bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bug #37456] colon notation and calling a static method thoug


From: anonymous
Subject: [Bug-kawa] [bug #37456] colon notation and calling a static method though an instance
Date: Fri, 28 Sep 2012 14:50:37 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20100101 Firefox/15.0.1

URL:
  <http://savannah.gnu.org/bugs/?37456>

                 Summary: colon notation and calling a static method though an
instance
                 Project: Kawa
            Submitted by: None
            Submitted on: Fri 28 Sep 2012 02:50:37 PM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Generally speaking, (instance:method-name argument ...) gives the
same result as (*:method-name instance argument ...), but
it is not necessarily true.

One of the exceptional cases is the case where the instance is
an instance of java.lang.Class, as described in the Kawa document.

I have found another exceptional case.  Given a Java Class Foo:

public class Foo {
    public Foo() {}
    public static Object foo(Object obj) {
        return obj;
    }
}

(define bar (Foo))(bar:foo "abc") causes error:

gnu.mapping.WrongArguments: call to 'Foo.foo(java.lang.Object)' has too
many arguments (2; must be 1)

while (*:foo bar "abc") makes a good result.

I don't think calling a static method though an instance is not a
good practice, but it is sometimes used. Automatically rewriting
(*:x y ...) into (y:x ...) is dangerous.

I would like Kawa to support colon notation for calling a static method though
an instance.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37456>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]