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

Re: [Scheme-reports] Are generated toplevel definitions secret?



On Sun 24 Apr 2011 16:57, Peter Bex <Peter.Bex@x> writes:

> Chicken doesn't support identifier syntax, so it would show an error :)

Heh, cool.  Fortunately it's not central to my argument.  How about an
accessor macro:

      (begin
        (define-syntax define-getter
          (syntax-rules ()
            ((_ var init)
             (begin
               (define val init)
               (define-syntax var
                 (syntax-rules ()
                   ((_) val)))))))

        (define-getter x 10)
        (define-getter y 20))

If I put that in a chicken module, import the module, then evaluate (x)
and (y), does that evaluate to 10 and 20, respectively?

Cheers,

Andy
-- 
http://wingolog.org/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports