Scheme of things

Programming in Static OO languages for a long time numbs the brain. These languages are designed to be simple and efficient. These criteria not necessary create beautiful languages. In the world of C++, C# our imagination get severely restricted.

Take for example the expression x + |y|. In scheme you can code this as

(define (addAbs x y)
((if (> y 0) + -) x y))

(addAbs 4 -5)

The if expression is very interesting. It actually compares y with 0 and returns a operator (+ or -). Its simply beautiful 🙂 

Comments (2)

  1. Al Tenhundfeld says:

    I’m not familiar with scheme. Can you post a link to a good introduction site?

    Please keep up the posts with your thoughts on advanced C#/.NET topics. I enjhoy reading them.

  2. Thanls Al 🙂

    I never learnt Scheme on its own. I went through SICP and picked up bits and pieces of Scheme on the way.

    SICP is a must read for any SW engineer

Skip to main content