This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Suggestion for strings.c


Per Bothner <per@bothner.com> writes:

> > if I understand you right, your "alias" is a identifier macro.
> 
> Yes, I believe define-alias can be implemented using identifier
> macros, though note that define-alias in Kawa works both at top-level and
> as an internal definition.
> 
> > there is at least one portable Scheme macro system that supports identifier
> > macros (syntax-case).
> 
> Identifier macros don't seem to be mentioned in the "Chez Scheme
> User's Guide" (http://www.scheme.com/csug/index.html), which is
> surprising given that Dybvig (co-)designed syntax-case.

they are not mentioned because they are not special.  try this in
Guile :

(use-syntax (ice-9 syncase))

(define-syntax id
  (lambda (x)
    (syntax-case x ()
      (id (syntax (car '(1 2)))))))

and you just defined `id' as an identifier macro that expands to
`(car (quote (1 2))'

i.e. you specify an atomic pattern and it works.

> 	--Per Bothner

--mike

P.S. now if your aliases are also first-class, then that's another
story.  but I really hope they are not.

-- 
All ITS machines now have hardware for a new machine instruction --
BOT
Branch On Tree.
Please update your programs.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]