|
|
|
|
|
by rscho
1851 days ago
|
|
you'll never get J/K brevity though. Because in opposition to Lisp where control flow is explicit in the syntax, most of the control flow in array languages is implicit. I love lisp too, but for some (rare) use cases it's not the best. |
|
You can get implicit control flow via macros.
Furthermore, all control flow is implicit is some way.
Take basic old progn: (progn (foo) (bar)) evaluates (foo) and then control implicitly passes to (bar) because that's the next thing.
The only control flow which is not implicit is that of a state machine described by a table or graph, indicating the next state for every input and current state.
(How can you say you can't get implicit control flow in Lisp, when I'm using pattern matching to express if you see this prefix, replace it with that?)
Speaking of macros, you could always resort to a macro like this:
The j macro expands the string to code at compile time. The code could be a bona fide J implementation, or something like it. That's still not down to J, because of the (j"") wrapping chewing up five characters. In a Lisp with a programmable read table, that could be reduced to two character framing or something.