This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

define-syntax and context


Hello,

I want build a scheme construct like this:

(define-syntax myfunc
  (syntax-rules ()
    ((myfunc  body-expr)
     (lambda (left right)  body-expr))))

(display ((myfunc (+ right left)) 3 5))

I get allways the following exception:
gnu.mapping.UnboundSymbol: Unbound symbol right
        at
gnu.expr.Interpreter.getDefaultSymbolValue(Interpreter.java:638)
...

After reading following introduction to scheme 
http://www.cs.utexas.edu/users/wilson/schintro/schintro_130.html#SEC186
I have thought it should work.

I have two question:
- Is my construct correct in scheme?
- if not, how should I express this?

Thanks
Christof



(define-syntax myfunc
  (syntax-rules ()
    ((myfunc  body-expr)
     (lambda (left right)  body-expr))))

(display ((myfunc (+ right left)) 3 5))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]