manual enhancement
Posted: Mon Nov 04, 2013 9:25 am
When reading expand chapter, there is:
expand is useful when composing lambda expressions or doing variable expansion inside macros.
But the example code below is nothing to do with macros.
expand is useful when composing lambda expressions or doing variable expansion inside macros.
But the example code below is nothing to do with macros.
Code: Select all
(define (raise-to power)
(expand (fn (base) (pow base power)) 'power))
(define square (raise-to 2))
(define cube (raise-to 3))
(square 5) → 25
(cube 5) → 125