How to write this program in Oberon-07?
I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler): MODULE case; IMPORT In,Out; VAR countVowels: INTEGER; ch: CHAR; BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case. Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help. -- Sent with https://mailfence.com Secure and private email
Hi Joe LOOP/EXIT might seem handy, but for source code readability and maintainability reasons it was neglected. Use REPEAT or WHILE instead. If numeric case is not implemented, use IF ELSIF or IF OR instead Or look into this “elegant” alternative 😊 IMPORT In, Out, Strings; … In.Char(ch); WHILE In.Done DO Strings.Search(ch, “AEIOUaeiou”, pos); IF pos >= 0 THEN INC(countVowels) END; In.Char(ch) END; The Module Strings.Mod is quite portable. I can send you the Oberon-07 version of it if you don’t have it. br Jörg Von: Oberon <oberon-bounces@lists.inf.ethz.ch> im Auftrag von Joe Turner <medianjoe@mailfence.com> Antworten an: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: Montag, 24. Januar 2022 um 15:15 An: <oberon@lists.inf.ethz.ch> Betreff: [Oberon] How to write this program in Oberon-07? I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler): MODULE case; IMPORT In,Out; VAR countVowels: INTEGER; ch: CHAR; BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case. Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help. -- Sent with https://mailfence.com Secure and private email -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi Jorg, Thanks for the reply. That's a neat solution. I can do that with the string library provided in OBNC. I was wondering how to do it with a CASE statement but it seems quite limited without ELSE. ie, for this example you would have to explicitly list all the values which ch could take (other than vowels). I learned (Turbo) pascal years ago and have recently started programming again. I never really liked the C syntax languages and rather than use Free Pascal I thought I'd give Oberon a try. I wonder if Wirth took minimalism a bit too far in this version though? January 24, 2022 4:03:08 PM CET "Jörg" <joerg.straube@iaeth.ch> wrote: Hi Joe LOOP/EXIT might seem handy, but for source code readability and maintainability reasons it was neglected. Use REPEAT or WHILE instead. If numeric case is not implemented, use IF ELSIF or IF OR instead Or look into this “elegant” alternative 😊 IMPORT In, Out, Strings; … In.Char(ch); WHILE In.Done DO Strings.Search(ch, “AEIOUaeiou”, pos); IF pos >= 0 THEN INC(countVowels) END; In.Char(ch) END; The Module Strings.Mod is quite portable. I can send you the Oberon-07 version of it if you don’t have it. br Jörg Von: Oberon <oberon-bounces@lists.inf.ethz.ch> im Auftrag von Joe Turner <medianjoe@mailfence.com> Antworten an: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: Montag, 24. Januar 2022 um 15:15 An: <oberon@lists.inf.ethz.ch> Betreff: [Oberon] How to write this program in Oberon-07? I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler): MODULE case; IMPORT In,Out; VAR countVowels: INTEGER; ch: CHAR; BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case. Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help. -- Sent with https://mailfence.com Secure and private email -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Sent with https://mailfence.com Secure and private email
Joe There is a long debate whether an ELSE in a CASE is something good or bad. That’s a little bit comparable to LOOP/EXIT: At first sight ELSE looks hand. But if you really had to debug complicated code with a lot of CASE statements you will conclude that the ELSE is quite dangerous. Let’s assume you forgot an important CASE. Instead of being trapped (default behaviour of an uncovered CASE without ELSE) the ELSE catches it, the code goes on with perhaps totally wrong variable settings and the code error (forgotten CASE) is mostly unnoticed! br Jörg Von: Oberon <oberon-bounces@lists.inf.ethz.ch> im Auftrag von Joe Turner <medianjoe@mailfence.com> Antworten an: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: Montag, 24. Januar 2022 um 18:28 An: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Betreff: Re: [Oberon] How to write this program in Oberon-07? Hi Jorg, Thanks for the reply. That's a neat solution. I can do that with the string library provided in OBNC. I was wondering how to do it with a CASE statement but it seems quite limited without ELSE. ie, for this example you would have to explicitly list all the values which ch could take (other than vowels). I learned (Turbo) pascal years ago and have recently started programming again. I never really liked the C syntax languages and rather than use Free Pascal I thought I'd give Oberon a try. I wonder if Wirth took minimalism a bit too far in this version though? January 24, 2022 4:03:08 PM CET "Jörg" <joerg.straube@iaeth.ch> wrote: Hi Joe LOOP/EXIT might seem handy, but for source code readability and maintainability reasons it was neglected. Use REPEAT or WHILE instead. If numeric case is not implemented, use IF ELSIF or IF OR instead Or look into this “elegant” alternative 😊 IMPORT In, Out, Strings; … In.Char(ch); WHILE In.Done DO Strings.Search(ch, “AEIOUaeiou”, pos); IF pos >= 0 THEN INC(countVowels) END; In.Char(ch) END; The Module Strings.Mod is quite portable. I can send you the Oberon-07 version of it if you don’t have it. br Jörg Von: Oberon <oberon-bounces@lists.inf.ethz.ch> im Auftrag von Joe Turner <medianjoe@mailfence.com> Antworten an: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: Montag, 24. Januar 2022 um 15:15 An: <oberon@lists.inf.ethz.ch> Betreff: [Oberon] How to write this program in Oberon-07? I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler): MODULE case; IMPORT In,Out; VAR countVowels: INTEGER; ch: CHAR; BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case. Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help. -- Sent with https://mailfence.com Secure and private email -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Sent with https://mailfence.com Secure and private email -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Tue, Jan 25, 2022 at 4:06 AM Jörg <joerg.straube@iaeth.ch> wrote:
There is a long debate whether an ELSE in a CASE is something good or bad.
That’s a little bit comparable to LOOP/EXIT: At first sight ELSE looks hand. But if you really had to debug complicated code with a lot of CASE statements you will conclude that the ELSE is quite dangerous.
Let’s assume you forgot an important CASE. Instead of being trapped (default behaviour of an uncovered CASE without ELSE) the ELSE catches it, the code goes on with perhaps totally wrong variable settings and the code error (forgotten CASE) is mostly unnoticed!
I agree. Similar potential pitfalls can occur in IF-THEN-ELSIF ladders. It can be a good defensive programming technique to add to the end of these: ELSE ASSERT(FALSE) END; That will trap current (or future, if related code is changed) possibilities that have been overlooked. As a real-life example of this I would have saved myself several hours of head-banging this week if problematic code I have been investigating had been implemented this way. I was able to replace it with a (more efficient) numeric CASE statement on this occasion. -- Chris Burrows CFB Software http://www.astrobe.com
Hi Chris and all, But of course you are aware that the latest revisions of the Oberon-07 language report say nothing about the fact that CASE should warn the programmer about an encountered label that is not in the list? Yeah, the report doesn't say anything about that. So this question, as well as many non-obvious points in Oberon-07, are left to the language's implementers to solve. And in the description of Oberon-2 and Component Pascal there is explicitly about CASE behavior. So ELSE for CASE could be useful to include at least ASSERT(FALSE). But since this is not possible, we make our poor programming even poorer. Chris Burrows пишет:
On Tue, Jan 25, 2022 at 4:06 AM Jörg <joerg.straube@iaeth.ch <mailto:joerg.straube@iaeth.ch>> wrote:
__ __
There is a long debate whether an ELSE in a CASE is something good or bad.____
That’s a little bit comparable to LOOP/EXIT: At first sight ELSE looks hand. But if you really had to debug complicated code with a lot of CASE statements you will conclude that the ELSE is quite dangerous.____
Let’s assume you forgot an important CASE. Instead of being trapped (default behaviour of an uncovered CASE without ELSE) the ELSE catches it, the code goes on with perhaps totally wrong variable settings and the code error (forgotten CASE) is mostly unnoticed!
I agree. Similar potential pitfalls can occur in IF-THEN-ELSIF ladders. It can be a good defensive programming technique to add to the end of these:
ELSE ASSERT(FALSE) END;
That will trap current (or future, if related code is changed) possibilities that have been overlooked. As a real-life example of this I would have saved myself several hours of head-banging this week if problematic code I have been investigating had been implemented this way. I was able to replace it with a (more efficient) numeric CASE statement on this occasion.
-- Chris Burrows CFB Software http://www.astrobe.com
------------------------------------------------------------------------
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Fri, Jan 28, 2022 at 11:31 AM Oleg N. Cher <allot@bk.ru> wrote:
Hi Chris and all,
But of course you are aware that the latest revisions of the Oberon-07 language report say nothing about the fact that CASE should warn the programmer about an encountered label that is not in the list?
Sure. A newcomer might also wonder what happens when the same label appears in more than one list, if the labels in a list are not in numeric order, if the range is in decreasing order etc. etc. An experienced programmer might have preconceived ideas about all of these so the questions might not arise for them. However, a compiler implementer has to consider all of them and decide what actions to take. The Oberon-07 Report does not *prescribe* implementation-specific behaviour. If you are implementing a compiler you can choose what to do depending on what is most feasible for the platform and target processor that you are using. There are usually many trade-offs concerned when making these decisions. If you are using a compiler and you cannot determine what the behaviour is, then you should either refer to the implementation-specific documentation for the compiler that you are using, or contact the author(s) for those details. -- Chris Burrows CFB Software http://www.astrobe.com
Hi Chris,
The Oberon-07 Report does not /prescribe/ implementation-specific behaviour. If you are implementing a compiler you can choose what to do depending on what is most feasible for the platform and target processor
Things like ELSE in CASE or a warning in the case of a label that is not encountered relate more to the safety and practicality of the language than to implementation features like the platform and target processor. And it also relates to the reliability of programs. But certainly not to the features of the platform. So it is too bad that all this has been forgotten. -- Oleg
Oleg In Oberon-07 CASE is mainly thought to allow a rather elegant syntax for type extensions. (No WITH DO anymore) NW did not even implement the numeric case in his compiler. My numeric CASE implementation generates a trap for all unmentioned labels. If you want to overwrite this compiler behaviour you don‘t need an ELSE: just mention the labels explicitely and do nothing. You could say: this is cumbersome but if you have a large CASE where you would have to mention a lot of labels to do nothing, CASE is not the right construct in the first place (use IF instead) Although not a great choice for CASE even here it‘s not too cumbersome (* with trap *) CASE x OF | 1: Out.String(“uno“) | 100: Out.String(“cien“) END (* without trap *) CASE x OF | 1: Out.String(“uno“) | 2..99: | 100: Out.String(“cien“) END br Jörg
Am 28.01.2022 um 02:01 schrieb Oleg N. Cher <allot@bk.ru>:
Hi Chris and all,
But of course you are aware that the latest revisions of the Oberon-07 language report say nothing about the fact that CASE should warn the programmer about an encountered label that is not in the list?
Yeah, the report doesn't say anything about that.
So this question, as well as many non-obvious points in Oberon-07, are left to the language's implementers to solve. And in the description of Oberon-2 and Component Pascal there is explicitly about CASE behavior.
So ELSE for CASE could be useful to include at least ASSERT(FALSE). But since this is not possible, we make our poor programming even poorer.
Chris Burrows пишет:
On Tue, Jan 25, 2022 at 4:06 AM Jörg <joerg.straube@iaeth.ch <mailto:joerg.straube@iaeth.ch>> wrote: __ __ There is a long debate whether an ELSE in a CASE is something good or bad.____ That’s a little bit comparable to LOOP/EXIT: At first sight ELSE looks hand. But if you really had to debug complicated code with a lot of CASE statements you will conclude that the ELSE is quite dangerous.____ Let’s assume you forgot an important CASE. Instead of being trapped (default behaviour of an uncovered CASE without ELSE) the ELSE catches it, the code goes on with perhaps totally wrong variable settings and the code error (forgotten CASE) is mostly unnoticed! I agree. Similar potential pitfalls can occur in IF-THEN-ELSIF ladders. It can be a good defensive programming technique to add to the end of these: ELSE ASSERT(FALSE) END; That will trap current (or future, if related code is changed) possibilities that have been overlooked. As a real-life example of this I would have saved myself several hours of head-banging this week if problematic code I have been investigating had been implemented this way. I was able to replace it with a (more efficient) numeric CASE statement on this occasion. -- Chris Burrows CFB Software http://www.astrobe.com ------------------------------------------------------------------------ -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
As mentioned by Jörg, Oberon-07 is a pure structured language in the sense that each (ASSERT free) statement sequence is either fully executed or not executed. With CASE statements you can often limit the range of values to inspect before the CASE statement is executed. Here is one way to do it: MODULE case; IMPORT In, Out; VAR countVowels: INTEGER; ch, capCh: CHAR; BEGIN In.Open; countVowels := 0; In.Char(ch); WHILE In.Done DO IF (ch >= "a") & (ch <= "z") THEN capCh := CHR(ORD("A") + ORD(ch) - ORD("a")) ELSE capCh := ch END; IF (capCh >= "A") & (capCh <= "U") THEN CASE capCh OF "A", "E","I","O","U": INC(countVowels) | "B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T": (*do nothing*) END END; In.Char(ch) END; Out.Int(countVowels, 0); Out.String(" vowels read."); Out.Ln END case. With the WHILE loop we can see instantly that it will continue until there are no more characters to read. Compare this to the LOOP in which the exit condition (or possibly exit conditions) is buried in the contained statement sequence. -- August On 2022-01-24 15:14, Joe Turner wrote:
I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler):
MODULE case; IMPORT In,Out;
VAR countVowels: INTEGER; ch: CHAR;
BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case.
Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help. -- Sent with https://mailfence.com Secure and private email
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
August, thanks for that. Are you by any chance the author of OBNC? Not that I'm an expert - far from it, but it's a very nice compiler and easy to use. I never learned OOP with Turbo Pascal and have been avoiding it for a long time because the terminology put me off - classes, methods, polymorphism, inheritance etc. One of the things which attracted me to Oberon is the way OOP is handled; it's just an extension of the record concept, so I'm looking forward to learning it at last. Good to know you experts are on hand to help me out if I get stuck! Thanks again to you and Jorg for the words of wisdom. Joe January 24, 2022 7:29:53 PM CET August Karlstrom <fusionfile@gmail.com> wrote:As mentioned by Jörg, Oberon-07 is a pure structured language in the sense that each (ASSERT free) statement sequence is either fully executed or not executed. With CASE statements you can often limit the range of values to inspect before the CASE statement is executed. Here is one way to do it: MODULE case; IMPORT In, Out; VAR countVowels: INTEGER; ch, capCh: CHAR; BEGIN In.Open; countVowels := 0; In.Char(ch); WHILE In.Done DO IF (ch >= "a") & (ch <= "z") THEN capCh := CHR(ORD("A") + ORD(ch) - ORD("a")) ELSE capCh := ch END; IF (capCh >= "A") & (capCh <= "U") THEN CASE capCh OF "A", "E","I","O","U": INC(countVowels) | "B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T": (*do nothing*) END END; In.Char(ch) END; Out.Int(countVowels, 0); Out.String(" vowels read."); Out.Ln END case. With the WHILE loop we can see instantly that it will continue until there are no more characters to read. Compare this to the LOOP in which the exit condition (or possibly exit conditions) is buried in the contained statement sequence. -- August On 2022-01-24 15:14, Joe Turner wrote:
I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler):
MODULE case; IMPORT In,Out;
VAR countVowels: INTEGER; ch: CHAR;
BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case.
Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help. -- Sent with https://mailfence.com Secure and private email
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Sent with https://mailfence.com Secure and private email
On Mon, Jan 24, 2022 at 11:14 AM Joe Turner <medianjoe@mailfence.com> wrote:
I'm working through the book "Into the Realm of Oberon" which is written
for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler):
MODULE case; IMPORT In,Out;
VAR countVowels: INTEGER; ch: CHAR;
BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case.
Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help.
Hi Joe, One way for you to use Oberon-2 syntax is to employ BlackBox Component Pascal Environment: https://blackboxframework.org/index.php?cID=home,en-us One public domain good book for practicing with BB CP is this: https://cslab.pepperdine.edu/warford/ComputingFundamentals/ And its resources: http://www.zinnamturm.eu/downloadsOS.htm#Pbox Another way to use Oberon-2 syntax is to employ Oberon System 3 with Gadgets under Windows or Linux: https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Win95NT https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Unix In BlackBox your program counts the vowels on the viewer from where it is called. In Oberon System 3, it counts the vowels after the command line in any viewer. I've only modified your program puting the executable part inside a procedure to call it from any viewer inside of Oberon System 3 or BlackBox CP: MODULE Case; IMPORT In,Out; VAR countVowels: INTEGER; ch: CHAR; PROCEDURE Vowcount *; BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END Vowcount; END Case. Best regards, Prof Pablo Cayuela Argentina
Hi Pablo, Many thanks for the links. I wasn't aware of Blackbox or component Pascal. I use Linux but it seems to work flawlessly with Wine. The book looks really good too. Joe January 24, 2022 8:19:02 PM CET Pablo Cayuela <pablo.cayuela@gmail.com> wrote: On Mon, Jan 24, 2022 at 11:14 AM Joe Turner <medianjoe@mailfence.com> wrote:
I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler):
MODULE case; IMPORT In,Out;
VAR countVowels: INTEGER; ch: CHAR;
BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case.
Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help.
Hi Joe, One way for you to use Oberon-2 syntax is to employ BlackBox Component Pascal Environment: https://blackboxframework.org/index.php?cID=home,en-us One public domain good book for practicing with BB CP is this: https://cslab.pepperdine.edu/warford/ComputingFundamentals/ And its resources: http://www.zinnamturm.eu/downloadsOS.htm#Pbox Another way to use Oberon-2 syntax is to employ Oberon System 3 with Gadgets under Windows or Linux: https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Win95NT https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Unix In BlackBox your program counts the vowels on the viewer from where it is called. In Oberon System 3, it counts the vowels after the command line in any viewer. I've only modified your program puting the executable part inside a procedure to call it from any viewer inside of Oberon System 3 or BlackBox CP: MODULE Case; IMPORT In,Out; VAR countVowels: INTEGER; ch: CHAR; PROCEDURE Vowcount *; BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END Vowcount; END Case. Best regards, Prof Pablo Cayuela Argentina -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Sent with https://mailfence.com Secure and private email
Hi, I do not want to start multiple rabbit holes. But here I go. There is another version of BlackBox which is based on the 'Base' from the link given. Its url is https://blackbox.oberon.org/. I did not dig deeper, since I already have invested time in other one, but it is on my 'explore' list. One clear distinction is the multiple documents as multiple windows (in contrast to the BlackBox at https://blackboxframework.org/ , which has the multiple documents inside one Window). HiH and Have fun. Regards, On Tue, Jan 25, 2022 at 12:14 PM Joe Turner <medianjoe@mailfence.com> wrote:
Hi Pablo, Many thanks for the links. I wasn't aware of Blackbox or component Pascal. I use Linux but it seems to work flawlessly with Wine. The book looks really good too. Joe
January 24, 2022 8:19:02 PM CET Pablo Cayuela <pablo.cayuela@gmail.com> wrote:
On Mon, Jan 24, 2022 at 11:14 AM Joe Turner <medianjoe@mailfence.com> wrote:
I'm working through the book "Into the Realm of Oberon" which is written
for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler):
MODULE case; IMPORT In,Out;
VAR countVowels: INTEGER; ch: CHAR;
BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END case.
Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. Thanks in advance for any help.
Hi Joe, One way for you to use Oberon-2 syntax is to employ BlackBox Component Pascal Environment: https://blackboxframework.org/index.php?cID=home,en-us One public domain good book for practicing with BB CP is this: https://cslab.pepperdine.edu/warford/ComputingFundamentals/ And its resources: http://www.zinnamturm.eu/downloadsOS.htm#Pbox
Another way to use Oberon-2 syntax is to employ Oberon System 3 with Gadgets under Windows or Linux: https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Win95NT https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Unix
In BlackBox your program counts the vowels on the viewer from where it is called. In Oberon System 3, it counts the vowels after the command line in any viewer. I've only modified your program puting the executable part inside a procedure to call it from any viewer inside of Oberon System 3 or BlackBox CP:
MODULE Case; IMPORT In,Out;
VAR countVowels: INTEGER; ch: CHAR;
PROCEDURE Vowcount *; BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END Vowcount; END Case.
Best regards, Prof Pablo Cayuela Argentina
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Sent with https://mailfence.com Secure and private email -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Yes Ala'a Mohammad, there are not less than three main versions of BlackBox Component Builder/Pascal: Core version: http://www.zinnamturm.eu/downloads.htm Center versions: https://blackboxframework.org/index.php?cID=goto-download-page,en-us The ones at https://blackbox.oberon.org/download also have the linux native version that is a work in progress, not so thoroughly tested as the version for MS Windows. One of the versions for linux have floating independent windows opened for every document, right now that is bbcb-1.8~b1.166 (both installable or portable). The other new version for linux has tabs instead of windows or viewers inside the program window, this is bbcb2-2.0~a1 (both versions). For MS Windows bbcb-1.8-b1.166 has windows inside the program window; and BlackBox-2.0-a1.039 that has tabs instead of windows inside the program window. The latest versions are mainly developed by a group of Russian researchers that use them at schools, colleges, universities and personal and commercial applications throughout all of Russia. They are a great community, maybe the largest both organized and interested in Oberon right now. BlackBox is just one of the projects that they are maintaining. Here it is a compendium of more groups and projects around Oberon, not only the Russian ones: https://oberon.org/en Best regards, Prof Pablo Cayuela Argentina El mar., 25 de enero de 2022 11:53, Ala'a Mohammad <amalawi@gmail.com> escribió:
Hi,
I do not want to start multiple rabbit holes. But here I go. There is
another version of BlackBox which is based on the 'Base' from the link given. Its url is https://blackbox.oberon.org/. I did not dig deeper, since I already have invested time in other one, but it is on my 'explore' list.
One clear distinction is the multiple documents as multiple windows (in contrast to the BlackBox at https://blackboxframework.org/ , which has the multiple documents inside one Window).
HiH and Have fun. Regards,
Hi Pablo, Thanks for the heads up. regards, Ala'a On Tue, Jan 25, 2022 at 8:53 PM Pablo Cayuela <pablo.cayuela@gmail.com> wrote:
Yes Ala'a Mohammad, there are not less than three main versions of BlackBox Component Builder/Pascal:
Core version: http://www.zinnamturm.eu/downloads.htm Center versions: https://blackboxframework.org/index.php?cID=goto-download-page,en-us
The ones at https://blackbox.oberon.org/download also have the linux native version that is a work in progress, not so thoroughly tested as the version for MS Windows. One of the versions for linux have floating independent windows opened for every document, right now that is bbcb-1.8~b1.166 (both installable or portable). The other new version for linux has tabs instead of windows or viewers inside the program window, this is bbcb2-2.0~a1 (both versions).
For MS Windows bbcb-1.8-b1.166 has windows inside the program window; and BlackBox-2.0-a1.039 that has tabs instead of windows inside the program window.
The latest versions are mainly developed by a group of Russian researchers that use them at schools, colleges, universities and personal and commercial applications throughout all of Russia. They are a great community, maybe the largest both organized and interested in Oberon right now. BlackBox is just one of the projects that they are maintaining. Here it is a compendium of more groups and projects around Oberon, not only the Russian ones: https://oberon.org/en
Best regards, Prof Pablo Cayuela Argentina
El mar., 25 de enero de 2022 11:53, Ala'a Mohammad <amalawi@gmail.com> escribió:
Hi,
I do not want to start multiple rabbit holes. But here I go. There is
One clear distinction is the multiple documents as multiple windows (in contrast to the BlackBox at https://blackboxframework.org/ , which has
another version of BlackBox which is based on the 'Base' from the link given. Its url is https://blackbox.oberon.org/. I did not dig deeper, since I already have invested time in other one, but it is on my 'explore' list. the multiple documents inside one Window).
HiH and Have fun. Regards,
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
If you will have questions about BlackBox, you are welcome to this board https://community.blackboxframework.org/ we also did chat recently https://matrix.to/#/#blackbox:matrix.org It is more easy to share questions and screenshot sometimes in chat format. Best regards, Ivan Denisov 25.01.2022 21:52, Ala'a Mohammad пишет:
Hi,
I do not want to start multiple rabbit holes. But here I go. There is another version of BlackBox which is based on the 'Base' from the link given. Its url is https://blackbox.oberon.org/. I did not dig deeper, since I already have invested time in other one, but it is on my 'explore' list. One clear distinction is the multiple documents as multiple windows (in contrast to the BlackBox at https://blackboxframework.org/ , which has the multiple documents inside one Window).
HiH and Have fun.
Regards,
On Tue, Jan 25, 2022 at 12:14 PM Joe Turner <medianjoe@mailfence.com> wrote:
Hi Pablo, Many thanks for the links. I wasn't aware of Blackbox or component Pascal. I use Linux but it seems to work flawlessly with Wine. The book looks really good too. Joe
January 24, 2022 8:19:02 PM CET Pablo Cayuela <pablo.cayuela@gmail.com> wrote:
On Mon, Jan 24, 2022 at 11:14 AM Joe Turner <medianjoe@mailfence.com> wrote: > > I'm working through the book "Into the Realm of Oberon" which is written for Oberon-2. I can't figure out how to translate the following program into Oberon-07 (I'm using the OBNC compiler): > > MODULE case; > IMPORT In,Out; > > VAR countVowels: INTEGER; ch: CHAR; > > BEGIN > In.Open; > countVowels:=0; > LOOP > In.Char(ch); > IF ~In.Done THEN EXIT END; > CASE ch OF > "a", "e", "i", "o", "u", > "A", "E","I","O","U": INC(countVowels) > ELSE > END; > END; > Out.Int(countVowels,0); > Out.String(" vowels read.");Out.Ln; > END case. > > Oberon-07 doesn't allow LOOP, EXIT, or ELSE in CASE. > Thanks in advance for any help. >
Hi Joe, One way for you to use Oberon-2 syntax is to employ BlackBox Component Pascal Environment: https://blackboxframework.org/index.php?cID=home,en-us One public domain good book for practicing with BB CP is this: https://cslab.pepperdine.edu/warford/ComputingFundamentals/ And its resources: http://www.zinnamturm.eu/downloadsOS.htm#Pbox
Another way to use Oberon-2 syntax is to employ Oberon System 3 with Gadgets under Windows or Linux: https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Win95NT https://github.com/pcayuela/oldftpETHZOberon/tree/master/System3/Unix
In BlackBox your program counts the vowels on the viewer from where it is called. In Oberon System 3, it counts the vowels after the command line in any viewer. I've only modified your program puting the executable part inside a procedure to call it from any viewer inside of Oberon System 3 or BlackBox CP:
MODULE Case; IMPORT In,Out;
VAR countVowels: INTEGER; ch: CHAR;
PROCEDURE Vowcount *; BEGIN In.Open; countVowels:=0; LOOP In.Char(ch); IF ~In.Done THEN EXIT END; CASE ch OF "a", "e", "i", "o", "u", "A", "E","I","O","U": INC(countVowels) ELSE END; END; Out.Int(countVowels,0); Out.String(" vowels read.");Out.Ln; END Vowcount; END Case.
Best regards, Prof Pablo Cayuela Argentina
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Sent with https://mailfence.com Secure and private email -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (9)
-
Ala'a Mohammad -
August Karlstrom -
Chris Burrows -
Ivan Denisov -
Joe Turner -
Joerg -
Jörg -
Oleg N. Cher -
Pablo Cayuela