🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.oberon
Article #1350

Oberon-2 Inconsistencies

#1350
From: Michael Griebling
Date: Sat, 20 Apr 1996 20:28
62 lines
2506 bytes
The members of the OOC project would like to start a discussion to resolve
some issues in the area of compiler-related legalities.  We have found that
various compilers treat the following topics differently either because the
language reference doesn't cover the issue or there may be some interpretation
differences.

These items are presented in no particular order:

1) INC/DEC

Is the following statement legal?
  VAR s: SHORTINT; i: INTEGER;
  ...
  INC (i, s)
Looking into the report I'd say yes, but some ETH compilers say no.
[I haven't checked this in the last few years, though.]

Some compilers also allow the following:

  VAR s: SomePtr;

  INC (SYSTEM.VAL(LONGINT, s), 4);

Our reading of the Oberon report says this is illegal.  Is the VAL
just a type-casting mechanism or is it to be treated as a function?
If the latter, why is the above syntax accepted by some ETH compilers?

----------------------------------------------------------------------

2) Order of declaration of type-bound procedures

Is the following sequence of tb-procs legal?
  TYPE R1 = RECORD END; R2 = RECORD (R1) END;
  ...
  PROCEDURE (VAR r: R2) P;
    END P;

  PROCEDURE (VAR r: R1) P;
    END P;
The report doesn't say anything about this, and some ETH compilers say
no.  Matters get more complicated if the formal parameters of R1.P and
R2.P differ (in this case it _is_ an error).
[I haven't checked this at all, I think Juergen told me about it.]

----------------------------------------------------------------------

3) The infamous WITH

Should a procedure's parameter change it's type in the procedure's
formal parameter list if it's guarded by WITH?
[I had mail from Templ on this.  He said this peculiar behaviour is
covered by the report and quoted the relevant section to me.  I'm not
convinced, though.  Lost the mail, too :-( ]

----------------------------------------------------------------------

4) Is type testing/guarding a NIL pointer legal?

Oakwood says no, but this topic creeps up now and then in the news.


-- From the OOC Development Group
Technical Details
Message-ID: <2065.6684T371T1766@inforamp.net>
Path: arc1-ca.pugleaf.net!inforamp.net!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!inforamp.net!usenet
From: grieblm@inforamp.net (Michael Griebling)
Newsgroups: comp.lang.oberon
Subject: Oberon-2 Inconsistencies
Date: 20 Apr 1996 20:28:33 GMT
Organization: InfoRamp Inc., Toronto, Ontario (416) 363-9100
Message-ID: <2065.6684T371T1766@inforamp.net>
NNTP-Posting-Host: ts22-07.tor.istar.ca
X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*