chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Re: Style Guide


From: Elf
Subject: Re: [Chicken-users] Re: Style Guide
Date: Wed, 7 Nov 2007 06:02:42 -0800 (PST)



On Wed, 7 Nov 2007, Benedikt Rosenau wrote:

On Tue, Nov 06, 2007 at 08:47:25PM -0800, Elf wrote:

really, it doesnt matter.  theres plenty of code with both, its entirely a
personal preference issue.

Well, not exactly the question asked, but something I learned from
reading Chicken's sources:

$  csi -no-init
..
#;1> (define square
      (let ((* *))
        (lambda (x) (* x x))))
#;2> (square 4)
16
#;3> (define (* . args) (apply + args))
#;4> (* 4 4)
8
#;5>  (square 4)
16
#;6> (use numbers) ; introduces a new binding for *
..
#;7> (square 1111111111111111111111111111111111111111)
Error: (*) bad argument type: 1111111111111111111111111111111111111111
..
#;7> (* 1111111111111111111111111111111111111111
       1111111111111111111111111111111111111111)
1234567901234567901234567901234567901234320987654320987654320987654320987654321



(define bla (let ((blubb blubb)) (lambda (fasel) ...))) gives access
to another namescope.
  Benedikt


of course it does :) all closures have their own namescope, as you put it. what you demonstrated above is the trick of associating state with a lambda. :)

-elf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]