cc: [email protected]
Subject: Re: Re: [ast-developers] [uwin-developers] Next alpha/beta and roadmap
for ksh93v?
--------
> >>
> >>> Why? How should I construct scripts from that using variables, i.e.
> >>> use typeset -s -E svar; printf 'typeset -s -E var; for ((var = %s; var
> >>> < %s; var+= %s)); do myfunc var; done' ${svar.MIN} ${svar.MAX}
> >>> $((2**24)) | source /dev/stdin
> >>>
> >>>
> >>>
> >> svar.MIN and svar.MAX will exist, but only in arithemtic expressions.
> >> Thus, $((svar.MIN)) and $((svar.MAX)) instead of ${svar.MIN} ${svar.MAX}.
> >> Only constants like PI, NaN, Inf, and others will not exist for each type.
> >> The limits would.
> >
> > I don't understand this. The patch
> > astksh20130814_math_constants001.diff.txt already allows MIN, MAX,
> > EPSILON etc if they are defined in .sh.mathconst. Why is the
> > functionality now restricted to $(())? It just makes it much harder to
> > use, if usable at all.
>
> Right. I don't like David's approach either, unless there is a very
> damn good justification for castrating numeric constants to $(()) and
> not for ${}. Given that Roland's patch works, minus having
> preconfigured constants, and can be extended to cover enums (bool is
> an enum) I don't see a reason for not taking that patch.
>
> Irek
>
OK, let me preset some reasons:
1. These variables are only arithmetic related. Just like NaN, nan,
Inf, and inf which also don't give the same result for ${NaN} and
$((NaN)).
2. The implementation is inconsistant in that ${!foo*} does not
expand all integer variables starting with foo to each of the
18 integer or 27 possible float suffices for integer and float
respectively.
3. Rolands implementation used about 2500 bytes of read write
memory which will be copied for each fork(). Mine use 0 more
bytes of read/write memory.
4. There is no additional functionlity created by allowwing ${i.MAX}.
I am planning to only support enum.constant in numerical expressions
as well where it belongs.
The changes will be in the next alpha.
David Korn
[email protected]
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers