3 ms·
>You're stated opinion seems to be that Clojure is playing catch-up Not really, it was about Zygomys, Clojure did it thing long time ago and proved it has some
by mapcars 10y ago
>You're stated opinion seems to be that Clojure is playing catch-up
Not really, it was about Zygomys, Clojure did it thing long time ago and proved it has something to offer, like STM in the core of language.
>I would compare Parse, Red's most notable feature, with core.match from Clojure.
I don't know the internals of core.match, but can it change rules in runtime like this?
red>> rule1: ['a]
== ['a]
red>> changer: [(append rule1 [| 'b])]
== [(append rule1 [| 'b])]
red>> parse [a a b b] [any rule1 [number! changer | ] any rule1]
== false
red>> parse [a a 1 b b] [any rule1 [number! changer | ] any rule1]
== true
(the code is not idiomatic or good, it's just what I came up with to quickly demonstrate what I mean)
- shakna 10y agoWell... Kind of. Clojure is crazy about immutability, so it makes live modifying any variable painful. However, core.match is usually used with a loop, so it should be possible with some nested lets.
- mapcars 10y agoOk, what I wanted to show is Red's parse is more than just pattern matching, since you can execute regular Red code in parsing rules, walk around the input and other things. You can check it's features here: http://www.red-lang.org/2013/11/041-introducing-parse.html http://www.red-lang.org/2013/11/041-introducing-parse.html
- ivanpierre 10y agoVariable, modifying... what the heck? You have a language that is crazy about mutability, it should make testing painful ;)