new Pipe stage: -- comment

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

new Pipe stage: -- comment

Jeff Hennick-3

One thing pipelines is missing is a comment facility.

I suggest adding this "--" stage, in line with NetRexx.  It is a stage, not a language feature, so it does not break any existing programs.  It extends to stagend or pipeend.  It can be used in files or command line pipes.

It does need a little tweaking for current naming conventions.

=================

-- --.nrx NJPipe Stage
/*
 *  Copyright (C) 2016  Jeffrey Hennick, [hidden email]
 *Distributed under the ICU 1.8.1 License with NO WARRANTIES of ANY kind.
 *  See LICENSE for the license and information on using, copying, modifying,
 *  and distributing this program.
 */
-- 16/03/16 New.  JHennick

/** -- [comment]

  >>-- -- any comment it will be ignored by pipes -->

  Notes:
   Not in CMS Pipelines; ends with stageend or pipeend

*/
options nostrictcase nostrictargs nostrictsignal nobinary

--package org.netrexx.njpipes.stages

import org.netrexx.njpipes.pipes.

class -- extends stage

method run() public

     do
       line = Rexx peekto()
       output(line)

       readto()
     catch StageError
     end

     do
       rc = rexx mrc()

       exit(rc*(rc<>12))
     catch NullPointerException
       exit(rc*(rc<>12))
     end

==================

Usage examples:

pipe (locatetest1)
   literal a1abc b2abc c3xyz a2xyz b3abc c1abc a3xyz b1xyz c2abc | -- test input |
   split |
   locate /2/ |
--   console |  -- remove comment for additional diagnostic output |
   -- check the output against the expected |
   compare: compare equal /OK/ notequal /BAD at \\c, \\b/ less /Less:\\p::\\s:/ more /More:\\p::\\s:/ |
   console ?
   literal b2abc;a2xyz;c2abc; | -- expected output |
   split ; |
   compare:



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

Reply | Threaded
Open this post in threaded view
|

Re: new Pipe stage: -- comment

rvjansen
Hi Jeff,

With some effort I could convince the filesystem and git that dashdash was a valid name, but I have a hard time compiling the class - because its name represents a comment, even if unicode-escaped. I can build it into the compiler?

René.

On 25 Aug 2019, at 12:06, Jeff Hennick <[hidden email]> wrote:

One thing pipelines is missing is a comment facility.

I suggest adding this "--" stage, in line with NetRexx.  It is a stage, not a language feature, so it does not break any existing programs.  It extends to stagend or pipeend.  It can be used in files or command line pipes.

It does need a little tweaking for current naming conventions.

=================

-- --.nrx NJPipe Stage
/*
 *  Copyright (C) 2016  Jeffrey Hennick, [hidden email]
 *Distributed under the ICU 1.8.1 License with NO WARRANTIES of ANY kind.
 *  See LICENSE for the license and information on using, copying, modifying,
 *  and distributing this program.
 */
-- 16/03/16 New.  JHennick

/** -- [comment]

  >>-- -- any comment it will be ignored by pipes -->

  Notes:
   Not in CMS Pipelines; ends with stageend or pipeend

*/
options nostrictcase nostrictargs nostrictsignal nobinary

--package org.netrexx.njpipes.stages

import org.netrexx.njpipes.pipes.

class -- extends stage

method run() public

     do
       line = Rexx peekto()
       output(line)

       readto()
     catch StageError
     end

     do
       rc = rexx mrc()

       exit(rc*(rc<>12))
     catch NullPointerException
       exit(rc*(rc<>12))
     end

==================

Usage examples:

pipe (locatetest1)
   literal a1abc b2abc c3xyz a2xyz b3abc c1abc a3xyz b1xyz c2abc | -- test input |
   split |
   locate /2/ |
--   console |  -- remove comment for additional diagnostic output |
   -- check the output against the expected |
   compare: compare equal /OK/ notequal /BAD at \\c, \\b/ less /Less:\\p::\\s:/ more /More:\\p::\\s:/ |
   console ?
   literal b2abc;a2xyz;c2abc; | -- expected output |
   split ; |
   compare:


_______________________________________________
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: new Pipe stage: -- comment

Jeff Hennick-3

Ha! The joke is on me.  It works fine in Windows.  If it is built in that would be great.  Or, if you, or any other, can come up with a better comment facility, that works for me.

Jeff

On 8/25/2019 10:11 AM, [hidden email] wrote:
Hi Jeff,

With some effort I could convince the filesystem and git that dashdash was a valid name, but I have a hard time compiling the class - because its name represents a comment, even if unicode-escaped. I can build it into the compiler?

René.

On 25 Aug 2019, at 12:06, Jeff Hennick <[hidden email]> wrote:

One thing pipelines is missing is a comment facility.

I suggest adding this "--" stage, in line with NetRexx.  It is a stage, not a language feature, so it does not break any existing programs.  It extends to stagend or pipeend.  It can be used in files or command line pipes.

It does need a little tweaking for current naming conventions.

=================

-- --.nrx NJPipe Stage
/*
 *  Copyright (C) 2016  Jeffrey Hennick, [hidden email]
 *Distributed under the ICU 1.8.1 License with NO WARRANTIES of ANY kind.
 *  See LICENSE for the license and information on using, copying, modifying,
 *  and distributing this program.
 */
-- 16/03/16 New.  JHennick

/** -- [comment]

  >>-- -- any comment it will be ignored by pipes -->

  Notes:
   Not in CMS Pipelines; ends with stageend or pipeend

*/
options nostrictcase nostrictargs nostrictsignal nobinary

--package org.netrexx.njpipes.stages

import org.netrexx.njpipes.pipes.

class -- extends stage

method run() public

     do
       line = Rexx peekto()
       output(line)

       readto()
     catch StageError
     end

     do
       rc = rexx mrc()

       exit(rc*(rc<>12))
     catch NullPointerException
       exit(rc*(rc<>12))
     end

==================

Usage examples:

pipe (locatetest1)
   literal a1abc b2abc c3xyz a2xyz b3abc c1abc a3xyz b1xyz c2abc | -- test input |
   split |
   locate /2/ |
--   console |  -- remove comment for additional diagnostic output |
   -- check the output against the expected |
   compare: compare equal /OK/ notequal /BAD at \\c, \\b/ less /Less:\\p::\\s:/ more /More:\\p::\\s:/ |
   console ?
   literal b2abc;a2xyz;c2abc; | -- expected output |
   split ; |
   compare:


_______________________________________________
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: new Pipe stage: -- comment

ThSITC
In reply to this post by Jeff Hennick-3

Hi Jeff, and all:

That is an EXCELLENT idea, indeed.

It would mean to accept a HYPHEN in a STAGE-name (as COBOL does, by the way, but still not yet a leading double Hyphen, nor a leading Hyphen  ;-))

Rene, please do this, when feasable  :-)

By the way: Wouldn't it be time to consider the equivalence of UNDERLINES and HYPHENS in Language names, as well ?

This would only mean that the MINUS SIGNS must be separated by a BLANK after a variable name (as in COBOL) ;-)

But it would ALSO MEAN that Variable Names might become more readable.

Full Stop.

Kindly, Thomas Schneider.

=======================================================================

Am 25.08.2019 um 18:06 schrieb Jeff Hennick:

One thing pipelines is missing is a comment facility.

I suggest adding this "--" stage, in line with NetRexx.  It is a stage, not a language feature, so it does not break any existing programs.  It extends to stagend or pipeend.  It can be used in files or command line pipes.

It does need a little tweaking for current naming conventions.

=================

-- --.nrx NJPipe Stage
/*
 *  Copyright (C) 2016  Jeffrey Hennick, [hidden email]
 *Distributed under the ICU 1.8.1 License with NO WARRANTIES of ANY kind.
 *  See LICENSE for the license and information on using, copying, modifying,
 *  and distributing this program.
 */
-- 16/03/16 New.  JHennick

/** -- [comment]

  >>-- -- any comment it will be ignored by pipes -->

  Notes:
   Not in CMS Pipelines; ends with stageend or pipeend

*/
options nostrictcase nostrictargs nostrictsignal nobinary

--package org.netrexx.njpipes.stages

import org.netrexx.njpipes.pipes.

class -- extends stage

method run() public

     do
       line = Rexx peekto()
       output(line)

       readto()
     catch StageError
     end

     do
       rc = rexx mrc()

       exit(rc*(rc<>12))
     catch NullPointerException
       exit(rc*(rc<>12))
     end

==================

Usage examples:

pipe (locatetest1)
   literal a1abc b2abc c3xyz a2xyz b3abc c1abc a3xyz b1xyz c2abc | -- test input |
   split |
   locate /2/ |
--   console |  -- remove comment for additional diagnostic output |
   -- check the output against the expected |
   compare: compare equal /OK/ notequal /BAD at \\c, \\b/ less /Less:\\p::\\s:/ more /More:\\p::\\s:/ |
   console ?
   literal b2abc;a2xyz;c2abc; | -- expected output |
   split ; |
   compare:



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


Virus-free. www.avg.com

_______________________________________________
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