1. QoD for Rob:

Rob:
If I type EX at the C:> prompt, Euphoria runs and asks for a filename
to load. I type MYPROG, and myprog runs.
Now, why is it not possible to have a load() command to do the same
thing from within a Euphoria program?
There would need to be a corresponding unload(), I suppose...

Then we could write little programs to do what we want, switching
from one to another via a menu system, without having to include
them all into one giant program, with the resulting name conflicts,
etc.
Irv

PS: please don't anyone tell me I can do this by calling system(),
I know that - it loads another copy of Eu. Perhaps another copy of
command.com as well??

new topic     » topic index » view message » categorize

2. Re: QoD for Rob:

Irv Mullins writes:
> If I type EX at the C:> prompt, Euphoria runs and asks
> for a filename to load. I type MYPROG, and myprog runs.
> Now, why is it not possible to have a load() command to do
> the same thing from within a Euphoria program?
> There would need to be a corresponding unload(), I suppose...
> Then we could write little programs to do what we want,
> switching from one to another via a menu system, without
> having to include them all into one giant program, with the
> resulting name conflicts, etc.

Several people have asked for something like this.
Unfortunately, it's extremely difficult to support more
than one program at a time. The compiler and interpreter
are not "reentrant", i.e. they have numerous data structures
that are all geared towards executing a single program.
It would be hard to jump from executing one program into
compiling and executing another independent program,
and then jump back again. It would take a major overhaul.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

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

3. Re: QoD for Rob:

> > If I type EX at the C:> prompt, Euphoria runs and asks
> > for a filename to load. I type MYPROG, and myprog runs.
> > Now, why is it not possible to have a load() command to do
> > the same thing from within a Euphoria program?
>
> Several people have asked for something like this.
> Unfortunately, it's extremely difficult to support more
> than one program at a time. The compiler and interpreter
> are not "reentrant", i.e. they have numerous data structures
> that are all geared towards executing a single program.
> It would be hard to jump from executing one program into
> compiling and executing another independent program,
> and then jump back again. It would take a major overhaul.

Would it be so much of a major overhaul to make it so you can "chain"
programs?  In other words, proga.ex calls progb.ex at which time proga
no longer runs.  progb can call proga again should it be needed and the
ability to add to the chained programs command line.  Uh, dunno if this
is any easier or not, but it sounded like it might do and provide a
workaround whereby we get some of the functionality suggested and avoid
the major overhaul that you don't really need to be working on (IMHO).
Laters,

\/\/ood/\/\age

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

4. Re: QoD for Rob:

>Several people have asked for something like this.
>Unfortunately, it's extremely difficult to support more
>than one program at a time. The compiler and interpreter
>are not "reentrant", i.e. they have numerous data structures
>that are all geared towards executing a single program.
>It would be hard to jump from executing one program into
>compiling and executing another independent program,
>and then jump back again. It would take a major overhaul.


Robert, I am confused.
Could you elaborate on this ?
I would say, if you can have *another* top-level statement such as 'include'
at any place in the program (outside of routines) .. can't you use the
'same' mechanism as include but with different scope rules, and the ability
to determine the 'name' of the file at run-time. Even from inside routines,
push the routine on the stack, and preceed on the top level (where the file
is now included) .. at the end.. the routine is loaded back from the stack.

Im speculation, I dont know much about this, but wouldnt this work ?

Ralf

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

5. Re: QoD for Rob:

Ralf writes:
> I would say, if you can have *another* top-level statement
> such as 'include' at any place in the program (outside of routines) ..
> can't you use the 'same' mechanism as include but with different
> scope rules, and the ability to determine the 'name' of the file
> at run-time.

I could allow the name of an include file to be determined
at run-time, at the top-level. i.e.

     include <string-sequence>

but that's not a really general solution to having a single
instance of ex.exe load/unload multiple programs on demand,
as Irv was suggesting. As you try to make the solution more
general and more satisfying, you eventually hit the wall
of non-reentrancy that I mentioned before. The same wall
applies to executing a dynamically-created string of text
that represents a Euphoria program - another popular request.

John Worthington writes:
> Would it be so much of a major overhaul to make it so you
> can "chain" programs?  In other words, proga.ex calls progb.ex
> at which time proga no longer runs.  progb can call proga again
> should it be needed and the ability to add to the chained
> programs command line.

Chaining was a necessary evil back in the days of 640K
(or 160K) limited BASIC. I wouldn't want to head back in that direction.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu