Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters
Ok, I see, thank you very much. It should be officially documented in any case. I'm implementing my first true Oberon validator by just following the language report word by word and got tons of inexplicable errors because of rule simply not describe there (neither in the tutorial). If I want to be able to successfully parse the Oberon System (which seems like an obligatory test case) then I consequently have to implement these specialities as well. I'm not very good at reading Oberon source code (yet) though, so I would prefer a precise and complete language report. Your document is already more precise, as it seems. Best R. _______________________________ From: Luca Boasso Sent on: Sat, 07 Dec 2019 03:02:01 +0100 To: rochus.keller@bluewin.ch Cc: Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters Those particular examples exploit an undocumented loophole in the type system that simplify the writing of lower lever functions. I left that out of my document. See ORP.Parameter: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN ORG.VarParam(x, par.type) On Fri, Dec 6, 2019, 17:45 rochus.keller@bluewin.ch <rochus.keller@bluewin.ch> wrote: This is a very helpful document indeed, thank you very much. But as it seems it doesn't explain my originally intended examples, e.g FileDir.Mod line 61 or Files.Mod line 104 (the first reported one was unfortunately my mishap, sorry). Best R.
To the best of my knowledge, that undocumented feature is the only (intentionally) missing type rule in my document. The type system described is a slight superset of the one implement by the original Oberon-07 RISC compiler. Let me know if you need clarifications on the document. oberonc implements all the rules of that document. You can find comments in the source code referring to the type rules, for example in https://github.com/lboasso/oberonc/blob/master/src/OJP.Mod at line 216: (* Type Rule A, B *) PROCEDURE EqualTypes(t0, t1: OJB.Type): BOOLEAN; BEGIN On Fri, Dec 6, 2019, 19:05 rochus.keller@bluewin.ch < rochus.keller@bluewin.ch> wrote:
Ok, I see, thank you very much.
It should be officially documented in any case. I'm implementing my first true Oberon validator by just following the language report word by word and got tons of inexplicable errors because of rule simply not describe there (neither in the tutorial). If I want to be able to successfully parse the Oberon System (which seems like an obligatory test case) then I consequently have to implement these specialities as well. I'm not very good at reading Oberon source code (yet) though, so I would prefer a precise and complete language report. Your document is already more precise, as it seems.
Best R.
_______________________________ From: Luca Boasso Sent on: Sat, 07 Dec 2019 03:02:01 +0100 To: rochus.keller@bluewin.ch Cc: Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters
Those particular examples exploit an undocumented loophole in the type system that simplify the writing of lower lever functions. I left that out of my document.
See ORP.Parameter: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN ORG.VarParam(x, par.type)
On Fri, Dec 6, 2019, 17:45 rochus.keller@bluewin.ch < rochus.keller@bluewin.ch> wrote:
This is a very helpful document indeed, thank you very much.
But as it seems it doesn't explain my originally intended examples, e.g FileDir.Mod line 61 or Files.Mod line 104 (the first reported one was unfortunately my mishap, sorry).
Best R. -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
ARRAY N OF BYTE is compatible to anything as long as the size matches. This comes in handy for low level programming. Jörg
Am 07.12.2019 um 08:51 schrieb Luca Boasso <luke.boasso@gmail.com>:
To the best of my knowledge, that undocumented feature is the only (intentionally) missing type rule in my document. The type system described is a slight superset of the one implement by the original Oberon-07 RISC compiler. Let me know if you need clarifications on the document.
oberonc implements all the rules of that document. You can find comments in the source code referring to the type rules, for example in https://github.com/lboasso/oberonc/blob/master/src/OJP.Mod at line 216: (* Type Rule A, B *) PROCEDURE EqualTypes(t0, t1: OJB.Type): BOOLEAN; BEGIN
On Fri, Dec 6, 2019, 19:05 rochus.keller@bluewin.ch <rochus.keller@bluewin.ch> wrote: Ok, I see, thank you very much.
It should be officially documented in any case. I'm implementing my first true Oberon validator by just following the language report word by word and got tons of inexplicable errors because of rule simply not describe there (neither in the tutorial). If I want to be able to successfully parse the Oberon System (which seems like an obligatory test case) then I consequently have to implement these specialities as well. I'm not very good at reading Oberon source code (yet) though, so I would prefer a precise and complete language report. Your document is already more precise, as it seems.
Best R.
_______________________________ From: Luca Boasso Sent on: Sat, 07 Dec 2019 03:02:01 +0100 To: rochus.keller@bluewin.ch Cc: Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters
Those particular examples exploit an undocumented loophole in the type system that simplify the writing of lower lever functions. I left that out of my document.
See ORP.Parameter: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN ORG.VarParam(x, par.type)
On Fri, Dec 6, 2019, 17:45 rochus.keller@bluewin.ch <rochus.keller@bluewin.ch> wrote:
This is a very helpful document indeed, thank you very much.
But as it seems it doesn't explain my originally intended examples, e.g FileDir.Mod line 61 or Files.Mod line 104 (the first reported one was unfortunately my mishap, sorry).
Best R. -- 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
In procedure ORP.Parameter() you find: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN Jörg
Am 07.12.2019 um 09:21 schrieb Jörg <joerg.straube@iaeth.ch>:
ARRAY N OF BYTE is compatible to anything as long as the size matches. This comes in handy for low level programming. Jörg
Am 07.12.2019 um 08:51 schrieb Luca Boasso <luke.boasso@gmail.com>:
To the best of my knowledge, that undocumented feature is the only (intentionally) missing type rule in my document. The type system described is a slight superset of the one implement by the original Oberon-07 RISC compiler. Let me know if you need clarifications on the document.
oberonc implements all the rules of that document. You can find comments in the source code referring to the type rules, for example in https://github.com/lboasso/oberonc/blob/master/src/OJP.Mod at line 216: (* Type Rule A, B *) PROCEDURE EqualTypes(t0, t1: OJB.Type): BOOLEAN; BEGIN
On Fri, Dec 6, 2019, 19:05 rochus.keller@bluewin.ch <rochus.keller@bluewin.ch> wrote: Ok, I see, thank you very much.
It should be officially documented in any case. I'm implementing my first true Oberon validator by just following the language report word by word and got tons of inexplicable errors because of rule simply not describe there (neither in the tutorial). If I want to be able to successfully parse the Oberon System (which seems like an obligatory test case) then I consequently have to implement these specialities as well. I'm not very good at reading Oberon source code (yet) though, so I would prefer a precise and complete language report. Your document is already more precise, as it seems.
Best R.
_______________________________ From: Luca Boasso Sent on: Sat, 07 Dec 2019 03:02:01 +0100 To: rochus.keller@bluewin.ch Cc: Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters
Those particular examples exploit an undocumented loophole in the type system that simplify the writing of lower lever functions. I left that out of my document.
See ORP.Parameter: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN ORG.VarParam(x, par.type)
On Fri, Dec 6, 2019, 17:45 rochus.keller@bluewin.ch <rochus.keller@bluewin.ch> wrote:
This is a very helpful document indeed, thank you very much.
But as it seems it doesn't explain my originally intended examples, e.g FileDir.Mod line 61 or Files.Mod line 104 (the first reported one was unfortunately my mishap, sorry).
Best R. -- 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
Hi A little bit of history: In the previous language report, chapter 12 explained that rule https://inf.ethz.ch/personal/wirth/Oberon/Oberon.Report.pdf You had to use SYSTEM.BYTE to enable it. SYSTEM.BYTE disappeared, but the (now undocumented) rule is still there. Br Jörg
Am 07.12.2019 um 09:32 schrieb Jörg <joerg.straube@iaeth.ch>:
In procedure ORP.Parameter() you find: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN Jörg
Am 07.12.2019 um 09:21 schrieb Jörg <joerg.straube@iaeth.ch>:
ARRAY N OF BYTE is compatible to anything as long as the size matches. This comes in handy for low level programming. Jörg
Am 07.12.2019 um 08:51 schrieb Luca Boasso <luke.boasso@gmail.com>:
To the best of my knowledge, that undocumented feature is the only (intentionally) missing type rule in my document. The type system described is a slight superset of the one implement by the original Oberon-07 RISC compiler. Let me know if you need clarifications on the document.
oberonc implements all the rules of that document. You can find comments in the source code referring to the type rules, for example in https://github.com/lboasso/oberonc/blob/master/src/OJP.Mod at line 216: (* Type Rule A, B *) PROCEDURE EqualTypes(t0, t1: OJB.Type): BOOLEAN; BEGIN
On Fri, Dec 6, 2019, 19:05 rochus.keller@bluewin.ch <rochus.keller@bluewin.ch> wrote: Ok, I see, thank you very much.
It should be officially documented in any case. I'm implementing my first true Oberon validator by just following the language report word by word and got tons of inexplicable errors because of rule simply not describe there (neither in the tutorial). If I want to be able to successfully parse the Oberon System (which seems like an obligatory test case) then I consequently have to implement these specialities as well. I'm not very good at reading Oberon source code (yet) though, so I would prefer a precise and complete language report. Your document is already more precise, as it seems.
Best R.
_______________________________ From: Luca Boasso Sent on: Sat, 07 Dec 2019 03:02:01 +0100 To: rochus.keller@bluewin.ch Cc: Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters
Those particular examples exploit an undocumented loophole in the type system that simplify the writing of lower lever functions. I left that out of my document.
See ORP.Parameter: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN ORG.VarParam(x, par.type)
On Fri, Dec 6, 2019, 17:45 rochus.keller@bluewin.ch <rochus.keller@bluewin.ch> wrote:
This is a very helpful document indeed, thank you very much.
But as it seems it doesn't explain my originally intended examples, e.g FileDir.Mod line 61 or Files.Mod line 104 (the first reported one was unfortunately my mishap, sorry).
Best R. -- 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
Hi, There is a subtle difference between the old rule and the new undocumented Project Oberon compiler extension. In the old rule ARRAY OF SYSTEM.BYTE matched ANY data type. In the new extension, the actual parameter must have the same number of bytes as the formal parameter. Regards, Chris Burrows CFB Software https://www.astrobe.com From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Jörg Sent: Saturday, 7 December 2019 7:10 PM To: ETH Oberon and related systems Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters Hi A little bit of history: In the previous language report, chapter 12 explained that rule https://inf.ethz.ch/personal/wirth/Oberon/Oberon.Report.pdf You had to use SYSTEM.BYTE to enable it. SYSTEM.BYTE disappeared, but the (now undocumented) rule is still there. Br Jörg Am 07.12.2019 um 09:32 schrieb Jörg <joerg.straube@iaeth.ch <mailto:joerg.straube@iaeth.ch> >: In procedure ORP.Parameter() you find: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN Jörg Am 07.12.2019 um 09:21 schrieb Jörg <joerg.straube@iaeth.ch <mailto:joerg.straube@iaeth.ch> >: ARRAY N OF BYTE is compatible to anything as long as the size matches. This comes in handy for low level programming. Jörg Am 07.12.2019 um 08:51 schrieb Luca Boasso <luke.boasso@gmail.com <mailto:luke.boasso@gmail.com> >: To the best of my knowledge, that undocumented feature is the only (intentionally) missing type rule in my document. The type system described is a slight superset of the one implement by the original Oberon-07 RISC compiler. Let me know if you need clarifications on the document. oberonc implements all the rules of that document. You can find comments in the source code referring to the type rules, for example in https://github.com/lboasso/oberonc/blob/master/src/OJP.Mod at line 216: (* Type Rule A, B *) PROCEDURE EqualTypes(t0, t1: OJB.Type): BOOLEAN; BEGIN On Fri, Dec 6, 2019, 19:05 rochus.keller@bluewin.ch <mailto:rochus.keller@bluewin.ch> <rochus.keller@bluewin.ch <mailto:rochus.keller@bluewin.ch> > wrote: Ok, I see, thank you very much. It should be officially documented in any case. I'm implementing my first true Oberon validator by just following the language report word by word and got tons of inexplicable errors because of rule simply not describe there (neither in the tutorial). If I want to be able to successfully parse the Oberon System (which seems like an obligatory test case) then I consequently have to implement these specialities as well. I'm not very good at reading Oberon source code (yet) though, so I would prefer a precise and complete language report. Your document is already more precise, as it seems. Best R. _______________________________ From: Luca Boasso Sent on: Sat, 07 Dec 2019 03:02:01 +0100 To: rochus.keller@bluewin.ch <mailto:rochus.keller@bluewin.ch> Cc: Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters Those particular examples exploit an undocumented loophole in the type system that simplify the writing of lower lever functions. I left that out of my document. See ORP.Parameter: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN ORG.VarParam(x, par.type) On Fri, Dec 6, 2019, 17:45 rochus.keller@bluewin.ch <mailto:rochus.keller@bluewin.ch> <rochus.keller@bluewin.ch <mailto:rochus.keller@bluewin.ch> > wrote: This is a very helpful document indeed, thank you very much. But as it seems it doesn't explain my originally intended examples, e.g FileDir.Mod line 61 or Files.Mod line 104 (the first reported one was unfortunately my mishap, sorry). Best R. -- Oberon@lists.inf.ethz.ch <mailto: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 <mailto:Oberon@lists.inf.ethz.ch> mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
IMHO this "undocumented Project Oberon compiler extension" is bad. First, because it is undocumented. Second, it is non obvious and obscure. In BlackBox it was much more clear I think. Should we not petition the Almighty to do it the BlackBox way? He was one of the directors of that project. The following is from the Component Pascal language report. As you can see, "ANYREC" is relevant in this context, it is documented, and it appearance in the code will make the intention clear. Component Pascal Report: The predeclared type ANYPTR is defined as POINTER TO ANYREC. Any pointer to a record type is therefore an extension of ANYPTR. The procedure NEW cannot be used for variables of type ANYPTR. Each record is implicitly an extension of the predeclared type ANYREC. ANYREC does not contain any fields and can only be used in pointer and variable parameter declarations. Wojtek ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of Chris Burrows [chris@cfbsoftware.com] Sent: Saturday, December 7, 2019 5:03 AM To: 'ETH Oberon and related systems' Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters Hi, There is a subtle difference between the old rule and the new undocumented Project Oberon compiler extension. In the old rule ARRAY OF SYSTEM.BYTE matched ANY data type. In the new extension, the actual parameter must have the same number of bytes as the formal parameter. Regards, Chris Burrows CFB Software From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Jörg Sent: Saturday, 7 December 2019 7:10 PM To: ETH Oberon and related systems Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters Hi A little bit of history: In the previous language report, chapter 12 explained that rule https://inf.ethz.ch/personal/wirth/Oberon/Oberon.Report.pdf You had to use SYSTEM.BYTE to enable it. SYSTEM.BYTE disappeared, but the (now undocumented) rule is still there. Br Jörg Am 07.12.2019 um 09:32 schrieb Jörg <joerg.straube@iaeth.ch<mailto:joerg.straube@iaeth.ch>>: In procedure ORP.Parameter() you find: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN Jörg Am 07.12.2019 um 09:21 schrieb Jörg <joerg.straube@iaeth.ch<mailto:joerg.straube@iaeth.ch>>: ARRAY N OF BYTE is compatible to anything as long as the size matches. This comes in handy for low level programming. Jörg Am 07.12.2019 um 08:51 schrieb Luca Boasso <luke.boasso@gmail.com<mailto:luke.boasso@gmail.com>>: To the best of my knowledge, that undocumented feature is the only (intentionally) missing type rule in my document. The type system described is a slight superset of the one implement by the original Oberon-07 RISC compiler. Let me know if you need clarifications on the document. oberonc implements all the rules of that document. You can find comments in the source code referring to the type rules, for example in https://github.com/lboasso/oberonc/blob/master/src/OJP.Mod at line 216: (* Type Rule A, B *) PROCEDURE EqualTypes(t0, t1: OJB.Type): BOOLEAN; BEGIN On Fri, Dec 6, 2019, 19:05 rochus.keller@bluewin.ch wrote: Ok, I see, thank you very much. It should be officially documented in any case. I'm implementing my first true Oberon validator by just following the language report word by word and got tons of inexplicable errors because of rule simply not describe there (neither in the tutorial). If I want to be able to successfully parse the Oberon System (which seems like an obligatory test case) then I consequently have to implement these specialities as well. I'm not very good at reading Oberon source code (yet) though, so I would prefer a precise and complete language report. Your document is already more precise, as it seems. Best R. _______________________________ From: Luca Boasso Sent on: Sat, 07 Dec 2019 03:02:01 +0100 To: rochus.keller@bluewin.ch<mailto:rochus.keller@bluewin.ch> Cc: Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters Those particular examples exploit an undocumented loophole in the type system that simplify the writing of lower lever functions. I left that out of my document. See ORP.Parameter: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN ORG.VarParam(x, par.type) On Fri, Dec 6, 2019, 17:45 rochus.keller@bluewin.ch<mailto:rochus.keller@bluewin.ch> <rochus.keller@bluewin.ch<mailto:rochus.keller@bluewin.ch>> wrote: This is a very helpful document indeed, thank you very much. But as it seems it doesn't explain my originally intended examples, e.g FileDir.Mod line 61 or Files.Mod line 104 (the first reported one was unfortunately my mishap, sorry). Best R.
There are two separate concepts here. 1. ARRAY N OF BYTE 2. Extensions of an empty RECORD They are mutually exclusive. My post that you replied to is only concerned with 1). Oberon-07 is NOT Component Pascal. They are different for good reason. IMHO experimental undocumented features are part of the natural evolution of a living language. The features that prove themselves over a period of time eventually become part of the language definition - the others just fade away into obscurity. Some are just added for convenience to satisfy peculiar requirements of a particular application (in this case Project Oberon). There are several more in the Project Oberon compiler. I won't mention the others for fear of alarming you further. If they haven't been of any concern to you yet then there's no need to worry about them now. Regards, Chris Chris Burrows CFB Software http://www.astrobe.com
-----Original Message----- From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Skulski, Wojciech Sent: Monday, 9 December 2019 12:13 PM To: ETH Oberon and related systems Subject: Re: [Oberon] Question about Oberon semantics of VAR parameters
IMHO this "undocumented Project Oberon compiler extension" is bad. First, because it is undocumented. Second, it is non obvious and obscure. In BlackBox it was much more clear I think. Should we not petition the Almighty to do it the BlackBox way? He was one of the directors of that project.
The following is from the Component Pascal language report. As you can see, "ANYREC" is relevant in this context, it is documented, and it appearance in the code will make the intention clear.
Component Pascal Report:
The predeclared type ANYPTR is defined as POINTER TO ANYREC. Any pointer to a record type is therefore an extension of ANYPTR. The procedure NEW cannot be used for variables of type ANYPTR.
Each record is implicitly an extension of the predeclared type ANYREC. ANYREC does not contain any fields and can only be used in pointer and variable parameter declarations.
Wojtek ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of Chris Burrows [chris@cfbsoftware.com] Sent: Saturday, December 7, 2019 5:03 AM To: 'ETH Oberon and related systems' Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters
Hi,
There is a subtle difference between the old rule and the new undocumented Project Oberon compiler extension. In the old rule ARRAY OF SYSTEM.BYTE matched ANY data type. In the new extension, the actual parameter must have the same number of bytes as the formal parameter.
Regards, Chris Burrows
CFB Software
From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of J rg Sent: Saturday, 7 December 2019 7:10 PM To: ETH Oberon and related systems Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters
Hi
A little bit of history: In the previous language report, chapter 12 explained that rule https://inf.ethz.ch/personal/wirth/Oberon/Oberon.Report.pdf You had to use SYSTEM.BYTE to enable it. SYSTEM.BYTE disappeared, but the (now undocumented) rule is still there.
Br J rg
Am 07.12.2019 um 09:32 schrieb J rg <joerg.straube@iaeth.ch<mailto:joerg.straube@iaeth.ch>>: ?In procedure ORP.Parameter() you find:
ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN
J rg
Am 07.12.2019 um 09:21 schrieb J rg <joerg.straube@iaeth.ch<mailto:joerg.straube@iaeth.ch>>: ?ARRAY N OF BYTE is compatible to anything as long as the size matches. This comes in handy for low level programming. J rg
Am 07.12.2019 um 08:51 schrieb Luca Boasso <luke.boasso@gmail.com<mailto:luke.boasso@gmail.com>>: ? To the best of my knowledge, that undocumented feature is the only (intentionally) missing type rule in my document. The type system described is a slight superset of the one implement by the original Oberon-07 RISC compiler. Let me know if you need clarifications on the document.
oberonc implements all the rules of that document. You can find comments in the source code referring to the type rules, for example in https://github.com/lboasso/oberonc/blob/master/src/OJP.Mod at line 216:
(* Type Rule A, B *)
PROCEDURE EqualTypes(t0, t1: OJB.Type): BOOLEAN;
BEGIN
On Fri, Dec 6, 2019, 19:05 rochus.keller@bluewin.ch wrote: Ok, I see, thank you very much.
It should be officially documented in any case. I'm implementing my first true Oberon validator by just following the language report word by word and got tons of inexplicable errors because of rule simply not describe there (neither in the tutorial). If I want to be able to successfully parse the Oberon System (which seems like an obligatory test case) then I consequently have to implement these specialities as well. I'm not very good at reading Oberon source code (yet) though, so I would prefer a precise and complete language report. Your document is already more precise, as it seems.
Best R.
_______________________________ From: Luca Boasso Sent on: Sat, 07 Dec 2019 03:02:01 +0100 To: rochus.keller@bluewin.ch<mailto:rochus.keller@bluewin.ch> Cc: Subject: Re: [Oberon] Fwd: Re: Re: Question about Oberon semantics of VAR parameters
Those particular examples exploit an undocumented loophole in the type system that simplify the writing of lower lever functions. I left that out of my document.
See ORP.Parameter: ELSIF (par.type.form = ORB.Array) & (par.type.base = ORB.byteType) & (par.type.len >= 0) & (par.type.size = x.type.size) THEN ORG.VarParam(x, par.type)
On Fri, Dec 6, 2019, 17:45 rochus.keller@bluewin.ch<mailto:rochus.keller@bluewin.ch> <rochus.keller@bluewin.ch<mailto:rochus.keller@bluewin.ch>> wrote:
This is a very helpful document indeed, thank you very much.
But as it seems it doesn't explain my originally intended examples, e.g FileDir.Mod line 61 or Files.Mod line 104 (the first reported one was unfortunately my mishap, sorry).
Best R. -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Chris:
There are several more in the Project Oberon compiler. I won't mention the others for fear of alarming you further. If they haven't been of any concern to you yet then there's no need to worry about them now.
I propose that the compiler documentation should always provide a chapter "All undocumented features of this compiler - please delete this file before opening it". Cheers, Wojtek
Wojtek As Chris pointed out there are other undocumented features in the compiler. We might collect and document them. In most (if not all) cases you can live without them or program around them. They come in handy if you have certain low level needs. The current discussed topic is about loosening the strict typing rules. You mentioned ANYREC and ANYPTR; this is a complete opening up of any type checking. The undocumented feature is something in between: it allows parameter passing of any variable as long as the size fits. This has the benefit that the low layer module offering this capability just sees the passed variable as a specific nbr of bytes. And the higher level module passing the variable declares its logical meaning. But the size of the two involved views of memory must fit. This is better than ANYREC. BTW: Standard Oberon-07 offers (kind of) ANYREC. The discussed topic could be rewritten as follows: Kernel.Mod: ANYREC = RECORD END; Sector = RECORD (ANYREC) buf: ARRAY 1024 OF BYTE END; PROCEDURE GetSector*(src: INTEGER; VAR dst: ANYREC); FileDir.Mod: FileHeader = RECORD (Kernel.ANYREC) mark: INTEGER; name: ARRAY 32 OF CHAR; aleng, bleng, date: INTEGER; ext: ARRAY 12 OF INTEGER; sec: ARRAY 64 OF INTEGER; fill: ARRAY 672 OF BYTE END; With this ANYREC method there is no size checking involved. Br Jörg
Am 09.12.2019 um 05:43 schrieb Skulski, Wojciech <skulski@pas.rochester.edu>:
Chris:
There are several more in the Project Oberon compiler. I won't mention the others for fear of alarming you further. If they haven't been of any concern to you yet then there's no need to worry about them now.
I propose that the compiler documentation should always provide a chapter "All undocumented features of this compiler - please delete this file before opening it".
Cheers, Wojtek
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Joerg: thank you for the comment. I am interested because the main point of FPGA Oberon is "low level needs" in hardware interfacing. It would be good to know all these little and not so little tricks which make it easier. Good documentation of undocumented features would be great. And keep the name "Undocumented features" as a nice joke;-) I like your explanation about interfacing with the low level buffers. I hope it is only enabled with the SYSTEM keyword. If so then it is actually a very neat solution just where it belongs. Thank you, Wojtek ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of Jörg [joerg.straube@iaeth.ch] Sent: Monday, December 9, 2019 3:15 AM To: ETH Oberon and related systems Subject: Re: [Oberon] Question about Oberon semantics of VAR parameters Wojtek As Chris pointed out there are other undocumented features in the compiler. We might collect and document them. In most (if not all) cases you can live without them or program around them. They come in handy if you have certain low level needs. The current discussed topic is about loosening the strict typing rules. You mentioned ANYREC and ANYPTR; this is a complete opening up of any type checking. The undocumented feature is something in between: it allows parameter passing of any variable as long as the size fits. This has the benefit that the low layer module offering this capability just sees the passed variable as a specific nbr of bytes. And the higher level module passing the variable declares its logical meaning. But the size of the two involved views of memory must fit. This is better than ANYREC. BTW: Standard Oberon-07 offers (kind of) ANYREC. The discussed topic could be rewritten as follows: Kernel.Mod: ANYREC = RECORD END; Sector = RECORD (ANYREC) buf: ARRAY 1024 OF BYTE END; PROCEDURE GetSector*(src: INTEGER; VAR dst: ANYREC); FileDir.Mod: FileHeader = RECORD (Kernel.ANYREC) mark: INTEGER; name: ARRAY 32 OF CHAR; aleng, bleng, date: INTEGER; ext: ARRAY 12 OF INTEGER; sec: ARRAY 64 OF INTEGER; fill: ARRAY 672 OF BYTE END; With this ANYREC method there is no size checking involved. Br Jörg
Am 09.12.2019 um 05:43 schrieb Skulski, Wojciech <skulski@pas.rochester.edu>:
Chris:
There are several more in the Project Oberon compiler. I won't mention the others for fear of alarming you further. If they haven't been of any concern to you yet then there's no need to worry about them now.
I propose that the compiler documentation should always provide a chapter "All undocumented features of this compiler - please delete this file before opening it".
Cheers, Wojtek
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.inf.ethz.ch_mailman_listinfo_oberon&d=DwIGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=uUiA_zLpwaGJIlq-_BM9w1wVOuyqPwHi3XzJRa-ybV0&m=o_2RMhgfw_bb7SCocmej1qRyQYU-aA6M2kccNE_1kxQ&s=tZld3Y85H0p8hhO3jGRQvvV2rareqkbTGvlrR0QAmd4&e=
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.inf.ethz.ch_mailman_listinfo_oberon&d=DwIGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=uUiA_zLpwaGJIlq-_BM9w1wVOuyqPwHi3XzJRa-ybV0&m=o_2RMhgfw_bb7SCocmej1qRyQYU-aA6M2kccNE_1kxQ&s=tZld3Y85H0p8hhO3jGRQvvV2rareqkbTGvlrR0QAmd4&e=
participants (5)
-
Chris Burrows -
Jörg -
Luca Boasso -
rochus.keller@bluewin.ch -
Skulski, Wojciech