5 ms·
Yet another way in which Lisp is vastly superior to any and all blub languages: (= 2 (+ 1 1) (sqrt 4)) ; => t (< most-negative-fixnum 0 most-p
by tmtvl 2y ago
Yet another way in which Lisp is vastly superior to any and all blub languages:
(= 2
(+ 1 1)
(sqrt 4))
; => t
(< most-negative-fixnum 0 most-positive-fixnum)
; => t
- Aachen 2y agoI have no idea what this does or if you are joking. Could use some explanation
- gus_massa 2y agoIn Lisp, you put the "operator" first, so instead of 2 + 3 + 4 you write (+ 2 3 4) This is nice for associative operations like + or *, very very very slightly confusing for - and / --- You use the same style for comparisons, so instead of 2 == 3 == 4 you write (== 2 3 4) To support the fist "infix" syntax, you need some magic in the == operator. But the second "prefix" syntax is totally natural and you need no magic in the parser or the operator.
- tmtvl 2y ago> very very very slightly confusing for - and / It's fine if you DNF it: (- a b c) => (+ a (- b) (- c)) (/ a b c) => (* a (/ 1 b) (/ 1 c))
- Aachen 2y agoI knew that Lisp does this operator first thing, it's everything around this that I'm not familiar with. What does ; do? Is the => an arrow or greater than or equal to? What is t? Do I guess correctly that most-negative-fixnum is like INT_MIN?
- tmtvl 2y agoThe semicolon is Lisp syntax for comments. T is the way you write true in Lisp. Most-negative-fixnum is the most negative number Lisp can represent without promotion to bignum (so it can be int_min if int is roughly equivalent to size_t).
- ahoka 2y agoIn the Lisp family of languages these comparisons are not implemented as operators, but functions. The functions behave like: = all the same /= all different < monotonically increasing > monotonically decreasing <= monotonically nondecreasing >= monotonically nonincreasing Also * is product and + is sum.
- ahoka 2y agoSo Python is a Lisp?