I must have gone full lisp weenie, because I find it ridiculous when remembering the days of being a happy java dev, waiting years for someone to include a syntactic change in the spec, all whilst crossing my fingers that they will include my use case.
Clojure macros have spoiled me with cond, condp and case plus whatever else I or the community come up with. And my half thought out changes are nicely isolated to a single project or library instead of baked into the language for eternity.
Generally speaking, when a language developer adds really useful, special syntax to a language — that language users cannot define themselves — it seems like a good idea to stop, and consider whether it makes sense to restrict the usefulness of this concept to just this special case.
I.e. the Java boolean type, which can only be true or false (and not default). Could it be that there are other valuable uses of this ability, instead of using enums where you always have to handle the default case?
Can it really be the case that true/false is the only case where not having to worry about default is extremely helpful?
I'm sorry, but I'm a little confused by your comment about default cases in reply to mine about syntax extensions being in the hands of language designers vs everyone.
I am also a little unsure what you mean by not worrying about default. Even polymorphism has to deal with this, if you call a polymorphic method on an object that doesn't implement that interface you'll get at best a compile problem, at worst a cast exception. This is why some languages provide support for a "default" or "method not implemented" hook in polymorphism.
If you are arguing that polymorphism is a better way to build systems than switch/case statements then no argument here. Open constructs like polymorphism are far better for growing and evolving large systems over time.
That doesn't mean we should exclude a nice way to say "i've got a variable that i want to translate to some other value in a few different ways".
My point was only that it just seems so silly to me that everyone is discussing whether this syntax is "best" or how it "doesn't do X, Y or Z", because I remember doing that too before Rich Hickey (angelic choir noises) showed me that actually you don't have to put up with that shit. Just use a language that puts syntax extension in the hands of it's community and let them figure it out without burdening the core language with a thousand little tradeoffs for the 90% use case.
> Just use a language that puts syntax extension in the hands of it's community and let them figure it out without burdening the core language with a thousand little tradeoffs for the 90% use case.
The downside of that is that some Lisp projects can only be understood by the original authors, during the time they were actually active on it.
I have seen a few that went DSL crazy with macros.
Clojure macros have spoiled me with cond, condp and case plus whatever else I or the community come up with. And my half thought out changes are nicely isolated to a single project or library instead of baked into the language for eternity.