2011/3/30 John Sampson <jrs....@ntlworld.com>: > Hello - > > I am going through TYSIFD which is said to be compatible with mzScheme. > > Descriptions of macros seem to be different depending which book one reads. > TYSIFD advises the reader to 'require' the defmacro library > - '(require (lib "defmacro.rkt"))' when using Racket (I assume) - and gives > the example > > (define-macro when > (lambda (test .branch) > (list 'if test > (cons 'begin branch))))
Way back in the olden days define-macro was a popular way to define macros. Back then define-syntax had not yet been invented. TYSIFD is slightly old so when it was written it made sense to use define-macro. Today I am sure the author would have chosen define-syntax. Now it ought to be possible to get the programs in the macro section running in MzScheme, since it is reasonable straightforward to write define-macro in terms of define-syntax. That is, the incantation (require (lib "defmacro.rkt")) makes define-macro available to you. But macros written with the help of define-macro is integrated as well as define-syntax in DrScheme/DrRacket. To make a long story short: Skip the macro section in TYSIFD (it is simply too old) and read the racket guide on macros. -- Jens Axel Søgaard _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users