2 ms·
I'm convinced it is a newbie friendly language only because they are so vehement in claiming that.
by taeric 7y ago
I'm convinced it is a newbie friendly language only because they are so vehement in claiming that.
- kazinator 7y agoMulti-way equivalence is more useful if it has OR semantics rather than AND. If you're working in TXR Lisp, you can use the meq, meql and mequal functions for three or more argument equality. The call: (meq a b c ...) does not mean anything similar to: (and (eq a b) (eq b c) ...) but the semantics (except for operand evaluation) is like: (or (eq a b) (eq a c) (eq a d) ...) and likewise for the other two. It's testing whether the left argument is equal to at least one of the remaining arguments. These functions can be called with only one argument, in which case they yield false, just like (or). These functions are very useful in cond statements that include some tests that prevent conversion into caseq/caseql/casequal. (cond ((meql x 1 2 3) ... ) ;; x is one of 1 2 3 ((> x 10) ...) ;; x is greater than 10 (t ...)) ;; otherwise m stands for "multi"; or, if you like, it stands for "member" because (meql x a b c) replaces (memql x (list a b c)).
- taeric 7y agoHaving a tool like that makes sense. That it is the non asked for default doesn't. That is, I think I'm in violent agreement.