bugKawa - Bugs: bug #38026, Mixed variables scope

 
 

bug #38026: Mixed variables scope

Submitter:  Alex Moiseenko <imdagger>
Submitted:  Sat 05 Jan 2013 11:38:16 PM UTC
   
 
Category:  Scheme language Severity:  3 - Normal
Item Group:  Run-time exception Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 19 Jul 2013 12:43:54 AM UTC, comment #1: 

I checked in a fix and your test-case.

Sorry for letting this one sit so long.

Per Bothner <bothner>
Group administrator
Sat 05 Jan 2013 11:38:16 PM UTC, original submission:  

I'm not sure that my code snippet is allowed in real projects, but i have met similar situation again like lambda-in-class-1.scm tries to cover:

(define-class A ()
    ((some-method (x ::int) (f ::procedure)) ::int
     (f x)))

(define-class B ()
    (p ::int 42)
    ((another-method) ::int
     ((A):some-method 13 (lambda (o ::int) ::int (+ o p)))))

(display ((B):another-method)) (newline)

For define-class (but not for define-simple-class) it fails with:
java.lang.IncompatibleClassChangeError: Class test$frame does not implement the requested interface test$B
at test$B$class.lambda1(test.scm:8)
at test$frame.apply1(test.scm:8)
at gnu.expr.ModuleMethod.apply1(ModuleMethod.java:192)
at test$A$class.someMethod(test.scm:3)
at test$A$class.someMethod(test.scm)
at test$B$class.anotherMethod(test.scm:8)
at test$B$class.anotherMethod(test.scm)
at test.run(test.scm:10)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:309)
at gnu.expr.CompiledModule.evalModule(CompiledModule.java:41)
at gnu.expr.CompiledModule.evalModule(CompiledModule.java:60)
at kawa.Shell.runFile(Shell.java:505)
at kawa.Shell.runFileOrClass(Shell.java:420)
at kawa.repl.main(repl.java:879)

I understand that I can write "(this):p" instead of "p", but I guess Kawa should not fail in this situation and maybe try to warn about missed "(this)" construction.

Alex Moiseenko <imdagger>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-19 bothner StatusNone Fixed
        Assigned toNone bothner
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code