> (display (type1:getClass:getName) )
> ok for compiling but when running i got a Null pointer:
> strange ,is there a way to make it work?
> my object is not Null it display as B5 , a string (java.langString or FString or gnu.text.char .... i do not know but not Null
It's confusing, but it's because colon notation tries to do so much ...
There are two problems:
(1) You can write either
(type1:getClass) ; call getClass method of type1
type1:class ; get class property of type1
Either works, because an X property can resolve either to an X field
or a getX method.
However, if you leave out the (inner) parens:
you get a procedure that *if* you apply it calls the getClass method.
(2) There is an unfortunate ambiguity between:
(object:method-name arg ...) ; instance method invocation
(Class:method-name arg ...) ; static method invocation
type1:class (or (type1:getName)) returns a class, so for
looks for the static method getName in the class of type1.