This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: WPI CS1102 Recap of New Scheme Operators from PPT CS 1102 : Programming Language Concepts Summary of New Scheme Operators During the slideshow exercise, we've seen several new Scheme constructs. Here's a brief recap of those constructs. More details appear in the DrScheme helpdesk. begin begin takes any number of expressions as arguments. It evaluates each one in turn and returns the result of the last one. Note that the results of all the expressions except the last get thrown away, so begin is only useful if the non-last expressions perform side-effects such as set! and printf operations. set! set! is the assignment operator in Scheme. It takes two arguments: a variable name and an expression. set! changes the value of the given variable to the result of the expression. Here's an example: (define count 0) (set! count (+ 1 count)) We expect you to use set! sparingly in your code. In particular, you should only use set! on a variable when you have one function that changes the value of the variable and another that uses the value of the...
View Full Document
This note was uploaded on 02/06/2008 for the course CS 1102 taught by Professor Fisler during the Fall '07 term at WPI.
- Fall '07