[M3devel] reference to globals in globals?
Daniel Alejandro Benavides D.
dabenavidesd at yahoo.es
Thu Aug 16 03:14:27 CEST 2012
Hi all:
For sure, do you mean Top in type sense? RT0 is the bottom of the world, but type here are "bottom of the world"
http://modula3.elegosoft.com/cm3/doc/help/gen_html/m3core/src/runtime/common/RT0.i3.html
Thanks in advance
--- El mié, 15/8/12, Hendrik Boom <hendrik at topoi.pooq.com> escribió:
De: Hendrik Boom <hendrik at topoi.pooq.com>
Asunto: Re: [M3devel] reference to globals in globals?
Para: m3devel at elegosoft.com
Fecha: miércoles, 15 de agosto, 2012 19:55
On Wed, Aug 15, 2012 at 09:51:41AM -0500, Rodney M. Bates wrote:
>
>
> On 08/14/2012 10:04 PM, Jay K wrote:
> >
> >Heck, even if these weren't global, is it that unreasonble,
> >from the programmer's point of view, for the language/compiler
> >to do some pointer escape analysis and let me take the address
> >of a local, as long as I don't store it somewhere that outlives
> >the local?
> >
>
> This is ultimately an undecidable problem and even conservative
> approximations of reasonable sophistication are far too involved
> for a language to require of every compiler.
Not to mention the obscurityof the language definition.
But isn't there something like that with the addresses of top-level
proocedures? the ones whose environments are completely static?
Or am I thinking of another type-safe language? Or am I thinking of
assigning the procedures themselves?
-- hendrik
> Of course, safe languages occasionally make you unnecessarily write a bit more
> code to do it the safe way. E.g., the famous fake pointer to the root of a
> linked list example.
You mean something like (in C with probable errors)
list **p, *q;
make q point to some linked list
for ( p = &q; *p != NIL; p = &((*p)->next))
{
And here you can easily delete elements by *p = (*p) -> next
}
This can be done prefectly type-safe in languages that allow
REF REF list
Or is there some other fake pointer trick you're talking about?
-- hendrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120816/fd66b71e/attachment-0002.html>
More information about the M3devel
mailing list