Nrxbug1: a simple superfluous */

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

Nrxbug1: a simple superfluous */

Thomas.Schneider.Wien
Hello Rene, and all, please find below a very easy to Fix NetRexxbug:

nrxbug1.nrx
=========
/* nrxbug1: a single superfluos *star slash* is not reported correctly */
/* before the first NetRexx statement            */  */
/***********************************************************************/
class nrxbug1
    say 'we are now in the main program'
    exit

Please fix asap.
Thomas.

--
Thomas Schneider Projects PP, ReyC, and LOGOS on www.KENAI.com
www.thsitc.com
_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Tom. (ths@db-123.com)
Reply | Threaded
Open this post in threaded view
|

Re: Nrxbug1: a simple superfluous */

alansam
On Sunday, 16 January 2011, Thomas Schneider <[hidden email]> wrote:

> Hello Rene, and all, please find below a very easy to Fix NetRexxbug:
>
> nrxbug1.nrx
> =========
> /* nrxbug1: a single superfluos *star slash* is not reported correctly */
> /* before the first NetRexx statement            */  */
> /***********************************************************************/
> class nrxbug1
>    say 'we are now in the main program'
>    exit
>

Speaking personally I don't see this as a bug.  The comment starts at
the first "/*" and ends at the last "*/" in the comment block.
Anything between the "comment block begins" and "comment block ends"
tokens should be treated as commentary and that's what happening here.
 Comments can be nested to allow commenting out blocks of code and
that's a good thing.  Having worked with languages that don't permit
comment nesting, the model comes as a refreshing change.

This is a feature rather than a defect.

Alan.

--
Can't tweet, won't tweet!

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Alan

--
Needs more cowbell.
Reply | Threaded
Open this post in threaded view
|

Re: Nrxbug1: a simple superfluous */

Aviatrexx
It looks to me that there are two ways of looking at this.

In Classic Rexx this would be an error because the superfluous '*/'
will be treated as a 'command' clause, and expression evaluation on it
will fail.  It is possible to have nested comments as long as the
internal comments are complete (balanced '/*' and '*/').

Since NetRexx no longer has the "none of the above" 'command' clause,
it is possible to loosen the "balanced" requirement on nested comments
and simply declare that '*/' has no significance unless it is closing
an open '/*'.  This would be in keeping with Rexx's 'keyword only in
context' philosophy.

I don't know if that's what is really going on, but that would mean
that Thomas' comment does not end "at the last "*/" in the comment
block" (where would that be?) but at the first one instead.  The "last
one" is simply ignored, it looks to me.

 From a user standpoint, I usually come down on the side of having
Rexx flag things that are obviously incorrect, even if there is a
sensible alternate behavior for the processor.

Consider that for symmetry with superfluous '*/' behavior, NetRexx
could choose not to flag a superfluous '/*' as a syntax error either.
  It would simply comment out the rest of the program.

Doing so would raise the 'astonishment factor' uncomfortably high for
me, however.

In the absence of other considerations, I think I would rather that
NetRexx flag unbalanced '/*' '*/' tokens rather than let them lie
around like land mines in the code for later.

I'd like to hear Mike's take on this, of course.

-Chip-


On 1/17/11 05:29 Alan Sampson said:

> On Sunday, 16 January 2011, Thomas Schneider <[hidden email]> wrote:
>> Hello Rene, and all, please find below a very easy to Fix NetRexxbug:
>>
>> nrxbug1.nrx
>> =========
>> /* nrxbug1: a single superfluos *star slash* is not reported correctly */
>> /* before the first NetRexx statement            */  */
>> /***********************************************************************/
>> class nrxbug1
>>    say 'we are now in the main program'
>>    exit
>>
>
> Speaking personally I don't see this as a bug.  The comment starts at
> the first "/*" and ends at the last "*/" in the comment block.
> Anything between the "comment block begins" and "comment block ends"
> tokens should be treated as commentary and that's what happening here.
>  Comments can be nested to allow commenting out blocks of code and
> that's a good thing.  Having worked with languages that don't permit
> comment nesting, the model comes as a refreshing change.
>
> This is a feature rather than a defect.
>
> Alan.
>
_______________________________________________
Ibm-netrexx mailing list
[hidden email]