Re: Independent Euphoria Interpreter

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

Pete Lomax wrote:

> Juergen Luethje wrote:
> 
> > 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.
> >
> Absolutely agreed.
> <snip>
> >
> > The problem is, that I sometimes do not know "where I am"
> I'm confused. Why would you ever use relative directories in such case?

It can happen by accident. In the same post, a few lines later I wrote:
| Newbies can only avoid this problem, if they are aware that it is a
| problem.

> > I already had given examples.
> Umm, the only thing I can find is:
> > 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.

I was referring to the following text, which I wrote previously:
| And when using a file manager such as Total Commander (TC) instead of
| the Windows Explorer, does then displaying a particular directory also
| mean that this one now is the "current directory"? As far as TC is
| concerned, the answer by it's author is "yes". But what about all the
| other file managers out there?

> Also, why are relative directories in .conf files somehow *less* confusing
> than
> those on the command line?

I didn't write something like that. It seems to be a misunderstanding.

> What happens when some edjut newbie decides to move
> a .conf file?

This might cause severe problems when we decide to use concept b)
(below), but less likely with concept a).

> Is that not far harder to solve than a -i option?
> 
> Confused,
> Pete
> 
> PS Relative directories *ARE* potentially confusing, we know.
> They are also damn handy, like as in yer first point. smile

Concerning relative directories, the question "Relative to what?" must
be answered unambiguously, and the Eu programmer should know the answer.
Sound concepts are IMHO:
a) relative to the location of the currently running instance of the
   interpreter/translator
b) relative to the location of the .conf file they are specified in
   (as you suggested)

No good concept is IMHO:
c) relative to the "current directory"

That's what I wrote before. I didn't write anything against an -i option
or against relative directories on the command-line.
The contrary is true. When Matt asked for my opinion, I replied:
| I think specifying a relative path on the command-line sometimes can
| make sense, too.

But IMHO relative directories (on the command-line or elsewhere) should
_not be relative to the so called "current directory"_. Because
sometimes it's not clear what the "current directory" is. See example
above concerning file managers. I had given another example:

| 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?

Also, according to the principle of least surprise, when we use relative
paths for specifiying the Eu configuration, we should only use _one_ of
the concepts a), b), or c) above!
When e.g. a relative path in a config file is relative to the location
of the interpreter, and a relative path on the command-line is relative
to the "current directory", this would be a good source of confusion.

Regards,
   Juergen

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

Search



Quick Links

User menu

Not signed in.

Misc Menu