bugKawa - Bugs: bug #47862, define-syntax does not accept...

 
 

bug #47862: define-syntax does not accept formals when inside a define-library

Submitted by:  Adrián Medraño Calvo <medranocalvo>
Submitted on:  Thu 05 May 2016 08:51:03 PM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Compile-time exceptionStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 06 May 2016 08:45:33 PM UTC, comment #3:

Indeed; the report comes from it working in the REPL but not in the code. Thank you very much!

Adrián Medraño Calvo <medranocalvo>
Fri 06 May 2016 05:48:37 AM UTC, comment #2:

hanks - I checked in a fix for this.

Note that define-syntax with a format parameter is not allowed by R7RS. Ideally, (import (scheme base)) should import a version that doesn't allow the formal parameter, while (import (kawa base)) should import a version that does. Which means they would conflict (unless import has some special support when one definition is a super-set of another).

In any case, I'm not going to bother with two different definitions of define-syntax, at least not for now.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Thu 05 May 2016 08:53:37 PM UTC, comment #1:

Corrected markup + balance parens:

Adrián Medraño Calvo <medranocalvo>
Thu 05 May 2016 08:51:03 PM UTC, original submission:

The formal parameter may be specified to define-syntax when outside a define-library definition (Ex. 1) but, when inside define-library (Ex. 2) it throws the error: unbound location: lambda

;; Ex 1: outside define-library:
(define-syntax (const1 stx)
(syntax-case stx ()
((_ c cs ...)
(syntax c))))
(display (const1 0 1 2 3 4))

;; Ex 2: inside define-library:
(define-library (somelib)
(import
(scheme base)
(kawa base))
(export const2)
(begin
(define-syntax (const2 stx)
(syntax-case stx ()
((_ c cs ...)
(syntax c)))))
(const2 0 1 2 3))

Adrián Medraño Calvo <medranocalvo>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by medranocalvo (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 28 Jul 2016 11:25:33 PM UTCbothnerAssigned toNone=>bothner
      Open/ClosedOpen=>Closed
    Fri 06 May 2016 05:48:37 AM UTCbothnerStatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1