[plt-scheme] Scheme exercise(image.ss)

From: Stephen Bloch (sbloch at adelphi.edu)
Date: Thu Feb 26 20:56:41 EST 2009

On Feb 26, 2009, at 5:06 PM, aditya shukla wrote:

> This is the part that confused me ,that's why i just passed traffic- 
> light as a parameter  but never used it.
>
> If you have experience programming in other languages, you might  
> have expected ALL-THREE-ON to change. That's because your previous  
> language probably uses the imperative programming style, which  
> generally relies on changing the values of variables. But in  
> Scheme, we're programming in the functional programming style. This  
> means that we're not changing the values of variables; instead,  
> we're just sending values as inputs to functions, which return  
> other values. You may wonder how it's even possible to write  
> programs without assigning new values to variables. Well, just stay  
> tuned, and for the moment just remember that the functions we write  
> don't change the values of their inputs.
>
>
> Can someone please shed a light on the concept mentioned above ?  
> and how do i use it to make my function?

You don't use it to make your function.  Write and test your function  
as usual, THEN read the above paragraph (and the short paragraph that  
was before it in the exercise).

Stephen Bloch
sbloch at adelphi.edu





Posted on the users mailing list.