REXX-ooRexx_4.3.0(MT)_64-bit 6.04 5 Nov 2022
DARWIN
Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz


-- ----------------------------------------------------------------------------
-- Overview of dataflows
-- ----------------------------------------------------------------------------
--
--   1          2     3            4       5
-- +----------+-----+------------+-------+------+
-- | previous | tag | annotation | index | item |
-- +----------+-----+------------+-------+------+
--    ^
--    |  +----------+-----+------------+-------+------+
--    +--| previous | tag | annotation | index | item |
--       +----------+-----+------------+-------+------+
--          ^
--          |
--          +-- etc...


-- A dataflow is created from a tag, an annotation, a pair of (item, index), and a previous dataflow (which can be .nil).
-- Representation : the strings (except the strings numbers) are surrounded by quotes.
   df1 = .dataflow~create(.nil, "tag1", "annotation1", "item1", "index1")
   say df1 -- by default, all the fields are included in the representation string.
tag1[annotation1]:'index1','item1'
   say df1~makeString(2) -- show tag
tag1:
   say df1~makeString(24) -- show tag, index
tag1:'index1'
   say df1~makeString(245) -- show tag, index, item
tag1:'index1','item1'


-- A dataflow can be linked to a previous dataflow.
-- Representation : the dataflows are separated by |
   df2 = .dataflow~create(df1, "tag2", "annotation2", "item2", "index2")
   say df2
tag1[annotation1]:'index1','item1' | tag2[annotation2]:'index2','item2'


-- Representation : the objects other than strings are surrounded by round brackets.
   df3 = .dataflow~create(df2, "tag3", "annotation3", .mutableBuffer~new(22222), .file~new("my file"))
   say df3
tag1[annotation1]:'index1','item1' | tag2[annotation2]:'index2','item2' | tag3[annotation3]:(my file),(22222)


-- showPool=.true : when an item (other than a number) appears several times then it is replaced by a reference to the first occurence of the item.
-- The references are named v1, v2, etc...
-- The operator == is used for the comparison.
-- Example :
-- "a" and .file~new("my file" are entered in the pool, because there is more than one occurence of them.
-- .mutableBuffer~new(22222) is not entered in the pool, because two distincts instances are never equal, even if their string representation is the same.
   df4 = .dataflow~create(df3, "tag4", "annotation4", .file~new("my file"), "a")
   df5 = .dataflow~create(df4, "tag5", "annotation5", .mutableBuffer~new(22222), "a")
   say df5 ; say df5~makeString(1234, .true)
tag1[annotation1]:'index1','item1' | tag2[annotation2]:'index2','item2' | tag3[annotation3]:(my file),(22222) | tag4[annotation4]:'a',(my file) | tag5[annotation5]:'a',(22222)
tag1[annotation1]:'index1' | tag2[annotation2]:'index2' | tag3[annotation3]:(my file) | tag4[annotation4]:v1='a' | tag5[annotation5]:*v1


-- ----------------------------------------------------------------------------
-- Overview of the sources supported by pipes
-- ----------------------------------------------------------------------------

-- Any object can be a source of pipe.
-- When the object does not support the method ~supplier then it's injected as-is.
-- Its associated index is always 1.
   "hello"~pipe(.console)
1 : 'hello'


-- By default, the dataflows are not shown, use the option dataflow.
-- dataflow is interpreted as the string "DATAFLOW" because no value assigned.
-- If dataflow was a variable with an assigned value, then you should use explicitely the string "dataflow" (caseless).
-- Other options supported by .console : index, item
   "hello"~pipe(.console dataflow)
source:1,'hello' 


-- A collection can be a source of pipe : each item of the collection is injected in the pipe.
-- The indexes are those of the collection.
   .array~of(10,20,30)~pipe(.console)
1 : 10
2 : 20
3 : 30
   .array~of(10,20,30)~pipe(.console dataflow)
source:1,10 
source:2,20 
source:3,30 


-- A coactivty can be a source of pipe : each yielded item is injected in the pipe.
-- Example :
-- This coactivity yields two results.
-- The hello outputs are not in the pipeline flow (not displayed by the .console).
-- 07/10/2019 : now the RexxBlock are always with implicit return. Must add options "COMMANDS".
   {::coactivity options "COMMANDS"; echo hello ; .yield["a"] ; say hello ; .yield["b"] }~doer~pipe(.console)
HELLO
1 : 'a'
HELLO
2 : 'b'
   {::coactivity options "COMMANDS"; echo hello ; .yield["a"] ; say hello ; .yield["b"] }~doer~pipe(.console dataflow)
HELLO
source:1,'a' 
HELLO
source:2,'b' 


-- ----------------------------------------------------------------------------
-- Overview of the pipe operators.
-- Reminder of the precedence (highest at the top) :
-- (message send)         : ~ ~~ (not overloaded for pipes)
-- (prefix operators)     : + - \ (not overloaded for pipes)
-- (power)                : ** (not overloaded for pipes)
-- (multiply and divide)  : * / % // (not overloaded for pipes)
-- (add and subtract)     : + - (not overloaded for pipes)
-- (blank) || (abuttal)   : (blank) is overloaded for adding options.
-- (comparison operators) : > >> are overloaded for pipes, the rest is not used : = < == << \= >< <> \> \< \== \>> \<< >= >>= <= <<=
-- (and operator)         : & (not overloaded for pipes).
-- (or, exclusive or)     : | is overloaded, && is not used.
-- ----------------------------------------------------------------------------

-- stage1 | stage2
-- stage1 > stage2
-- | and > share the same implementation...
-- (they connect the primary output of stage1 to the primary input of stage2)
   "hello"~pipe(.left[2] | .upper | .console)
1 : 'HE'

-- Same pipeline as previous, but with methods only
   "hello"~pipe(    (.left~new(2) ~append(.upper~new))    ~append(.console~new)    )
1 : 'HE'


-- ...but | and > don't have the same precedence ! No impact here.
   "hello"~pipe(.left[2] | .upper > .console)
1 : 'HE'

-- Same pipeline as previous, but with methods only
   "hello"~pipe(    .left~new(2) ~append(   .upper~new ~append(.console~new)    )    )
1 : 'HE'


-- stage1 >> stage2
-- Connects the secondary output of stage1 to the primary input of stage2
-- Here, the result is not what you expect. You want "LLO", you get "he"...
-- This is because .console is the primary follower of .left, not the primary
-- follower of .upper.
-- Why ? because the pipestage returned by .left[2] >> .upper is .left,
-- and .console is attached to the pipestage found by starting from .left
-- and walking through the 'next' references until a pipestage with no 'next'
-- is found. So .upper is not walked though, because it's a secondary follower.
   "hello"~pipe(.left[2] >> .upper | .console)
1 : 'he'

-- Same pipeline as previous, but with methods only
   "hello"~pipe(    (.left~new(2) ~appendSecondary(.upper~new))    ~append(.console~new)    )
1 : 'he'


-- ...You need additional parentheses to get the expected behavior.
-- Here, .console is the primary follower of .upper.
   "hello"~pipe(.left[2] >> ( .upper | .console ) )
1 : 'LLO'

-- Same pipeline as previous, but with methods only
   "hello"~pipe(    .left~new(2) ~appendSecondary(    .upper~new ~append(.console~new)    )    )
1 : 'LLO'


-- ----------------------------------------------------------------------------
-- Overview of the sorting facilities
-- ----------------------------------------------------------------------------

-- A collection can be sorted by item (default)
   .array~of(b, a, c)~pipe(.sort byItem | .console)
2 : 'A'
1 : 'B'
3 : 'C'


-- ...or by index
   .array~of(b, a, c)~pipe(.sort byIndex | .console)
1 : 'B'
2 : 'A'
3 : 'C'


-- ...ascending (default)
-- The order of options is important : a byItem option is impacted only by the preceding options
-- This is because several byItem options can be specified, and a sort is made for each.
   .array~of(b, a, c)~pipe(.sort ascending byItem | .console)
2 : 'A'
1 : 'B'
3 : 'C'


-- ...descending
   .array~of(b, a, c)~pipe(.sort descending byItem | .console)
3 : 'C'
1 : 'B'
2 : 'A'


-- ...by index descending
-- The order of options is important : a byIndex option is impacted only by the preceding options.
-- This is because several byIndex options can be specified, and a sort is made for each.
   .array~of(b, a, c)~pipe(.sort descending byIndex | .console)
3 : 'C'
2 : 'A'
1 : 'B'


-- ...caseless (stable by default)
   .array~of("bb", "AA", "bB", "Aa", "Bb", "aA", "BB", "aa")~pipe(.sort caseless byItem | .console)
2 : 'AA'
4 : 'Aa'
6 : 'aA'
8 : 'aa'
1 : 'bb'
3 : 'bB'
5 : 'Bb'
7 : 'BB'


-- ...caseless quickSort (unstable)
-- No difference bewteen stable and unstable ? yes, see commit 6275 in interpreter/memory/setup.cpp :
--  // there have been some problems with the quick sort used as the default sort, so map everything
--  // to the stable sort.  The stable sort, in theory, uses more memory, but in practice, this is not true.
--  defineKernelMethod(CHAR_SORT         ,TheArrayBehaviour, CPPM(RexxArray::stableSortRexx), 0);
--  defineKernelMethod(CHAR_SORTWITH     ,TheArrayBehaviour, CPPM(RexxArray::stableSortWithRexx), 1);
--  defineKernelMethod(CHAR_STABLESORT   ,TheArrayBehaviour, CPPM(RexxArray::stableSortRexx), 0);
--  defineKernelMethod(CHAR_STABLESORTWITH ,TheArrayBehaviour, CPPM(RexxArray::stableSortWithRexx), 1);
   .array~of("bb", "AA", "bB", "Aa", "Bb", "aA", "BB", "aa")~pipe(.sort caseless quickSort byItem | .console)
2 : 'AA'
4 : 'Aa'
6 : 'aA'
8 : 'aa'
1 : 'bb'
3 : 'bB'
5 : 'Bb'
7 : 'BB'


-- Sort descending with a comparator.
-- The DescendingComparator use the default CompareTo, which is made on items.
   .array~of(b, a, c)~pipe(.sortWith[.DescendingComparator~new] | .console)
3 : 'C'
1 : 'B'
2 : 'A'


-- Sort by column with a comparator.
   .array~of("c:2", "b:2", "A:2", "c:1", "a:1", "B:1", "C:3")~pipe(,
       .sortWith[.InvertingComparator~new(.CaselessColumnComparator~new(3,1))] |,
       .sortWith[.CaselessColumnComparator~new(1,1)] |,
       .console,
       )
3 : 'A:2'
5 : 'a:1'
2 : 'b:2'
6 : 'B:1'
7 : 'C:3'
1 : 'c:2'
4 : 'c:1'


-- ----------------------------------------------------------------------------
-- Options available on any pipeStage : memorize
-- ----------------------------------------------------------------------------

   "aaaBBBcccDDDeee"~pipe(.reverse memorize | .console dataflow)
source:1,'aaaBBBcccDDDeee' | reverse:1,'eeeDDDcccBBBaaa' 


   "aaaBBBcccDDDeee"~pipe(.upper memorize | .console dataflow)
source:1,'aaaBBBcccDDDeee' | upper:1,'AAABBBCCCDDDEEE' 


   "aaaBBBcccDDDeee"~pipe(.lower memorize | .console dataflow)
source:1,'aaaBBBcccDDDeee' | lower:1,'aaabbbcccdddeee' 


   "aaaBBBcccDDDeee"~pipe(.changeStr["B", "b", 2] memorize | .console dataflow)
source:1,'aaaBBBcccDDDeee' | changeStr:1,'aaabbBcccDDDeee' 


   "aaaBBBcccDDDeee"~pipe(.delStr[4, 9] memorize | .console dataflow)
source:1,'aaaBBBcccDDDeee' | delStr:1,'aaaeee' 


   "aaaBBBcccDDDeee"~pipe(.left[3] memorize >> .console "secondary :" dataflow | .console "primary:" dataflow)
primary: source:1,'aaaBBBcccDDDeee' | left:1,'aaa' 
secondary : source:1,'aaaBBBcccDDDeee' | left:1,'BBBcccDDDeee' 


   "aaaBBBcccDDDeee"~pipe(.right[3] memorize >> .console "secondary :" dataflow | .console "primary:" dataflow)
primary: source:1,'aaaBBBcccDDDeee' | right:1,'eee' 
secondary : source:1,'aaaBBBcccDDDeee' | right:1,'aaaBBBcccDDD' 


   "aaaBBBcccDDDeee"~pipe(.insert["---", 3] memorize | .console dataflow)
source:1,'aaaBBBcccDDDeee' | insert:1,'aaa---BBBcccDDDeee' 


   "aaaBBBcccDDDeee"~pipe(.overlay["---", 3] memorize | .console dataflow)
source:1,'aaaBBBcccDDDeee' | overlay:1,'aa---BcccDDDeee' 


   "48656c6c6f"~pipe(.x2c memorize | .console dataflow)
source:1,'48656c6c6f' | x2c:1,'Hello' 


   .array~of("a", "", "b", , "c", , "", "d")~pipe(.dropNull memorize | .console dataflow)
source:1,v1='a' | dropNull:1,*v1 
source:3,v1='b' | dropNull:3,*v1 
source:5,v1='c' | dropNull:5,*v1 
source:8,v1='d' | dropNull:8,*v1 


   .array~of("header", 1, 2 ,3 , "footer")~pipe(,
       .drop first memorize >> .console "secondary of drop first :" dataflow |,
       .drop last memorize >> .console "secondary of drop last :" dataflow |,
       .console "primary:" dataflow) -- Remove header and footer
secondary of drop first : source:1,v1='header' | drop:1,*v1 
primary: source:2,1 | drop:2,1 | drop[eof]:2,1 
primary: source:3,2 | drop:3,2 | drop[eof]:3,2 
primary: source:4,3 | drop:4,3 | drop[eof]:4,3 
secondary of drop last : source:5,v1='footer' | drop:5,*v1 | drop[eof]:5,*v1 


-- ----------------------------------------------------------------------------
-- .do and .inject pipeStages
-- ----------------------------------------------------------------------------

-- .do is a synonym of .inject.
-- Sometimes, the name '.do' is better than the name '.inject'.
-- Both support the same options and have the same behavior.


-- Do something for each item (no returned value, so no value passed to .console).
   .array~of(1, , 2, , 3)~pipe(.do {say 'item='item 'dataflow='dataflow~makeString} | .console)
item=1 dataflow=source:1,1
item=2 dataflow=source:3,2
item=3 dataflow=source:5,3


-- Do something for each item (the returned result replaces the item's value).
-- Here, only one result is calculated for an item, so resultIndex is always 1.
   .array~of(1, , 2, , 3)~pipe(.do {return 2*item} memorize | .console)
1 : 2
3 : 4
5 : 6


-- Inject a value for each item (the returned value is injected after the input item).
   .array~of(1, , 2, , 3)~pipe(.inject after {item*10} memorize | .console dataflow)
source:1,1 | inject[->-]:1,1 
source:1,1 | inject:1,10 
source:3,2 | inject[->-]:3,2 
source:3,2 | inject:3,20 
source:5,3 | inject[->-]:5,3 
source:5,3 | inject:5,30 


-- Inject two values for each item (each item of the returned collection is written in the pipe).
-- Note the "iterateAfter" option : using this option, when the result of .inject is an object which
-- understands "supplier" then each pair (item, index) returned by the supplier is injected in the pipe.
   .array~of(1, , 2, , 3)~pipe(.inject after {.array~of(item*10, item*20)} iterateAfter memorize | .console dataflow)
source:1,1 | inject[->-]:1,1 
source:1,1 | inject:1,10 
source:1,1 | inject:2,20 
source:3,2 | inject[->-]:3,2 
source:3,2 | inject:1,20 
source:3,2 | inject:2,40 
source:5,3 | inject[->-]:5,3 
source:5,3 | inject:1,30 
source:5,3 | inject:2,60 


-- Each injected value can be used as input to inject a new value, recursively.
-- The default order is depth-first.
-- If the recursion is infinite, must specify a limit (here 0, 1 and 2).
-- The options 'before' and 'after' are not used, so the initial item is discarded.
   .array~of(1, , 2, , 3)~pipe(.inject {item*10} recursive.0 | .console dataflow "item =" item)
source:1,1 item = 10 
source:3,2 item = 20 
source:5,3 item = 30 
   .array~of(1, , 2, , 3)~pipe(.inject {item*20} recursive.1 | .console dataflow "item =" item)
source:1,1 item = 20 
source:1,1 item = 400 
source:3,2 item = 40 
source:3,2 item = 800 
source:5,3 item = 60 
source:5,3 item = 1200 
   .array~of(1, , 2, , 3)~pipe(.inject {item*30} recursive.2 | .console dataflow "item =" item)
source:1,1 item = 30 
source:1,1 item = 900 
source:1,1 item = 27000 
source:3,2 item = 60 
source:3,2 item = 1800 
source:3,2 item = 54000 
source:5,3 item = 90 
source:5,3 item = 2700 
source:5,3 item = 81000 


-- Same as previous example, but here, the recursive.memorize option is used.
-- The dataflow is like a call stack.
-- Ex : the last line is
-- source:5,3 | inject:1,90 | inject:1,2700 | inject:1,81000 item = 81000
-- The item at index 5 in input array has injected 3 "inject" dataflows by recursion.
   .array~of(1, , 2, , 3)~pipe(.inject {item*10} recursive.0.memorize | .console dataflow "item =" item)
source:1,1 | inject:1,10 item = 10 
source:3,2 | inject:3,20 item = 20 
source:5,3 | inject:5,30 item = 30 
   .array~of(1, , 2, , 3)~pipe(.inject {item*20} recursive.1.memorize | .console dataflow "item =" item)
source:1,1 | inject:1,20 item = 20 
source:1,1 | inject:1,20 | inject:1,400 item = 400 
source:3,2 | inject:3,40 item = 40 
source:3,2 | inject:3,40 | inject:3,800 item = 800 
source:5,3 | inject:5,60 item = 60 
source:5,3 | inject:5,60 | inject:5,1200 item = 1200 
   .array~of(1, , 2, , 3)~pipe(.inject {item*30} recursive.2.memorize | .console dataflow "item =" item)
source:1,1 | inject:1,30 item = 30 
source:1,1 | inject:1,30 | inject:1,900 item = 900 
source:1,1 | inject:1,30 | inject:1,900 | inject:1,27000 item = 27000 
source:3,2 | inject:3,60 item = 60 
source:3,2 | inject:3,60 | inject:3,1800 item = 1800 
source:3,2 | inject:3,60 | inject:3,1800 | inject:3,54000 item = 54000 
source:5,3 | inject:5,90 item = 90 
source:5,3 | inject:5,90 | inject:5,2700 item = 2700 
source:5,3 | inject:5,90 | inject:5,2700 | inject:5,81000 item = 81000 


-- Factorial, no value injected for -1
   .array~of(-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)~pipe(.inject {
       use arg n
       if n < 0 then return
       if n == 0 then return 1
       return n * .context~executable~call(n - 1)} | .console dataflow item)
source:2,0 1 
source:3,1 1 
source:4,2 2 
source:5,3 6 
source:6,4 24 
source:7,5 120 
source:8,6 720 
source:9,7 5040 
source:10,8 40320 
source:11,9 362880 


-- Another illustration of the "iterateAfter" option.
   10~pipe(.inject {item~times} | .console)
1 : [1,2,3,4,5,6,7,8,9,10]
   10~pipe(.inject {item~times} iterateAfter | .console)
1 : 1
2 : 2
3 : 3
4 : 4
5 : 5
6 : 6
7 : 7
8 : 8
9 : 9
10 : 10
   10~pipe(.inject {item~times.generate} | .console)
1 : (a Coactivity)
   10~pipe(.inject {item~times.generate} iterateAfter | .console)
1 : 1
2 : 2
3 : 3
4 : 4
5 : 5
6 : 6
7 : 7
8 : 8
9 : 9
10 : 10


-- Another illustration of the "iterateAfter" option.
-- In this example, the block passed to .inject returns another block whose doer is a coactivity.
-- The option "iterateAfter" force to check if the returned value has the "supplier" method.
-- If yes, then .inject iterates over the items returned by the supplier and sends them to the next pipeStage.
-- A block has no "supplier" method, but its doer may have one. This is the case in this example.
-- The method "hasMethod" has been redefined on RexxBlock to return .true if the doer has the method "supplier".
-- The method "supplier" has been defined on RexxBlock to forward to its doer.
-- Note :
-- The pipeStage .take is mandatory because the generator passed to .inject will generate an infinite sequence of numbers.
   1~pipe(.inject {{::coactivity expose item ; do forever ; .yield[item] ; item += 1 ; end}} iterateAfter | .take 10 | .console)
1 : 1
2 : 2
3 : 3
4 : 4
5 : 5
6 : 6
7 : 7
8 : 8
9 : 9
10 : 10


-- ----------------------------------------------------------------------------
-- Additional sorting facilities
-- ----------------------------------------------------------------------------

-- Select files in the installation directory, whose path contains "rexx" , sorted by file size.
-- The "length" message is sent to the item and the returned result is used as a key for sorting.
   .file~new(installdir())~listFiles~pipe(,
       .all["rexx"] caseless |,
       .sortWith[.MessageComparator~new("length/N")] |,
       .console dataflow {"length="item~length},
       )
source:7,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxregexp.cls) length=3525 
source:15,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/mime.cls) length=11444 
source:11,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe2.dylib) length=12928 
source:5,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe1.dylib) length=13228 
source:13,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxsubcom) length=13292 
source:18,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexxc) length=13316 
source:21,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexxtry.rex) length=14946 
source:4,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/callrexx2) length=17272 
source:14,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx) length=17316 
source:22,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls) length=17681 
source:8,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe3.dylib) length=17724 
source:6,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxqueue) length=17812 
source:19,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/smtp.cls) length=18662 
source:17,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/callrexx1) length=21196 
source:10,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) length=24960 
source:12,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/socket.cls) length=31409 
source:9,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls) length=31791 
source:3,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx.cat) length=46683 
source:2,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) length=47686 
source:20,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxftp.cls) length=65447 
source:1,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxapi) length=76156 
source:16,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx.img) length=1720952 


-- Same as above, but simpler... You can sort directly by length, no need of MessageComparator
   .file~new(installdir())~listFiles~pipe(,
       .all["rexx"] caseless |,
       .sort {item~length} |,
       .console dataflow {"length="item~length},
       )
source:7,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxregexp.cls) length=3525 
source:15,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/mime.cls) length=11444 
source:11,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe2.dylib) length=12928 
source:5,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe1.dylib) length=13228 
source:13,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxsubcom) length=13292 
source:18,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexxc) length=13316 
source:21,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexxtry.rex) length=14946 
source:4,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/callrexx2) length=17272 
source:14,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx) length=17316 
source:22,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls) length=17681 
source:8,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe3.dylib) length=17724 
source:6,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxqueue) length=17812 
source:19,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/smtp.cls) length=18662 
source:17,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/callrexx1) length=21196 
source:10,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) length=24960 
source:12,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/socket.cls) length=31409 
source:9,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls) length=31791 
source:3,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx.cat) length=46683 
source:2,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) length=47686 
source:20,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxftp.cls) length=65447 
source:1,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxapi) length=76156 
source:16,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx.img) length=1720952 


-- Sort by file size, then by file extension (with only one .sort pipestage)
   .file~new(installdir())~listFiles~pipe(,
       .all["rexx"] caseless |,
       .sort {item~length} {filespec('e', item~name)} |,
       .console dataflow {"length="item~length},
       )
source:13,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxsubcom) length=13292 
source:18,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexxc) length=13316 
source:4,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/callrexx2) length=17272 
source:14,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx) length=17316 
source:6,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxqueue) length=17812 
source:17,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/callrexx1) length=21196 
source:1,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxapi) length=76156 
source:3,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx.cat) length=46683 
source:7,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxregexp.cls) length=3525 
source:15,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/mime.cls) length=11444 
source:22,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls) length=17681 
source:19,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/smtp.cls) length=18662 
source:10,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) length=24960 
source:12,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/socket.cls) length=31409 
source:9,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls) length=31791 
source:2,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) length=47686 
source:20,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxftp.cls) length=65447 
source:11,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe2.dylib) length=12928 
source:5,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe1.dylib) length=13228 
source:8,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/libwpipe3.dylib) length=17724 
source:16,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx.img) length=1720952 
source:21,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexxtry.rex) length=14946 


-- ----------------------------------------------------------------------------
-- Various examples with collections and recursive processing
-- Illustration of the depthFirst vs breadthFirst options
-- ----------------------------------------------------------------------------

-- All instance methods of the context.
-- Notice that the default sort by item is useless here... Must sort by index.
   .context~instanceMethods~pipe(.sort byIndex | .console)
'' : (a Method)
' ' : (a Method)
'<>' : (a Method)
'=' : (a Method)
'==' : (a Method)
'><' : (a Method)
'ARGS' : (a Method)
'CLASS' : (a Method)
'CONDITION' : (a Method)
'COPIPE' : (a Method)
'COPIPEPROFILE' : (a Method)
'COPY' : (a Method)
'COPY' : (a Method)
'DEFAULTNAME' : (a Method)
'DEPTH' : (a Method)
'DIGITS' : (a Method)
'DIGITSPROPAGATE' : (a Method)
'DISCLOSE' : (a Method)
'DUMP2' : (a Method)
'EACH' : (a Method)
'ENCLOSE' : (a Method)
'EXECUTABLE' : (a Method)
'FORM' : (a Method)
'FUZZ' : (a Method)
'GENERATE' : (a Method)
'GENERATEI' : (a Method)
'GETUSERDATA' : (a Method)
'HASHCODE' : (a Method)
'HASMETHOD' : (a Method)
'IDENTITYHASH' : (a Method)
'INIT' : (a Method)
'INSTANCEMETHOD' : (a Method)
'INSTANCEMETHODS' : (a Method)
'ISA' : (a Method)
'ISCOMPATIBLEWITHBYTESTRING' : (a Method)
'ISINSTANCEOF' : (a Method)
'ISNIL' : (a Method)
'ISTEXTORBUFFERORSTRING' : (a Method)
'LINE' : (a Method)
'NAME' : (a Method)
'NAMEDARGS' : (a Method)
'OBJECTNAME' : (a Method)
'OBJECTNAME=' : (a Method)
'PACKAGE' : (a Method)
'PARENTCONTEXT' : (a Method)
'PIPE' : (a Method)
'PIPEPROFILE' : (a Method)
'PP2' : (a Method)
'PPINDEX2' : (a Method)
'PPSTRING' : (a Method)
'RANK' : (a Method)
'REQUEST' : (a Method)
'REQUESTTEXTORBUFFERORSTRING' : (a Method)
'RESHAPE' : (a Method)
'RS' : (a Method)
'RUN' : (a Method)
'SEND' : (a Method)
'SENDWITH' : (a Method)
'SETARGS' : (a Method)
'SETMETHOD' : (a Method)
'SETMETHOD1' : (a Method)
'SETUSERDATA' : (a Method)
'SHAPE' : (a Method)
'SHAPETOSTRING' : (a Method)
'STACKFRAMES' : (a Method)
'START' : (a Method)
'STARTWITH' : (a Method)
'STRING' : (a Method)
'UNSETMETHOD' : (a Method)
'VARIABLES' : (a Method)
'\=' : (a Method)
'\==' : (a Method)
'||' : (a Method)


-- All private methods of the context.
   .context~instanceMethods~pipe(,
       .select {item~isPrivate} |,
       .sort byIndex |,
       .console,
       )
'RUN' : (a Method)
'SETMETHOD' : (a Method)
'UNSETMETHOD' : (a Method)


-- Instance methods of the specified classes (not including those inherited).
-- Each class is written in the pipeline, followed by the returned methods (option 'after').
   .array~of(.RexxContext, .Package, .Method)~pipe(,
       .inject after {item~instanceMethods(item~class)} iterateAfter memorize |,
       .sort byIndex {dataflow["source"]~item} |,
       .console dataflow,
       )
source:3,(The Method class) | inject:'!DEFINE_CLASS_METHOD',(a Method) 
source:3,(The Method class) | inject:'!DEFINE_METHODS',(a Method) 
source:3,(The Method class) | inject:'!REXXDEFINED',(a Method) 
source:3,v1=(The Method class) | inject[->-]:3,*v1 
source:3,(The Method class) | inject:'<>',(a Method) 
source:3,(The Method class) | inject:'=',(a Method) 
source:3,(The Method class) | inject:'==',(a Method) 
source:3,(The Method class) | inject:'><',(a Method) 
source:3,(The Method class) | inject:'ACTIVATE',(a Method) 
source:3,(The Method class) | inject:'BASECLASS',(a Method) 
source:3,(The Method class) | inject:'DEFAULTNAME',(a Method) 
source:3,(The Method class) | inject:'DEFINE',(a Method) 
source:3,(The Method class) | inject:'DELETE',(a Method) 
source:3,(The Method class) | inject:'ENHANCED',(a Method) 
source:3,(The Method class) | inject:'HASHCODE',(a Method) 
source:3,(The Method class) | inject:'ID',(a Method) 
source:3,(The Method class) | inject:'INHERIT',(a Method) 
source:3,(The Method class) | inject:'ISSUBCLASSOF',(a Method) 
source:3,(The Method class) | inject:'METACLASS',(a Method) 
source:3,(The Method class) | inject:'METHOD',(a Method) 
source:3,(The Method class) | inject:'METHODS',(a Method) 
source:3,(The Method class) | inject:'MIXINCLASS',(a Method) 
source:3,(The Method class) | inject:'QUERYMIXINCLASS',(a Method) 
source:3,(The Method class) | inject:'SUBCLASS',(a Method) 
source:3,(The Method class) | inject:'SUBCLASSES',(a Method) 
source:3,(The Method class) | inject:'SUPERCLASS',(a Method) 
source:3,(The Method class) | inject:'SUPERCLASSES',(a Method) 
source:3,(The Method class) | inject:'UNINHERIT',(a Method) 
source:3,(The Method class) | inject:'\=',(a Method) 
source:3,(The Method class) | inject:'\==',(a Method) 
source:2,v1=(The Package class) | inject[->-]:2,*v1 
source:2,(The Package class) | inject:'<>',(a Method) 
source:2,(The Package class) | inject:'=',(a Method) 
source:2,(The Package class) | inject:'==',(a Method) 
source:2,(The Package class) | inject:'><',(a Method) 
source:2,(The Package class) | inject:'ACTIVATE',(a Method) 
source:2,(The Package class) | inject:'BASECLASS',(a Method) 
source:2,(The Package class) | inject:'DEFAULTNAME',(a Method) 
source:2,(The Package class) | inject:'DEFINE',(a Method) 
source:2,(The Package class) | inject:'DELETE',(a Method) 
source:2,(The Package class) | inject:'ENHANCED',(a Method) 
source:2,(The Package class) | inject:'HASHCODE',(a Method) 
source:2,(The Package class) | inject:'ID',(a Method) 
source:2,(The Package class) | inject:'INHERIT',(a Method) 
source:2,(The Package class) | inject:'ISSUBCLASSOF',(a Method) 
source:2,(The Package class) | inject:'METACLASS',(a Method) 
source:2,(The Package class) | inject:'METHOD',(a Method) 
source:2,(The Package class) | inject:'METHODS',(a Method) 
source:2,(The Package class) | inject:'MIXINCLASS',(a Method) 
source:2,(The Package class) | inject:'QUERYMIXINCLASS',(a Method) 
source:2,(The Package class) | inject:'SUBCLASS',(a Method) 
source:2,(The Package class) | inject:'SUBCLASSES',(a Method) 
source:2,(The Package class) | inject:'SUPERCLASS',(a Method) 
source:2,(The Package class) | inject:'SUPERCLASSES',(a Method) 
source:2,(The Package class) | inject:'UNINHERIT',(a Method) 
source:2,(The Package class) | inject:'\=',(a Method) 
source:2,(The Package class) | inject:'\==',(a Method) 
source:1,v1=(The RexxContext class) | inject[->-]:1,*v1 
source:1,(The RexxContext class) | inject:'<>',(a Method) 
source:1,(The RexxContext class) | inject:'=',(a Method) 
source:1,(The RexxContext class) | inject:'==',(a Method) 
source:1,(The RexxContext class) | inject:'><',(a Method) 
source:1,(The RexxContext class) | inject:'ACTIVATE',(a Method) 
source:1,(The RexxContext class) | inject:'BASECLASS',(a Method) 
source:1,(The RexxContext class) | inject:'DEFAULTNAME',(a Method) 
source:1,(The RexxContext class) | inject:'DEFINE',(a Method) 
source:1,(The RexxContext class) | inject:'DELETE',(a Method) 
source:1,(The RexxContext class) | inject:'ENHANCED',(a Method) 
source:1,(The RexxContext class) | inject:'HASHCODE',(a Method) 
source:1,(The RexxContext class) | inject:'ID',(a Method) 
source:1,(The RexxContext class) | inject:'INHERIT',(a Method) 
source:1,(The RexxContext class) | inject:'ISSUBCLASSOF',(a Method) 
source:1,(The RexxContext class) | inject:'METACLASS',(a Method) 
source:1,(The RexxContext class) | inject:'METHOD',(a Method) 
source:1,(The RexxContext class) | inject:'METHODS',(a Method) 
source:1,(The RexxContext class) | inject:'MIXINCLASS',(a Method) 
source:1,(The RexxContext class) | inject:'QUERYMIXINCLASS',(a Method) 
source:1,(The RexxContext class) | inject:'SUBCLASS',(a Method) 
source:1,(The RexxContext class) | inject:'SUBCLASSES',(a Method) 
source:1,(The RexxContext class) | inject:'SUPERCLASS',(a Method) 
source:1,(The RexxContext class) | inject:'SUPERCLASSES',(a Method) 
source:1,(The RexxContext class) | inject:'UNINHERIT',(a Method) 
source:1,(The RexxContext class) | inject:'\=',(a Method) 
source:1,(The RexxContext class) | inject:'\==',(a Method) 


-- Methods (not inherited) of all the classes whose id starts with "R".
   .environment~pipe(,
       .select {item~isA(.class)} |,
       .select {item~id~caselessAbbrev('R') <> 0} |,
       .inject after {item~methods(item)} iterateAfter memorize |,
       .sort byIndex {dataflow["source"]~item} |,
       .console dataflow,
       )
source:'RELATION',(The Relation class) | inject:'ALLAT',(a Method) 
source:'RELATION',(The Relation class) | inject:'ALLINDEX',(a Method) 
source:'RELATION',(The Relation class) | inject:'ALLINDEXES',(a Method) 
source:'RELATION',(The Relation class) | inject:'ALLITEMS',(a Method) 
source:'RELATION',(The Relation class) | inject:'AT',(a Method) 
source:'RELATION',(The Relation class) | inject:'DIFFERENCE',(a Method) 
source:'RELATION',(The Relation class) | inject:'EMPTY',(a Method) 
source:'RELATION',(The Relation class) | inject:'HASINDEX',(a Method) 
source:'RELATION',(The Relation class) | inject:'HASITEM',(a Method) 
source:'RELATION',(The Relation class) | inject:'INDEX',(a Method) 
source:'RELATION',(The Relation class) | inject:'INTERSECTION',(a Method) 
source:'RELATION',(The Relation class) | inject:'ISEMPTY',(a Method) 
source:'RELATION',(The Relation class) | inject:'ITEMS',(a Method) 
source:'RELATION',(The Relation class) | inject:'MAKEARRAY',(a Method) 
source:'RELATION',(The Relation class) | inject:'PUT',(a Method) 
source:'RELATION',(The Relation class) | inject:'READOBJECT',(a Method) 
source:v1='RELATION',v2=(The Relation class) | inject[->-]:*v1,*v2 
source:'RELATION',(The Relation class) | inject:'REMOVE',(a Method) 
source:'RELATION',(The Relation class) | inject:'REMOVEALL',(a Method) 
source:'RELATION',(The Relation class) | inject:'REMOVEITEM',(a Method) 
source:'RELATION',(The Relation class) | inject:'SUBSET',(a Method) 
source:'RELATION',(The Relation class) | inject:'SUPPLIER',(a Method) 
source:'RELATION',(The Relation class) | inject:'UNION',(a Method) 
source:'RELATION',(The Relation class) | inject:'UNIQUEINDEXES',(a Method) 
source:'RELATION',(The Relation class) | inject:'WRITEOBJECT',(a Method) 
source:'RELATION',(The Relation class) | inject:'XOR',(a Method) 
source:'RELATION',(The Relation class) | inject:'[]',(a Method) 
source:'RELATION',(The Relation class) | inject:'[]=',(a Method) 
source:'REXXBLOCK',(The RexxBlock class) | inject:'COPY',(a Method) 
source:'REXXBLOCK',(The RexxBlock class) | inject:'KIND',(a Method) 
source:'REXXBLOCK',(The RexxBlock class) | inject:'PACKAGE',(a Method) 
source:'REXXBLOCK',(The RexxBlock class) | inject:'RAWEXECUTABLE',(a Method) 
source:v1='REXXBLOCK',v2=(The RexxBlock class) | inject[->-]:*v1,*v2 
source:'REXXBLOCK',(The RexxBlock class) | inject:'SOURCE',(a Method) 
source:'REXXBLOCK',(The RexxBlock class) | inject:'VARIABLES',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'ARGS',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'CONDITION',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'COPY',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'DIGITS',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'DIGITSPROPAGATE',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'EXECUTABLE',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'FORM',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'FUZZ',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'LINE',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'NAME',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'NAMEDARGS',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'PACKAGE',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'PARENTCONTEXT',(a Method) 
source:v1='REXXCONTEXT',v2=(The RexxContext class) | inject[->-]:*v1,*v2 
source:'REXXCONTEXT',(The RexxContext class) | inject:'RS',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'SETARGS',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'STACKFRAMES',(a Method) 
source:'REXXCONTEXT',(The RexxContext class) | inject:'VARIABLES',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'DELETE',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'EMPTY',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'GET',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'INIT',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'LINEIN',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'LINEOUT',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'MAKEARRAY',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'PULL',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'PUSH',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'QUEUE',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'QUEUED',(a Method) 
source:v1='REXXQUEUE',v2=(The RexxQueue class) | inject[->-]:*v1,*v2 
source:'REXXQUEUE',(The RexxQueue class) | inject:'SAY',(a Method) 
source:'REXXQUEUE',(The RexxQueue class) | inject:'SET',(a Method) 
source:v1='REXXTEXT',v2=(The RexxText class) | inject[->-]:*v1,*v2 
source:'ROUTINE',(The Routine class) | inject:'CALL',(a Method) 
source:'ROUTINE',(The Routine class) | inject:'CALLWITH',(a Method) 
source:'ROUTINE',(The Routine class) | inject:'PACKAGE',(a Method) 
source:v1='ROUTINE',v2=(The Routine class) | inject[->-]:*v1,*v2 
source:'ROUTINE',(The Routine class) | inject:'SETSECURITYMANAGER',(a Method) 
source:'ROUTINE',(The Routine class) | inject:'SOURCE',(a Method) 


-- All packages that are visible from current context, including the current package (source of the pipeline).
   .context~package~pipe(,
       .inject after {item~importedPackages} iterateAfter recursive.memorize.cycle |,
       .console {'  '~copies(dataflow~length)} {.file~new(item~name)~name},
       )
     pipe_extension_test.rex 
     pipe_extension.cls 
       pipe.cls 
         profiling.cls 
       extensions.cls 
         coactivity.cls 
         generator.cls 
           coactivity.cls 
           functionals.cls 
             doers.cls 
               coactivity.cls 
         array.cls 
           infinity.cls 
             indeterminate.cls 
               novalue.cls 
             novalue.cls 
           collection.cls 
         collection.cls 
         complex.cls 
           novalue.cls 
         doers.cls 
           coactivity.cls 
         file.cls 
         indeterminate.cls 
           novalue.cls 
         infinity.cls 
           indeterminate.cls 
             novalue.cls 
           novalue.cls 
         string.cls 
           stringChunk.cls 
           stringChunkExtended.cls 
             stringChunk.cls 
         text.cls 
           string.cls 
             stringChunk.cls 
             stringChunkExtended.cls 
               stringChunk.cls 
           stringEncoding.cls 
             string.cls 
               stringChunk.cls 
               stringChunkExtended.cls 
                 stringChunk.cls 
           unicode.cls 
             stringEncoding.cls 
               string.cls 
                 stringChunk.cls 
                 stringChunkExtended.cls 
                   stringChunk.cls 
         functionals.cls 
           doers.cls 
             coactivity.cls 
         logical.cls 
           doers.cls 
             coactivity.cls 
         rexxinfo.cls 
         object.cls 
     rgf_util2_wrappers.rex 
       rgf_util2.rex 


-- Same as above, but in breadth-first order
   .context~package~pipe(,
       .inject after {item~importedPackages} iterateAfter recursive.breadthFirst.memorize.cycle |,
       .console {'  '~copies(dataflow~length)} {.file~new(item~name)~name},
       )
     pipe_extension_test.rex 
     pipe_extension.cls 
     rgf_util2_wrappers.rex 
       pipe.cls 
       extensions.cls 
       rgf_util2.rex 
         profiling.cls 
         coactivity.cls 
         generator.cls 
         array.cls 
         collection.cls 
         complex.cls 
         doers.cls 
         file.cls 
         indeterminate.cls 
         infinity.cls 
         string.cls 
         text.cls 
         functionals.cls 
         logical.cls 
         rexxinfo.cls 
         object.cls 
           coactivity.cls 
           functionals.cls 
           infinity.cls 
           collection.cls 
           novalue.cls 
           coactivity.cls 
           novalue.cls 
           indeterminate.cls 
           novalue.cls 
           stringChunk.cls 
           stringChunkExtended.cls 
           string.cls 
           stringEncoding.cls 
           unicode.cls 
           doers.cls 
           doers.cls 
             doers.cls 
             indeterminate.cls 
             novalue.cls 
             novalue.cls 
             stringChunk.cls 
             stringChunk.cls 
             stringChunkExtended.cls 
             string.cls 
             stringEncoding.cls 
             coactivity.cls 
             coactivity.cls 
               coactivity.cls 
               novalue.cls 
               stringChunk.cls 
               stringChunk.cls 
               stringChunkExtended.cls 
               string.cls 
                 stringChunk.cls 
                 stringChunk.cls 
                 stringChunkExtended.cls 
                   stringChunk.cls 


-- ----------------------------------------------------------------------------
-- .take pipeStage
-- ----------------------------------------------------------------------------

-- The .take pipeStage lets stop the preceding pipeStages when the number of items to take
-- has been reached, whatever its position in the pipeline.
-- Note the "" at the end of the first .console. This is an indicator to not insert a newline.
   supplier = .array~of(1,2,3,4,5,6,7,8,9)~supplier
   supplier~pipe(.console "2*" item "=" "" | .do {return 2*item} | .take 2 | .console item)
2* 1 =  2 
2* 2 =  4 
   say supplier~index -- this is the index of the last processed item
2
   supplier~next -- skip the last processed item
   supplier~pipe(.console "4*" item "=" "" | .do {return 4*item} | .take 4 | .console item)
4* 3 =  12 
4* 4 =  16 
4* 5 =  20 
4* 6 =  24 
   say supplier~index
6


-- Display the 4 first sorted items
   .array~of(5, 8, 1, 3, 6, 2)~pipe(.sort | .take 4 | .console)
3 : 1
6 : 2
4 : 3
1 : 5


-- Sort the 4 first items
   .array~of(5, 8, 1, 3, 6, 2)~pipe(.take 4 | .sort | .console)
3 : 1
4 : 3
1 : 5
2 : 8


-- Select files in the installation directory, whose name contains "rexx".
-- Note : the .select is not equivalent to .all["rexx"], because .select tests only the name,
-- whereas .all tests the string representation of the item, which is the absolute path.
-- Take the 15 firsts.
   .file~new(installdir())~listFiles~pipe(,
       .select {item~name~caselessPos('rexx') <> 0} |,
       .take 15 |,
       .console,
       )
3 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx.cat)
4 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/callrexx2)
14 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx)
16 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexx.img)
17 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/callrexx1)
18 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexxc)
21 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rexxtry.rex)


-- ----------------------------------------------------------------------------
-- .append pipeStage
-- ----------------------------------------------------------------------------

-- The .append pipeStage copies items from its primary input to its primary output, and then invokes
-- the producer passed as argument and writes the items produced by that producer to its primary output.
-- If the producer is a doer, then the producer is executed to get the effective producer.
-- If the effective producer understands the message "supplier" then each pair (item, index)
-- returned by the supplier is appended.
-- Otherwise, the effective producer is appended as-is (single object) with local index 1.
   supplier1 = .array~of(1,2,3,4,5,6,7,8,9)~supplier
   supplier2 = .array~of(10,11,12,13,14,15,16,17,18,19)~supplier
-- The first .take limits supplier1 to 2 items.
-- The second .take sees the two items produced by supplier1, so only 3 items are accepted from supplier2.
   supplier1~pipe(.take 2 | .append supplier2 iterate | .take 5 | .console)
1 : 1
2 : 2
1 : 10
2 : 11
3 : 12
   say supplier1~index
2
   say supplier2~index
3
   supplier1~next
   supplier2~next
   supplier1~pipe(.take 4 | .append supplier2 iterate | .take 9 | .console)
3 : 3
4 : 4
5 : 5
6 : 6
4 : 13
5 : 14
6 : 15
7 : 16
8 : 17
   say supplier1~index
6
   say supplier2~index
8


-- ----------------------------------------------------------------------------
-- pipeStages which support partitions
-- ----------------------------------------------------------------------------

-- Drop the first item
   .array~of(1,1,1,2,2,2,3,3,3,1,1,1)~pipe(.drop | .console)
2 : 1
3 : 1
4 : 2
5 : 2
6 : 2
7 : 3
8 : 3
9 : 3
10 : 1
11 : 1
12 : 1


-- Drop the first item of each partition
   .array~of(1,1,1,2,2,2,3,3,3,1,1,1)~pipe(.drop {item} | .console)
2 : 1
3 : 1
5 : 2
6 : 2
8 : 3
9 : 3
11 : 1
12 : 1


-- Drop the last item
   .array~of(1,1,1,2,2,2,3,3,3,1,1,1)~pipe(.drop last | .console)
1 : 1
2 : 1
3 : 1
4 : 2
5 : 2
6 : 2
7 : 3
8 : 3
9 : 3
10 : 1
11 : 1


-- Drop the last item of each partition
   .array~of(1,1,1,2,2,2,3,3,3,1,1,1)~pipe(.drop last {item} | .console)
1 : 1
2 : 1
4 : 2
5 : 2
7 : 3
8 : 3
10 : 1
11 : 1


   datas = .directory~new
   datas["key1"] = .array~of("header", 1, 2, "footer")
   datas["key2"] = .array~of("header", 5, 3, -9, 12, "footer")
   datas["key3"] = .array~of("header", 4, 6, 5, "footer")


-- The whole datas, including headers and footers
   datas~pipe(.inject {item} iterateBefore memorize | .console)
1 : 'header'
2 : 1
3 : 2
4 : 'footer'
1 : 'header'
2 : 5
3 : 3
4 : -9
5 : 12
6 : 'footer'
1 : 'header'
2 : 4
3 : 6
4 : 5
5 : 'footer'


-- The datas without the headers and footers
   datas~pipe(.inject {item} iterateBefore memorize | .drop first {dataflow["source"]~item } | .drop last {dataflow["source"]~item } | .console)
2 : 1
3 : 2
2 : 5
3 : 3
4 : -9
5 : 12
2 : 4
3 : 6
4 : 5


-- No partition here, so the whole set of words is written twice, separated by "==="
   .array~of("one two three","un deux trois")~pipe(.words | .buffer[2, "==="] | .console)
1 : 'one'
2 : 'two'
3 : 'three'
1 : 'un'
2 : 'deux'
3 : 'trois'
1 : '==='
1 : 'one'
2 : 'two'
3 : 'three'
1 : 'un'
2 : 'deux'
3 : 'trois'


-- There is a partition on the source items, so there is a separator "===" between each set of words extracted from each string
   .array~of("one two three","un deux trois")~pipe(.words memorize | .buffer[2, "==="] {dataflow["source"]~item} | .console)
1 : 'one'
2 : 'two'
3 : 'three'
1 : '==='
1 : 'one'
2 : 'two'
3 : 'three'
1 : '==='
1 : 'un'
2 : 'deux'
3 : 'trois'
1 : '==='
1 : 'un'
2 : 'deux'
3 : 'trois'


-- ----------------------------------------------------------------------------
-- .fanout, .fanin, .merge pipeStages
-- ----------------------------------------------------------------------------

-- Here, only the output from fanout1 is sent to console.
   fanout1 = .left[3]  memorize | .lower memorize
   fanout2 = .right[3] memorize | .upper memorize | .inject after {"my_"item}
   .array~of("aaaBBB", "CCCddd", "eEeFfF")~pipe(.fanout memorize >> fanout2 > fanout1 | .console dataflow item)
source:1,v1='aaaBBB' | fanout:1,*v1 | left:1,v2='aaa' | lower:1,*v2 'aaa' 
source:2,v1='CCCddd' | fanout:2,*v1 | left:2,'CCC' | lower:2,'ccc' 'ccc' 
source:3,v1='eEeFfF' | fanout:3,*v1 | left:3,'eEe' | lower:3,'eee' 'eee' 


-- Here, each branch of the fanout remains separated. Each branch has its own console.
   fanout1 = .left[3]  memorize | .lower memorize | .console dataflow item
   fanout2 = .right[3] memorize | .upper memorize | .inject after {"my_"item} | .console dataflow item
   .array~of("aaaBBB", "CCCddd", "eEeFfF")~pipe(.fanout memorize >> fanout2 > fanout1)
source:1,v1='aaaBBB' | fanout:1,*v1 | left:1,v2='aaa' | lower:1,*v2 'aaa' 
source:1,v1='aaaBBB' | fanout:1,*v1 | right:1,v2='BBB' | upper:1,*v2 'BBB' 
source:1,v1='aaaBBB' | fanout:1,*v1 | right:1,v2='BBB' | upper:1,*v2 'my_BBB' 
source:2,v1='CCCddd' | fanout:2,*v1 | left:2,'CCC' | lower:2,'ccc' 'ccc' 
source:2,v1='CCCddd' | fanout:2,*v1 | right:2,'ddd' | upper:2,'DDD' 'DDD' 
source:2,v1='CCCddd' | fanout:2,*v1 | right:2,'ddd' | upper:2,'DDD' 'my_DDD' 
source:3,v1='eEeFfF' | fanout:3,*v1 | left:3,'eEe' | lower:3,'eee' 'eee' 
source:3,v1='eEeFfF' | fanout:3,*v1 | right:3,'FfF' | upper:3,'FFF' 'FFF' 
source:3,v1='eEeFfF' | fanout:3,*v1 | right:3,'FfF' | upper:3,'FFF' 'my_FFF' 


-- Here, a fanin is used to serialize the branches of the fanout.
-- The output from fanout1 is sent to console, then the output from fanout2 (delayed)
   fanin = .fanin memorize | .console dataflow item
   fanout1 = .left[3]  memorize | .lower memorize | fanin  -- not bufferized
   fanout2 = .right[3] memorize | .upper memorize | .inject after {"my_"item} | .secondaryConnector | fanin -- bufferized until fanout1 is eof
   .array~of("aaaBBB", "CCCddd", "eEeFfF")~pipe(.fanout memorize >> fanout2 > fanout1)
source:1,v1='aaaBBB' | fanout:1,*v1 | left:1,v2='aaa' | lower:1,*v2 | fanin[->-]:1,*v2 'aaa' 
source:2,v1='CCCddd' | fanout:2,*v1 | left:2,'CCC' | lower:2,v2='ccc' | fanin[->-]:2,*v2 'ccc' 
source:3,v1='eEeFfF' | fanout:3,*v1 | left:3,'eEe' | lower:3,v2='eee' | fanin[->-]:3,*v2 'eee' 
source:1,v1='aaaBBB' | fanout:1,*v1 | right:1,v2='BBB' | upper:1,*v2 | fanin[eof]:1,*v2 'BBB' 
source:1,v1='aaaBBB' | fanout:1,*v1 | right:1,v2='BBB' | upper:1,*v2 | fanin[eof]:1,'my_BBB' 'my_BBB' 
source:2,v1='CCCddd' | fanout:2,*v1 | right:2,'ddd' | upper:2,v2='DDD' | fanin[eof]:2,*v2 'DDD' 
source:2,v1='CCCddd' | fanout:2,*v1 | right:2,'ddd' | upper:2,'DDD' | fanin[eof]:2,'my_DDD' 'my_DDD' 
source:3,v1='eEeFfF' | fanout:3,*v1 | right:3,'FfF' | upper:3,v2='FFF' | fanin[eof]:3,*v2 'FFF' 
source:3,v1='eEeFfF' | fanout:3,*v1 | right:3,'FfF' | upper:3,'FFF' | fanin[eof]:3,'my_FFF' 'my_FFF' 

-- Here, a merge is used to serialize the branches of the fanout.
-- There is no specific order (no delay).
   merge = .merge memorize | .console dataflow item
   fanout1 = .left[3]  memorize | .lower memorize | merge  -- not bufferized
   fanout2 = .right[3] memorize | .upper memorize | .inject after {"my_"item} | .secondaryConnector | merge -- not bufferized
   .array~of("aaaBBB", "CCCddd", "eEeFfF")~pipe(.fanout memorize >> fanout2 > fanout1)
source:1,v1='aaaBBB' | fanout:1,*v1 | left:1,v2='aaa' | lower:1,*v2 | merge[->-]:1,*v2 'aaa' 
source:1,v1='aaaBBB' | fanout:1,*v1 | right:1,v2='BBB' | upper:1,*v2 | merge[->-]:1,*v2 'BBB' 
source:1,v1='aaaBBB' | fanout:1,*v1 | right:1,v2='BBB' | upper:1,*v2 | merge[->-]:1,'my_BBB' 'my_BBB' 
source:2,v1='CCCddd' | fanout:2,*v1 | left:2,'CCC' | lower:2,v2='ccc' | merge[->-]:2,*v2 'ccc' 
source:2,v1='CCCddd' | fanout:2,*v1 | right:2,'ddd' | upper:2,v2='DDD' | merge[->-]:2,*v2 'DDD' 
source:2,v1='CCCddd' | fanout:2,*v1 | right:2,'ddd' | upper:2,'DDD' | merge[->-]:2,'my_DDD' 'my_DDD' 
source:3,v1='eEeFfF' | fanout:3,*v1 | left:3,'eEe' | lower:3,v2='eee' | merge[->-]:3,*v2 'eee' 
source:3,v1='eEeFfF' | fanout:3,*v1 | right:3,'FfF' | upper:3,v2='FFF' | merge[->-]:3,*v2 'FFF' 
source:3,v1='eEeFfF' | fanout:3,*v1 | right:3,'FfF' | upper:3,'FFF' | merge[->-]:3,'my_FFF' 'my_FFF' 


-- ----------------------------------------------------------------------------
-- .fileTree pipeStage
-- ----------------------------------------------------------------------------

-- The *.cls files of ooRexx
   installdir()~pipe(,
       .fileTree recursive |,
       .endsWith[".cls"] |,
       .console,
       )
2 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls)
7 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxregexp.cls)
9 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls)
10 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls)
12 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/socket.cls)
15 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/mime.cls)
19 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/smtp.cls)
20 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxftp.cls)
22 : (/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls)


-- Total number of lines in the *.cls files of ooRexx
   installdir()~pipe(,
       .fileTree recursive |,
       .endsWith[".cls"] |,
       .fileLines | .lineCount |,
       .console,
       )
(The NIL object) : 6248


-- Number of lines in each *.cls files of ooRexx
   installdir()~pipe(,
       .fileTree recursive memorize.file |,
       .endsWith[".cls"] |,
       .fileLines | .lineCount {dataflow["file"]~item} |,
       .console,
       )
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) : 1258
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxregexp.cls) : 57
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls) : 699
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) : 490
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/socket.cls) : 680
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/mime.cls) : 236
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/smtp.cls) : 416
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxftp.cls) : 2016
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls) : 396


-- Total number of words in the *.cls files of ooRexx
   installdir()~pipe(,
       .fileTree recursive |,
       .endsWith[".cls"] |,
       .fileLines | .wordCount |,
       .console,
       )
(The NIL object) : 26041


-- Number of words in each *.cls files of ooRexx
   installdir()~pipe(,
       .fileTree recursive memorize.file |,
       .endsWith[".cls"] |,
       .fileLines | .wordCount {dataflow["file"]~item} |,
       .console,
       )
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) : 5566
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxregexp.cls) : 404
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls) : 3507
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) : 2105
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/socket.cls) : 2607
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/mime.cls) : 955
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/smtp.cls) : 1664
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxftp.cls) : 7601
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls) : 1632


-- Total number of characters in the *.cls files of ooRexx (not counting the newline characters)
   installdir()~pipe(,
       .fileTree recursive |,
       .endsWith[".cls"] |,
       .fileLines | .charCount |,
       .console,
       )
(The NIL object) : 246357


-- Number of characters in each *.cls files of ooRexx (not counting the newline characters)
   installdir()~pipe(,
       .fileTree recursive memorize.file |,
       .endsWith[".cls"] |,
       .fileLines | .charCount {dataflow["file"]~item} |,
       .console,
       )
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) : 46428
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxregexp.cls) : 3468
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls) : 31092
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) : 24470
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/socket.cls) : 30729
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/mime.cls) : 11208
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/smtp.cls) : 18246
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/rxftp.cls) : 63431
(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls) : 17285


-- Alphanumeric words of 16+ chars found in the *.cls files of ooRexx.
-- Only the first two words per file are taken :
--     .take 2 {dataflow["file"]~item}
-- Here, the partition expression returns the current file object produced by the pipeStage "fileTree".
-- Exemple of result :
-- source:1,'d:/local/Rexx/ooRexx/svn/sandbox/jlf/trunk/Win32rel/' | FILE:338,(d:\local\Rexx\ooRexx\svn\sandbox\jlf\trunk\Win32rel\winsystm.cls) | fileLines:250,'::method DeleteDesktopIcon' | words:2,'DeleteDesktopIcon' 'DeleteDesktopIcon'
-- "DeleteDesktopIcon" is the 2nd word of the 250th line of the file
-- "d:\local\Rexx\ooRexx\svn\sandbox\jlf\trunk\Win32dbg\winsystm.cls"
-- which is the 338th file/directory of the directory
-- "d:/local/Rexx/ooRexx/svn/sandbox/jlf/trunk/Win32rel/"
--
-- To investigate : I get sometimes a crash in the sort.
--
   call time('r') -- to see how long this takes
   installdir()~pipe(,
       .fileTree recursive memorize.file |,
       .endsWith[".cls"] |,
       .fileLines memorize | .words memorize | .select {item~datatype('a') & item~length >= 16} |,
       .take 2 {dataflow["file"]~item} | .sort caseless | .console dataflow item,
       )
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:2,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) | fileLines:240,'::method getEncodingDataOffset class    -- determine UTF-encoding, return UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE' | words:2,'getEncodingDataOffset' 'getEncodingDataOffset' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:10,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) | fileLines:64,'::Attribute headerLineAbsent      private -- headersexist but absent' | words:2,'headerLineAbsent' 'headerLineAbsent' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:22,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls) | fileLines:47,'::class 'StreamSocket' public subclass InputOutputStream' | words:5,'InputOutputStream' 'InputOutputStream' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:9,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls) | fileLines:640,'::METHOD newsubpadprivate private EXTERNAL "LIBRARY orxncurses OrxCurSubpadprivate"' | words:2,'newsubpadprivate' 'newsubpadprivate' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:2,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) | fileLines:66,'*   <li>an OrderdCollection maps to a JSON array (comma separated list of values, enquoted in sqaure brackets),' | words:3,'OrderdCollection' 'OrderdCollection' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:10,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) | fileLines:63,'::Attribute originalRawHeaders    private -- for comparison' | words:2,'originalRawHeaders' 'originalRawHeaders' 
   say "duration="time('e') -- elapsed duration
duration=1.537440


-- From here, some methods of the pipeline classes are instrumented to let profiling.
-- The performances are impacted because the profiled methods are instrumented with an additional forward.
   .pipeProfiler~instrument("start", "process", "eof", "isEOP")


-- Same as above, but with profiling
   call time('r') -- to see how long this takes
   installdir()~pipeProfile(,
       .fileTree recursive memorize.file |,
       .endsWith[".cls"] |,
       .fileLines memorize | .words memorize | .select {item~datatype('a') & item~length >= 16} |,
       .take 2 {dataflow["file"]~item} | .sort caseless | .console dataflow item,
       )
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:2,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) | fileLines:240,'::method getEncodingDataOffset class    -- determine UTF-encoding, return UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE' | words:2,'getEncodingDataOffset' 'getEncodingDataOffset' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:10,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) | fileLines:64,'::Attribute headerLineAbsent      private -- headersexist but absent' | words:2,'headerLineAbsent' 'headerLineAbsent' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:22,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/streamsocket.cls) | fileLines:47,'::class 'StreamSocket' public subclass InputOutputStream' | words:5,'InputOutputStream' 'InputOutputStream' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:9,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/ncurses.cls) | fileLines:640,'::METHOD newsubpadprivate private EXTERNAL "LIBRARY orxncurses OrxCurSubpadprivate"' | words:2,'newsubpadprivate' 'newsubpadprivate' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:2,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/json.cls) | fileLines:66,'*   <li>an OrderdCollection maps to a JSON array (comma separated list of values, enquoted in sqaure brackets),' | words:3,'OrderdCollection' 'OrderdCollection' 
source:1,'/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/' | FILE:10,(/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/csvStream.cls) | fileLines:63,'::Attribute originalRawHeaders    private -- for comparison' | words:2,'originalRawHeaders' 'originalRawHeaders' 
----------------------------------------
.fileTree~go
  .fileTree~PROCESS count=1 duration=11.364989
    .endsWith~ISEOP count=44 duration=0.000739
    .endsWith~PROCESS count=22 duration=11.325023
      .fileLines~ISEOP count=31 duration=0.000461
      .fileLines~PROCESS count=9 duration=11.321715
        .words~ISEOP count=12514 duration=0.476715
        .words~PROCESS count=6248 duration=9.716071
          .select~ISEOP count=58330 duration=0.984281
          .select~PROCESS count=26041 duration=3.468056
            .take~ISEOP count=26069 duration=0.446340
            .take~PROCESS count=28 duration=0.008068
              .sort~ISEOP count=34 duration=0.000516
              .sort~PROCESS count=6 duration=0.000630
  .fileTree~START count=1 duration=0.001268
    .endsWith~START count=1 duration=0.001007
      .fileLines~START count=1 duration=0.000888
        .words~START count=1 duration=0.000719
          .select~START count=1 duration=0.000593
            .take~START count=1 duration=0.000466
              .sort~START count=1 duration=0.000285
                .console~START count=1 duration=0.000111
  .endsWith~EOF count=1 duration=0.011322
    .fileLines~EOF count=1 duration=0.011261
      .words~EOF count=1 duration=0.011202
        .select~EOF count=1 duration=0.011143
          .take~EOF count=1 duration=0.011082
            .sort~EOF count=1 duration=0.011016
              .console~EOF count=1 duration=0.000025
              .console~ISEOP count=12 duration=0.000178
              .console~PROCESS count=6 duration=0.009905
duration=11.377579
----------------------------------------
   say "duration="time('e') -- elapsed duration
duration=11.418752


   say installdir() ; say
/local/rexx/oorexx/build/executor.master/sandbox/jlf/trunk/macos/clang/release/64/delivery/bin/


Ended coactivities: 0
