Closed daveyarwood closed 7 years ago
I'm still leaning against adding this as a syntactic feature.
Inline Clojure code has matured since this issue was created, and I think reversing a sequence is a good example of one of the cool things you can do with it:
piano:
(reverse (alda-code "c8 d e f g"))
Notably, this doesn't behave exactly like you might expect -- you end up getting quarter notes G, F, E, D followed by an eighth note C.
But, you could get around that by making your code more explicit:
piano:
(set-duration (note-length 8))
(reverse (alda-code "c d e f g"))
The above gives you 8th notes G-F-E-D-C.
One overall goal in my design decisions for Alda is to make the language as simple as possible. Each new proposed operator makes the language more complicated. I would prefer to do things with inline Clojure code wherever possible.
Moved from https://github.com/alda-lang/alda/issues/130.
Quoting myself: