41 ms·
Author here: unified function call syntax is awesome but sadly out of scope for what I was trying to do with this language. I mention this in the "Class-based d
by ar-nelson 6y ago
Author here: unified function call syntax is awesome but sadly out of scope for what I was trying to do with this language. I mention this in the "Class-based discoverability" section: for the sake of uniformity and IDE discoverability (arguably Java's killer feature that its successors have diluted), I'd want every value and function to belong to a class, which means every nonlocal method call should come after a dot.
- vanderZwan 6y agoThis already assumes that unified call syntax would inherently get in the way of that - do you have any reason to believe that? I mean, Lobster has classes, or at least something that it calls classes: https://aardappel.github.io/lobster/language_reference.html#user-defined-types https://aardappel.github.io/lobster/language_reference.html#...
- ar-nelson 6y agoTake Java as an example. In Java, there are no free functions. Every method belongs to an object or a class. So you couldn't write `f(a, b, c)` as `a.f(b, c)`, because `f` as a free function couldn't exist to begin with. Either it would already be `a.f`, or `f` would be a method of the current class or a static method imported via `import static`, in which case using the `a.f` syntax could deceive readers about what class `f` is a member of. That's what I'm going for with this language, for uniformity and discoverability. If you want to add a new method that takes type `A` as its first argument, you should add it as an extension method on type `A`.
- vanderZwan 6y agoCould you elaborate on what "discoverability" means to you, because don't see any reason in this explanation why an IDE would not be able do autocomplete on `a.f(b, c)`, with automatic documentation on top, which is all that is needed for discoverability in my book. (also, to be clear, I'm not the one who downvoted you)