3 ms·
Just a nit; Java does not use dot notation for map access. (Groovy can, but can also use Java notation.) Not that it matters, but how do you reckon `get(obj,
by michaelcampbell 11y ago
Just a nit; Java does not use dot notation for map access. (Groovy can, but can also use Java notation.)
Not that it matters, but how do you reckon
`get(obj, key)` is less syntax than `obj.key`?
- masklinn 11y agoI'm guessing they're talking about the syntactic footprint of the language. Of course that assumes: 1. you have free functions at all (wasn't the case in Java until 1.5 and static imports IIRC, still isn't the case in Smalltalk, and seemingly free functions in Ruby are actually methods of Kernel, an actual free function would be a Proc bound to a global name) 2. you only have free functions, or all your syntax is expressed with free function syntax (which is fairly specific to Lisps, Julia also has generic functions but afaik still uses dotted attribute access)
- yjgyhj 11y agoYeah, the concepts are different, but usage overlaps. That is why I consider them equal.
- vorg 11y agoExcept that `obj.class` gets the class for the object, instead of `get(obj, "class")` or `obj["class"]`. So many little special cases in Groovy's huge grammar, which is still written in Antlr 2.x when both Antlr 3 and 4 shipped long ago.