loop...over bug

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

loop...over bug

Marc Simpson
Morning all,

I've encountered a few related bugs while using loop...over with
one-dimensional arrays in 3.01 RC2. I'm afraid this message is rather
long as I've included snippets of code, compiler output and formatted
Java.

First, consider the following (working) case,

--( l1.nrx, working )--------------
input = [String 'a', 'b', 'c']
loop s over input
  say s
end
-----------------------------------

Output:

-----------------------------------
$ nrc -run l1
NetRexx portable processor, version NetRexx 3.01RC2, build 1-20110925-2337
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l1.nrx
Compilation of 'l1.nrx' successful
Running l1...
a
b
c
-----------------------------------

First problem: If I remove the type declaration, thereby initialising
an array of type Rexx[],

--( l2.nrx, not working )----------
input = ['a', 'b', 'c']
loop s over input
  say s
end
-----------------------------------

I get the following at compile-time:

-----------------------------------
$ nrc -run l2
NetRexx portable processor, version NetRexx 3.01RC2, build 1-20110925-2337
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l2.nrx
/Users/marc/projects/rexx/nrx/l2.java:3: Undefined variable or class name: $1
{int $3=0;java.util.Vector $2=new
java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);

                   ^
/Users/marc/projects/rexx/nrx/l2.java:3: Undefined variable or class name: $1
{int $3=0;java.util.Vector $2=new
java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);

                                                            ^
/Users/marc/projects/rexx/nrx/l2.java:3: Method
testnode(netrexx.lang.Rexx) not found in class java.lang.Object.
{int $3=0;java.util.Vector $2=new
java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);


                         ^
3 errors
Compilation of 'l2.nrx' failed [javac failed]
-----------------------------------

Here's a tidied version of the compiler output (via nrc -keepasjava):

-----------------------------------
/* Generated from 'l2.nrx' 19 Jan 2012 10:40:51 [v3.01] *//* Options:
Crossref Decimal Java Logo Trace2 Verbose3 */
public class l2 {
    private static final java.lang.String $0 = "l2.nrx";

    public static void main(java.lang.String $0s[]) {
        netrexx.lang.Rexx input[];
        netrexx.lang.Rexx s = null;
        input = new netrexx.lang.Rexx[]{new netrexx.lang.Rexx('a'),
new netrexx.lang.Rexx('b'), new netrexx.lang.Rexx('c')};
        {
            int $3 = 0;
            java.util.Vector $2 = new java.util.Vector(100, 0);
            synchronized (input) {
                for (; ; ) {
                    if (!$1.hasMoreElements()) break;
                    $2.addElement($1.nextElement());
                    if (!input.testnode((netrexx.lang.Rexx)
($2.elementAt($3)))) {
                        $2.removeElementAt($3);
                        continue;
                    }
                    $3++;
                }
            }
            s:
            for (; ; ) {
                if (--$3 < 0) break;
                s = (netrexx.lang.Rexx) $2.elementAt($3);
                netrexx.lang.RexxIO.Say(s);
            }
        }/*s*/
        return;
    }

    private l2() {
        return;
    }
}
-----------------------------------

Notice that $1 hasn't been declared and the testnode method is being
called on the Rexx[] array. A related error occurs for arrays
initialised with 'int' type:

--( l3.nrx, not working )----------
input = [int 1, 2, 3]
loop s over input
  say s
end
-----------------------------------

Output:

-----------------------------------
$ nrc -run l3
NetRexx portable processor, version NetRexx 3.01RC2, build 1-20110925-2337
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l3.nrx
/Users/marc/projects/rexx/nrx/l3.java:3: Incompatible type for =.
Can't convert int to java.lang.Object.
{int $3=0;java.lang.Object[] $2=new
java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];

                                                     ^
1 error
Compilation of 'l3.nrx' failed [javac failed]
-----------------------------------

In this case, the produced Java is actually okay and can be compiled
with javac, run normally:

-----------------------------------
/* Generated from 'l3.nrx' 19 Jan 2012 10:44:08 [v3.01] *//* Options:
Crossref Decimal Java Logo Trace2 Verbose3 */
public class l3 {
    private static final java.lang.String $0 = "l3.nrx";

    public static void main(java.lang.String $0s[]) {
        int input[];
        java.lang.Object s = null;
        input = new int[]{new netrexx.lang.Rexx(1).toint(), 2, 3};
        {
            int $3 = 0;
            java.lang.Object[] $2 = new java.lang.Object[input.length];
            synchronized (input) {
                for (; ; ) {
                    if ($3 == $2.length) break;
                    $2[$3] = input[input.length - 1 - $3];
                    $3++;
                }
            }
            s:
            for (; ; ) {
                if (--$3 < 0) break;
                s = (java.lang.Object) $2[$3];
                netrexx.lang.RexxIO.Say(s);
            }
        }/*s*/
        return;
    }

    private l3() {
        return;
    }
}
-----------------------------------

Final example,

--( l4.nrx, not working )----------
input = [1, 2, 3]
loop s over input
  say s
end
-----------------------------------

Compiler output:

-----------------------------------
$ nrc -run l4
NetRexx portable processor, version NetRexx 3.01RC2, build 1-20110925-2337
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l4.nrx
/Users/marc/projects/rexx/nrx/l4.java:3: Undefined variable or class name: $1
{int $3=0;java.util.Vector $2=new
java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);

                   ^
/Users/marc/projects/rexx/nrx/l4.java:3: Undefined variable or class name: $1
{int $3=0;java.util.Vector $2=new
java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);

                                                            ^
/Users/marc/projects/rexx/nrx/l4.java:3: Method
testnode(netrexx.lang.Rexx) not found in class java.lang.Object.
{int $3=0;java.util.Vector $2=new
java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);


                         ^
3 errors
Compilation of 'l4.nrx' failed [javac failed]
-----------------------------------

In this case, the produced Java is almost identical to l2.java above;
undeclared $1, testnode called on the array.

If my use of the loop...over construct in the above snippets is
currently unsupported in NetRexx (i.e., the bug is in my code), the
compiler/translator should notify me before outputting the Java
source; as you can see, the errors are rather opaque.

Having said that, this feels more like a bug in the translation
phase—I can't see why [String 'a', 'b', 'c'] would be supported while
int and Rexx arrays are not, nor why the translator would produce code
referencing undeclared variables. The Rexx[] case is particularly
strange since the translated code runs just fine when compiled by
hand.

Please let me know whether any more information is required to
replicate the issue;
Best,
M


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: loop...over bug

rvjansen
Marc,

these might have been fixed in RC3 - which is not yet out there, due to - we'll I don't have the time to explain why I did not have the time, but I promise - this week. I have to look what we can do about the installer that was delivered by Tom Maynard, it would be great if that could be added.

In the meantime, you could build a new version yourself, it is not too much work, and the more testers we have the earlier, the better.

best regards,

René Jansen.


On 19 jan. 2012, at 12:03, Marc Simpson wrote:

> Morning all,
>
> I've encountered a few related bugs while using loop...over with
> one-dimensional arrays in 3.01 RC2. I'm afraid this message is rather
> long as I've included snippets of code, compiler output and formatted
> Java.
>
> First, consider the following (working) case,
>
> --( l1.nrx, working )--------------
> input = [String 'a', 'b', 'c']
> loop s over input
>  say s
> end
> -----------------------------------
>
> Output:
>
> -----------------------------------
> $ nrc -run l1
> NetRexx portable processor, version NetRexx 3.01RC2, build 1-20110925-2337
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l1.nrx
> Compilation of 'l1.nrx' successful
> Running l1...
> a
> b
> c
> -----------------------------------
>
> First problem: If I remove the type declaration, thereby initialising
> an array of type Rexx[],
>
> --( l2.nrx, not working )----------
> input = ['a', 'b', 'c']
> loop s over input
>  say s
> end
> -----------------------------------
>
> I get the following at compile-time:
>
> -----------------------------------
> $ nrc -run l2
> NetRexx portable processor, version NetRexx 3.01RC2, build 1-20110925-2337
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l2.nrx
> /Users/marc/projects/rexx/nrx/l2.java:3: Undefined variable or class name: $1
> {int $3=0;java.util.Vector $2=new
> java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);
>
>                   ^
> /Users/marc/projects/rexx/nrx/l2.java:3: Undefined variable or class name: $1
> {int $3=0;java.util.Vector $2=new
> java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);
>
>                                                            ^
> /Users/marc/projects/rexx/nrx/l2.java:3: Method
> testnode(netrexx.lang.Rexx) not found in class java.lang.Object.
> {int $3=0;java.util.Vector $2=new
> java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);
>
>
>                         ^
> 3 errors
> Compilation of 'l2.nrx' failed [javac failed]
> -----------------------------------
>
> Here's a tidied version of the compiler output (via nrc -keepasjava):
>
> -----------------------------------
> /* Generated from 'l2.nrx' 19 Jan 2012 10:40:51 [v3.01] *//* Options:
> Crossref Decimal Java Logo Trace2 Verbose3 */
> public class l2 {
>    private static final java.lang.String $0 = "l2.nrx";
>
>    public static void main(java.lang.String $0s[]) {
>        netrexx.lang.Rexx input[];
>        netrexx.lang.Rexx s = null;
>        input = new netrexx.lang.Rexx[]{new netrexx.lang.Rexx('a'),
> new netrexx.lang.Rexx('b'), new netrexx.lang.Rexx('c')};
>        {
>            int $3 = 0;
>            java.util.Vector $2 = new java.util.Vector(100, 0);
>            synchronized (input) {
>                for (; ; ) {
>                    if (!$1.hasMoreElements()) break;
>                    $2.addElement($1.nextElement());
>                    if (!input.testnode((netrexx.lang.Rexx)
> ($2.elementAt($3)))) {
>                        $2.removeElementAt($3);
>                        continue;
>                    }
>                    $3++;
>                }
>            }
>            s:
>            for (; ; ) {
>                if (--$3 < 0) break;
>                s = (netrexx.lang.Rexx) $2.elementAt($3);
>                netrexx.lang.RexxIO.Say(s);
>            }
>        }/*s*/
>        return;
>    }
>
>    private l2() {
>        return;
>    }
> }
> -----------------------------------
>
> Notice that $1 hasn't been declared and the testnode method is being
> called on the Rexx[] array. A related error occurs for arrays
> initialised with 'int' type:
>
> --( l3.nrx, not working )----------
> input = [int 1, 2, 3]
> loop s over input
>  say s
> end
> -----------------------------------
>
> Output:
>
> -----------------------------------
> $ nrc -run l3
> NetRexx portable processor, version NetRexx 3.01RC2, build 1-20110925-2337
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l3.nrx
> /Users/marc/projects/rexx/nrx/l3.java:3: Incompatible type for =.
> Can't convert int to java.lang.Object.
> {int $3=0;java.lang.Object[] $2=new
> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>
>                                                     ^
> 1 error
> Compilation of 'l3.nrx' failed [javac failed]
> -----------------------------------
>
> In this case, the produced Java is actually okay and can be compiled
> with javac, run normally:
>
> -----------------------------------
> /* Generated from 'l3.nrx' 19 Jan 2012 10:44:08 [v3.01] *//* Options:
> Crossref Decimal Java Logo Trace2 Verbose3 */
> public class l3 {
>    private static final java.lang.String $0 = "l3.nrx";
>
>    public static void main(java.lang.String $0s[]) {
>        int input[];
>        java.lang.Object s = null;
>        input = new int[]{new netrexx.lang.Rexx(1).toint(), 2, 3};
>        {
>            int $3 = 0;
>            java.lang.Object[] $2 = new java.lang.Object[input.length];
>            synchronized (input) {
>                for (; ; ) {
>                    if ($3 == $2.length) break;
>                    $2[$3] = input[input.length - 1 - $3];
>                    $3++;
>                }
>            }
>            s:
>            for (; ; ) {
>                if (--$3 < 0) break;
>                s = (java.lang.Object) $2[$3];
>                netrexx.lang.RexxIO.Say(s);
>            }
>        }/*s*/
>        return;
>    }
>
>    private l3() {
>        return;
>    }
> }
> -----------------------------------
>
> Final example,
>
> --( l4.nrx, not working )----------
> input = [1, 2, 3]
> loop s over input
>  say s
> end
> -----------------------------------
>
> Compiler output:
>
> -----------------------------------
> $ nrc -run l4
> NetRexx portable processor, version NetRexx 3.01RC2, build 1-20110925-2337
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l4.nrx
> /Users/marc/projects/rexx/nrx/l4.java:3: Undefined variable or class name: $1
> {int $3=0;java.util.Vector $2=new
> java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);
>
>                   ^
> /Users/marc/projects/rexx/nrx/l4.java:3: Undefined variable or class name: $1
> {int $3=0;java.util.Vector $2=new
> java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);
>
>                                                            ^
> /Users/marc/projects/rexx/nrx/l4.java:3: Method
> testnode(netrexx.lang.Rexx) not found in class java.lang.Object.
> {int $3=0;java.util.Vector $2=new
> java.util.Vector(100,0);synchronized(input){for(;;){if(!$1.hasMoreElements())break;$2.addElement($1.nextElement());if(!input.testnode((netrexx.lang.Rexx)($2.elementAt($3)))){$2.removeElementAt($3);continue;}$3++;}}s:for(;;){if(--$3<0)break;s=(netrexx.lang.Rexx)$2.elementAt($3);
>
>
>                         ^
> 3 errors
> Compilation of 'l4.nrx' failed [javac failed]
> -----------------------------------
>
> In this case, the produced Java is almost identical to l2.java above;
> undeclared $1, testnode called on the array.
>
> If my use of the loop...over construct in the above snippets is
> currently unsupported in NetRexx (i.e., the bug is in my code), the
> compiler/translator should notify me before outputting the Java
> source; as you can see, the errors are rather opaque.
>
> Having said that, this feels more like a bug in the translation
> phase—I can't see why [String 'a', 'b', 'c'] would be supported while
> int and Rexx arrays are not, nor why the translator would produce code
> referencing undeclared variables. The Rexx[] case is particularly
> strange since the translated code runs just fine when compiled by
> hand.
>
> Please let me know whether any more information is required to
> replicate the issue;
> Best,
> M
>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: loop...over bug

Marc Simpson
Hi René,

On Thu, Jan 19, 2012 at 12:11 PM, René Jansen <[hidden email]> wrote:
> these might have been fixed in RC3 - which is not yet out there, due to - we'll I don't have the time to explain why I did not have the time, but I promise - this week. I have to look what we can do about the installer that was delivered by Tom Maynard, it would be great if that could be added.

Apologies for overlooking the log messages (r187-8) and
http://kenai.com/jira/browse/NETREXX-72; I'll search JIRA next time.

(Incidentally, a link to the issue tracker on the Community page might
be helpful.)

> In the meantime, you could build a new version yourself, it is not too much work, and the more testers we have the earlier, the better.

With r188 (i.e., head of trunk):

-----------------------------------
$ nrc -run l1
NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l1.nrx
Compilation of 'l1.nrx' successful
Running l1...
a
b
c

$ nrc -run l2
NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l2.nrx
Compilation of 'l2.nrx' successful
Running l2...
a
b
c

$ nrc -run l4
NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l4.nrx
Compilation of 'l4.nrx' successful
Running l4...
1
2
3

$ nrc -run l3
NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l3.nrx
/Users/marc/projects/rexx/nrx/l3.java:3: Incompatible type for =.
Can't convert int to java.lang.Object.
{int $3=0;java.lang.Object[] $2=new
java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];

                                                     ^
1 error
Compilation of 'l3.nrx' failed [javac failed]
-----------------------------------

As before, NetRexx produces valid Java from l3.nrx which can be
compiled and run.

Best,
M


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: loop...over bug

Kermit Kiser
Hi Marc -

Sorry for the delay in responding but I got sidelined for a couple of
days by a winter storm power outage.

Thanks for the problem report and analysis. It looks like there may be
an error in the way NetRexx 3.01 LOOP OVER handles primitive arrays.
Since RC3 has been waiting a while, perhaps there is time to slip in a
patch first if René OKs it.

-- Kermit


On 1/19/2012 4:34 AM, Marc Simpson wrote:

> Hi René,
>
> On Thu, Jan 19, 2012 at 12:11 PM, René Jansen<[hidden email]>  wrote:
>> these might have been fixed in RC3 - which is not yet out there, due to - we'll I don't have the time to explain why I did not have the time, but I promise - this week. I have to look what we can do about the installer that was delivered by Tom Maynard, it would be great if that could be added.
> Apologies for overlooking the log messages (r187-8) and
> http://kenai.com/jira/browse/NETREXX-72; I'll search JIRA next time.
>
> (Incidentally, a link to the issue tracker on the Community page might
> be helpful.)
>
>> In the meantime, you could build a new version yourself, it is not too much work, and the more testers we have the earlier, the better.
> With r188 (i.e., head of trunk):
>
> -----------------------------------
> $ nrc -run l1
> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l1.nrx
> Compilation of 'l1.nrx' successful
> Running l1...
> a
> b
> c
>
> $ nrc -run l2
> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l2.nrx
> Compilation of 'l2.nrx' successful
> Running l2...
> a
> b
> c
>
> $ nrc -run l4
> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l4.nrx
> Compilation of 'l4.nrx' successful
> Running l4...
> 1
> 2
> 3
>
> $ nrc -run l3
> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l3.nrx
> /Users/marc/projects/rexx/nrx/l3.java:3: Incompatible type for =.
> Can't convert int to java.lang.Object.
> {int $3=0;java.lang.Object[] $2=new
> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>
>                                                       ^
> 1 error
> Compilation of 'l3.nrx' failed [javac failed]
> -----------------------------------
>
> As before, NetRexx produces valid Java from l3.nrx which can be
> compiled and run.
>
> Best,
> M
>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>
>
>

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: loop...over bug

rvjansen
Hi Kermit,

I am fine with postponing a bit more and slipping a patch in - it would be no good if we would release it with a known deficiency, and the more we test on RC3, the better.

best regards,

René Jansen.

On 21 jan. 2012, at 09:46, Kermit Kiser wrote:

> Hi Marc -
>
> Sorry for the delay in responding but I got sidelined for a couple of days by a winter storm power outage.
>
> Thanks for the problem report and analysis. It looks like there may be an error in the way NetRexx 3.01 LOOP OVER handles primitive arrays. Since RC3 has been waiting a while, perhaps there is time to slip in a patch first if René OKs it.
>
> -- Kermit
>
>
> On 1/19/2012 4:34 AM, Marc Simpson wrote:
>> Hi René,
>>
>> On Thu, Jan 19, 2012 at 12:11 PM, René Jansen<[hidden email]>  wrote:
>>> these might have been fixed in RC3 - which is not yet out there, due to - we'll I don't have the time to explain why I did not have the time, but I promise - this week. I have to look what we can do about the installer that was delivered by Tom Maynard, it would be great if that could be added.
>> Apologies for overlooking the log messages (r187-8) and
>> http://kenai.com/jira/browse/NETREXX-72; I'll search JIRA next time.
>>
>> (Incidentally, a link to the issue tracker on the Community page might
>> be helpful.)
>>
>>> In the meantime, you could build a new version yourself, it is not too much work, and the more testers we have the earlier, the better.
>> With r188 (i.e., head of trunk):
>>
>> -----------------------------------
>> $ nrc -run l1
>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>> Copyright (c) RexxLA, 2011.  All rights reserved.
>> Parts Copyright (c) IBM Corporation, 1995,2008.
>> Program l1.nrx
>> Compilation of 'l1.nrx' successful
>> Running l1...
>> a
>> b
>> c
>>
>> $ nrc -run l2
>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>> Copyright (c) RexxLA, 2011.  All rights reserved.
>> Parts Copyright (c) IBM Corporation, 1995,2008.
>> Program l2.nrx
>> Compilation of 'l2.nrx' successful
>> Running l2...
>> a
>> b
>> c
>>
>> $ nrc -run l4
>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>> Copyright (c) RexxLA, 2011.  All rights reserved.
>> Parts Copyright (c) IBM Corporation, 1995,2008.
>> Program l4.nrx
>> Compilation of 'l4.nrx' successful
>> Running l4...
>> 1
>> 2
>> 3
>>
>> $ nrc -run l3
>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>> Copyright (c) RexxLA, 2011.  All rights reserved.
>> Parts Copyright (c) IBM Corporation, 1995,2008.
>> Program l3.nrx
>> /Users/marc/projects/rexx/nrx/l3.java:3: Incompatible type for =.
>> Can't convert int to java.lang.Object.
>> {int $3=0;java.lang.Object[] $2=new
>> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>>
>>                                                      ^
>> 1 error
>> Compilation of 'l3.nrx' failed [javac failed]
>> -----------------------------------
>>
>> As before, NetRexx produces valid Java from l3.nrx which can be
>> compiled and run.
>>
>> Best,
>> M
>>
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>
>>
>>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: loop...over bug

Marc Simpson
Thanks for looking into this;
Best,
M

On Sun, Jan 22, 2012 at 11:20 PM, René Jansen <[hidden email]> wrote:

> Hi Kermit,
>
> I am fine with postponing a bit more and slipping a patch in - it would be no good if we would release it with a known deficiency, and the more we test on RC3, the better.
>
> best regards,
>
> René Jansen.
>
> On 21 jan. 2012, at 09:46, Kermit Kiser wrote:
>
>> Hi Marc -
>>
>> Sorry for the delay in responding but I got sidelined for a couple of days by a winter storm power outage.
>>
>> Thanks for the problem report and analysis. It looks like there may be an error in the way NetRexx 3.01 LOOP OVER handles primitive arrays. Since RC3 has been waiting a while, perhaps there is time to slip in a patch first if René OKs it.
>>
>> -- Kermit
>>
>>
>> On 1/19/2012 4:34 AM, Marc Simpson wrote:
>>> Hi René,
>>>
>>> On Thu, Jan 19, 2012 at 12:11 PM, René Jansen<[hidden email]>  wrote:
>>>> these might have been fixed in RC3 - which is not yet out there, due to - we'll I don't have the time to explain why I did not have the time, but I promise - this week. I have to look what we can do about the installer that was delivered by Tom Maynard, it would be great if that could be added.
>>> Apologies for overlooking the log messages (r187-8) and
>>> http://kenai.com/jira/browse/NETREXX-72; I'll search JIRA next time.
>>>
>>> (Incidentally, a link to the issue tracker on the Community page might
>>> be helpful.)
>>>
>>>> In the meantime, you could build a new version yourself, it is not too much work, and the more testers we have the earlier, the better.
>>> With r188 (i.e., head of trunk):
>>>
>>> -----------------------------------
>>> $ nrc -run l1
>>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>> Program l1.nrx
>>> Compilation of 'l1.nrx' successful
>>> Running l1...
>>> a
>>> b
>>> c
>>>
>>> $ nrc -run l2
>>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>> Program l2.nrx
>>> Compilation of 'l2.nrx' successful
>>> Running l2...
>>> a
>>> b
>>> c
>>>
>>> $ nrc -run l4
>>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>> Program l4.nrx
>>> Compilation of 'l4.nrx' successful
>>> Running l4...
>>> 1
>>> 2
>>> 3
>>>
>>> $ nrc -run l3
>>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>> Program l3.nrx
>>> /Users/marc/projects/rexx/nrx/l3.java:3: Incompatible type for =.
>>> Can't convert int to java.lang.Object.
>>> {int $3=0;java.lang.Object[] $2=new
>>> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>>>
>>>                                                      ^
>>> 1 error
>>> Compilation of 'l3.nrx' failed [javac failed]
>>> -----------------------------------
>>>
>>> As before, NetRexx produces valid Java from l3.nrx which can be
>>> compiled and run.
>>>
>>> Best,
>>> M
>>>
>>>
>>> _______________________________________________
>>> Ibm-netrexx mailing list
>>> [hidden email]
>>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>>
>>>
>>>
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>
>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

RE: loop...over bug

Mike Cowlishaw
In reply to this post by rvjansen
 

> I am fine with postponing a bit more and slipping a patch in
> - it would be no good if we would release it with a known
> deficiency, and the more we test on RC3, the better.

Definitely would be nice to keep up the tradition of never putting out a NetRexx
release with a known bug :-).

Mike

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

RE: loop...over bug

rvjansen
And actually when I was driving to work this morning, I was already
certain that you would answer this at some point today. As these errors
popped up rather late in the release cycle, we -I- must be working
harder on the testset, which did not include tests for this
functionality, that might have or might not have been already in this
state in previous releases, as I think I do recollect from an earlier
email from Kermit.

It also is debatable if one can release a "release candidate" with
known bugs- depending on complete coverage of the testset I think not;
so I would like to keep with this tradition.

Also, I think this makes the case for having a requirement of
delivering unit tests with changes - this in addition to the design
document and NRL changes.

best regards,

René.


On 2012-01-23 12:33, Mike Cowlishaw wrote:

>> I am fine with postponing a bit more and slipping a patch in
>> - it would be no good if we would release it with a known
>> deficiency, and the more we test on RC3, the better.
>
> Definitely would be nice to keep up the tradition of never putting
> out a NetRexx
> release with a known bug :-).
>
> Mike
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: loop...over bug

ThSITC
In reply to this post by Mike Cowlishaw
Fully agreed! ;-)

... and that's the reason, why I've not yet put out my stuff, already. :-(
..... still known bugs :-(

...................   *and* : out of money :-( :-( :-(
Thomas.
================================================================
Am 23.01.2012 12:33, schrieb Mike Cowlishaw:

>
>
>> I am fine with postponing a bit more and slipping a patch in
>> - it would be no good if we would release it with a known
>> deficiency, and the more we test on RC3, the better.
> Definitely would be nice to keep up the tradition of never putting out a NetRexx
> release with a known bug :-).
>
> Mike
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>
>


--
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge
Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team
(www.netrexx.org)

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: loop...over bug - update

Kermit Kiser
In reply to this post by Marc Simpson
Here is a brief summary of my progress so far:  I have confirmed this
problem and I am testing a partial fix (not published yet) using the
after3.01 development branch. The partial fix resolves the compiler
issue but does not yet address a similar problem with the interpreter.

More details for those interested: It seems that when I tested the LOOP
OVER support for arrays, I used Integer[] thinking that I had primitives
covered. However Integer is not a primitive type in Java but a wrapper
class; thus an Integer array consists of objects which can be cast to
type Object while an "int" array contains primitive values which cannot
be cast to objects. Based on Marc's results, especially the fact that
the code produced by NetRexx could be compiled and executed by Java with
no problem, I immediately suspected the "autoboxing" feature of Java (
which converts primitive values to objects) had something to do with the
problem. When I ran some tests with Marc's l3.nrx program, I found some
strange things.

This is Marc's l3.nrx program :

--( l3.nrx, not working )----------
input = [int 1, 2, 3]
loop s over input
   say s
end
--( end of l3.nrx )----------

I also used the following program for my testing which simply calls the
Java compiler via the interface used by NetRexx:
-----  myjavac.nrx  -----
  javacok=sun.tools.javac.Main(System.out,
'javac').compile([String(arg),"-classpath",System.getProperty("java.class.path")])
-----  end myjavac.nrx  -----

Here is the log of my testing with some comments added (exact results
may depend on the Java version used):

---- First, duplicate Marc's error result:

C:\NetRexx\testing>nrc -replace l3

NetRexx portable processor, version NetRexx after3.01, build
156-20111226-1711
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l3.nrx
C:\NetRexx\testing\l3.java:3: Incompatible type for =. Can't convert int
to java.lang.Object.
{int $3=0;java.lang.Object[] $2=new
java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];
$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
                                                                                                                             ^
1 error
Compilation of 'l3.nrx' failed [javac failed]

---- Second, javac is able to compile the code produced by NetRexx, just
as Marc found:

C:\NetRexx\testing>nrc -replace -nocompile -keepasjava l3

NetRexx portable processor, version NetRexx after3.01, build
156-20111226-1711
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l3.nrx
Compilation of 'l3.nrx' successful

C:\NetRexx\testing>javac l3.java -cp ..\NetRexxC.jar

---- Note no error from above javac compile.

---- Third, javac produces a similar error to NetRexx when restricted to
Java 1.4 capabilities (ie no autoboxing):

C:\NetRexx\testing>javac l3.java -cp ..\NetRexxC.jar -source 1.4
l3.java:3: incompatible types
found   : int
required: java.lang.Object
{int $3=0;java.lang.Object[] $2=new
java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];
$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
                                                                                                                                   ^
1 error

---- Fourth, bypassing the javac entry and using the legacy entry point
that NetRexx uses to compile the Java code produces the exact error Marc
found:

C:\NetRexx\testing>java -cp .;..\NetRexxC.jar;tools.jar myjavac l3.java
Note: sun.tools.javac.Main has been deprecated.
l3.java:3: Incompatible type for =. Can't convert int to java.lang.Object.
{int $3=0;java.lang.Object[] $2=new
java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];
$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
                                                                                                                             ^
1 error, 1 warning

---- The above result is interesting because my research on the net
found that many Java programmers have been looking for a way to disable
autoboxing in Java without success, but Marc may have found one! (I am a
little puzzled that Eclipse and Ant, etc have not reported any problem
but then I don't really know how they access the Java compiler these days.)

---- Fifth, compiling and running the l3.nrx program with the current
patch I am testing:

C:\NetRexx\testing>nrc -run l3 -replace

NetRexx portable processor, version NetRexx after3.01, build
158-20120122-2323
Copyright (c) RexxLA, 2011.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program l3.nrx
Compilation of 'l3.nrx' successful
Running l3...
1
2
3

---- The test patch for the NetRexx compile simply uses the original
array type for the "snapshot" used by LOOP OVER rather than using an
Object array.  The interpreter is proving more difficult to fix as it
uses a Java Vector for the snapshot and a Vector cannot contain
primitive values. I am still working on that part of the fix.

-- Kermit


On 1/23/2012 12:32 AM, Marc Simpson wrote:

> Thanks for looking into this;
> Best,
> M
>
> On Sun, Jan 22, 2012 at 11:20 PM, René Jansen<[hidden email]>  wrote:
>> Hi Kermit,
>>
>> I am fine with postponing a bit more and slipping a patch in - it would be no good if we would release it with a known deficiency, and the more we test on RC3, the better.
>>
>> best regards,
>>
>> René Jansen.
>>
>> On 21 jan. 2012, at 09:46, Kermit Kiser wrote:
>>
>>> Hi Marc -
>>>
>>> Sorry for the delay in responding but I got sidelined for a couple of days by a winter storm power outage.
>>>
>>> Thanks for the problem report and analysis. It looks like there may be an error in the way NetRexx 3.01 LOOP OVER handles primitive arrays. Since RC3 has been waiting a while, perhaps there is time to slip in a patch first if René OKs it.
>>>
>>> -- Kermit
>>>
>>>
>>> On 1/19/2012 4:34 AM, Marc Simpson wrote:
>>>> Hi René,
>>>>
>>>> On Thu, Jan 19, 2012 at 12:11 PM, René Jansen<[hidden email]>    wrote:
>>>>> these might have been fixed in RC3 - which is not yet out there, due to - we'll I don't have the time to explain why I did not have the time, but I promise - this week. I have to look what we can do about the installer that was delivered by Tom Maynard, it would be great if that could be added.
>>>> Apologies for overlooking the log messages (r187-8) and
>>>> http://kenai.com/jira/browse/NETREXX-72; I'll search JIRA next time.
>>>>
>>>> (Incidentally, a link to the issue tracker on the Community page might
>>>> be helpful.)
>>>>
>>>>> In the meantime, you could build a new version yourself, it is not too much work, and the more testers we have the earlier, the better.
>>>> With r188 (i.e., head of trunk):
>>>>
>>>> -----------------------------------
>>>> $ nrc -run l1
>>>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>>> Program l1.nrx
>>>> Compilation of 'l1.nrx' successful
>>>> Running l1...
>>>> a
>>>> b
>>>> c
>>>>
>>>> $ nrc -run l2
>>>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>>> Program l2.nrx
>>>> Compilation of 'l2.nrx' successful
>>>> Running l2...
>>>> a
>>>> b
>>>> c
>>>>
>>>> $ nrc -run l4
>>>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>>> Program l4.nrx
>>>> Compilation of 'l4.nrx' successful
>>>> Running l4...
>>>> 1
>>>> 2
>>>> 3
>>>>
>>>> $ nrc -run l3
>>>> NetRexx portable processor, version NetRexx 3.01RC2, build 6-20120119-1224
>>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>>> Program l3.nrx
>>>> /Users/marc/projects/rexx/nrx/l3.java:3: Incompatible type for =.
>>>> Can't convert int to java.lang.Object.
>>>> {int $3=0;java.lang.Object[] $2=new
>>>> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>>>>
>>>>                                                       ^
>>>> 1 error
>>>> Compilation of 'l3.nrx' failed [javac failed]
>>>> -----------------------------------
>>>>
>>>> As before, NetRexx produces valid Java from l3.nrx which can be
>>>> compiled and run.
>>>>
>>>> Best,
>>>> M
>>>>
>>>>
>>>> _______________________________________________
>>>> Ibm-netrexx mailing list
>>>> [hidden email]
>>>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> Ibm-netrexx mailing list
>>> [hidden email]
>>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>>
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>
>
>

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: loop...over bug - update

Marc Simpson
Hi Kermit,

Very interesting—thanks for the info.

Best,
M

On Tue, Jan 24, 2012 at 10:11 AM, Kermit Kiser <[hidden email]> wrote:

> Here is a brief summary of my progress so far:  I have confirmed this
> problem and I am testing a partial fix (not published yet) using the
> after3.01 development branch. The partial fix resolves the compiler issue
> but does not yet address a similar problem with the interpreter.
>
> More details for those interested: It seems that when I tested the LOOP OVER
> support for arrays, I used Integer[] thinking that I had primitives covered.
> However Integer is not a primitive type in Java but a wrapper class; thus an
> Integer array consists of objects which can be cast to type Object while an
> "int" array contains primitive values which cannot be cast to objects. Based
> on Marc's results, especially the fact that the code produced by NetRexx
> could be compiled and executed by Java with no problem, I immediately
> suspected the "autoboxing" feature of Java ( which converts primitive values
> to objects) had something to do with the problem. When I ran some tests with
> Marc's l3.nrx program, I found some strange things.
>
> This is Marc's l3.nrx program :
>
> --( l3.nrx, not working )----------
> input = [int 1, 2, 3]
> loop s over input
>  say s
> end
> --( end of l3.nrx )----------
>
> I also used the following program for my testing which simply calls the Java
> compiler via the interface used by NetRexx:
> -----  myjavac.nrx  -----
>  javacok=sun.tools.javac.Main(System.out,
> 'javac').compile([String(arg),"-classpath",System.getProperty("java.class.path")])
> -----  end myjavac.nrx  -----
>
> Here is the log of my testing with some comments added (exact results may
> depend on the Java version used):
>
> ---- First, duplicate Marc's error result:
>
> C:\NetRexx\testing>nrc -replace l3
>
> NetRexx portable processor, version NetRexx after3.01, build
> 156-20111226-1711
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l3.nrx
> C:\NetRexx\testing\l3.java:3: Incompatible type for =. Can't convert int to
> java.lang.Object.
> {int $3=0;java.lang.Object[] $2=new
> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];
> $3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>
>                                                ^
> 1 error
> Compilation of 'l3.nrx' failed [javac failed]
>
> ---- Second, javac is able to compile the code produced by NetRexx, just as
> Marc found:
>
> C:\NetRexx\testing>nrc -replace -nocompile -keepasjava l3
>
> NetRexx portable processor, version NetRexx after3.01, build
> 156-20111226-1711
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l3.nrx
> Compilation of 'l3.nrx' successful
>
> C:\NetRexx\testing>javac l3.java -cp ..\NetRexxC.jar
>
> ---- Note no error from above javac compile.
>
> ---- Third, javac produces a similar error to NetRexx when restricted to
> Java 1.4 capabilities (ie no autoboxing):
>
> C:\NetRexx\testing>javac l3.java -cp ..\NetRexxC.jar -source 1.4
> l3.java:3: incompatible types
> found   : int
> required: java.lang.Object
> {int $3=0;java.lang.Object[] $2=new
> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];
> $3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>
>                                                      ^
> 1 error
>
> ---- Fourth, bypassing the javac entry and using the legacy entry point that
> NetRexx uses to compile the Java code produces the exact error Marc found:
>
> C:\NetRexx\testing>java -cp .;..\NetRexxC.jar;tools.jar myjavac l3.java
> Note: sun.tools.javac.Main has been deprecated.
> l3.java:3: Incompatible type for =. Can't convert int to java.lang.Object.
> {int $3=0;java.lang.Object[] $2=new
> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];
> $3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>
>                                                ^
> 1 error, 1 warning
>
> ---- The above result is interesting because my research on the net found
> that many Java programmers have been looking for a way to disable autoboxing
> in Java without success, but Marc may have found one! (I am a little puzzled
> that Eclipse and Ant, etc have not reported any problem but then I don't
> really know how they access the Java compiler these days.)
>
> ---- Fifth, compiling and running the l3.nrx program with the current patch
> I am testing:
>
> C:\NetRexx\testing>nrc -run l3 -replace
>
> NetRexx portable processor, version NetRexx after3.01, build
> 158-20120122-2323
> Copyright (c) RexxLA, 2011.  All rights reserved.
> Parts Copyright (c) IBM Corporation, 1995,2008.
> Program l3.nrx
> Compilation of 'l3.nrx' successful
> Running l3...
> 1
> 2
> 3
>
> ---- The test patch for the NetRexx compile simply uses the original array
> type for the "snapshot" used by LOOP OVER rather than using an Object array.
>  The interpreter is proving more difficult to fix as it uses a Java Vector
> for the snapshot and a Vector cannot contain primitive values. I am still
> working on that part of the fix.
>
> -- Kermit
>
>
> On 1/23/2012 12:32 AM, Marc Simpson wrote:
>>
>> Thanks for looking into this;
>> Best,
>> M
>>
>> On Sun, Jan 22, 2012 at 11:20 PM, René Jansen<[hidden email]>  wrote:
>>>
>>> Hi Kermit,
>>>
>>> I am fine with postponing a bit more and slipping a patch in - it would
>>> be no good if we would release it with a known deficiency, and the more we
>>> test on RC3, the better.
>>>
>>> best regards,
>>>
>>> René Jansen.
>>>
>>> On 21 jan. 2012, at 09:46, Kermit Kiser wrote:
>>>
>>>> Hi Marc -
>>>>
>>>> Sorry for the delay in responding but I got sidelined for a couple of
>>>> days by a winter storm power outage.
>>>>
>>>> Thanks for the problem report and analysis. It looks like there may be
>>>> an error in the way NetRexx 3.01 LOOP OVER handles primitive arrays. Since
>>>> RC3 has been waiting a while, perhaps there is time to slip in a patch first
>>>> if René OKs it.
>>>>
>>>> -- Kermit
>>>>
>>>>
>>>> On 1/19/2012 4:34 AM, Marc Simpson wrote:
>>>>>
>>>>> Hi René,
>>>>>
>>>>> On Thu, Jan 19, 2012 at 12:11 PM, René Jansen<[hidden email]>
>>>>>  wrote:
>>>>>>
>>>>>> these might have been fixed in RC3 - which is not yet out there, due
>>>>>> to - we'll I don't have the time to explain why I did not have the time, but
>>>>>> I promise - this week. I have to look what we can do about the installer
>>>>>> that was delivered by Tom Maynard, it would be great if that could be added.
>>>>>
>>>>> Apologies for overlooking the log messages (r187-8) and
>>>>> http://kenai.com/jira/browse/NETREXX-72; I'll search JIRA next time.
>>>>>
>>>>> (Incidentally, a link to the issue tracker on the Community page might
>>>>> be helpful.)
>>>>>
>>>>>> In the meantime, you could build a new version yourself, it is not too
>>>>>> much work, and the more testers we have the earlier, the better.
>>>>>
>>>>> With r188 (i.e., head of trunk):
>>>>>
>>>>> -----------------------------------
>>>>> $ nrc -run l1
>>>>> NetRexx portable processor, version NetRexx 3.01RC2, build
>>>>> 6-20120119-1224
>>>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>>>> Program l1.nrx
>>>>> Compilation of 'l1.nrx' successful
>>>>> Running l1...
>>>>> a
>>>>> b
>>>>> c
>>>>>
>>>>> $ nrc -run l2
>>>>> NetRexx portable processor, version NetRexx 3.01RC2, build
>>>>> 6-20120119-1224
>>>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>>>> Program l2.nrx
>>>>> Compilation of 'l2.nrx' successful
>>>>> Running l2...
>>>>> a
>>>>> b
>>>>> c
>>>>>
>>>>> $ nrc -run l4
>>>>> NetRexx portable processor, version NetRexx 3.01RC2, build
>>>>> 6-20120119-1224
>>>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>>>> Program l4.nrx
>>>>> Compilation of 'l4.nrx' successful
>>>>> Running l4...
>>>>> 1
>>>>> 2
>>>>> 3
>>>>>
>>>>> $ nrc -run l3
>>>>> NetRexx portable processor, version NetRexx 3.01RC2, build
>>>>> 6-20120119-1224
>>>>> Copyright (c) RexxLA, 2011.  All rights reserved.
>>>>> Parts Copyright (c) IBM Corporation, 1995,2008.
>>>>> Program l3.nrx
>>>>> /Users/marc/projects/rexx/nrx/l3.java:3: Incompatible type for =.
>>>>> Can't convert int to java.lang.Object.
>>>>> {int $3=0;java.lang.Object[] $2=new
>>>>>
>>>>> java.lang.Object[input.length];synchronized(input){for(;;){if($3==$2.length)break;$2[$3]=input[input.length-1-$3];$3++;}}s:for(;;){if(--$3<0)break;s=(java.lang.Object)$2[$3];
>>>>>
>>>>>                                                      ^
>>>>> 1 error
>>>>> Compilation of 'l3.nrx' failed [javac failed]
>>>>> -----------------------------------
>>>>>
>>>>> As before, NetRexx produces valid Java from l3.nrx which can be
>>>>> compiled and run.
>>>>>
>>>>> Best,
>>>>> M
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Ibm-netrexx mailing list
>>>>> [hidden email]
>>>>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>>>>
>>>>>
>>>>>
>>>> _______________________________________________
>>>> Ibm-netrexx mailing list
>>>> [hidden email]
>>>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>>>
>>>
>>> _______________________________________________
>>> Ibm-netrexx mailing list
>>> [hidden email]
>>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>>
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>
>>
>>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/