guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

why args are invalid syntaxes in syntax-rules


From: Marco Maggi
Subject: why args are invalid syntaxes in syntax-rules
Date: Sat, 13 Oct 2007 08:37:42 +0200

Ciao,
  trying this:

(define-module (hurt-me)
  #:use-module (ice-9 syncase))

(define-syntax this
  (syntax-rules ()
    ((_ ?body ?handler)
     (catch #t ?body ?handler))))

(this (lambda ()
        (display 'ciao)
        (newline))
      (lambda (key . args)
        #f))

(define-syntax that
  (syntax-rules (body handler)
    ((_ (body ?args ?body)
        (handler ?handler-args ?handler))
     (catch #t
       (lambda ?args
         ?body)
       (lambda ?handler-args
         ?handler)))))

(this (body ()
        (display 'ciao)
        (newline))
      (handler (key . args)
        #f))

I get:

  ERROR: invalid syntax ()

from the first argument to BODY; if I change
'body ()' to 'body (a b)' the error becomes:

  ERROR: invalid syntax (key . args)

Why there is no error when using LAMBDA
but there is with custom keywords?

--
Marco Maggi

"Now feel the funk blast!"
Rage Against the Machine - "Calm like a bomb"






reply via email to

[Prev in Thread] Current Thread [Next in Thread]