[plt-scheme] Symbol Table in v200?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Aug 1 19:57:57 EDT 2002

Ah - I was confused about a different kind of "keyword", and that
prevented me from understanding the code at all.

I think you're just looking for `namespace-variable-value' and
`namespace-set-variable-value!' to replace the uses of
`global-defined-value'.

<module-note>
The implementation strategy below won't work in a `module'ized world,
and I imagine that it doesn't compile easily with mzc. To work with
modules, you'd want something like a `define-keyword' form. Even
fancier: you might re-define `#%top' to treat any identifier starting
with ":" as a keyword. I bet Eli has already tried something like that.
</module-note>

Matthew

At Thu, 1 Aug 2002 16:49:10 -0700, "Alex Peake" wrote:
> It is actually used only to copy the Commom Lisp keyword concept, so that I 
> did not have to quote
> the symbols.
> 
> (attribute "Backorderable" char :dom-len 1 :nullable #t )
> 
> where :dom-len and :nullable are keywords (rather than 'dom-len or ':dom-len 
> etc)
> 
> Alex
> 
> > -----Original Message-----
> > From: Matthew Flatt [mailto:mflatt at cs.utah.edu]
> > Sent: Thursday, August 01, 2002 4:21 PM
> > To: Alex Peake
> > Cc: plt-scheme at tux.cs.brown.edu
> > Subject: Re: [plt-scheme] Symbol Table in v200?
> >
> >
> > > I am trying to get a PLT 103 program to run in PLT 200. I used to use
> > > a copied function:
> > >
> > > (define (make-keyword symbol)
> > >   (cond ((not (defined? symbol))
> > >         (global-defined-value symbol symbol)
> > >         (keyword-name symbol))
> > >        ((not (or (eq? (global-defined-value symbol) symbol)
> > >                  (eq? symbol ':))) ; MrSpidy compatibility has a ":" macro
> > >         (error 'make-keyword
> > >                "symbol ~e is already bound, can't make it a keyword." 
> symbol))
> > >        ((not (keyword-name? symbol)) (keyword-name symbol))
> > >        (else #t)))
> > >
> > > What do you do in PLT 200?
> >
> > I'm not sure how this `make-keyword' function is used, but there are no
> > keywords in v200. The new macro system makes the old distinction
> > unnecessary.
> >
> > Matthew
> >
> >
> 
> 




Posted on the users mailing list.