5 ms·
I gotta say you lost me at args->allof It’s 2020, if you’re really serious about building a new language, shouldn’t you at least pick a reasonable naming case
by xixixao 6y ago
I gotta say you lost me at args->allof
It’s 2020, if you’re really serious about building a new language, shouldn’t you at least pick a reasonable naming case convention? (allOf, AllOf, all_of, all-of would all work)
(Not talking about the fact that allOf doesn’t seem very consistent with other languages...)
- TylerE 6y agoall-of should not work unless your syntax for basic arithmetic is something heinous.
- munro 6y agoOr you're Lisp
- traes 6y agoOr you require whitespace in arithmetic.
- cygx 6y agoOr The Language Formerly Known as Perl6 [1], where it won't cause much friction as variable names ordinarily start with a sigil. [1] https://docs.raku.org/syntax/identifiers#Ordinary_identifiers https://docs.raku.org/syntax/identifiers#Ordinary_identifier...
- benibela 6y agoOr XPath
- shakna 6y agoRefusing to allow symbols in identifiers might make some things easier to read, but is annoying as hell if you're touching anything scientific. If you have something clear you break tokens on, like whitespace (except within quotes), then you should have no problems allowing arbitrary symbols inside an identifier.
- TomMarius 6y agox = 0 y = 1 x+y = 0 z = x+y What is z?
- traes 6y agox+y = 0 (with that specific syntax) will error in pretty much every language.
- TomMarius 6y agoSo we will refuse to allow symbols in identifiers after all?
- traes 6y agoThe only programming languages where arithmetic symbols are allowed identifiers have an identifier sigil (ala Perl, PHP), require whitespace around arithmetic (some teaching languages), or don't have conventional arithmetic syntax (e.g. Forth, Lisp).
- TomMarius 6y agoPlease read the comment I originally answered to.
- dkersten 6y agoPersonally, I’m a fan of just requiring whitespace around operators. I find expressions hard to read otherwise, so think it’s bad practice, but I also find precedence rules awkward in all but the simplest expressions, so like to use parentheses a lot, which mean I don’t necessarily need whitespace-based grouping to make expressions clearer, eg: “a/b + c” I would just write as “(a / b) + c” anyway. I’ve been programming for 20 years so it’s not just unfamiliarity, I guess I just found these things cause me speed bumps needlessly.
- mrkmarron 6y agoYou are right, allof is inconsistent with the language naming conventions. I was updating some other collections support and made that fix as well. Thanks!
- dkersten 6y agoMy question is why -> instead of . for method/field access. I see almost all of the examples using -> but a few use . but unless there’s a difference (like how in C++ -> is a pointer dereference access), I think -> just adds noise to the syntax needlessly . The documentation doesn’t appear to explain when to use one over the other, or perhaps . is a typo.
- Koshkin 6y agoAgree, the arrow is syntactically redundant in C and C++ and does indeed make code look noisier that it could be. (The same can be said about the “four-dot” double colon.)