On Oct 21, 7:36 pm, jhaase <[email protected]> wrote:
> > > Can your version handle this?:
>
> > >   (let ()
> > >     (define-integrable (even? n) (or (zero? n) (m-odd? (- n 1))))
> > >     (define-integrable (odd? n) (not (m-even? n)))
> > >     (define-syntax m-odd? (syntax-rules () ((_ x) (odd? x))))
> > >     (define-syntax m-even? (syntax-rules () ((_ x) (even? x))))
> > >     (even? 5))
>
> This works now :-D

Oh noes! False alert. I made a mistake.

I played around with this with my first version and changed it to
(note the "apply"s in the marked lines):

(let ()
  (define-integrable (even? n) (or (zero? n) (m-odd? (- n 1))))
  (define-integrable (odd? n) (not (m-even? n)))
  (define-syntax m-odd? (syntax-rules () ((_ x) (apply odd? x
'()))))     (*)
  (define-syntax m-even? (syntax-rules () ((_ x) (apply even? x
'()))))     (*)
  (even? 5))

Then I completely started from the beginning and forgot to change this
test back ... So back to the drawing board.

Reply via email to