Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: The sh substitution problem.



On Jun 10,  1:05pm, Peter Stephenson wrote:
} Subject: The sh substitution problem.
}
} This is tricky and I have no idea of its detailed feasibility.  If
} anyone wants to try they should.  Otherwise just make comments.

I think the discussion Oliver and I had earlier this year, e.g.

    http://www.zsh.org/mla/workers/2002/msg00512.html

regarding passing around Parameter structs instead of Value structs, is
the key to this problem as well.  If the right-hand-side of the :+ (etc.)
were encoded as a parameter, it can carry around all the state necessary
to properly substitute it when the time comes.  Passing it around as just
a string or array is not sufficient, no matter what you do WRT preserving
nulls etc.

You sort of hint at this when you say:

}    [It might be possible to keep val and aval as a pair in a structure,
}    a sort of pseudo-parameter, and only convert between scalar and array
}    when really necessary with a `forcescalar' or `forcearray'
}    function/macro.]

Of course this is a more significant rewrite than just "fixing" multsub(),
but last year I had several goes at multsub() without coming up with
anything usable.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author