Macro-expand time arithmetics with syntax-rules 
Author Message
 Macro-expand time arithmetics with syntax-rules

It has been alleged that R5RS macros are deficient in that they
cannotdo arithmetics. Therefore, it might appear that Scheme loses out
toC++: with template meta-programming, it is possible to convert code
   x = Factorial<5>::RET;into     x = 120;at _compile_ time.Fully
standard R5RS Scheme macros are capable of the same. We canindeed
compute factorials or other computable functions over numbersat
macro-expand time. We do _not_ resort to lower-level macrofacilities
or non-standard extensions such as syntax-case. We do _not_rely on a
constant folding in a Scheme compiler either. After the codeis macro
expanded, all occurrences of, e.g., (?fact 4), will bereplaced by the
number 24. No more computation is needed at latercompilation phases,
let alone at run time.We will be using CPS macros elaborated at    
http://www.*-*-*.com/ ~oleg/ftp/Scheme/macros.html#Macro-CPS-programmingThat
web page section refers to a USENET article    
http://www.*-*-*.com/ ~oleg/ftp/Scheme/syntax-rule-CPS-lambda.txtthat,
among other things, derives a macroexpand-time factorial overunary
numbers. The present article re-uses that code without
detailedexplanations. Please refer to the syntax-rule-CPS-lambda.txt
articlefor elaboration and discussion.  The only missing piece was a
translationbetween decimal and unary numbers. This translation is
facilitated bythe following macro.; Translation between integers and
Peano-Church numerals; 0 <-> (); 1 <-> ( () ); 2 <-> (( () )); etc.;;
To be more precise, the macro-invocation;   (define-numeral-domain
(encoder-name decoder-name) (0 1 2 ... n)); defines the encoder and
decoder macros with the given names that; translate integers 0 though
n into the Peano-Church notation,; and back. Negative and rational
numbers can be treated in a similar way:; they are all
countable.(define-syntax define-numeral-domain  (syntax-rules ()  
((_ names decimals)     (define-numeral-domain #f () () () decimals
names))    ((_ #f conv-decimals conv-unaries curr-unary (decimal .
decimals) names)     (define-numeral-domain #f       (decimal .
conv-decimals)       (curr-unary . conv-unaries)       (curr-unary)
decimals names))    ((_ #f (decimal ...) (unary ...) curr-unary ()    
  (decimal->unary unary->decimal))     (begin       (define-syntax
decimal->unary        (syntax-rules ()          ((_ decimal k) (??!apply k
unary))    ...))       (define-syntax unary->decimal  (syntax-rules
()         ((_ unary k) (??!apply k decimal))      ...))       ))    ))Now we
can define(define-numeral-domain  (decimal->unary unary->decimal)  (0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27
27))There is no hard limit as to how long the list of decimal numbers
canbe. The only limitation is the amount of physical memory and of
swapspace on the computer and the amount of patience of the operator.
Wemust stress that template meta-programming in C++ has
similarlimitations. As a matter of fact, C++ standard does not
guaranteetemplate instantiations with the depth greater than 16 (?).
There areabsolutely no such prescribed limits in Scheme. The only
limitationsare again physical memory, swap space and patience.If we
store the code in Appendix A in a file named syntax-rule-arithm.scm
andinvoke, for example, SCM Scheme system, we see$ /usr/bin/time -l
scm -r5 -l macro-lambda.scm -l syntax-rule-arithm.scmFactorial is: 24
      2.34 real         2.19 user         0.10 sys      2828  maximum
resident set size       188  average shared memory size      1417
average unshared data size       128  average unshared stack size    
 575  page reclaims         0  page faults         0  swapsThe
platform is Pentium IV 2GHz, 1GB of physical memory. As we saw,SCM
used only a tiny fraction of all available memory.The result seems
correct. But was it computed at compile time? To makesure of that, we
will use Petite Chez Scheme, which has a convenienttool to show the
expansion of a macro.$ /usr/local/src/csv6.0a/bin/i3le/scheme.exe -h
/usr/local/src/csv6.0a/bin/i3le/petite.heap macro-lambda.scm
syntax-rule-arithm.scmPetite Chez Scheme Version 6.0aCopyright (c)
1998 Cadence Research SystemsFactorial is: 24> (time (?fact 4))(time
(?fact 4))    no collections    0 ms elapsed cpu time    0 ms elapsed
real time    0 bytes allocated24> (expand '(display (?fact
4)))(display 24)First we see that the computation of (?fact 4) took no
time at all --because all the computation finished before the run
time. We then askChez Scheme to show us the expansion of (display
(?fact 4)): and it isindeed (display 24). As promised, the occurrence
of (?fact 4) isreplaced with 4! at macro-expand time.Appendix A. The
code for compile-time factorialNote, the implementation of ??!apply
can be downloaded from    
http://www.*-*-*.com/ ~oleg/ftp/Scheme/macros.html#Macro-lambda;
Translation between integers and Peano-Church numerals; 0 <-> (); 1
<-> ( () ); 2 <-> (( () )); etc.;; To be more precise, the
macro-invocation;   (define-numeral-domain (encoder-name decoder-name)
(0 1 2 ... n)); defines the encoder and decoder macros with the given
names that; translate integers 0 though n into the Peano-Church
notation,; and back. Negative and rational numbers can be treated in a
similar way:; they are all countable.(define-syntax
define-numeral-domain  (syntax-rules ()    ((_ names decimals)    
(define-numeral-domain #f () () () decimals names))    ((_ #f
conv-decimals conv-unaries curr-unary (decimal . decimals) names)    
(define-numeral-domain #f       (decimal . conv-decimals)      
(curr-unary . conv-unaries)       (curr-unary) decimals names))    ((_
#f (decimal ...) (unary ...) curr-unary ()       (decimal->unary
unary->decimal))     (begin       (define-syntax decimal->unary  
(syntax-rules ()           ((_ decimal k) (??!apply k unary))      ...))      
(define-syntax unary->decimal         (syntax-rules ()          ((_ unary k)
(??!apply k decimal))      ...))       ))    ))(define-numeral-domain
(decimal->unary unary->decimal)  (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 27 27)); Macroexpand-time factorial
in CPS. See ;     http://www.*-*-*.com/ ~oleg/ftp/Scheme/syntax-rule-CPS-lambda.txt;
for detailed explanations and derivations.      (define-syntax ?plc-zero
(syntax-rules ()    ((_ k) (??!apply k ()))))   (define-syntax ?plc-succ
 (syntax-rules ()    ((_ c k) (??!apply k (c)))))       (define-syntax
?plc-pred  (syntax-rules ()    ((_ (c) k) (??!apply k
c))))   (define-syntax ?plc-zero?  (syntax-rules ()    ((_ () k-on-zero
k-on-pos)     (??!apply k-on-zero ()))    ((_ c k-on-zero k-on-pos)  
 (??!apply k-on-pos c))    ))   (define-syntax ?plc-add   (syntax-rules
()    ((_ c1 c2 k)     (?plc-zero? c1    (??!lambda (vc1) (??!apply k
c2))     (??!lambda (vc1)          (?plc-succ c2             (??!lambda (c2+1)        
(?plc-pred (??! vc1)             (??!lambda (c1-1)                 (?plc-add (??! c1-1) (??!
c2+1) k)))))))))); Test case    (?plc-add (( () )) ((( () )))    
(??!lambda (c) (display '(??! c))))(newline)    ;===prints===>
(((((())))));In other words: 5  (define-syntax ?plc-mul  (syntax-rules
()    ((_ c1 c2 _k)     (letrec-syntax   ((?loop           (syntax-rules ()      
   ((_ c accum k)             (?plc-zero? c              (??!lambda (vc1) (??!apply k
accum))          (??!lambda (vc1)                  (?plc-pred (??! vc1)               (??!lambda
(c1-1)                   (?plc-add c2 accum                         (??!lambda (new-accum)                            
(?loop (??! c1-1) (??! new-accum) k)))))))))))      
(?plc-zero      (??!lambda (accum) (?loop c1 (??! accum) _k)))))))      ; Test
case    (?plc-mul (( () )) ((( () )))      (??!lambda (c) (display '(??!
c))))(newline)  ;===prints===> ((((((()))))));In other words:
6       (define-syntax ?plc-fact  (syntax-rules ()    ((_ co k)    
(?plc-zero? co       (??!lambda (c) (?plc-succ (??! c) k))      
(??!lambda (c)    (?plc-pred (??! c)         (??!lambda (c-1)        
(?plc-fact (??! c-1)              (??!lambda (c-1-fact)              (?plc-mul (??! c)
(??! c-1-fact) k))))))))))      ; (?plc-fact ((( () )));           (??!lambda (c)
(display '(??! c)))); (newline) ; Macroexpand-time direct-style
factorial. It is a wrapper; over the CPS macro ?plc-fact.;
Direct-style macros -- just as direct-style functions -- are; far more
pleasing to look at.(define-syntax ?fact  (syntax-rules ()    ((_ n)  
   (decimal->unary n       (??!lambda (x)     (?plc-fact (??! x)      
(??!lambda (c)       (unary->decimal (??! c)        (??!lambda (f)
(??! f))))))))))(display "Factorial is: ") (display (?fact
4))(newline);The result is: 24


Wed, 13 Jul 2005 19:29:27 GMT  
 Macro-expand time arithmetics with syntax-rules
Even by Oleg's standards this is a new height of
indecipherability. (-:

Thank goodness the code's in Scheme, not python -- at least the
programs didn't change meaning!

Shriram



Thu, 14 Jul 2005 02:42:33 GMT  
 Macro-expand time arithmetics with syntax-rules

Quote:

> We canindeed compute factorials or other computable functions over
> numbersat macro-expand time.
> (define-numeral-domain (decimal->unary unary->decimal) (0 1 2 3 4 5
> 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 27))There
> is no hard limit as to how long the list of decimal numbers
> canbe. The only limitation is the amount of physical memory and of
> swapspace on the computer and the amount of patience of the
> operator.

So you can "compute" n factorial as long as the programmer spends
Omega(n! log n) time typing in the numbers up to n!.

So the highest n for which you can compute the factorial is quite a
bit less than Theta(log patience).

Why not just ask the programmer to type in something like this:

  (define-syntax factorial
    (syntax-rules ()
      ((_ 0) 1)
      ((_ 1) 1)
      ((_ 2) 2)
      ((_ 3) 6)
      ((_ 4) 24)
      ((_ 5) 120)
      ;; Limited Only by Your Patience (TM) ...
      ))  

That would require a lot less patience.

-al

P.S.

Quote:
> Negative and rational numbers can be treated in a similar way:; they
> are all countable.

Imagine the things that can be done by those programmers with
uncountably infinite patience.


Thu, 14 Jul 2005 04:43:38 GMT  
 Macro-expand time arithmetics with syntax-rules

Quote:
> Imagine the things that can be done by those programmers with
> uncountably infinite patience.

It's called J2EE.


Thu, 14 Jul 2005 05:18:44 GMT  
 Macro-expand time arithmetics with syntax-rules

Quote:

> It has been alleged that R5RS macros are deficient in that they
> cannotdo arithmetics. Therefore, it might appear that Scheme loses out
> toC++: with template meta-programming, it is possible to convert code
>    x = Factorial<5>::RET;into     x = 120;at _compile_ time.Fully
> standard R5RS Scheme macros are capable of the same. We canindeed
> compute factorials or other computable functions over numbersat
> macro-expand time.

Excellent, although, if I have deciphered it correctly, somewhat more
complicated than I expected.  I will have to study the solution in
more detail. The C++ implementation seems far simpler though.

  template<int n>
  struct Factorial
  {  enum { RET = n * Factorial<n-1>::RET };  };

  template<>
  struct Factorial<0>
  {  enum { RET = 1 };  };



Thu, 14 Jul 2005 08:50:06 GMT  
 Macro-expand time arithmetics with syntax-rules
[I'm really sorry for the snafu during the first attempt to post the
article. On Friday night we had a bad connectivity problem. I had to
use a different computer and a different browser, w3m, to post the
article. It seems there is an unfortunate interaction between the
Google posting system and the browser. Curiously, when I asked Google
to preview the article before positing, Google showed me the article
with all newlines intact. It is when I pressed 'post it', the newlines
got stripped off. This surely defeats the purpose of the
preview. Incidentally, from what I know about the Google post system,
if I posted the article without the preview, it would have looked
fine. I spent the rest of the night trying to install and configure a
different browser, over a deteriorating connection. When I was almost
finished, the network died completely. Sorry again.

Incidentally, one of the points of Gerard Huet's PADL03 invited talk
was text segmentation. He said, imagine you are about to submit an
article and pressed some key which erased all the spaces, saved the
buffer and then killed the buffer. Is there any way to re-insert the
spaces? He showed code that does that. That was not an idle exercise:
he deals with Sanscrit, which does not separate words and sentences
with spaces. I ought to try his approach on my first post, to see if
his program can re-insert the newlines.

     http://pauillac.inria.fr/~huet/FREE/tagger.pdf

As one of the founders of the CAML project, he programs in OCaml.]

It has been alleged that R5RS macros are deficient in that they cannot
do arithmetics. Therefore, it might appear that Scheme loses out to
C++: with template meta-programming, it is possible to convert code
     x = Factorial<5>::RET;
into
     x = 120;
at _compile_ time.

Fully standard R5RS Scheme macros are capable of the same. We can
indeed compute factorials or other computable functions over numbers
at macro-expand time. We do _not_ resort to lower-level macro
facilities or non-standard extensions such as syntax-case. We do _not_
rely on a constant folding in a Scheme compiler either. After the code
is macro expanded, all occurrences of, e.g., (?fact 4), will be
replaced by the number 24. No more computation is needed at later
compilation phases, let alone at run time.

We will be using CPS macros elaborated at
     http://pobox.com/~oleg/ftp/Scheme/macros.html#Macro-CPS-programming

That web page section refers to a USENET article
     http://pobox.com/~oleg/ftp/Scheme/syntax-rule-CPS-lambda.txt

that, among other things, derives a macroexpand-time factorial over
unary numbers. The present article re-uses that code without detailed
explanations. Please refer to the syntax-rule-CPS-lambda.txt article
for elaboration and discussion.  The only missing piece was a
translation
between decimal and unary numbers. This translation is facilitated by
the following macro.

; Translation between integers and Peano-Church numerals
; 0 <-> ()
; 1 <-> ( () )
; 2 <-> (( () ))
; etc.
;
; To be more precise, the macro-invocation
;   (define-numeral-domain (encoder-name decoder-name) (0 1 2 ... n))
; defines the encoder and decoder macros with the given names that
; translate integers 0 though n into the Peano-Church notation,
; and back. Negative and rational numbers can be treated in a similar
way:
; they are all countable.

(define-syntax define-numeral-domain
  (syntax-rules ()
    ((_ names decimals)
     (define-numeral-domain #f () () () decimals names))
    ((_ #f conv-decimals conv-unaries curr-unary (decimal . decimals)
names)
     (define-numeral-domain #f
       (decimal . conv-decimals)
       (curr-unary . conv-unaries)
       (curr-unary) decimals names))
    ((_ #f (decimal ...) (unary ...) curr-unary ()
       (decimal->unary unary->decimal))
     (begin
       (define-syntax decimal->unary
         (syntax-rules ()
           ((_ decimal k) (??!apply k unary))
           ...))
       (define-syntax unary->decimal
         (syntax-rules ()
           ((_ unary k) (??!apply k decimal))
           ...))
       ))
    ))

Now we can define

(define-numeral-domain
  (decimal->unary unary->decimal)
  (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
27 27))

There is no hard limit as to how long the list of decimal numbers can
be. The only limitation is the amount of physical memory and of swap
space on the computer and the amount of patience of the operator. We
must stress that template meta-programming in C++ has similar
limitations. As a matter of fact, C++ standard does not guarantee
template instantiations with the depth greater than 16 (?). There are
absolutely no such prescribed limits in Scheme. The only limitations
are again physical memory, swap space and patience.

If we store the code in Appendix A in a file named
syntax-rule-arithm.scm and
invoke, for example, SCM Scheme system, we see

$ /usr/bin/time -l scm -r5 -l macro-lambda.scm -l
syntax-rule-arithm.scm
Factorial is: 24
        2.34 real         2.19 user         0.10 sys
      2828  maximum resident set size
       188  average shared memory size
      1417  average unshared data size
       128  average unshared stack size
       575  page reclaims
         0  page faults
         0  swaps

The platform is Pentium IV 2GHz, 1GB of physical memory. As we saw,
SCM used only a tiny fraction of all available memory.

The result seems correct. But was it computed at compile time? To make
sure of that, we will use Petite Chez Scheme, which has a convenient
tool to show the expansion of a macro.

$ /usr/local/src/csv6.0a/bin/i3le/scheme.exe -h
/usr/local/src/csv6.0a/bin/i3le/petite.heap macro-lambda.scm
syntax-rule-arithm.scm
Petite Chez Scheme Version 6.0a
Copyright (c) 1998 Cadence Research Systems
Factorial is: 24

Quote:
> (time (?fact 4))

(time (?fact 4))
    no collections
    0 ms elapsed cpu time
    0 ms elapsed real time
    0 bytes allocated
24
Quote:
> (expand '(display (?fact 4)))

(display 24)

First we see that the computation of (?fact 4) took no time at all --
because all the computation finished before the run time. We then ask
Chez Scheme to show us the expansion of (display (?fact 4)): and it is
indeed (display 24). As promised, the occurrence of (?fact 4) is
replaced with 4! at macro-expand time.

Appendix A. The code for compile-time factorial

Note, the implementation of ??!apply can be downloaded from
      http://pobox.com/~oleg/ftp/Scheme/macros.html#Macro-lambda

; Translation between integers and Peano-Church numerals
; 0 <-> ()
; 1 <-> ( () )
; 2 <-> (( () ))
; etc.
;
; To be more precise, the macro-invocation
;   (define-numeral-domain (encoder-name decoder-name) (0 1 2 ... n))
; defines the encoder and decoder macros with the given names that
; translate integers 0 though n into the Peano-Church notation,
; and back. Negative and rational numbers can be treated in a similar
way:
; they are all countable.

(define-syntax define-numeral-domain
  (syntax-rules ()
    ((_ names decimals)
     (define-numeral-domain #f () () () decimals names))
    ((_ #f conv-decimals conv-unaries curr-unary (decimal . decimals)
names)
     (define-numeral-domain #f
       (decimal . conv-decimals)
       (curr-unary . conv-unaries)
       (curr-unary) decimals names))
    ((_ #f (decimal ...) (unary ...) curr-unary ()
       (decimal->unary unary->decimal))
     (begin
       (define-syntax decimal->unary
         (syntax-rules ()
           ((_ decimal k) (??!apply k unary))
           ...))
       (define-syntax unary->decimal
         (syntax-rules ()
           ((_ unary k) (??!apply k decimal))
           ...))
       ))
    ))

(define-numeral-domain
  (decimal->unary unary->decimal)
  (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
27 27))

; Macroexpand-time factorial in CPS. See
;    http://pobox.com/~oleg/ftp/Scheme/syntax-rule-CPS-lambda.txt
; for detailed explanations and derivations.

(define-syntax ?plc-zero
  (syntax-rules ()
    ((_ k) (??!apply k ()))))

(define-syntax ?plc-succ
  (syntax-rules ()
    ((_ c k) (??!apply k (c)))))

(define-syntax ?plc-pred
  (syntax-rules ()
    ((_ (c) k) (??!apply k c))))

(define-syntax ?plc-zero?
  (syntax-rules ()
    ((_ () k-on-zero k-on-pos)
     (??!apply k-on-zero ()))
    ((_ c k-on-zero k-on-pos)
     (??!apply k-on-pos c))
    ))

(define-syntax ?plc-add
  (syntax-rules ()
    ((_ c1 c2 k)
     (?plc-zero? c1
         (??!lambda (vc1) (??!apply k c2))
         (??!lambda (vc1)
           (?plc-succ c2
             (??!lambda (c2+1)
               (?plc-pred (??! vc1)
                 (??!lambda (c1-1)
                   (?plc-add (??! c1-1) (??! c2+1) k))))))))))

; Test case    
(?plc-add (( () )) ((( () )))
           (??!lambda (c) (display '(??! c))))
(newline)      
;===prints===>  (((((())))))
;In other words: 5

(define-syntax ?plc-mul
  (syntax-rules ()
    ((_ c1 c2 _k)
     (letrec-syntax
         ((?loop
           (syntax-rules ()
             ((_ c accum k)
              (?plc-zero? c
                 (??!lambda (vc1) (??!apply k accum))
                 (??!lambda (vc1)
                   (?plc-pred (??! vc1)
                      (??!lambda (c1-1)
                         (?plc-add c2 accum
                            (??!lambda (new-accum)
                               (?loop (??! c1-1) (??! new-accum) k)))))))))))
       (?plc-zero
        (??!lambda (accum) (?loop c1 (??! accum) _k)))))))

; Test case    
(?plc-mul (( () )) ((( () )))
           (??!lambda (c) (display '(??! c))))
(newline)      
;===prints===> ((((((()))))))
;In other words: 6

(define-syntax ?plc-fact
  (syntax-rules ()
    ((_ co k)
     (?plc-zero? co
       (??!lambda (c) (?plc-succ (??! c) k))
       (??!lambda (c)
          (?plc-pred (??! c)
             (??!lambda (c-1)
               (?plc-fact (??! c-1)
                  (??!lambda (c-1-fact)
                     (?plc-mul (??! c) (??! c-1-fact) k))))))))))

; (?plc-fact ((( () )))
;          (??!lambda (c) (display '(??! c))))
; (newline)    

; Macroexpand-time direct-style factorial. It is a wrapper
; over the CPS macro ?plc-fact.
; Direct-style macros -- just as direct-style functions -- are
; far more pleasing to look at.

(define-syntax ?fact
  (syntax-rules ()
    ((_ n)
     (decimal->unary n
       (??!lambda (x)
         (?plc-fact (??! x)
           (??!lambda (c)
             (unary->decimal (??!
...

read more »



Fri, 15 Jul 2005 05:14:28 GMT  
 Macro-expand time arithmetics with syntax-rules

Quote:


> > We canindeed compute factorials or other computable functions over
> > numbersat macro-expand time.

> > (define-numeral-domain (decimal->unary unary->decimal) (0 1 2 3 4 5
> > 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 27))There
> > is no hard limit as to how long the list of decimal numbers
> > canbe. The only limitation is the amount of physical memory and of
> > swapspace on the computer and the amount of patience of the
> > operator.

> So you can "compute" n factorial as long as the programmer spends
> Omega(n! log n) time typing in the numbers up to n!.

It seems to me that this sort of thing is amenable to place-value
notation.

No, I'm not going to produce the macro that does it.



Sat, 16 Jul 2005 00:49:05 GMT  
 Macro-expand time arithmetics with syntax-rules
Quote:

> So you can "compute" n factorial as long as the programmer spends
> Omega(n! log n) time typing in the numbers up to n!.

> So the highest n for which you can compute the factorial is quite a
> bit less than Theta(log patience).

> Why not just ask the programmer to type in something like this:

>   (define-syntax factorial
>     (syntax-rules ()
>       ((_ 0) 1)
>       ((_ 1) 1)
>       ((_ 2) 2)
>       ((_ 3) 6)
>       ((_ 4) 24)
>       ((_ 5) 120)
>       ;; Limited Only by Your Patience (TM) ...
>       ))  

> That would require a lot less patience.

You do realize of course that once you typed in a macro invocation

(define-numeral-domain  (decimal->unary unary->decimal) (0 1 ... n))

you can compute not only a factorial of any number within that range:
you can compute *any* computable function within that domain and
range. There are (n+1)^(n+1) functions of a type a->a with that domain
and range; there are (n+1)^((n+1)^2) functions of a type a*a->a with
this domain and range; there are (n+1)^((n+1)^k) functions of arity k
with that domain and range, with k not limited. The overhead -- the
ratio of the amount of effort to enter define-numeral-domain to the
number of functions that can thus be computed at macro-expand time
approaches zero. We get quite a big bang for the buck.



Sat, 16 Jul 2005 08:48:33 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. syntax-rules macros with sub-macros

2. Scheme->syntax-rules [Was: hygienic macro primality tester]

3. How to write seemingly unhygienic macros using syntax-rules

4. Implementing letrec-syntax using only let-syntax and syntax-rules

5. Syntax-case vs. syntax-rules

6. define-syntax must be followed by syntax-rules ??

7. Macros defining macros with define-syntax

8. Load-time problem with a macro that defines a macro

9. Expanding macros in FD.

10. expanding macros in my assembly code

11. Assembly file preprocessing to expand macros

12. Macros expanding beyond column 72 in Fortran77?

 

 
Powered by phpBB® Forum Software