Awesome thanks for explaining that. That’s cool as hell.
Comment on I dunno
vala@lemmy.dbzer0.com 1 week agoThis is called “prefix notation”. The operator comes before the operands and every expression goes in parentheses.
For instance you could write:
(+ 1 2 3 4)
Which would evaluate to 10.
This syntax is from a family of programming languages usually called LISP.
Reginald_T_Biter@lemmy.world 1 week ago
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!
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.