Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!howland.reston.ans.net!torn!watserv2.uwaterloo.ca!watserv3.uwaterloo.ca!watermidge
From: MACHAPUT@ARTSU1.uwaterloo.ca (Matthew Allan Chaput)
Subject: A couple MORE simple questions
Message-ID: <45u7g0$b20_002@watstar.uwaterloo.ca>
Sender: news@watserv3.uwaterloo.ca
Nntp-Posting-Host: watermidge.watstar.uwaterloo.ca
Organization: University of Waterloo
X-Newsreader: News Xpress Version 1.0 Beta #3
Date: Mon, 16 Oct 1995 18:15:28 GMT
Lines: 39

Okay, since everybody else is asking questions and getting answers...

How can I set up contingent variables in scheme? Take the problem

> (define rent 250)
> (define months 4)
> (define total (* rent months))
> total
1000
> (define rent 500)
> total
1000

In this example, what I want to do is change the value of rent (say), 
and have the value of total change. Is there some way, sort of like 
(quote ), of marking an sexpression so that it is not evaluated when it 
is bound, but when it is looked up. Probably not.

How about making total a function? I can't try this right now, but 
would it work? I'm using Gambit.

If anyone can help me with this, I'd appreciate it.

BTW, another question I have: in programming books, the authors 
(almost) always define high level functions followed by low-level 
functins (top-down programming), as if functions were called by name. 
Maybe I'm missing something, but *I* can't define functions in terms of 
functions that aren't bound yet! Is it just a convention? Do they 
expect me to just type them in reverse order?

Just wondering,

Matt Chaput
machaput@artsu1.uwaterloo.ca



------------------------------------------------------------------------------
Matthew Allan Chaput
