Re: Independent Euphoria Interpreter

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

Juergen Luethje wrote:
> 
> Matt Lewis wrote:
> > 
> > Yes, that's how I've got it coded, and I've fixed the wiki to reflect this.
> 
> Wow, you're fast! smile

And now I've committed my first version of the code (works for interpreter
and translator--need to update the binder).

To get the code:
$ svn export https://rapideuphoria.svn.sf.net/svnroot/rapideuphoria/branches/nix
rdsnix
(will put the source into a new subdirectory of the current dir)

So far, I've only tested it on Linux, but it should work on windows 
(the code is there for the appropriate environment variables).  The
interesting stuff is mainly in pathopen.e for the interested.

I've also added the built-in option_switches() to get any command line
arguments passed to the interpreter/compiler before the file name.

> > It should probably be considered bad practice to use relative paths in
> > general, although I can see that it would be helpful in some cases.  I
> > can imagine a library developer possibly shipping these, as it would
> > make their directory structure more portable, and wouldn't require that
> > people change their system settings to try out the demos that come with
> > a library.
> 
> When running Euphoria from a portable device, at least for usage on
> Windows, writing relative paths into the config file(s) is the only
> working possibility, because it's not predictable what drive letter
> the device will have when it will be used next time.

Yes, portable (and possibly cgi--don't know enough about that mode of
operation) are the main exceptions that I had in mind.  But since
they're in the euinc.conf files, the relativity is easily defined and
understood.

> > > > and a -i relative path should be relative to the current directory.
> > > 
> > > Hmm ... I do not like the concept of "current directory".
> > > My current directory probably changes every 10 minutes or so.
> > > I prefer it when
> > >      cd C:\mydir
> > >      exw myapp.exw
> > > and
> > >      exw C:\mydir\myapp.exw
> > > exactly behave the same way, so that it's not necessary to change the
> > > current directory in order to achive a specific result.
> > 
> > Since the -i is a command line only thing, the 'current directory' would
> > be wherever you ran the command.
> 
> The problem is, that I sometimes do not know "where I am", i.e. what the
> so called "current directory" is. I already had given examples. Another
> one: When I chose on Windows 'Start' > 'Run', then a small input box opens,
> where I can enter a command. What is the "current directory" then?

No clue.  We'll have to try it and see what happens. :)

I guess I'd probably tell you that if it doesn't work, you should probably
open up a console and do it that way if you really want to do it that
way.  Or just use an absolute path.  Auto-complete is your friend in
that case.
 
> > If it's a problem, then don't use a relative path in the command line.
> 
> Newbies can only avoid this problem, if they are aware that it is a
> problem. IMHO it would be better not to introduce this problem, by not
> using the concept of "current directory".

Yes, the documentation will be important, but I think it's better to try
to follow the principle of least surprise.  You'll be able to see what 
directory it thought it should look in within the error message, so it
shouldn't be complete voodoo.  In any case, this is where testing will
be important, so we can get both the code and the documentation correct.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu