bugKawa - Bugs: bug #44398, Unnecessary Warning when binding...

 
 

bug #44398: Unnecessary Warning when binding java object instances to a name

Submitted by:  ruuns <ruuns>
Submitted on:  Sun 01 Mar 2015 02:54:20 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Documentation typo/errorStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 05 Mar 2015 11:34:09 AM UTC, comment #2:

I see :) Thx for the detailed clarification.

ruuns <ruuns>
Sun 01 Mar 2015 03:12:52 PM UTC, comment #1:

The "no known slot" message means there is no slot known at compile-time, so the compiler has to generate code to do a run-time lookup (using reflection). This succeeds, but is much slower.

The reason is due to the REPL: The compiler can't be sure that b is a point. After all the next statement could be:

Instead of 'define' you could use the new '!' operator, which is similar to define-constant (but will allow pattern-match). You can also use 'define-constant', 'define-private', or plain define with a type-specifier:

This is not a problem in a file (as long as it is processd in whole-file mode rather than line-at-a-time mode).

Per Bothner <bothner>
Project Administrator
Sun 01 Mar 2015 02:54:20 PM UTC, original submission:

Hi, this is an issue which is probably not very important but i would like to report it still for your knowledge.

I've tested some things in the REPL with some objects created with define-simple-class and found maybe an unnecessary warning.

Assume any define-simple-class definition e.g.

(define-simple-class point () (x init-value: 10))

You get no problem by using it with:

#|kawa:20|# (point):x
10
#|kawa:21|# (let ((a (point))) a:x)
10

But if you bind an instance to a name via define, you get an unexpected warning "no known slot" although the correct value is returned.

#|kawa:22|# (define b (point))
#|kawa:23|# b:x
/dev/stdin:23:1: warning - no known slot 'x' in java.lang.Object
10

Ruuns

ruuns <ruuns>

 

(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 ruuns (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 15 Jun 2015 06:51:09 PM UTCbothnerOpen/ClosedOpen=>Closed
    Sun 01 Mar 2015 03:12:52 PM UTCbothnerStatusNone=>Invalid

    Back to the top


    Powered by Savane 3.1-cleanup1