Programming Language Concepts

Programming - WPI CS1102 Recap of New Scheme Operators from PPT CS 1102 Programming Language Concepts Summary of New Scheme Operators During the

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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.

Page1 / 3

Programming - WPI CS1102 Recap of New Scheme Operators from PPT CS 1102 Programming Language Concepts Summary of New Scheme Operators During the

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online