Mail Archives: djgpp-workers/1999/05/03/10:23:12
On Mon, 3 May 1999, Michel de Ruiter wrote:
> The solution
> Eli proposed, using ?default? for the default value however
> bothers me a bit. In particular, I don't like the fact, that
> yet another syntax convention is invented. I understand the
> already existing notations for "use this value if empty", like
> DJGPP.ENV's + or Bash's ${var-value} cannot be used. So I
> think the ?default? solution remains. Or maybe {default},
> [default] or (default)
My rationale for this notation went like this:
- we must have a default, since env vars are not set all too often;
- the syntax should allow simple and fast processing, since put_path
is a work-horse used by many library functions.
?default? was chosen because `?' cannot appear in file names. I could
use other characters, like `*' or `"' (the double quote), but they didn't
seem more attractive. However, if people like them better, changing
that is simple.
> so the following would be readable:
>
> /dev/env/C_INCLUDE_PATH{/dev/env/DJDIR{/djgpp}}/include
{} is not a good idea as it is special to Bash and therefore it would be
difficult to drag such a name through configure scripts (I'm thinking
about "./configure --prefix=/dev/env/DJDIR" etc.); [] and () can appear
in file names (rare, I know, but possible). Other things I considered
involved two or more characters, like ?: etc.; but this complicates the
code, so I've chosen not to use them.
> Would it be a good idea to add the default possibility to the
> DJGPP.ENV syntax somehow?
If a default is part of the feature, why do you need something special
for DJGPP.ENV? The DJGPP.ENV file itself won't be found anyway, unless
$DJDGPP is set.
- Raw text -