Re: [CSG111] CSG111 MP4: Are procedure names considered variables?


Subject: Re: [CSG111] CSG111 MP4: Are procedure names considered variables?
From: Mitchell Wand (wand@ccs.neu.edu)
Date: Fri Feb 11 2005 - 16:25:32 EST


MW> I don't know what you mean by "work with", but yes, procedure names
MW> are definitely variables-- they are no different from any other
MW> variable.

>> We were puzzled because we weren't if we need to keep
>> track of both the procedure address and the address of
>> the arguments. For example, if we've got

>> even(x)

>> it sounds like we need to compute both the address of
>> even and of x. Is this similar to evaluating a
>> procedure, or should we expect to write a new kind of
>> translator for the left side of a function expression?

In the expression

letrec
  even(x) = if zero?(x) then 1 else (odd sub1(x))
  odd(x) = if zero?(x) then 0 else (even sub1(x))
in (odd 13)

the even and the x in even(x) are both variable _declarations_, not
uses. So they don't get replaced by anything: they are like the
bound variables in a let.

--Prof. Wand

_______________________________________________
csg111 mailing list
csg111@lists.ccs.neu.edu
https://lists.ccs.neu.edu/bin/listinfo/csg111



This archive was generated by hypermail 2b28 : Tue Feb 27 2007 - 19:00:11 EST