From: Ken A. <kan...@bb...> - 2004-03-24 19:21:44
|
The problem is that while loadking psyntax-init.scm changes (eval) and (load), the old (eval) and (load) is being used by jscheme.REPL. I fixed this once, but it got broken when dynamic enviroments were added. I'll try fixinig it again. For now, you can either put the macro definition in a file and load it, or use (eval '(define-syntax swap ...)) (eval '(swap x y)) BTW, you can see the macroexpansion using sc-expand. k At 10:58 AM 3/22/2004 -0500, Borislav Iordanov wrote: >Hi all, > >I have a problem getting macros to work. As I understand, I need to load >the following two files: > >elf/eopl2/jscheme/genwrite.scm >elf/eopl2/jscheme/psyntax-init.scm > >I do that and then try something simple like: > >(define-syntax swap > (syntax-rules () > ((swap a b) (let ((tmp b)) (set! b a) (set! a tmp))))) > >Evaluating the last expression tells me "undefined variable >'define-syntax'". > >I also tried loading a the OO style code using/friedman-init.scm which >makes heavy use of macros and I get an error saying that 'pretty-print' >is not defined. > >This is with the latest code from CVS, patched not to set the current >thread's classloader to Import.CLASSLOADER. > >I am quite a beginner in Scheme and I've never used macros, so the >problem may be a really straightforward misunderstanding on my part. > >Thanks, >Boris > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |