[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bugs #10561] define-syntax and case generate bad code
From: |
Per Bothner |
Subject: |
[Bug-kawa] [bugs #10561] define-syntax and case generate bad code |
Date: |
Mon, 04 Oct 2004 18:30:45 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040803 |
This mail is an automated notification from the bugs tracker
of the project: Kawa.
/**************************************************************************/
[bugs #10561] Latest Modifications:
Changes by:
Per Bothner <address@hidden>
'Date:
Mon 10/04/2004 at 22:16 (GMT)
What | Removed | Added
---------------------------------------------------------------------------
Resolution | None | Postponed
Assigned to | None | bothner
------------------ Additional Follow-up Comments ----------------------------
I haven't chased this all they way, but I'm not too surprised. The interaction
between quote handling and hygiene is a bit kludgy. The basic problem is that
Kawa handles hygiene by symbol renaming, which conflicts with quote; the
implemented solution is not very robust.
A better solution may be to implement hygiene using lexical closures. I
suspect syntax-case uses some variant of the latter. I'd like to take some
time out and clean up macro handling in Kawa, including solid
let-syntax/letrec-syntax support, fixing quote handling, and useful (maybe
complete) support for implementation. I'd prefer to defer this bug until then.
/**************************************************************************/
[bugs #10561] Full Item Snapshot:
URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10561>
Project: Kawa
Submitted by: Chris Dean
On: Sun 10/03/2004 at 03:03
Category: Scheme language
Severity: 5 - Average
Item Group: Unexpected result
Resolution: Postponed
Privacy: Public
Assigned to: bothner
Status: Open
Summary: define-syntax and case generate bad code
Original Submission: Both (foo) and (bar) below should return the same result,
but
(foo) returns the wrong result due to improper macro expansion.
(define-syntax log-mode
(syntax-rules ()
((log-mode mode)
(case 'mode
((error) "error mode")
((warning) "warning mode")
(else "bad mode")))))
(define (foo)
(log-mode warning))
(define (bar)
(case 'warning
((error) "error mode")
((warning) "warning mode")
(else "bad mode")))
Follow-up Comments
------------------
-------------------------------------------------------
Date: Mon 10/04/2004 at 22:16 By: Per Bothner <bothner>
I haven't chased this all they way, but I'm not too surprised. The interaction
between quote handling and hygiene is a bit kludgy. The basic problem is that
Kawa handles hygiene by symbol renaming, which conflicts with quote; the
implemented solution is not very robust.
A better solution may be to implement hygiene using lexical closures. I
suspect syntax-case uses some variant of the latter. I'd like to take some
time out and clean up macro handling in Kawa, including solid
let-syntax/letrec-syntax support, fixing quote handling, and useful (maybe
complete) support for implementation. I'd prefer to defer this bug until then.
For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10561>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/