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

Scoped syntax

I seems to me that syntax additions should have scope just
like function definitions do. From my understanding of the
manual, define-macro works like the usual lisp macro, and
works like a global function; you get it when its loaded.
(Maybe I am misreading the manual).

It seems to me that the following code should be equivalent:

(locale ()
  (define-integrable (a b) (- b))
  (lambda (x) (a x)))

(locale ()
  (define-macro (a b) `(- ,b))
  (lambda (x) (a x)))

The important point is that macro or function a should be local to
the locale. This implies that locales must keep syntax information;
thing get hairy fast.

I hope you find these suggestion helpful.