2 ms·
First of all, no one is suggesting you get rid of good old +-/* and friends. So more accurate would be: (+ (- (/ b (* 2 a))) (* (/ 1 (* 2 a)) (sqrt (- (^ b 2
by James_K 3y ago
First of all, no one is suggesting you get rid of good old +-/* and friends. So more accurate would be:
(+ (- (/ b (* 2 a))) (* (/ 1 (* 2 a)) (sqrt (- (^ b 2) (* 4 a c)))))
;; or just
(/ (+ (- b) (sqrt (- (^ b 2) (* 4 a c))))
(* 2 a))
Secondly, another advantage of lisp is that you can change the format of expressions as needed.
;; With Scheme's SRFI-105 – Curly Infix Expressions
{{-(b) / {2 * a}} + {{1 / {2 * a}} * sqrt{{b ^ 2} - (* 4 a c)}}}
;; With a macro
(math - b / (2 * a) + 1 / (2 * a) * (sqrt (b ^ 2 - 4 * a * c)))
;; Reader macros
#math(-b/(2*a) + 1/(2*a) * (b^2 - 4*a*c))
What this represents is that lisp allows you to decouple the way code is input and displayed from the content of it. Wolfram Language uses a similar system to display mathematical expressions as though they had been typeset with LaTeX. A lisp system would likely support something similar. In the source code, you would have:
(formula (+ (- (/ b (* 2 a))) (* (/ 1 (* 2 a)) (sqrt (- (^ b 2) (* 4 a c))))))
But the editor would display:
(formula -b/(2a) + 1/(2a) √(b²-4ac))
Finally, I find this post to be very disingenuous in that it doesn't address the plethora of other strange symbols used in the blog post, to which my comment was referring. Only talking about standard arithmetic symbols that everyone already understands completely missing the issue I was addressing: that people won't use something if they can't understand it without memorising an entire manual of foreign symbols. Everyone knows what + means, many people can understand "reduce", but no one who hasn't already learned APL will understand the meaning of ⍒. What's worse, they won't even be able to ask someone what it means: "Hey bob, what does "triangle with a line through it" mean?" Well which way is the triangle pointing? And is the line vertical or horizontal? Is it a full triangle or is the bottom missing? So if you show your boss a spreadsheet with this stuff in it, he's going to have to put his finger right on your monitor to point to the triangle he's talking about, and that's gonna leave you with a nice finger smudge on your display. This simply isn't ergonomic.