This is from Rexx.nrx
I pass variable in and it is transformed. There are multiple Rexx( signatures ) in the Class. /** Make a Rexx object from an array of java.lang.String; the array elements are concatenated with a single blank between each. */ method Rexx(strings=java.lang.String[]) this(sa2ca(strings), 1); return -- use helper Why do some do this( thing, 1 OR TRUE) and some just do this( type var) ? Where is the 1 used? What is the name or concept for the way this( ................) is used? _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
So it means to call method Rexx(s=char[], trynum=boolean) shared which has the right "signature"
Still, would like to know what is the word or phrase that describes the OO concept.
On Wed, Oct 24, 2012 at 10:44 PM, Jason Martin <[hidden email]> wrote: This is from Rexx.nrx _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Not sure I understand what you're getting at, but perhaps it's "overloading," one meaning of which is multiple methods of the same name but different "signatures" (argument patterns).
On Thu, Oct 25, 2012 at 12:27 AM, Jason Martin <[hidden email]> wrote: So it means to call method Rexx(s=char[], trynum=boolean) shared which has the right "signature" -- "One can live magnificently in this world if one knows how to work and how to love." -- Leo Tolstoy _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Jason,
method Rexx() is the constructor, and as George rightly says, it is overloaded. The call that you indicated just reuses another constructor (with a different signature), the one that takes the char array and the boolean. Not sure if there is a word for that, like 'composing' constructors, or sharing, reusing the code. Mike might as well have repeated the code in the other constructor, but that would have gone against the principle of having everything in one place at most. Now, I think there was a word for that ... best regards, René. On 25 okt. 2012, at 06:47, George Hovey <[hidden email]> wrote: Not sure I understand what you're getting at, but perhaps it's "overloading," one meaning of which is multiple methods of the same name but different "signatures" (argument patterns). _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
Ok, thanks. But is there a special definition or phrase when it is the keyword "this" that is used?
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
"this" has a number of different uses. In the context you show, this is called an "explicit constructor". This tutorial might be useful for understanding the different uses:
Rick
On Thu, Oct 25, 2012 at 7:21 AM, Jason Martin <[hidden email]> wrote: Ok, thanks. But is there a special definition or phrase when it is the keyword "this" that is used? _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Jason Martin
That's what I was looking for. Thanks.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Free forum by Nabble | Edit this page |