[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: let vs. local
Paul writes:
| this is at the margins of the language, and is subject to change.
| currently, only dynamically bound (let + global scope) are consulted
| for fn- and set- prefixes. i'm not sure i can defend the reasoning
| which led to that behavior. at one point it seemed logical, but
| it doesn't any longer. my inclincation is to change that, but i
| need to think about it first. comments, anyone?
Unless there is a very compelling reason to introduce a special case,
don't. Functions should be just like any other first class datatype,
as in scheme.
| as a footnote, in my first example, the preferable form will become
| local (rm = <>{%whatis rm}) fn rm { $rm -i $* }
I think the <> looks funny. I'd prefer to write something like
rm = ${%whatis rm}
(other shells use a syntax like that, so there's some precident.)
Unfortunately for this idea, es lets you say
{x}=foo
echo ${x}