[Oberon] System.Directory options
skulski at pas.rochester.edu
Wed Nov 1 17:54:29 CET 2017
I wonder whether we should not adopt some of the Unix/Linux syntax at this point in order to make the System somewhat more palatable to casual users. Which probably means "all users". The directory listing command would look like this:
System.Directory *.Mod-la ~
where minus sign "-" means there will be options, and the option letters "l" (small L), "a", and possibly others will have the same meaning as in Unix. The "la" options are among the most commonly used, and for a reason.
This syntax can be adopted in addition to your "!" discussion. Just allow the minus sign to be on the list of the interpreted symbols.
My proposition stems from recently using the Oberon System, both the FPGA and the Linz V4. Years ago I was a proficient user of Linz V4, but now I am constantly puzzled and a bit annoyed, though I still remember a bit. I wonder if it makes sense to acknowledge that for most users the Oberon System is not, and it will never be, their only computer interface. It would make the user's life a little bit easier if some common conventions are adopted from Linux, which is probably familiar to everyone on this list at some elementary level.
Just my two groszes.
From: Oberon [oberon-bounces at lists.inf.ethz.ch] on behalf of Andreas Pirklbauer [andreas_pirklbauer at yahoo.com]
Sent: Wednesday, November 1, 2017 10:40 AM
To: ETH Oberon and related systems
Subject: [Oberon] System.Directory options
> On Sun Oct 22 18:16:10 CEST 2017 Paul Reed wrote:
> ... > WHILE ch > "!" DO pat[i] := ch; INC(i); Texts.Read(R, ch) END; > pat[i] := 0X; pat[i+1] := ch; (*directory option*) > …
A more general solution that also allows for multiple single-character options is:
i := 0;
WHILE ch > " " DO
IF ch = "!" THEN pat[i] := 0X; pat[i+1] := "!"; INC(i, 2) (*directory option*)
ELSE pat[i] := ch; INC(i)
pat[i] := 0X;
The difference is that this solution reads the *entire* argument string, i.e. it does
not stop at the first “!” character. This leads to at least two desirable properties:
1) First, it makes it easy to accept *multiple* single-character directory options, so
long as the first one is “!” (one could of course remove that limitation). For example,
System.Directory *.Mod!$? ~
could be interpreted as having three single-character options “!”, “$”, “?”. Procedure
System.List can be easily adapted to simply read the remaining characters after the “!”
Second, it naturally lends itself to be ported to situations, where the *entire*
argument string MUST be read anyway, for example, when receiving it over an RS232
line - this is the case, for example, in Oberon0.Mod (Oberon-0 command interpreter
which is the top module of the build-up boot file used for booting over a serial line).
With the above modifications, it is easy o make it work in that environment: one
only has to replace the line
with the following line
RS232.Rec(x); ch := 0X
Neither original Oberon solution nor the change proposed by Paul would work in
Oberon0, since the partner program on the host computer always sends the *entire*
argument string, no matter what (see module ORC.Mod). If the client does not read
it all, it will simply hang (or time out). The above code works in all situations.
Just my two Maria Theresien Taler..
More information about the Oberon