Re: Questions about DSSSL evaluation order.

Subject: Re: Questions about DSSSL evaluation order.
From: ht@xxxxxxxxxxxxxxx (Henry S. Thompson)
Date: 04 Feb 1998 11:01:56 +0000
"Frank A. Christoph" <christo@xxxxxxxxxxxxxxxxxx> writes:

> Second, a "closure" is the result of
> evaluating a function.

I would have said (connecting up to our other current thread :-) that
a closure is the result of evaluating a lambda-form, as in the
following crypto-object-creation procedure:

(define makePerson
 (lambda (name sex age)
  (lambda (opr arg)
    (cond ((eq? opr 'age) age)
          ((eq? opr 'set-age) (set! age arg))
	  ((eq? opr 'sex) sex)
          ((eq? opr 'set-sex) (set! sex arg))
	  ((eq? opr 'name) name)
          ((eq? opr 'set-name) (set! name arg))))))

(define john (makePerson "john" 'm 37))

(john 'age '())

(john 'set-age 38)

(john 'age '())

ht


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Questions about DSSSL evaluation order.
    • KAZUMI Saito - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id XAA29603Tue, 3 Feb 1998 23:10:29 -0500 (EST)
      • <Possible follow-ups>
      • Frank A. Christoph - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id AAA01083Wed, 4 Feb 1998 00:52:56 -0500 (EST)
        • Henry S. Thompson - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id GAA08522Wed, 4 Feb 1998 06:03:52 -0500 (EST) <=