Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language

Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Scheme Programming Language

Why this macro don't work?


Why this macro don't work?
(define-syntax myor
   (syntax-rules ()
          ((myor) #f)
          ((myor e)    e)
          ((myor e1 . es)
            (let ((r e1)) (if r r (myor . es))))))
(define (nonzero? r) (myor (negative? r) (positive? r)))
(display (nonzero? 1)) (newline)
(display (nonzero? -1))(newline)
(display (nonzero? 0)) (newline)
(display (nonzero?))   (newline)
;; procedure nonzero?: expects 1 argument, given 0


Your macro works just fine, I think. Your "nonzero?" function, on the
other hand...
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc