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.
vala@lemmy.dbzer0.com 1 week ago
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.
en.wikipedia.org/…/Lisp_(programming_language)
merc@sh.itjust.works 1 week ago
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.Reginald_T_Biter@lemmy.world 1 week ago
Awesome thanks for explaining that. That’s cool as hell.
call_me_xale@lemmy.zip 1 week ago
I understand prefix notation, but you got the order of operations wrong…
vala@lemmy.dbzer0.com 1 week ago
Yeah I’m stupid
call_me_xale@lemmy.zip 1 week ago
Knowing is half the battle!