[M3devel] reference to globals in globals?
Rodney M. Bates
rodney_bates at lcwb.coop
Thu Aug 16 18:40:45 CEST 2012
On 08/15/2012 08:14 PM, Daniel Alejandro Benavides D. wrote:
> 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
>
I think here, "top" means outermost in the nested scopes of a compilation.
That is, a "top-level" procedure is declared immediately inside an interface
or module, not inside any procedure or block.
This is an entirely different hierarchy from that of interfaces importing
other interfaces, where the "bottom of the world" phrase is used to mean
these types do not refer to any other imported interface.
Oddly, I have heard this second sense referred to as the "top" of a type
hierarchy, but that usage is highly counterintuitive to me.
> --- 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
>
More information about the M3devel
mailing list