Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

x-y and x - y meaning different things seems like a great source of errors to me


That's not a problem because subtraction in Racket, as in any Lisp-like, looks like this:

    (- x y)


It depends on a couple of factors. Personally I always write subtraction as "x - y", so I never have any issues. Also, if undeclared variables are a compile-time error, the compiler will (probably) complain loudly about "x-y". So you can fix that quickly and easily, it's not too bad.

The one error that might be problematic depending on the language's semantics is if you write something like "x.y-z" intending to subtract "z" from "x.y", but in fact you are going to get the "y-z" property of "x". I must say that in Earl Grey you'll unfortunately end up with "undefined" as the result of that expression (saner languages would raise an exception on a missing property). I have never had that issue in practice, but then again, I always space subtraction.


I don't have a problem with "x - y" and approve of hyphenated names if you can't support spaces within names.

I had initially jumped to the conclusion that your language would use a postfix notation and be more influenced by Forth than LISP. This is because I assumed it's name alluded to the way that Captain Jean Luc Picard would program his replicator.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: