Re:Source Conversion NetRexx<->Java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re:Source Conversion NetRexx<->Java

Martin Lafaix

Some comments/thoughts...

First, while it's obviously possible to convert a NetRexx program
to an equivalent Java program and conversely, there isn't a
one-to-one mapping between the two languages.  This implies that a
given conversion is environment-dependant.  (NetRexx's adapters
are an example of a feature not present in Java.  If an abstract
or interface member is added, the Java program will need editing
to work again.)

Second, as soon as you start using an unmatched feature, the code
quickly becomes hard to read/follow.  Two examples: the NetRexx
'parse' statement and Java Boolean operators.

Namely,

  parse Date() . . . lcltime lclzone .

gives the following in Java:

 private static final char[] $03={1,10,6,0,0,0,1,2,0,0};

 Rexx $1[]=new Rexx[3];
 RexxParse.parse(new Rexx(String.valueOf(new Date())),$03,$1);
 lcltime=$1[1];lclzone=$1[2];

and

  if (foo == null || foo.bar > 5)
    xxx

as to be split in NetRexx:

  if foo = null then
    xxx
  else
  if foo.bar > 5 then
    xxx

[If we don't split the expression, it will crash each time foo is
 null, because the foo.bar statement will always be evaluated if
 we write 'if foo = null | foo.bar > 5 then'.]

What I'm trying to say is that, while again doable, such
converters will be quite disappointing (read not useful for
their intended purpose).  The above examples are very common.

As an aside, I would like to see one day shortcut Boolean
operators in NetRexx.  Possibly maybe '|||' and '&&&'.  This is a
very useful feature.  I miss it.

[And, no, even with the above feature, my point remains.  Just
 think of switches or anonymous classes or ...]


Martin, rumbling and lobbying again.
--
[hidden email]
Team OS/2
http://www.mygale.org/~lafaix

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>