Re: [racket] string problem question

2012-03-20 Thread Roelof Wobben
Thanks, Everything works now like a charm. Roelof Op 20-3-2012 1:20, Stephen Bloch schreef: On Mar 19, 2012, at 3:10 PM, Roelof Wobben wrote: But the contents of color does not change so I get a error message. What is the racket way to change the value of a string. That's not the problem.

Re: [racket] string problem question

2012-03-19 Thread Stephen Bloch
On Mar 19, 2012, at 3:10 PM, Roelof Wobben wrote: > But the contents of color does not change so I get a error message. > What is the racket way to change the value of a string. That's not the problem. It's your error message, so you should be able to figure out why it's happening. It has noth

Re: [racket] string problem question

2012-03-19 Thread Matthias Felleisen
ps. Your program's light function does NOT map Strings to Images. It maps World to images, ASSUMING you have defined ;; World is ... (probably string here but 1, 2, and 3 would work and so would many others). On Mar 19, 2012, at 4:25 PM, Matthias Felleisen wrote: > > 1. Your program doe

Re: [racket] string problem question

2012-03-19 Thread Matthias Felleisen
1. Your program does NOT change a string. It changes the state of the traffic light (or it tells drracket to keep track of a different state). The string "rood" remains the same in eternity. 2. You're missing test cases, and if you had tested the program you would have discovered it before ev

[racket] string problem question

2012-03-19 Thread Roelof Wobben
Hello, I have to make a traffic-light which changes color after each tick of the computer. So I thought this would work : ;; String -> Image ;; given a state of a trafic-light display a circle of the given color if it's a color of the traffic-light otherwise error (define (light color) (c