why Unix?
Steven Schveighoffer
schveiguy at yahoo.com
Tue Apr 7 16:52:12 PDT 2009
On Tue, 07 Apr 2009 19:41:36 -0400, Jarrett Billingsley
<jarrett.billingsley at gmail.com> wrote:
> 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 ;)
>
What it looks like to me then is:
if you are in interactive mode, the default is script mode, and % turns
miniD on and off, which continues beyond a single line
if you are in a script mode, then you are always in miniD mode, unless it
sees %, which turns it to script mode for a single line.
This is very confusing to me :)
I'm citing your original example:
> %foreach(file; shell.ls()) -> clearly % escaped to miniD mode
.. {
.. writeln("processing file ", file) -> still in miniD mode, right?
.. %something $file -> back to shell mode, right?
.. } -> um... in shell mode still maybe? or not?
If I'm still mistaken, don't worry about trying to help me understand.
I'm sure you wouldn't release something like this, so I'll wait until I
have mdsh to play with before I complain :)
-Steve
More information about the Digitalmars-d
mailing list