bugKawa - Bugs: bug #14097, problem with (this) syntax within...

 
 

bug #14097: problem with (this) syntax within define-syntax

Submitted by:  tk <huh>
Submitted on:  Thu 11 Aug 2005 08:20:39 PM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Run-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 18 Nov 2005 09:14:33 PM UTC, comment #1:

Fixed in CVS.
I also checked in your testcase into the testsuite.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Thu 11 Aug 2005 08:20:39 PM UTC, original submission:

There's a problem with the translation of the (this) syntax when
it occurs within define-syntax, illustrated in the code below.
This code worked in 1.7, but fails in 1.8b.

workaround: the defmacro implementation of the same syntax works fine.

$ cat this.scm
(define-syntax slot
(syntax-rules ()
((_ obj slotname)
(field obj (quote slotname)))
((_ slotname)
(field (this) (quote slotname)))))

(define-simple-class <x> ()
(x :init 0)
((incx) <void>
(set! (slot x) (+ 1 (slot x))))
((incx2) <void>
(set! (slot (this) x) (+ 1 (slot (this) x)))))

#|
(defmacro slot args
(if (null? (cdr args))
`(field (this) ',(car args))
`(field ,(car args) ',(cadr args))))
|#

$ rlwrap java -jar kawa-1.8beta.jar
#|kawa:1|# (compile-file "this.scm" "this.zip")
#|kawa:2|# (load "this.zip")
#|kawa:3|# (set! x (make <x>))
#|kawa:4|# (invoke x 'incx)
gnu.mapping.UnboundLocationException: unbound location $this$
at gnu.mapping.Location.get(Location.java:67)
at x.incx(this.scm:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at gnu.expr.PrimProcedure.apply(PrimProcedure.java:194)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:251)
at gnu.mapping.CallContext.runUntilValue(CallContext.java:315)
at gnu.mapping.MethodProc.applyN(MethodProc.java:105)
at gnu.kawa.reflect.Invoke.applyN(Invoke.java:157)
at gnu.kawa.reflect.Invoke.applyN(Invoke.java:51)
at gnu.mapping.Procedure.apply(Procedure.java:124)
at gnu.mapping.Procedure.apply(Procedure.java:116)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:251)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:218)
at kawa.Shell.run(Shell.java:229)
at kawa.Shell.run(Shell.java:172)
at kawa.Shell.run(Shell.java:159)
at kawa.repl.main(repl.java:744)
#|kawa:5|# (invoke x 'incx2)
#|kawa:6|#

tk <huh>

 

(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

 

CC list is empty

 

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 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Fri 18 Nov 2005 09:14:33 PM UTCbothnerStatusNone=>Fixed
  Assigned toNone=>bothner
  Open/ClosedOpen=>Closed
Thu 11 Aug 2005 08:20:39 PM UTChuhCarbon-Copy-=>Added -unavailable-

Back to the top


Powered by Savane 3.1-cleanup1