why Unix?

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Apr 7 16:41:36 PDT 2009


On Tue, Apr 7, 2009 at 7:14 PM, Steven Schveighoffer
<schveiguy at yahoo.com> wrote:

>> (It also follows that if you wrote a full shellscript, in a .mdsh file
>> or something, the compiler would, when compiling it, start in MiniD
>> mode by default so you wouldn't have to escape every statement with a
>> %.)

> I'm a little confused on the escaping.  In one example, it looks like %
> turns MiniD alternately on and off, yet you say you'd have to escape every
> line in a script file?

I'm sure if you read what I've quoted here, you'll see your mistake ;)

> If you meant the "on/off" style, the escaping should be more like
> open/closing (e.g. %< minid code >% ).  Otherwise, it'd be hard to tell in
> the middle of the file whether you're in miniD or bash syntax.

A shellscript would always be compiled in MiniD mode, and you'd have
to escape into bash mode with %, and that would only work on a single
statement.

> You should also be able to alias any miniD function that takes an array of
> strings to a shell "command".  This would allow you to have a selected
> overlap between miniD and your PATH's namespace.  Something like:
>
>> %shell.alias("foo", &foo)
>> foo a b "c d e"
>
> which would be equivalent to calling foo("a", "b", "c d e"), even if there
> was a foo command in your path.

Oh totally.  I've got all sorts of ideas.

> BTW, never used miniD, so I don't know what's already possible.

Anything!  ;)



More information about the Digitalmars-d mailing list