1

A normal arithmetic expression looks like this, right?:

3 + 5 * 3 + 14 / 7

The same expression written in Scheme looks like this:

(+ 3 (* 5 3) (/ 14 7) )

How do I call it? Is there a name for such an unusual way of writing an arithmetic expression?

The thing is, I've written a program that evaluates such Scheme'ish expressions and now I don't know how do I describe what it does. Thanks!

Edit: Rob Arthan correctly commented that it was S-expression. Someone put it as an answer so I can mark it solved!

1 Answers1

2

These things are called S-expressions. It is not the same as Polish notation: in Polish notation, you don't need brackets because each operator has a known number of operands. Something like (+ 1 2 3) is a perfectly good S-expression and evaluates to 6 in Scheme.

Rob Arthan
  • 48,577
  • 1
    And, I'd note, that not all S-expressions will give valid calculable expressions. So this is an S-expression implementation of prefix notation. – Joffan Apr 06 '15 at 15:33