unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
Subject: (ice-9 syncase)
Date: Mon, 04 Oct 2004 22:18:26 +0200	[thread overview]
Message-ID: <1096921106.3932.139.camel@localhost> (raw)

Hey all,

I've been having some problems lately with syncase macros and modules.

Now, a specific problem that completely stumps me. I am getting SSAX to
work with r5rs macros. Part of SSAX's API are a set of macros to create
custom SAX parsers. They don't work, though:

guile> ssax:make-parser
$1 = #<macro! sc-macro>
guile> (ssax:make-parser)
ERROR: invalid syntax (find k-args (DOCTYPE . default) DOCTYPE val . others)
ABORT: (misc-error)

This same code me a more proper error about not putting the right
arguments if I put myself in the (sxml ssax) module first.

This error isn't very informative due to syncase stack cutting.
ssax:make-parser is a macro made by another macro, ssax:define-labeled-
arg-macro, which is also exported, and it starts off like this:

(define-syntax ssax:define-labeled-arg-macro
  (syntax-rules ()
    ((ssax:define-labeled-arg-macro
       labeled-arg-macro-name
       (positional-macro-name
	 (arg-name . arg-def) ...))
      (define-syntax labeled-arg-macro-name
	(syntax-rules ()
	  ((labeled-arg-macro-name . kw-val-pairs)
	    (letrec-syntax
	      ((find 
		 (syntax-rules (arg-name ...)
                 [...]

The interesting thing is that `find' is actually a local syntactic
binding. I could maybe understand if find were a toplevel binding, then
one would expect information about it to be stored in the module
somewhere (apparently on the variable). However, it's not toplevel.
Perhaps this is affected by the note on psyntax.ss:203:

;;; "let-syntax" and "letrec-syntax" are also treated as splicing
;;; constructs, in violation of the R4RS appendix and probably the R5RS
;;; when it comes out.  A consequence, let-syntax and letrec-syntax do
;;; not create local contours, as do let and letrec.  Although the
;;; functionality is greater as it is presently implemented, we will
;;; probably change it to conform to the R4RS/expected R5RS.

However, the `find' symbol is bound to a procedure within (sxml ssax).

I don't know what's going on here. Any ideas? Now I have to do crappy
things like

(use-modules (sxml ssax))
(define-module (sxml ssax))

to use these macros.

Thanks in advance,
-- 
Andy Wingo <wingo@pobox.com>
http://ambient.2y.net/wingo/


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


             reply	other threads:[~2004-10-04 20:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-04 20:18 Andy Wingo [this message]
2004-10-05 19:30 ` (ice-9 syncase) Andy Wingo
2004-10-18 12:39   ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1096921106.3932.139.camel@localhost \
    --to=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).