My code is nobinary. The error messages I was getting without the explicit conversion from Rexx to String looked something like this: +++ Error: The method 'setTextViewText(int,netrexx.lang.Rexx)' cannot be found in class 'android.widget.RemoteViews' or a superclass Apparently NetRexx does not realize that a string conversion is needed sometimes. The way I did the conversion was probably not the best (a cast works too: String (expression) where expression is a Rexx type.) , but when I looked at the code later, it made it instantly clear to me what was being done and why. It sounds like you encountered a similar problem to mine. -- Kermit David Requena wrote: Kermit, _______________________________________________ Ibm-netrexx mailing list [hidden email] |
Kermit,
I was making two distinct observations on your snippet. Sorry if I didn't make it clear. El 15/04/2010 20:32, Kermit Kiser escribió: My code is nobinary. So 'Rexx >= (String("foo")String("bar"))' evaluates to 1 (true); no need for 'Rexx(String("foo")String("bar"))' as the expression is already of type Rexx. This is of course non related to the type conversion issue at hand. The error messages I was getting without the explicit conversion from Rexx to String looked something like this: Yeah, this is the error I would expect. As it appears, current rule for auto conversion from Rexx to String is: "Convert Rexx to String whenever a String object is required" What I propose is to change this rule to: "Convert Rexx to String whenever an object is required which either: a) is of class String b) implements any of the String implemented interfaces (Serializable, Comparable, CharSequence) " Note the 'b)' option might be furthered with 'when not already implemented by the Rexx type'. This would cater to Serializable. That way, given a method signature 'void setText(CharSequence arg)', a Rexx object would be converted to String; being CharSequence an interface implemented by String. This should be a safe conversion under any circumstances.
That's in my view a matter of taste. No comment at my end :-)
hmm.. I don't think so, not really. It's just related to the same area of type inference/lookup/conversion of the language. That is IMHO the NetRexx general area which would most benefit from a little overhaul. --- Saludos / Kind regards. David Requena _______________________________________________ Ibm-netrexx mailing list [hidden email] |
Free forum by Nabble | Edit this page |