Expander tries to take the car of some #{thingamabob ...}

Bug #407754 reported by Gwen Weinholt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
High
Abdulaziz Ghuloum

Bug Description

I want to learn more about how syntax-case etc works, so I'm reading Waddell and Dybvig's paper "Extending the Scope of Syntactic Abstraction". There's an example in section 5.2 that I thought wouldn't work in R6RS, so I modified it a little and here's what happened:

Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1834, build 2009-08-01)
Copyright (c) 2006-2009 Abdulaziz Ghuloum

> (library (M)
  (export a b)
  (import (rnrs))
  (define-syntax a
    (syntax-rules ()
      [(_ e0 e1 ...) (e0 (quote c) e1 ... )]))
  (define b (lambda () c))
  (define c 3)
  (lambda () (set! c 5))) ;make Ikarus believe c is mutable
> (import (M))
> (let ()
  (define-syntax f
    (syntax-rules ()
      [(_ (any id)) id]
      [(_ (any id) value) (set! id value)]))
  (let ([original (a f)])
    (a f 4)
    (list original (b)))) ; (3 4)
Unhandled exception
 Condition components:
   1. &assertion
   2. &who: car
   3. &message: "argument does not have required pair structure"
   4. &irritants: (#{c |&qTay!6SOGg0MwBL|})
>

I'm still pretty sure this isn't supposed to work, but the exception raised indicates a bug in the expander, rather than in the code above.

Btw, it works without error in Ypsilon. :)

Related branches

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 407754] [NEW] Expander tries to take the car of some #{thingamabob ...}

On Aug 1, 2009, at 8:41 PM, Göran Weinholt wrote:

> Btw, it works without error in Ypsilon. :)

I'm not sure what you mean by "it works", but I fixed the crash in
revision 1835.

Aziz,,,

** Affects: ikarus
    Status: Fix Committed

Changed in ikarus:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → Abdulaziz Ghuloum (aghuloum)
Revision history for this message
Gwen Weinholt (weinholt) wrote :

> > Btw, it works without error in Ypsilon. :)

> I'm not sure what you mean by "it works", but I fixed the crash in
> revision 1835.

I tried the example from the bug report in Ypsilon 0.9.6-trunk/r503 and it returned (3 4).

Thanks for the fix, it's clear to me now that Ypsilon is in error.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.