Re: [Oberon] Module aliases - what is the correct way to handle them
Andreas, From: Andreas Pirklbauer <andreas_pirklbauer@yahoo.com> Date: Fri, 14 Feb 2020 16:10:20 +0100
... module aliases may be useful in some cases.
I don't mean to be argumentative. Just curious. Paul Reed mentioned the tidy idea of deactivating a module by aliasing to a stub. The immediate objective was to deactivate test output. In a language without aliasing, a constant can activate or deactivate output, although Paul hinted at risk. Do you have another way to switch output? Thanks, ... P. -- https://en.wikibooks.org/wiki/Medical_Machines https://en.wikibooks.org/wiki/Oberon Tel: +1 604 670 0140 Bcc: peter at easthope. ca
On Sun, 12 Jul 2020 13:15:50 -0700 peter@easthope.ca wrote:
Paul Reed mentioned the tidy idea of deactivating a module by aliasing to a stub.
Hi, I wish I new what stub is, and how I can use one. I was thinking of running Oberon server with compiler. Compiler output directed to a file, or to RS232 stream, clients running Oberon0 command interpreter. -- Tomas Kral <thomas.kral@email.cz>
Tomas Debug output could be coded like this IMPORT Out, Debug := Out; and all your debug output like Debug.Str(“packet sent“) appears on screen. A „stub“ of Out looks like this MODULE OutStub; PROCEDURE Char*(ch: CHAR); END Char; PROCEDURE String*(s: ARRAY OF CHAR); END String; PROCEDURE Int*(i, n: INTEGER); END Int; PROCEDURE Ln*; END Ln; END OutStub; if you want to use it, you write IMPORT Out, Debug := OutStub; and „magically“ all your debug ouput is not written to screen. br Jörg
Am 13.07.2020 um 16:50 schrieb Tomas Kral <thomas.kral@email.cz>:
On Sun, 12 Jul 2020 13:15:50 -0700 peter@easthope.ca wrote:
Paul Reed mentioned the tidy idea of deactivating a module by aliasing to a stub.
Hi,
I wish I new what stub is, and how I can use one.
I was thinking of running Oberon server with compiler. Compiler output directed to a file, or to RS232 stream, clients running Oberon0 command interpreter.
-- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On 2020-07-13 17:57, Joerg wrote:
Debug output could be coded like this IMPORT Out, Debug := Out; and all your debug output like Debug.Str(“packet sent“) appears on screen. I don't think we can (or should) rely on the import order; an Oberon implementation could choose to import modules from right to left and it's not obvious that a module should be allowed to be imported twice.
-- August
Karl I agree that the import implementation of the compiler in ProjectOberon is too simplistic. We had this discussion already and Andreas provided a solution for this. Generally speaking, the LHS and RHS of an import alias have nothing to do with each other. RHS is a name of a sym file, LHS is an identifier to be used in your code. The import order does/should not matter, as the implementation should look up the LHS and RHS in different name spaces. br Jörg Am 13.07.20, 18:28 schrieb "Oberon im Auftrag von August Karlstrom" <oberon-bounces@lists.inf.ethz.ch im Auftrag von fusionfile@gmail.com>: On 2020-07-13 17:57, Joerg wrote: > Debug output could be coded like this > IMPORT Out, Debug := Out; > and all your debug output like Debug.Str(“packet sent“) appears on screen. I don't think we can (or should) rely on the import order; an Oberon implementation could choose to import modules from right to left and it's not obvious that a module should be allowed to be imported twice. -- August -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
IMPORT Out, Debug := OutStub;
Good, now running applications on a displayless server. Oberon0 client[s] connected to it. How about more servers, and one dedicated load balancer? Some maths intensive computing, fractals, etc. Each server just give a partial result, that is consolidated by a client, then transported to its display. Bad idea? -- Tomas Kral <thomas.kral@email.cz>
participants (5)
-
August Karlstrom -
Joerg -
Jörg -
peter@easthope.ca -
Tomas Kral