Sinisterly
Math and basic structure in Lisp - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Coding (https://sinister.ly/Forum-Coding--71)
+--- Thread: Math and basic structure in Lisp (/Thread-Math-and-basic-structure-in-Lisp)



Math and basic structure in Lisp - Inori - 08-31-2015

Lisp, above all else, is one of the weirdest languages I know of (other than Whitespace). Math in lLsp is just the tip of the iceberg.

What the hell are you talking about?

Lisp uses prefix notation (also known as Polish notation [thanks @Shebang]). In prefix notation-based evaluations, operators are read before operands.

Spoiler: Example
In the following examples, a is the normal equation, whereas b is the prefix notated version.

a:
Code:
print 12 * (120 / 10) + 7 =>151
b:
Code:
(write(+ (* 12 (/ 120 10)) 7)) =>151


Oh, that makes sense

Yeah, starting out, it's a bit annoying, but after a while, it becomes second nature.
Until you're programming in Ruby and forget it's not Lisp then totally screw yourself in every operation.

Anyway, that's basic math structure in Lisp. I might release some more mini-tutorials on the language later.


RE: Math and basic structure in Lisp - dotcppfile - 08-31-2015

That share is simple indeed, I myself programmed in lisp for about a year and it was a really nice experience and I'm not sure why people hate it, probably because of the over usage of parentheses but that's a dumb excuse, anyways back on topic, it would be great if you could keep this up and go deeper in Lisp, that would be pretty nice and special and will bring joy to my heart Lol, seriously though, keep it coming if possible and thanks in advance.