|
|
|
|
|
by opnitro
2183 days ago
|
|
I believe, on the pattern matching side, it has to do with the fact that it's a higher level feature that feels much more declarative. Inside of writing a sequence of instructions to check whether a list is 3 and the first two are equal, one writes the declarative syntax: (define (f x)
(match x
[`(,x ,x ,y) y]
[_ #f]))
|
|
The procedural 'if x.len == 3 and x[0] == x[1]' seems a lot clearer as to what is actually being tested.