🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.oberon
Article #1268

Re: Is "POINTER TO ARRAY OF Object" legal?

#1268
From: skulski
Date: Wed, 03 Apr 1996 19:01
44 lines
2237 bytes
In article <3183BF9F.13D9@iis.nsk.su>,
 Alex Nedorya <ned@iis.nsk.su> writes:
> skulski@fermi.nsrl.rochester.edu wrote:
>> 
>> Is the following legal Oberon-2;
>> 
>>         Object* = POINTER TO ObjectDesc;
>>         ObjectDesc* = RECORD END;
>> 
>>         Array* = POINTER TO ARRAY OF Object;
>> 
>> It compiles OK under Linux V4-0.9. However, I was told of at least
>> one compiler Oberon-2 which does not compile this. Is the above
>> construct legal, or is the said compiler broken?
>> 
>> Pls note, that for example Kepler uses the following to represent
>> objects:                StarTab = POINTER TO ARRAY OF LONGINT;
>> with calls to SYSTEM.VAL to convert POINTERS to  LONGINTs.
>> 
>> So, there is a potential problem here which Josef wanted to avoid.
>>
>> Is the "POINTER TO ARRAY OF Object" good legal Oberon, or is it not?
> 
> It is a good legal Oberon, no doubt.
> What can be wrong with POINTER TO ARRAY OF POINTER?

 I was told that some older implementations of GC had problems with 
this. 

> 
> I've checked (under XDS) POINTER TO ARRAY OF ObjectDesc, 
  because SIZE(ObjectDesc) is zero and it can 
> cause a problem (array which element is of zero size), 
  but both cases work OK.

Well, the purpose of Array is not to be used with Objects as such, but 
with extensions of Objects. I have implemented an indexable array 
of arbitrary Objects this way. (As a self advertisement, let me remind
that it is available from ftp://nuchem.nsrl.rochester.edu/pub/Oberon/Objects.
It is a data-management library with recursive abstract Containers,
whose concrete realisations are a List and the said array. The whole 
thing has also a platform-independent storage and a few other features.)

Wojtek
Technical Details
Message-ID: <1996Apr3.140147.1@fermi.nsrl.rochester.edu>
Path: arc1-ca.pugleaf.net!fermi.nsrl.rochester.edu!skulski
References: <1996Apr1.191755.1@fermi.nsrl.rochester.edu> <3183BF9F.13D9@iis.nsk.su>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.oberon
Path: arc1-ca.pugleaf.net!fermi.nsrl.rochester.edu!skulski
From: skulski@fermi.nsrl.rochester.edu
Subject: Re: Is "POINTER TO ARRAY OF Object" legal?
Message-ID: <1996Apr3.140147.1@fermi.nsrl.rochester.edu>
Sender: news@galileo.cc.rochester.edu
Nntp-Posting-Host: nsrlc6.nsrl.rochester.edu
Organization: Nuclear Structure Research Laboratory
References: <1996Apr1.191755.1@fermi.nsrl.rochester.edu> <3183BF9F.13D9@iis.nsk.su>
Date: 3 Apr 96 14:01:47 -0500