Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!tub!fauern!lan!hohendor From: hohendor@lan.informatik.tu-muenchen.dbp.de (Christian Hohendorf) Newsgroups: comp.lang.scheme Subject: extend-syntax Message-ID: <4215@tuminfo1.lan.informatik.tu-muenchen.dbp.de> Date: 30 Aug 90 23:04:56 GMT Sender: news@lan.informatik.tu-muenchen.dbp.de Distribution: comp Organization: Inst. fuer Informatik, Technische Univ. Muenchen, West Germany Lines: 31 Hello experts, I have ported "extend-syntax", a kind of easy-to-understand macro replacement, the MacScheme code of which came across the net some years ago, to some other scheme implementations. Now I'm having trouble replacing macros by extend- syntax (for compatibility's sake). In my opinion, the following should work: (let ((var '())) (extend-syntax (test) ((test) var) ((test q) (set! var (cons 1 var))) ((test q w) (set! var (cons 2 var))) ((test q w e) (set! var (cons 3 var)))))) Calling the macth parameters, extend-syntax claims var not to be bound (except when it is also defined globally). - When calling test without parameters, and var defined globally, extend-syntax tries to evaluate the list bound to var. When replacing the corresponding line with ((test) 'var), just the symbol var is returned. But I want the non- evaluated list bound to that symbol. Unfortunately, I don't have access to Ken Dybvig's book about Scheme, and I'm running out of time a bit. Any hints would be heavily appreciated. Thanks in advance, Chris -- Christian Hohendorf hohendor@lan.informatik.tu-muenchen.dbp.de