▲ 736 ▼ I dunno (europe.pub) submitted 11 months ago by LadyButterfly@piefed.blahaj.zone [M] to c/science_memes@mander.xyz 759 comments fedilink hide all child comments
[–] vala@lemmy.dbzer0.com 22 points 11 months ago* (last edited 11 months ago) (10 children) (* (+ 2 5) (- 8 5)) Hope some LISP can clear this up Edit: ( + 2 ( * 5 ( - 8 5 ) ) ) permalink fedilink source hideshow 10 child comments replies: [–] yboutros@infosec.pub 21 points 11 months ago (1 child) Is this a meme? Shouldn't it be ( + 2 ( * 5 ( - 8 5 ) ) ) permalink fedilink source parent hideshow 1 child comment replies: [–] vala@lemmy.dbzer0.com 7 points 11 months ago Damn you are right haha. Mine evals to 21. permalink fedilink source parent [–] merc@sh.itjust.works 1 point 11 months ago So, if 2 5 8 5 - × + is "RPN" does that mean that the LISP version is Polish Notation? permalink fedilink source parent [–] Reginald_T_Biter@lemmy.world 1 point 11 months ago (6 children) Explain yourself sir permalink fedilink source parent hideshow 6 child comments replies: [–] vala@lemmy.dbzer0.com 8 points 11 months ago (5 children) This 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. https://en.wikipedia.org/wiki/Lisp_(programming_language) permalink fedilink source parent hideshow 5 child comments replies: [–] merc@sh.itjust.works 2 points 11 months 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 (plus 1 2 3 4) Which would be like plus(1, 2, 3, 4) in other kinds of programming languages. permalink fedilink source parent [–] call_me_xale@lemmy.zip 2 points 11 months ago (2 children) I understand prefix notation, but you got the order of operations wrong... permalink fedilink source parent hideshow 2 child comments replies: [–] vala@lemmy.dbzer0.com 6 points 11 months ago (1 child) Yeah I'm stupid permalink fedilink source parent hideshow 1 child comment replies: [–] call_me_xale@lemmy.zip 4 points 11 months ago Knowing is half the battle! permalink fedilink source parent [–] Reginald_T_Biter@lemmy.world 2 points 11 months ago Awesome thanks for explaining that. That's cool as hell. permalink fedilink source parent
[–] yboutros@infosec.pub 21 points 11 months ago (1 child) Is this a meme? Shouldn't it be ( + 2 ( * 5 ( - 8 5 ) ) ) permalink fedilink source parent hideshow 1 child comment replies: [–] vala@lemmy.dbzer0.com 7 points 11 months ago Damn you are right haha. Mine evals to 21. permalink fedilink source parent
[–] vala@lemmy.dbzer0.com 7 points 11 months ago Damn you are right haha. Mine evals to 21. permalink fedilink source parent
[–] merc@sh.itjust.works 1 point 11 months ago So, if 2 5 8 5 - × + is "RPN" does that mean that the LISP version is Polish Notation? permalink fedilink source parent
[–] Reginald_T_Biter@lemmy.world 1 point 11 months ago (6 children) Explain yourself sir permalink fedilink source parent hideshow 6 child comments replies: [–] vala@lemmy.dbzer0.com 8 points 11 months ago (5 children) This 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. https://en.wikipedia.org/wiki/Lisp_(programming_language) permalink fedilink source parent hideshow 5 child comments replies: [–] merc@sh.itjust.works 2 points 11 months 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 (plus 1 2 3 4) Which would be like plus(1, 2, 3, 4) in other kinds of programming languages. permalink fedilink source parent [–] call_me_xale@lemmy.zip 2 points 11 months ago (2 children) I understand prefix notation, but you got the order of operations wrong... permalink fedilink source parent hideshow 2 child comments replies: [–] vala@lemmy.dbzer0.com 6 points 11 months ago (1 child) Yeah I'm stupid permalink fedilink source parent hideshow 1 child comment replies: [–] call_me_xale@lemmy.zip 4 points 11 months ago Knowing is half the battle! permalink fedilink source parent [–] Reginald_T_Biter@lemmy.world 2 points 11 months ago Awesome thanks for explaining that. That's cool as hell. permalink fedilink source parent
[–] vala@lemmy.dbzer0.com 8 points 11 months ago (5 children) This 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. https://en.wikipedia.org/wiki/Lisp_(programming_language) permalink fedilink source parent hideshow 5 child comments replies: [–] merc@sh.itjust.works 2 points 11 months 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 (plus 1 2 3 4) Which would be like plus(1, 2, 3, 4) in other kinds of programming languages. permalink fedilink source parent [–] call_me_xale@lemmy.zip 2 points 11 months ago (2 children) I understand prefix notation, but you got the order of operations wrong... permalink fedilink source parent hideshow 2 child comments replies: [–] vala@lemmy.dbzer0.com 6 points 11 months ago (1 child) Yeah I'm stupid permalink fedilink source parent hideshow 1 child comment replies: [–] call_me_xale@lemmy.zip 4 points 11 months ago Knowing is half the battle! permalink fedilink source parent [–] Reginald_T_Biter@lemmy.world 2 points 11 months ago Awesome thanks for explaining that. That's cool as hell. permalink fedilink source parent
[–] merc@sh.itjust.works 2 points 11 months 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 (plus 1 2 3 4) Which would be like plus(1, 2, 3, 4) in other kinds of programming languages. permalink fedilink source parent
[–] call_me_xale@lemmy.zip 2 points 11 months ago (2 children) I understand prefix notation, but you got the order of operations wrong... permalink fedilink source parent hideshow 2 child comments replies: [–] vala@lemmy.dbzer0.com 6 points 11 months ago (1 child) Yeah I'm stupid permalink fedilink source parent hideshow 1 child comment replies: [–] call_me_xale@lemmy.zip 4 points 11 months ago Knowing is half the battle! permalink fedilink source parent
[–] vala@lemmy.dbzer0.com 6 points 11 months ago (1 child) Yeah I'm stupid permalink fedilink source parent hideshow 1 child comment replies: [–] call_me_xale@lemmy.zip 4 points 11 months ago Knowing is half the battle! permalink fedilink source parent
[–] call_me_xale@lemmy.zip 4 points 11 months ago Knowing is half the battle! permalink fedilink source parent
[–] Reginald_T_Biter@lemmy.world 2 points 11 months ago Awesome thanks for explaining that. That's cool as hell. permalink fedilink source parent