On 27.03.2020 15:18, René Jansen wrote:
On 27 Mar 2020, at 15:10, Jeff Hennick <[hidden email]> wrote: ooRexx will output its null value, i.e. the ooRexx object representing null, .nil, with a default string value of "The NIL object", no exceptions whatsoever. So this is how it works: G:\test\oorexx>rexx -e "say .nil" The NIL object ---rony _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
ah thanks Rony. So we might consider to do that, on order to keep things more tidy.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by rvjansen
At my GEISCO Times, we did have an attribute ZERO='unknown' for instance, to track down ZERO-Values in PRINT-Outs. In NetRexx, this should be something as NULL='unknown' as a SUFFIX in any NetRexx DECLARATION. My RexxPrint program, currently under deployment to www.RexxLa.org *or* www.Sourceforge.org does handle the following suffix attributes: HEAD='my header' -- for defining a HEADER for any Print-Outs. PIC='editing Picture (as in COBOL)' for any printout. NULL='text for a Null-pointer' and also: LABEL='My desired Screen Label' for SCREENs, as well. As it currently looks like, I shall be able to release this whole stuff end of April, 2020. The RUN-Time package is already completed, and I am currently REVIEWING my whole software for OPEN SOURCE RELEASE. Kindly, Thomas Schneider, Vienna, Austria. ============================================================================================= Am 27.03.2020 um 15:18 schrieb René
Jansen:
On 27 Mar 2020, at 15:10, Jeff Hennick <[hidden email]> wrote: _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
In reply to this post by Rony G. Flatscher
Hmm, maybe this is more helpful from
ooRexx: creating an array and iterating over it including entries
that have no value assigned to it:
Running the above ooRexx program yields
the following output:
---rony
On 27.03.2020 15:46, Rony G. Flatscher
wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Last of the series. This is how BSF4ooRexx the ooRexx/Java bridge handles this: arr=bsf.createArray("java.lang.String", 5) -- Java String array, capacity 5 arr[1]="a" arr[3]="c" do i=1 to 5 say "arr["i"]:" arr[i] end say "---" -- Java String array with enumerated values, including nulls arr=bsf.createArrayOf("java.lang.String", "a", .nil,"c", .nil, .nil) do i=1 to 5 say "arr["i"]:" arr[i] end ::requires "BSF.CLS" -- get Java bridge Running the above BSF4ooRexx program yields: arr[1]: a arr[2]: The NIL object arr[3]: c arr[4]: The NIL object arr[5]: The NIL object --- arr[1]: a arr[2]: The NIL object arr[3]: c arr[4]: The NIL object arr[5]: The NIL object Note, in this case the Rexx array object is actually Java array of type java.lang.String with a capacity of 5, where there are no String values for the second, forth and fifth entry. Also note: although "arr" is a real Java array it gets
camouflaged as an ooRexx array where the index of the first array
element has the value "1" and so on (Java by contrast would start
with 0 for the first entry). ---rony _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Rony G. Flatscher
Hi Rony,
yes, that is also helpful. But I find “The NIL object” too verbose, apart from the question if there is really only one. Wherever I trap null pointers in my own (application) code, I always use ’null’. Because it is ‘a’ null, not ’the’ null. I make lots of them. Saw you other mail coming in also; it confirmed my impression. Also, I was wondering when the word ‘camouflage’ would fall ;-) I am pondering if NIL would be a right fit for NetRexx where we trap nulls. It sounds UK English enough for me, and I wonder if Simon Nash came up with it. best regards, René.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Rony G. Flatscher
Sorry, I lied :), there is one more, maybe interesting case: using the ooRexx do...over loop over the array object. In such a case all Java null values in an array gets ignored such that only "a" and "c" gets processed: arr=bsf.createArray("java.lang.String", 5) -- Java String array, capacity 5 arr[1]="a" arr[3]="c" do i=1 to 5 say "arr["i"]:" arr[i] end say "---" arr=bsf.createArrayOf("java.lang.String", "a", .nil,"c", .nil, .nil) do i=1 to 5 say "arr["i"]:" arr[i] end say "---" do entry over arr say entry end ::requires "BSF.CLS" -- get Java bridge Output: arr[1]: a arr[2]: The NIL object arr[3]: c arr[4]: The NIL object arr[5]: The NIL object --- arr[1]: a arr[2]: The NIL object arr[3]: c arr[4]: The NIL object arr[5]: The NIL object --- a c This really concludes the BSF4ooRexx bridge behaviour (the idea has been to camouflage all of Java as ooRexx). ---rony
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by rvjansen
On Fri, Mar 27, 2020 at 11:11 AM René Jansen <[hidden email]> wrote:
Yes, there is really only one. It is a real object rather than the absence of an object (which null is).
Yes, Simon Nash was the origin of this. Rick
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Rony G. Flatscher
yes, I get the picture. Good to see that except for the array initializers this is all the same code between netrexx and oorexx/bsf4that.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by Rony G. Flatscher
On Fri, Mar 27, 2020 at 11:12 AM Rony G. Flatscher <[hidden email]> wrote:
This is not ignoring the value, it occurs because the array class makeArray method returns a non-sparse array when the snapshot is taken at the beginning of the loop. Rick
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by rickmcguire
Hi Rick,
thank your for clearing that up - if it is the one object then it really is “The NIL”. My programs have usually lots of nulls before I clear them out. I see Simon’s face before my eyes if I say “The NIL Object” out loud. René.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
On Fri, Mar 27, 2020 at 11:19 AM René Jansen <[hidden email]> wrote:
I have a similar problem working with the code any time I encounter the Behaviour class. After 30+ years of working with the code, I always have to stop and think about where I am before typing the word.
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by rvjansen
On 27.03.2020 15:18, René Jansen wrote:
On 27 Mar 2020, at 15:10, Jeff Hennick <[hidden email]> wrote: Hmm, in Java, if you do a System.out.println("abc:"+someObj) and
someObj is null then there is no exception thrown but rather the
string "null" is used instead. So instead of an exception one could either use "null" to indicate that the reference is a null reference or even an empty string "" assuming that null for a String is an alternative value for representing the empty String (i.e. no String). Just ideas... ---rony
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by rickmcguire
Hello Rick McGuire: Glad to hear that You are still alive (as me) and not suffering from COVID-19 :-) May I, please, propose for all REXX Dialects A NIL object(in ooRexx) or a Null Value(in NetRexx) shall NOT yield a NULL exception in any&all OUTPUT-Statements. It should simply output 'NULL', when not a NULL='MyNull' suffix-clase in the respective NetRexx Declaration. Thus, a NetRexx Declaration shoule be anhanced to allow Clauses like. A=Rexx '', Head='Customer Name' B =int, PIC='999.999' etc, etc. When HEAD is NOT defined, the variables name is used as the Header. When PIC is NOT defined, normal output (as currently) should be used. When NULL is NOT defined, 'NULL' shall be used in any and all OUTPUT-Statements. Full Stop. Thomas.
Am 27.03.2020 um 16:16 schrieb Rick
McGuire:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
May I add One COMMENT again, to this, my previous, statement , please: A CONCAT statement is also an OUPUT-Statement, e.g. X = A B C (where A, B , C are already defined ooRexx/NetRexx variables) ... Should also output the NULL-value ... The remaining question is only: Would this be a GOOD IDEA ? Maybe NOT, as we may all not be able to detect MIS-Spellings in the above statement as well. Hence: OPEN DISCUSSION, Now! Thomas Schneider ========================================================================== Am 27.03.2020 um 16:53 schrieb Thomas
Schneider:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
In reply to this post by rvjansen
But
your question is valid, and likely should be considered a bug in
SAY.
I often considered making a lot more 'automatic' conversions between
String and Rexx. I think that to do that needs taking a step back
and looking at all the cases (and there are some security issues, too, I think,
as Java relies on String being 'special').
I suspect that making a 'quick fix' for concat .. and then
another for the next case .. etc. .. is the wrong approach.
Mike
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by ThSITC
Possibly what we are dancing around, and toward, is a STRICTNULLS option. My thinking at this time, and I'm persuadable, is
that with the default of NOSTRICTNULLS, on output or
concatenation, a Rexx NULL is the string "". With STRICTNULLS it
is the string "NULL". And never the dreaded showstopping Java
error. (Or should STRICTNULLS always give the error? Is there a
three-way option? Say STRICTNULLSx, where x is 1, 2, or 3 --
which is not quite so readable -- ?) On 3/27/2020 12:34 PM, Thomas Schneider
wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
On Fri, Mar 27, 2020 at 10:47 AM Jeff Hennick <[hidden email]> wrote:
Shouldn't a strict null be… null? Also, null _is_ used for Java interop, no? Best, Marc _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Hi Marc, thanks for your response! When NULL is defined as ZERO, as former ethonoligies did define that: How would You evaluate the following Formula: - 1 - - 1 ?? Thomas. =================================================================== Am 27.03.2020 um 18:59 schrieb Marc
Simpson:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
This is a typical sample of PATTERN RECOGNITION, I think: - I - - I --- I When You do count the Minus Signs first, You probably shall count 1,2,3, ... But is probably better to SEE that there is only ONE 'I' in this context. As long as WE All shall stay INDIVIDUALS (denoted by 'I' above) even no VIRUS as COVID-19 can attack and kill US ALL !!! Kindly, and strictly, Massa Tho'Massa, as some african friends here in Vienna and other societies are calling me since 1984 (sorry ;-)) =========================================================================================================== Am 27.03.2020 um 19:11 schrieb Thomas
Schneider:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
Free forum by Nabble | Edit this page |