This is the mail archive of the guile@cygnus.com mailing list for the guile project.


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

Re: AAAAAArgh! (Modules)


Lalo Martins <lalo@webcom.com> writes:

> I have this working:
> 
> > (define-syntax sonya (syntax-rules ()
> >   ((sonya <first> ...) ((lambda () 
> >     (sonya-debug-display "Running sonya...\n")
> >     (sonya-eval () (list <first> ...))
> >     ))
> >   )
> > ))
> 
> But now I want to make sonya.scm a module, and I just found out
> that the module system doesn't know about define-syntax. How can
> I export "sonya" from a module? Documentation on syntaxes and
> macros is so annoying...
> 

export-syntax will do the trick... ex:

(define-module (locallib lispy)
	#:use-module (guile syncase))

(define-syntax when
  (syntax-rules ()
		((when cond stmt ...) (if cond (begin stmt ...)))))

(export-syntax when)


-- 
Greg: lack of documentation is probably more accurate.