Small effort to add functional/piping ability ?
I've raised this point before, under the subject of functional-programming; since the method of getting an answer by passing the data through multiple stages is the essence of functional programming. ETHO already uses this extensively, except that it's not yet automated: the output/s go to ScreenFrames, which can be marked as the the input. to the next stage of the <pipe>. A somewhat contrived example is solving the intolerable situation that ETHO doesn't show you the most recent files of a directory. Imagine having a directory of 88 files, some of which are 2 years old, and you want to continue with the project that you last worked on. 3 days ago. Obviously you want immediate access to the most recent [say 6] files which you <left on top of the work pile>. System.Directory ^ Linux:*\d gives eg:... Linux:Browser.Mod 19.05.1970 01:02:17 38540 Linux:C.Tool 04.05.2017 09:31:44 4372 Linux:Clipboard.Obj 04.11.2012 11:13:15 6677 Linux:CmprFiles 24.08.2017 21:00:37 1289 ... Under linux I've found that the most convenient listing format is: FileSize : FileName 1454 : NeedPiping 49174 : oberon.log 1105 : NeedPiping.Bak 10485760 : oberon100321.dsk 1964988 : noname.eml 678 : oberon.cnf 48055 : HrOrderFuncts .... and I vaguelly remember using ETHO's existing *FUNCTIONS* to do: 1. put the 2nd field to the front. == 24.08.2017 Linux:CmprFiles 21:00:37 1289 2. rearange the date-strings. == 2017.08.24 3. sort the System.Directory lines using ETHO's existing function. == file listing in recentcy order 4. output only the Size & Name fields. == just show the size and FileName So that's a 4stage-pipe. The great advantage of functional/piping is the extreme modularity: at any/every stage:N you only need be concerned about the output of stage:N-1 and stage:N. Nothing else need be considered. Since ETHO already uses the manualy repeated 2 stage loop: 1. Put Output:N-1 to <F1 marked Frame> 2. Take <newly F1 marked Frame> as input to pipe-stage-N: why can't we modify/extend this to be able to have a syntax eg: <pipeSequenceCommand> <Argument> ? eg. Pipe.ListRecentcyOrderedFiles /sdc2/CRG/LNOspare/ Also our ET.Mod already can execute a sequence of M.P. Adding the ability to have the text of stageN be the input of stage(N+1) would give us functional/piping ability. == crg
How about using an anonymous file as a pipe? j. On Tue, May 15, 2018 at 6:38 PM, eas lab <lab.eas@gmail.com> wrote:
I've raised this point before, under the subject of functional-programming; since the method of getting an answer by passing the data through multiple stages is the essence of functional programming.
ETHO already uses this extensively, except that it's not yet automated: the output/s go to ScreenFrames, which can be marked as the the input. to the next stage of the <pipe>.
A somewhat contrived example is solving the intolerable situation that ETHO doesn't show you the most recent files of a directory.
Imagine having a directory of 88 files, some of which are 2 years old, and you want to continue with the project that you last worked on. 3 days ago.
Obviously you want immediate access to the most recent [say 6] files which you <left on top of the work pile>.
System.Directory ^ Linux:*\d gives eg:... Linux:Browser.Mod 19.05.1970 01:02:17 38540 Linux:C.Tool 04.05.2017 09:31:44 4372 Linux:Clipboard.Obj 04.11.2012 11:13:15 6677 Linux:CmprFiles 24.08.2017 21:00:37 1289 ... Under linux I've found that the most convenient listing format is: FileSize : FileName 1454 : NeedPiping 49174 : oberon.log 1105 : NeedPiping.Bak 10485760 : oberon100321.dsk 1964988 : noname.eml 678 : oberon.cnf 48055 : HrOrderFuncts .... and I vaguelly remember using ETHO's existing *FUNCTIONS* to do: 1. put the 2nd field to the front. == 24.08.2017 Linux:CmprFiles 21:00:37 1289 2. rearange the date-strings. == 2017.08.24 3. sort the System.Directory lines using ETHO's existing function. == file listing in recentcy order 4. output only the Size & Name fields. == just show the size and FileName
So that's a 4stage-pipe. The great advantage of functional/piping is the extreme modularity: at any/every stage:N you only need be concerned about the output of stage:N-1 and stage:N. Nothing else need be considered.
Since ETHO already uses the manualy repeated 2 stage loop: 1. Put Output:N-1 to <F1 marked Frame> 2. Take <newly F1 marked Frame> as input to pipe-stage-N: why can't we modify/extend this to be able to have a syntax eg: <pipeSequenceCommand> <Argument> ? eg. Pipe.ListRecentcyOrderedFiles /sdc2/CRG/LNOspare/
Also our ET.Mod already can execute a sequence of M.P. Adding the ability to have the text of stageN be the input of stage(N+1) would give us functional/piping ability.
== crg -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-----Original Message----- From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of eas lab Sent: Wednesday, 16 May 2018 2:09 AM To: oberon@lists.inf.ethz.ch Subject: [Oberon] Small effort to add functional/piping ability ?
A somewhat contrived example is solving the intolerable situation that ETHO doesn't show you the most recent files of a directory.
Imagine having a directory of 88 files, some of which are 2 years old, and you want to continue with the project that you last worked on. 3 days ago.
Obviously you want immediate access to the most recent [say 6] files which you <left on top of the work pile>.
While pipes can be a useful feature for chaining commands your example should not be relevant to an Oberon user. Oberon is not Linux - Oberon is not a file-centric system. If an experienced Oberon user had been working on an Oberon project three days ago (e.g. HCFiler) they would already have created a tool (e.g. HCFiler.Tool) that included all of the commands that they needed to work on that project. The only filename they may need to remember is the name of the tool. If they used the tool regularly then they would have included the tool name on their System.Tool. Tools are just text files - you can modify them even while you are using them. If you are not familiar with the Tool Viewer concept in Oberon there are five pages describing it in section 2.6 of Martin Reiser's book that I recommended yesterday. It starts by saying: "A text viewer which displays a set of commands is called a tool viewer, a novel concept which is a blend of the two paradigms 'remember and type' and 'point and click.'" Regards, Chris Burrows CFB Software http://www.astrobe.com/RISC5
In my ETHOberon installation I find in the work directory something called "Projects.Tool", see attachments. Does anyone know, for what purpose and how it could be used? Or am I something missing? Regards, Dieter
-----Original Message----- From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Dieter Sent: Sunday, 20 May 2018 2:17 AM To: oberon@lists.inf.ethz.ch Subject: [Oberon] Projects.Tool on ETHOberon Plugin for Windows 2.5
In my ETHOberon installation I find in the work directory something called "Projects.Tool", see attachments. Does anyone know, for what purpose and how it could be used? Or am I something missing?
It is just an example template Tool Viewer that you can use to store the commands that you use regularly with projects of your own. "... Space for your own projects ..." is a comment indicating its purpose. Regards, Chris Burrows CFB Software http://www.astrobe.com/RISC5
participants (4)
-
Chris Burrows -
Dieter -
eas lab -
Jan de Kruyf