Scheme is an interesting variant of the lisp language. The scheme version I used is drscheme 2.09. The interface is pretty nice. Can be downloaded in http://www.plt-scheme.org.
What makes me feel uncomfortable is scheme's processing of expressions. It uses a method similar to "prefix expression" and also writes a lot of parentheses. For example, to compute 3 + 5, scheme must be written as (+ 3 5). There must be a space between "+" and a number. I think this may be the "functional language" model. Scheme regards "+" as a function, which is used to calculate the sum of two parameters. In principle, the "+" function can have only two parameters, but there is still a simple method. For example, a join method:
3 + 5 + 2 + 1
It can be replaced by only one "+". Writing:
(+ 3 5 2 1)
There is no concept of computing priority in scheme, because they are all functions! Therefore, you can only use (). The scheme interpreter calculates the result from the beginning to the outermost layer. For example, to compute 3 + 5*3, you must write it as (+ 3 (* 5 3 )).
Scheme functions are also very special. For example, to define a function S = 3.1416 * r for calculating the circular area, you can write it as follows:
(Define (s r)
(* 3.1416 R ))
When r = 5, call function s:
(S 5)
In the sameProgramThe function can be called at multiple levels, such as calculating the area of a ring: (set the inner diameter to R and the outer diameter to R ). Within s-s, the corresponding scheme function is:
(Define (area out in)
(-(S out) (s in )))