[Oberon] extending ETHO to function-composition syntax.

eas lab lab.eas at gmail.com
Sun Jun 8 06:55:17 CEST 2014


Prof Wirth's statement: "The definition of the abstract type Text in the
system's core suggests the replacement of files by texts as carrier of
input and output data in very many cases." , leads to the idea of
function composition.

To demonstrate <function composition>, I've contrived the following problem:-
Show me FileNames |  <- NB. Names, not file-contents
containing "-"|  <--  `System.Directory *-* ` is problematic.
but not in directory "hdc6/" |
in sorted order.
===> which [via marking Viewers] is obtained by manually chaining the 4 M.P/s:
System.Directory * , RX.Grep * "-"  , RX.Grep * \i "/" , Sort.Sort *\u

Now, if instead of manually marking Viewers,
the Viewers could be programatically marked, we could use:
[eg. for my particular ScreenSetting]
ET.Marker  set 611 420 ~ System.Directory * = writes Viewer below the marker
ET.Marker  set 611 390 = mark inside Directory Viewer
RX.* cmnds must end at line-end: RX.Grep * "-"
ET.Marker  set 611 360 = mark inside RX.Grep Viewer
RX.Grep * \i "/"
ET.Marker  set 611 330 = mark inside next RX.Grep Viewer
Sort.Sort *\u = sort with don't keep duplicates (unique lines only)
[Pity that: Miscellaneous.CountLines * ~  <- is invalid for Marked Viewer,
else we could have shown an extra stage].

And I can put these 7 steps in an ETHO <script>: Steps7
System.Directory *
ET.Marker  set 611 390 ~
RX.Grep * "-"
ET.Marker  set 611 360 ~
RX.Grep * \i "/"
ET.Marker  set 611 330 ~
Sort.Sort *\u
! ==End of <script>: Steps7

which is executed by: ET.Do Steps7 ~

Now, apply successive-refinement to:
1. replace the sequence of MarkedViewers by just 2, which are cycled.
  Please, some one do this.
2. perhaps replace the MarkedViewers, which take up screen space,
  with an <invisible carrier> like unix does ?

== Chris Glur.

PS. I want to further discuss this EFFORT-economical functional
programming style, as an 'extention' for ETHO.



More information about the Oberon mailing list