Re: Berkeley DB with Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

Or use my namespace parser, which will convert a file included under
2 namespaces into 2 instances. (Personally I'd like to see the features
of my namespace parser remade in the interpreter itself, however Rob
indicated that having too many features might confuse new users.)

jbrown

On  0, Andy Serpa <renegade at earthling.net> wrote:
> 
> 
> irv at take.maxleft.com wrote:
> > 
> > Andy Serpa wrote:
> > 
> > > Yeah, exactly, so in my example of including database.e twice as "dbA" 
> > > and "dbB" you could:
> > > 
> > > dbA:db_open("database A")
> > > dbB:db_open("database B")
> > > 
> > > Now BOTH databases will be open and current so instead of using 
> > > db_select() and switching back & forth you just use the appropriate 
> > > "dbA:" or "dbB:" in front of the proper one.  Sort of a quick & dirty 
> > > way to get separate "instances" in a OOP-like fashion...
> > > 
> > > (Unless there is some reason that won't work?  Like I said, I haven't 
> > > actually tried it.)
> > 
> > It won't work, because Rob's implementation of namespacing doesn't 
> > create multiple instances of an include, it just makes "aliases" for 
> > one single instance. I, for one, think this is unfortunate.
> > 
> > Therefore, no matter what you prefix the db_* commands with, they 
> > still use the single copy of database.e with its variables (including 
> > the currently selected database file).
> > 
> 
> Ok, what if we just make two copies of database.e and then:
> 
> include databaseA.e as dbA
> include databaseB.e as dbB
> 
> Now would they be separate?
> 


--

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu