1. Namespace request

Rob, can you change namespacing so that more than one file can be included into
the same namespace?

Here is an example of what I want to do:

include misc.e as rds
include machine.e as rds
include dll.e as rds

Currently the interpreter gives an error.

Rationale: I want to use namespaces in a file that is intended to be included by
another so as to avoid conflicts in user programs. But when I know that there
will be no conflicts within the files that I'm including I don't want to make a
new namespace for every single include. This will also help prevent namespace
pollution by reducing the number of unique namespaces that a program needs to
come up with.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » topic index » view message » categorize

2. Re: Namespace request

Jason Gade wrote:
> 
> Rob, can you change namespacing so that more than one file can be included
> into
> the same namespace?
> 
> Here is an example of what I want to do:
> 
> include misc.e as rds
> include machine.e as rds
> include dll.e as rds
> 
> Currently the interpreter gives an error.
> 
> Rationale: I want to use namespaces in a file that is intended to be included
> by another so as to avoid conflicts in user programs. But when I know that
> there
> will be no conflicts within the files that I'm including I don't want to make
> a new namespace for every single include. This will also help prevent
> namespace
> pollution by reducing the number of unique namespaces that a program needs to
> come up with.
> 
> --
> "Any programming problem can be solved by adding a level of indirection."
> --anonymous
> "Any performance problem can be solved by removing a level of indirection."
> --M. Haertel
> j.

Hi there,


So i guess you're saying you want to include multiple files under the
same namespace so functions can be called in multiple files using
the same prefix...interesting...



Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

3. Re: Namespace request

Al Getz wrote:
> 
> Jason Gade wrote:
> > 
> > Rob, can you change namespacing so that more than one file can be included
> > into
> > the same namespace?
> > 
> > Here is an example of what I want to do:
> > 
> > include misc.e as rds
> > include machine.e as rds
> > include dll.e as rds
> > 
> > Currently the interpreter gives an error.
> > 
> > Rationale: I want to use namespaces in a file that is intended to be
> > included
> > by another so as to avoid conflicts in user programs. But when I know that
> > there
> > will be no conflicts within the files that I'm including I don't want to
> > make
> > a new namespace for every single include. This will also help prevent
> > namespace
> > pollution by reducing the number of unique namespaces that a program needs
> > to
> > come up with.
> 
> Hi there,
> 
> 
> So i guess you're saying you want to include multiple files under the
> same namespace so functions can be called in multiple files using
> the same prefix...interesting...

Yes. That's the way it works in C++, several related includes are part of the
same namespace. C++ also has the 'using namespace' keyword.

But right now I'm looking through the listserv archives to understand better how
namespace rules actually work. I've noticed so far that they don't exactly do
what I think they do.

So far I've found that using namespaces within a library won't prevent symbol
conflicts in user programs, though using them might make them easier to fix. The
user program will still have to use a namespace when a conflict arises.

By my example, I don't really expect there to be a symbol conflict with RDS
libs, but I was trying to be "future proof" and protect the user from having to
worry about it.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Namespace request

Jason Gade wrote:
> 
> Rob, can you change namespacing so that more than one file can be included
> into
> the same namespace?
> 
> Here is an example of what I want to do:
> 
> include misc.e as rds
> include machine.e as rds
> include dll.e as rds
> 
> Currently the interpreter gives an error.
> 
> Rationale: I want to use namespaces in a file that is intended to be included
> by another so as to avoid conflicts in user programs. But when I know that
> there
> will be no conflicts within the files that I'm including I don't want to make
> a new namespace for every single include. This will also help prevent
> namespace
> pollution by reducing the number of unique namespaces that a program needs to
> come up with.
> 
> --
> "Any programming problem can be solved by adding a level of indirection."
> --anonymous
> "Any performance problem can be solved by removing a level of indirection."
> --M. Haertel
> j.

Hi Jason,

I don't think agree with this idea.

Heres why:

What if you had two or more files with globals with the same name? If those two
files where assigned the same namespace how would you differentiate, for example,
between the "foo" routines, variables, or constants in the multiple files under
the same namespace? Or maybe there is something I'm not understanding here?

Now that Robert has agreed to fix, in my opionion, the biggest potential problem
with Euphoria, I think we should let him be with all the feature requests. I
don't want him to think that now that he's granted a feature that we will expect
more and more. Maybe that is the case for some people, but not with me.

I bet Robert has enough feature ideas to keep him going for many releases after
Euphoria v3.0. Lets let him use them all before requesting a whole bunch more.


Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

5. Re: Namespace request

Vincent wrote:
> 
> Jason Gade wrote:
> > 
> > Rob, can you change namespacing so that more than one file can be included
> > into
> > the same namespace?
> > 
> > Here is an example of what I want to do:
> > 
> > include misc.e as rds
> > include machine.e as rds
> > include dll.e as rds
> > 
> > Currently the interpreter gives an error.
> > 
> > Rationale: I want to use namespaces in a file that is intended to be
> > included
> > by another so as to avoid conflicts in user programs. But when I know that
> > there
> > will be no conflicts within the files that I'm including I don't want to
> > make
> > a new namespace for every single include. This will also help prevent
> > namespace
> > pollution by reducing the number of unique namespaces that a program needs
> > to
> > come up with.
> 
> Hi Jason,
> 
> I don't think agree with this idea.
> 
> Heres why:
> 
> What if you had two or more files with globals with the same name? If those
> two files where assigned the same namespace how would you differentiate, for
> example, between the "foo" routines, variables, or constants in the multiple
> files under the same namespace? Or maybe there is something I'm not
> understanding
> here?

See in my post where I say "But when I know that there will be no conflicts
within the files that I'm including I don't want to make a new namespace for
every single include."

If you include two files *without* a namespace qualifier you get an error when
trying to reference conflicting symbols. So your example should still be an
error.

> Now that Robert has agreed to fix, in my opionion, the biggest potential
> problem
> with Euphoria, I think we should let him be with all the feature requests. I
> don't want him to think that now that he's granted a feature that we will
> expect
> more and more. Maybe that is the case for some people, but not with me.
> 
> I bet Robert has enough feature ideas to keep him going for many releases
> after
> Euphoria v3.0. Lets let him use them all before requesting a whole bunch more.
> 
> 
> Regards,
> Vincent

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Namespace request

Jason Gade wrote:
> 
> Al Getz wrote:
> > 
> > Jason Gade wrote:
> > > 
> > > Rob, can you change namespacing so that more than one file can be included
> > > into
> > > the same namespace?
> > > 
> > > Here is an example of what I want to do:
> > > 
> > > include misc.e as rds
> > > include machine.e as rds
> > > include dll.e as rds
> > > 
> > > Currently the interpreter gives an error.
> > > 
> > > Rationale: I want to use namespaces in a file that is intended to be
> > > included
> > > by another so as to avoid conflicts in user programs. But when I know that
> > > there
> > > will be no conflicts within the files that I'm including I don't want to
> > > make
> > > a new namespace for every single include. This will also help prevent
> > > namespace
> > > pollution by reducing the number of unique namespaces that a program needs
> > > to
> > > come up with.
> > 
> > Hi there,
> > 
> > 
> > So i guess you're saying you want to include multiple files under the
> > same namespace so functions can be called in multiple files using
> > the same prefix...interesting...
> 
> Yes. That's the way it works in C++, several related includes are part of the
> same namespace. C++ also has the 'using namespace' keyword.
> 
> But right now I'm looking through the listserv archives to understand better
> how namespace rules actually work. I've noticed so far that they don't exactly
> do what I think they do.
> 
> So far I've found that using namespaces within a library won't prevent symbol
> conflicts in user programs, though using them might make them easier to fix.
> The user program will still have to use a namespace when a conflict arises.
> 
> By my example, I don't really expect there to be a symbol conflict with RDS
> libs, but I was trying to be "future proof" and protect the user from having
> to worry about it.
> 
> --
> "Any programming problem can be solved by adding a level of indirection."
> --anonymous
> "Any performance problem can be solved by removing a level of indirection."
> --M. Haertel
> j.

Hi again,

I guess there are good points to this and bad points, but i havent
thought it all through myself yet.
I wanted to be able to include the same file more than once (which
would be easy in the source code) and have it load again so that 
local variables get repeated:

--Start Manager.ew
  atom a
  global procedure LoadA(atom x)
    a=x
  end procedure
  global function GetA()
    return a
  end function
--End Manager.ew

  include Manager.ew as M1
  include Manager.ew as M2

  M1:LoadA(10)
  M2:LoadA(20)

  ?M1:GetA() --prints "10"
  ?M2:GetA() --prints "20"

Currently, you have to copy and rename Manager.ew and included it a second
time with it's new name
  include Manager1.ew as M1
  include Manager2.ew as M2

If we could include the same file twice and get a new instance loaded
(as per code far above) we would be able to handle files as entire
objects, which would increase the functionality of Euphoria quite a bit.
Imagine being able to write a 'class' file as an include file that had
all kinds of functionality including functions AND data structures,
and in one line be able to repeat that 'object' 
  include MyClass.ew as Class1
  include MyClass.ew as Class2

Add to that the ability to index and WOW we've got incredible functionality:
  Class={1,2,3,4,5}
  for k=1 to 5 do
    include MyClass.ew as Class[k]
  end for
and suddenly we can index entire classes:
  data1=Class[1]:data
  data2=Class[2]:data
  etc.

WOW!!!!!!!!


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

7. Re: Namespace request

Jason Gade wrote:

> See in my post where I say "But when I know that there will be no conflicts
> within the files that I'm including I don't want to make a new namespace for
> every single include."
> 
> If you include two files *without* a namespace qualifier you get an error when
> trying to reference conflicting symbols. So your example should still be an
> error.
> 
> j.

I understand your reason for wanting this but it gives the opportunity for the
user to make another possible problem. The namespace was implemented to solve the
problem with conflicting symbols. With your method it is possible for problems to
occur without a namespace identifier and with one holding the same named symbols
from two or more different files.

I had a very difficult time convincing Rob to fix the duplicate filename issue.
Do you really think you could convince Rob or even the majority of us to agree
with this concept?

No offense. smile


Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

8. Re: Namespace request

Vincent wrote:
> 
> Jason Gade wrote:
> 
> > See in my post where I say "But when I know that there will be no conflicts
> > within the files that I'm including I don't want to make a new namespace for
> > every single include."
> > 
> > If you include two files *without* a namespace qualifier you get an error
> > when
> > trying to reference conflicting symbols. So your example should still be an
> > error.
> > 
> > j.
> 
> I understand your reason for wanting this but it gives the opportunity for the
> user to make another possible problem. The namespace was implemented to solve
> the problem with conflicting symbols. With your method it is possible for
> problems
> to occur without a namespace identifier and with one holding the same named
> symbols from two or more different files.

I understand what you are saying, but I disagree. If this was implemented and I
tried to include two files in the same namespace AND if I got an error because of
a conflict, I would change one of the namespaces. That is the same thing I would
do now if I included two files without namespaces and got an error because of a
conflict.

Since I am writing a library, it will have *ZERO* affect on users of my library.
Just on me.

Now when I originally posted the question, I thought that namespaces worked
differently than they do. I've since found that no matter what namespace I use in
my library, it will not prevent a conflict in a user's program. So the point is
probably moot.

When writing libraries, I should be very careful of what I include so that I
don't introduce naming conflicts further downstream.


> 
> I had a very difficult time convincing Rob to fix the duplicate filename
> issue.
> Do you really think you could convince Rob or even the majority of us to agree
> with this concept?

No. I don't expect I'll have any chance of convincing Rob. Convincing other
users, well maybe...

> 
> No offense. smile
None taken. smile

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Namespace request

Al Getz wrote:
> 
> Jason Gade wrote:
> > 
> > Al Getz wrote:
> > > 
> > > Jason Gade wrote:
> > > > 
> > > > Rob, can you change namespacing so that more than one file can be
> > > > included
> into</font></i>
> > > > the same namespace?
> > > > 
> > > > Here is an example of what I want to do:
> > > > 
> > > > include misc.e as rds
> > > > include machine.e as rds
> > > > include dll.e as rds
> > > > 
> > > > Currently the interpreter gives an error.
> > > > 
> > > > Rationale: I want to use namespaces in a file that is intended to be
> > > > included
> > > > by another so as to avoid conflicts in user programs. But when I know
> > > > that
> there</font></i>
> > > > will be no conflicts within the files that I'm including I don't want to
> > > > make
> > > > a new namespace for every single include. This will also help prevent
> > > > namespace
> > > > pollution by reducing the number of unique namespaces that a program
> > > > needs to
> > > > come up with.
> > > 
> > > Hi there,
> > > 
> > > 
> > > So i guess you're saying you want to include multiple files under the
> > > same namespace so functions can be called in multiple files using
> > > the same prefix...interesting...
> > 
> > Yes. That's the way it works in C++, several related includes are part of
> > the
> > same namespace. C++ also has the 'using namespace' keyword.
> > 
> > But right now I'm looking through the listserv archives to understand better
> > how namespace rules actually work. I've noticed so far that they don't
> > exactly
> > do what I think they do.
> > 
> > So far I've found that using namespaces within a library won't prevent
> > symbol
> > conflicts in user programs, though using them might make them easier to fix.
> > The user program will still have to use a namespace when a conflict arises.
> > 
> > By my example, I don't really expect there to be a symbol conflict with RDS
> > libs, but I was trying to be "future proof" and protect the user from having
> > to worry about it.
> > 
> > --
> > "Any programming problem can be solved by adding a level of indirection."
> > --anonymous
> > "Any performance problem can be solved by removing a level of indirection."
> > --M. Haertel
> > j.
> 
> Hi again,
> 
> I guess there are good points to this and bad points, but i havent
> thought it all through myself yet.
> I wanted to be able to include the same file more than once (which
> would be easy in the source code) and have it load again so that 
> local variables get repeated:
> 
> --Start Manager.ew
>   atom a
>   global procedure LoadA(atom x)
>     a=x
>   end procedure
>   global function GetA()
>     return a
>   end function
> --End Manager.ew
> 
>   include Manager.ew as M1
>   include Manager.ew as M2
> 
>   M1:LoadA(10)
>   M2:LoadA(20)
> 
>   ?M1:GetA() --prints "10"
>   ?M2:GetA() --prints "20"
> 
> Currently, you have to copy and rename Manager.ew and included it a second
> time with it's new name
>   include Manager1.ew as M1
>   include Manager2.ew as M2
> 
> If we could include the same file twice and get a new instance loaded
> (as per code far above) we would be able to handle files as entire
> objects, which would increase the functionality of Euphoria quite a bit.
> Imagine being able to write a 'class' file as an include file that had
> all kinds of functionality including functions AND data structures,
> and in one line be able to repeat that 'object' 
>   include MyClass.ew as Class1
>   include MyClass.ew as Class2
> 
> Add to that the ability to index and WOW we've got incredible functionality:
>   Class={1,2,3,4,5}
>   for k=1 to 5 do
>     include MyClass.ew as Class[k]
>   end for
> and suddenly we can index entire classes:
>   data1=Class[1]:data
>   data2=Class[2]:data
>   etc.
> 
> WOW!!!!!!!!
> 
> 
> Al
> 
> 
> My bumper sticker: "I brake for LED's"

I really wish that it worked that way, too. I've lobbied for it in the past
(except for the include as Class[k] bit -- Beautiful! I can see all kinds of
possibilities). I think that it would provide more modularity and make OO like
you are proposing easier.

But RDS is extremely unlikely to implement it because... well because Rob likes
the way includes work now! In fact, I'm still surprised that Vincent finally got
him to give a little slack on the
includes-with-the-same-filename-but-different-paths problem.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

10. Re: Namespace request

Jason Gade wrote:
> 
> Al Getz wrote:
> > 
> > Jason Gade wrote:
> > > 
> > > Al Getz wrote:
> > > > 
> > > > Jason Gade wrote:
> > > > > 
> > > > > Rob, can you change namespacing so that more than one file can be
> > > > > included
> > into</font></i>
> > > > > the same namespace?
> > > > > 
> > > > > Here is an example of what I want to do:
> > > > > 
> > > > > include misc.e as rds
> > > > > include machine.e as rds
> > > > > include dll.e as rds
> > > > > 
> > > > > Currently the interpreter gives an error.
> > > > > 
> > > > > Rationale: I want to use namespaces in a file that is intended to be
> > > > > included
> > > > > by another so as to avoid conflicts in user programs. But when I know
> > > > > that
> > there</font></i>
> > > > > will be no conflicts within the files that I'm including I don't want
> > > > > to
> make</font></i>
> > > > > a new namespace for every single include. This will also help prevent
> > > > > namespace
> > > > > pollution by reducing the number of unique namespaces that a program
> > > > > needs
> to</font></i>
> > > > > come up with.
> > > > 
> > > > Hi there,
> > > > 
> > > > 
> > > > So i guess you're saying you want to include multiple files under the
> > > > same namespace so functions can be called in multiple files using
> > > > the same prefix...interesting...
> > > 
> > > Yes. That's the way it works in C++, several related includes are part of
> > > the
> > > same namespace. C++ also has the 'using namespace' keyword.
> > > 
> > > But right now I'm looking through the listserv archives to understand
> > > better
> > > how namespace rules actually work. I've noticed so far that they don't
> > > exactly
> > > do what I think they do.
> > > 
> > > So far I've found that using namespaces within a library won't prevent
> > > symbol
> > > conflicts in user programs, though using them might make them easier to
> > > fix.
> > > The user program will still have to use a namespace when a conflict
> > > arises.
> > > 
> > > By my example, I don't really expect there to be a symbol conflict with
> > > RDS
> > > libs, but I was trying to be "future proof" and protect the user from
> > > having
> > > to worry about it.
> > > 
> > > --
> > > "Any programming problem can be solved by adding a level of indirection."
> > > --anonymous
> > > "Any performance problem can be solved by removing a level of
> > > indirection."
> > > --M. Haertel
> > > j.
> > 
> > Hi again,
> > 
> > I guess there are good points to this and bad points, but i havent
> > thought it all through myself yet.
> > I wanted to be able to include the same file more than once (which
> > would be easy in the source code) and have it load again so that 
> > local variables get repeated:
> > 
> > --Start Manager.ew
> >   atom a
> >   global procedure LoadA(atom x)
> >     a=x
> >   end procedure
> >   global function GetA()
> >     return a
> >   end function
> > --End Manager.ew
> > 
> >   include Manager.ew as M1
> >   include Manager.ew as M2
> > 
> >   M1:LoadA(10)
> >   M2:LoadA(20)
> > 
> >   ?M1:GetA() --prints "10"
> >   ?M2:GetA() --prints "20"
> > 
> > Currently, you have to copy and rename Manager.ew and included it a second
> > time with it's new name
> >   include Manager1.ew as M1
> >   include Manager2.ew as M2
> > 
> > If we could include the same file twice and get a new instance loaded
> > (as per code far above) we would be able to handle files as entire
> > objects, which would increase the functionality of Euphoria quite a bit.
> > Imagine being able to write a 'class' file as an include file that had
> > all kinds of functionality including functions AND data structures,
> > and in one line be able to repeat that 'object' 
> >   include MyClass.ew as Class1
> >   include MyClass.ew as Class2
> > 
> > Add to that the ability to index and WOW we've got incredible functionality:
> >   Class={1,2,3,4,5}
> >   for k=1 to 5 do
> >     include MyClass.ew as Class[k]
> >   end for
> > and suddenly we can index entire classes:
> >   data1=Class[1]:data
> >   data2=Class[2]:data
> >   etc.
> > 
> > WOW!!!!!!!!
> > 
> > 
> > Al
> > 
> > 
> > My bumper sticker: "I brake for LED's"
> 
> I really wish that it worked that way, too. I've lobbied for it in the past
<snip>


He he, yeah :)


I think that neither Rob nor anyone else truely understands the power
of programming that would come out of something like this.  To be able
to declare a class the same way you declare a variable like 'atom x'
is quite a powerful programming technique, and the logic behind it
stems from the way a language progresses anyway:

  You start with variables, which you include by declaring them:
    atom a
  You move toward 'groups' of these things:
    sequence s
    s={0,1,23,4}
  You add function calls:
    x=myfunc()
  You add 'include' files which allow you to keep functions and
  data (variables) in the same file as a set of functions and data.

  A logical next step is to be able to declare your built up
  function/data groups as a single object which can be repeated
  the same way you declare a 'normal' variable:
    Normal var (Euphoria allows many atoms to be declared):
      atom a
      atom b
    Group (Class):
      include MyGroup.ew as MG1
      include MyGroup.ew as MG2

  and now we have two groups to use as well as two atoms.

  Maybe a better wording would have been:
     atom a,b
     group("MyGroup.ew") MG1, MG2
  so it ends up being something like a 'type', only a prefix instead.

  I guess another keyword would be more clear:

  include class MyGroup.ew as MG1
  include class MyGroup.ew as MG2

  ie a Euphoria with classes :)  (the word 'include' is optional).


Euphoria allows you to 'include' as many atoms and sequences as
you care to declare, so why not allow you to include (declare) as
many custom built objects as you care to ?
Think also about how fast it would be to wrap a class object?
You wouldnt have to try to 'sequence the living carp' out of 
everything he he :)  (ie stick every dang thing into some sequence
somewhere AND maintain them all).


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

11. Re: Namespace request

Al Getz wrote:

<snip>

> I think that neither Rob nor anyone else truely understands the power
> of programming that would come out of something like this.  To be able
> to declare a class the same way you declare a variable like 'atom x'
> is quite a powerful programming technique, and the logic behind it
> stems from the way a language progresses anyway:
> 
>   You start with variables, which you include by declaring them:
>     atom a
>   You move toward 'groups' of these things:
>     sequence s
>     s={0,1,23,4}
>   You add function calls:
>     x=myfunc()
>   You add 'include' files which allow you to keep functions and
>   data (variables) in the same file as a set of functions and data.
> 
>   A logical next step is to be able to declare your built up
>   function/data groups as a single object which can be repeated
>   the same way you declare a 'normal' variable:
>     Normal var (Euphoria allows many atoms to be declared):
>       atom a
>       atom b
>     Group (Class):
>       include MyGroup.ew as MG1
>       include MyGroup.ew as MG2
> 
>   and now we have two groups to use as well as two atoms.
> 
>   Maybe a better wording would have been:
>      atom a,b
>      group("MyGroup.ew") MG1, MG2
>   so it ends up being something like a 'type', only a prefix instead.
> 
>   I guess another keyword would be more clear:
> 
>   include class MyGroup.ew as MG1
>   include class MyGroup.ew as MG2
> 
>   ie a Euphoria with classes :)  (the word 'include' is optional).
> 
> 
> Euphoria allows you to 'include' as many atoms and sequences as
> you care to declare, so why not allow you to include (declare) as
> many custom built objects as you care to ?
> Think also about how fast it would be to wrap a class object?
> You wouldnt have to try to 'sequence the living carp' out of 
> everything he he :)  (ie stick every dang thing into some sequence
> somewhere AND maintain them all).
> 
> 
> Al
> 
> 
> My bumper sticker: "I brake for LED's"

I'm not a big fan of OO, but I can see its usefulness. Euphoria includes can
practically be classes as they are, but only as singletons (I think that's the OO
word I'm looking for). Include files can keep state and allow or restrict access
to that state.

But in order to have more than one instance, you have to write a lot of logic in
your include to handle that.

I don't think any new keywords need to be added to make includes work as
classes.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

12. Re: Namespace request

Jason Gade wrote:
> 
> I don't think any new keywords need to be added to make includes work as
> classes.
> 

Well, i just thought that using a new keyword would mean it wouldnt
interfere with 'normal' include operation, and we'd still get the
functionality.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

13. Re: Namespace request

Jason Gade wrote:
> Rob, can you change namespacing so that more than one file can be included
> into
> the same namespace?
> 
> Here is an example of what I want to do:
> 
> include misc.e as rds
> include machine.e as rds
> include dll.e as rds
> 
> Currently the interpreter gives an error.
> 
> Rationale: I want to use namespaces in a file that is intended to be included
> by another so as to avoid conflicts in user programs. But when I know that
> there
> will be no conflicts within the files that I'm including I don't want to make
> a new namespace for every single include. 

I really don't want to open up the whole namespace can of worms
over a relatively minor thing like this. I think the way
it works now, with one namespace id per included file, is fine.

> This will also help prevent namespace
> pollution by reducing the number of unique namespaces that a program needs to
> come up with.

Namespace identifiers have a scope that is local to the file
they are defined in. So there is no "pollution" across files.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

14. Re: Namespace request

Robert Craig wrote:
> 
> Namespace identifiers have a scope that is local to the file
> they are defined in. So there is no "pollution" across files.
> 
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a>

Don't worry, I've come to my senses on this. But I didn't mean that the
namespace identifier was polluting the namespace, I meant that the included
file's globals were polluting the namespace.

But I made a later post basically saying that I wasn't going to worry about it
anymore until I figured out how to implement it and experiment with it myself in
eu.ex. If that ever actually happens...

Fortunately I am actually working on something instead of just haranguing you on
how *I* think Euphoria should be. At least for now. smile

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

15. Re: Namespace request

Jason Gade wrote:

> 
> Rob, can you change namespacing so that more than one file can be included
> into
> the same namespace?
> 
> Here is an example of what I want to do:
> 
> include misc.e as rds
> include machine.e as rds
> include dll.e as rds
> 
> Currently the interpreter gives an error.
> 
> Rationale: I want to use namespaces in a file that is intended to be included
> by another so as to avoid conflicts in user programs. But when I know that
> there
> will be no conflicts within the files that I'm including I don't want to make
> a new namespace for every single include. This will also help prevent
> namespace
> pollution by reducing the number of unique namespaces that a program needs to
> come up with.

Hi Jason,

Just combine these libs into a single one, say,
some 'misc_machine_dll.e' and include it:

include misc_machine_dll.e as rds


Why not?

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view message » categorize

16. Re: Namespace request

Igor Kachan wrote:
<snip>
> 
> Hi Jason,
> 
> Just combine these libs into a single one, say,
> some 'misc_machine_dll.e' and include it:
> 
> }}}
<eucode>
> include misc_machine_dll.e as rds
> </eucode>
{{{

> 
> Why not?
> 
> Regards,
> Igor Kachan
> kinz at peterlink.ru

Hi, Igor. I considered that solution as well. Thanks!

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu