[prev in list] [next in list] [prev in thread] [next in thread] 

List:       racket-users
Subject:    [racket] splicing internal define?
From:       eli () barzilay ! org (Eli Barzilay)
Date:       2011-09-30 11:55:35
Message-ID: 20101.44599.356086.85610 () winooski ! ccs ! neu ! edu
[Download RAW message or body]

Yesterday, Marijn wrote:
> > Incidentally, Marijn, given that that's a module right there, I
> > suspect that the main reason you want to hide "value-store" like
> > this is if this code was actually the result of a macro expansion.
> 
> This code is the result of macro expansion, local to the code
> produced by the macro and because the macro is looking to become
> rather large, I wanted to hide the implementation of value-store
> from the local uses as well. [...]

BTW, if you have a toplevel definition with a name that is introduced
hygienically, then it's already hidden, for example:

  #lang racket
  (define-syntax-rule (defcounter name)
    (begin (define c 0)
           (define (name) (set! c (add1 c)) c)))
  (defcounter a)
  (defcounter b)
  (defcounter c)
  (list (a) (b) (c) (c) (b) (a))

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic