Discussion:
Dereferencing Result of Function
(too old to reply)
August Karlstrom
2005-10-31 13:31:50 UTC
Permalink
Hi everyone,

Why does Oberon disallow dereferencing a function result, like in

x.Func(y)^.z

OK, the obvious answer is that according to the language report `.',
`[...]', `^' and function call `(...)' can only occur in designators
(they are not operators like in C). But is this just to keep the
language report short or does it present a real difficulty to the
compiler, make the language "unsafe" in any way or complicates the
language semantics?


August
Ulrich
2005-10-31 18:58:15 UTC
Permalink
Post by August Karlstrom
Hi everyone,
Why does Oberon disallow dereferencing a function result, like in
x.Func(y)^.z
OK, the obvious answer is that according to the language report `.',
`[...]', `^' and function call `(...)' can only occur in designators
(they are not operators like in C). But is this just to keep the
language report short or does it present a real difficulty to the
compiler, make the language "unsafe" in any way or complicates the
language semantics?
August
Es macht den Übersetzer komplexer - insbesondere auch das Erzeugen von Prozessorinstruktionen. Es gibt schon genug Fälle, bei
denen die Register ausgehen. Auch verleitet diese Möglichkeit zum Schreiben von Ungetümen.

In Component Pascal ist das übrigens erlaubt; mir sind keine technischen Komplikationen bekannt.

In Oberon würde man im obigen Beispiel aber den Aufwärtspfeil weglassen.
Loading...