Article View: comp.lang.oberon
Article #1273Re: Is "POINTER TO ARRAY OF Object" legal?
From: Simon Egli
Date: Thu, 04 Apr 1996 09:02
Date: Thu, 04 Apr 1996 09:02
51 lines
2492 bytes
2492 bytes
In article <1996Apr3.140147.1@fermi.nsrl.rochester.edu>, skulski@fermi.nsrl.rochester.edu writes: > 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 As far as I know, the GC of Mac Oberon V4 & Ceres don't mark pointers in arrays. But anyway, this is an implementation restriction, and your code is legal Oberon. Simi
Technical Details
Message-ID:
<1996Apr4.100235.46249@yogi.urz.unibas.ch>Path:
arc1-ca.pugleaf.net!ubaclu.unibas.ch!eglisReferences:
<1996Apr1.191755.1@fermi.nsrl.rochester.edu> <1996Apr3.140147.1@fermi.nsrl.rochester.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ubaclu.unibas.ch!eglis From: eglis@ubaclu.unibas.ch (Simon Egli) Newsgroups: comp.lang.oberon Subject: Re: Is "POINTER TO ARRAY OF Object" legal? Message-ID: <1996Apr4.100235.46249@yogi.urz.unibas.ch> Date: 4 Apr 96 10:02:35 MET References: <1996Apr1.191755.1@fermi.nsrl.rochester.edu> <1996Apr3.140147.1@fermi.nsrl.rochester.edu> Organization: University of Basel, Switzerland