Hi, Am 21.08.2009 um 20:02 schrieb Sigrid:
Could someone point me to what the difference is? I know pattern matching e.g. from the PLT scheme implementation, and there the pattern matching also provides the binding and destructuring I think...?
The difference is, that in pattern matching you can also specify values on the left side. For example in OCaml:
type foo = [ Foo of int ];
value frobnicate x =
match x with
[ Foo 5 -> do_something ()
| Foo 7 -> do_something_else ()
| Foo x -> do_more x ];
(Please bear with me if I don't remember all the details of the syntax.)
While this is not possible in Clojure:
(let [[x 5 y] [1 2 3]]
...)
The five on the left hand side is not allowed.
Hope this helps.
Sincerely
Meikel
smime.p7s
Description: S/MIME cryptographic signature
