Also, you can use this for more than just arithmetic. The first thing in the list is the name of the function, and everything else is something that you pass to the function. So you could instead write
(plus 1 2 3 4)
Which would be like plus(1, 2, 3, 4) in other kinds of programming languages.
Hope some LISP can clear this up
Edit:
So, if
2 5 8 5 - × +is “RPN” does that mean that the LISP version is Polish Notation?Is this a meme? Shouldn’t it be
Damn you are right haha.
Mine evals to 21.
Explain yourself sir
This is called “prefix notation”. The operator comes before the operands and every expression goes in parentheses.
For instance you could write:
Which would evaluate to 10.
This syntax is from a family of programming languages usually called LISP.
https://en.wikipedia.org/wiki/Lisp_(programming_language)
Also, you can use this for more than just arithmetic. The first thing in the list is the name of the function, and everything else is something that you pass to the function. So you could instead write
Which would be like
plus(1, 2, 3, 4)in other kinds of programming languages.I understand prefix notation, but you got the order of operations wrong…
Yeah I’m stupid
Knowing is half the battle!
Awesome thanks for explaining that. That’s cool as hell.