bugKawa - Bugs: bug #47651, Scope issue calling for-each from...

 
 

bug #47651: Scope issue calling for-each from a class method

Submitter:  Tom Bousso <tbousso>
Submitted:  Fri 08 Apr 2016 09:24:55 PM UTC
   
 
Category:  Code generation Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  bothner
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 15 Apr 2016 01:05:40 AM UTC, comment #2: 

I checked in a fix - see gnu/expr/ChangeLog.

I also checked in your testcase - see testsuite/sva47651.scm.
Thanks!

This change ended up both removing some redundant code, and causing slightly better code to be generated in at least one test-case.

Per Bothner <bothner>
Group administrator
Sun 10 Apr 2016 05:53:50 AM UTC, comment #1: 

hanks for the clean test-case.
I have confirmed that it fails for me.
I'll try to figure out what is going on tomorrow.

Per Bothner <bothner>
Group administrator
Fri 08 Apr 2016 09:24:55 PM UTC, original submission:  


(define-simple-class A ()
        ((*init*)
                (for-each
                        (lambda
                                (n)
                                (print n)
                        )
                        '(1 2 3)
                )
        )
        ((print n)
                (format #t "~D" n)
        )
)

(A)


That code results in an error: test.scm:6:5: internal error: missing LambdaExp:print/5/l:11

It seems like the lambda doesn't capture the object's scope correctly. If I create my own for-each in Scheme or change it to ((this):print n) then it works.

Tom Bousso <tbousso>

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2016-04-23 bothner Open/ClosedOpen Closed
    2016-04-15 bothner StatusConfirmed Fixed
    2016-04-10 bothner StatusNone Confirmed
        Assigned toNone bothner

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code