1. Re: More Namespace

On Tue, 28 Sep 1999, you wrote:
> You have my vote! globals remain wide global... it's clear English (and
> french too).

Whatever approach is taken, I hope that it does not require _any_ modification
to included library files. The reason? If I modify Jiri's font library to work
with my program, and Ralf modifies Jiri's library to work with _his_ program,
which version is going to work for Raude when he downloads and tries our
programs? How many slightly different copies will be out there, all with the
same name? When you download a new program, will some of your old programs
cease to work?  Not to mention that modifying the code would break the "free"
use of that file.

A suggestion: suppose the keyword "as" was added to Euphoria.
It would allow us to do the following:

include jirifonts.e as jfont
include ralffonts.e as rfont

Euphoria could prepend a token to the globals from the two libraries so that
they could be sorted out later. Perhaps like this:
jfont.color = BLUE
rfont.color = {RED,BLACK}
or, a method that is available in Pascal, and generally works very well:
with jfont do
  color = BLUE -- color is Jiri's color variable
                     -- BLUE is Jiri's version of BLUE if it exists,
                     -- if not, the global is selected, or an error message
                    -- is issued if there is no global by that name
  ...more stuff with jiri's font file
end with

Without the keyword "as" things would work as they do now.

My real wish would be for some kind of association between a variable and
a list of constants which is used to reference slices of that variable.
So that, for example, spaceship[COORDS] and target[COORDS] could be declared,
and referenced, even tho the spaceship[COORDS] might be the first slice of
the sequence "spaceship", and target[COORDS] might be the fifth slice or
sequence "target". Hopefully the method above would accomplish this as well.

Regards,
Irv

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu