<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New" size=2>I have reduced more complicated code
to the following:</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>file trial.ss
========================================</FONT></DIV>
<DIV><FONT face="Courier New" size=2>#lang scheme</FONT></DIV>
<DIV><FONT face="Courier New" size=2>(provide declare-tag use-tag)</FONT></DIV>
<DIV><FONT face="Courier New" size=2>(define-for-syntax tag-register
'())</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New" size=2>(define-for-syntax (register-tag
tag)<BR> (set! tag-register<BR> (cons (syntax->datum tag)
tag-register)))</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New" size=2>(define-for-syntax (tag?
tag)<BR> (member (syntax->datum tag) tag-register))</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New" size=2>(define-syntax (declare-tag
stx)<BR> (syntax-case stx ()<BR> ((_ tag)<BR> (begin
(register-tag #'tag) #'(void)))))</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New" size=2>(define-syntax (use-tag
stx)<BR> (syntax-case stx ()<BR> ((_ tag) (tag? #'tag)
#''ok)<BR> ((_ tag)<BR> (raise-syntax-error
'tags<BR> "unknown tag" stx #'tag))))</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>; of course I can leave out the check (tag?
#'tag)</FONT></DIV>
<DIV><FONT face="Courier New" size=2>; and omit the error detection, but that
gives rise</FONT></DIV>
<DIV><FONT face="Courier New" size=2>; to unclear error messages when wrong tags
are used</FONT></DIV>
<DIV><FONT face="Courier New" size=2>; in the program I excerpted this example
from.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New" size=2>(declare-tag a)<BR>(declare-tag
b)</FONT></DIV>
<DIV><FONT face="Courier New" size=2>(use-tag a) ; --> ok<BR></DIV></FONT>
<DIV><FONT face="Courier New" size=2>file-use-trial.ss
======================================</FONT></DIV>
<DIV><FONT face="Courier New" size=2>#lang scheme<BR>(require
"trial.ss")<BR>(declare-tag x)<BR>(use-tag x) ; ok, but<BR>(use-tag a) ; -->
unknown tag</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>I understand that the tag-register is
reset to () when invoked for different phases. </FONT><FONT face="Courier New"
size=2>Is there a way to register the tags in such a way that macro use-tag sees
both those declared in trial.ss and in use-trial.ss? </FONT><FONT
face="Courier New" size=2>If I remember correctly use-tag did do that in
version 370.</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Thanks, Jos</DIV></FONT></BODY></HTML>