Discussion:
How does OOC handle this ?
(too old to reply)
n***@absamail.co.za
2006-03-22 15:25:03 UTC
Permalink
For me, ETH-Sys3's gadgets with mouse-chording is THE killer-application;
ahead of Norton's-commander [well cloned to MC].

Since ETH's function is to get gradutes out the door, it's understandable
that similar [hence wasteful/irritating] code repeatedly [each student
must repeat the exercises] appears in all sources of eg. the family of
commands which do:
<CommandOn> <AtextOrfile>. eg.
AsciiCoder.CodeText *
AsciiCoder.CodeFiles ^
Backup.ReadFiles ^
Compiler.Compile @
UUDecoder.Decode ~
...etc.

Reading Compiler.Mod , we see:--
Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S);
globalOpt := ""; GetOptions(S, globalOpt);
IF (S.class = Texts.Char) & ((S.c = "*") OR (S.c = "@")) THEN
IF S.c = "*" THEN
t := Oberon.MarkedText(); pos := 0; frame := Oberon.MarkedFrame();
ELSE (* S.c = "@" *)
Oberon.GetSelection(t, pos, end, time); frame := NIL;
....
ELSIF ((S.class = Texts.Char) & (S.c = "^")) OR (S.class = Texts.Name) THEN
IF (S.c = "^") THEN ..........
---
I would be happy if this repeated, with each author's own flavour/format
could be factored out, to give some thing like:--

CONST (* factored-out module *)
MarkedViewer = "*"; ThatFile = "^"; StartOfSelctn = "@"; ...
....

CASE FirstArg OF (* in client module *)
MarkedViewer: CompileMarkedViewer
|ThatFile: CompileThatFile
|StartOfSelctn: CompileFromSelctnStart
.....
---

I'm reluctant to spend time analysing ooc, but a first look seemd to show
a nice 'formal' setup. Has ooc got a policy on the above issue: code
factoring ?

Another thing of S3 which I suspect is for the benefit of 'exercising' the
students is the heavy use of var-pars instead of a more functional style.
Ie. saving CPU cycles instead of programmers effort.
What is the policy of the existing ooc code ?

Thanks for any input.

== Chris Glur.
Stefan Salewski
2006-03-23 17:11:26 UTC
Permalink
***@absamail.co.za wrote:

[...]
Post by n***@absamail.co.za
Since ETH's function is to get gradutes out the door, it's understandable
that similar [hence wasteful/irritating] code repeatedly [each student
must repeat the exercises] appears in all sources of eg.
[...]

Yes, reading nearly the same code in different modules (many modules
contains procedures Min(), Max, IntToStr(), ...) was one point of
ETH-Oberon which has irritated me when I saw it for the first time.
Now I have become familar with this ETH-habit, but still this kind of
software-design may appear like a couple of programming exercises.
There was a discussion about this topic in this group or in the ETH-mailing
list about this topic some months ago. One explanation was that it is
easier to write a simple procedure or code fragment new than finding the
relevant procedure in the (ETH)-documentation.

Best regards

Stefan Salewski

Loading...