you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 11 months ago (6 children)
  • [–] 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)

  • source
  • parent
  • hideshow 5 child comments
  • [–] 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.

  • source
  • parent