Namespacing for modules (silent overwriting in cases of name collision?)
jpl
jpl.algol68@gmail.com
Thu Jan 29 20:53:35 GMT 2026
Oh Man,
This is embarassing, as soon as I read the "But if you do: access A access B..."
I recognized this from my earlier reading in the "The GNU Algol 68
Compiler" manual.
Damn. Just plain forgot that.
Right, I did the:
access ModA
acess ModB
So, ghosting is working exactly as documented.
Well, in order to salvage something out of this. Would it ever be
possible to have namespacing with modules?
Thanks for your patience with this.
/James
On Thu, Jan 29, 2026 at 8:44 PM Jose E. Marchesi <jemarch@gnu.org> wrote:
>
>
> > Hello All,
> >
> > Been experimenting more and having waaaaaay too much fun doing so. I
> > am looking forward to being able to program more and more in this
> > language. (The fft library is coming along nicely!)
> >
> > In my recent experimentation, I created two different modules that had
> > similarly named pub procedures. Everything compiled and linked just
> > fine. However, of the two similarly named exported procedures, it was
> > the one from the "accessed module" listed second that would be run in
> > the executable code.
> >
> > This is understandable. However, it does raise a few questions:
> >
> > 1) Is there some way to obtain "namespacing" of modules that I am
> > simply unaware of?
> >
> > 2) If this not possible presently, might this become possible at some
> > point in time? (Or is this just inherently completely impossible?)
> >
> > 3) Should this name collision be a compilation/linker "error", or a
> > "warning message"?
>
> I am a little surprised.
>
> If you have modules A and B and both modules publicize the same
> identifier, if you do:
>
>
> access A, B (...) or access A, B def ... fed
>
> Then you should get a compile error message.
>
> But if you do:
>
> access A access B (...)
>
>
> Then the definition in B will ghost the definition in A.
>
> Still you should be able to get a warning in that case if you use
> -Whidden-declarations=all.
>
> Is that not the case?
>
>
> >
> > Regards,
> > James
> >
> > PS Please disregard if this is bothersome question. I can respect that.
More information about the Algol68
mailing list