On Fri, Aug 23, 2013 at 8:19 PM, Cedric Blancher
<[email protected]> wrote:
>
> On 23 August 2013 15:52, Tina Harriott <[email protected]> wrote:
> > On 23 August 2013 14:38, David Korn <[email protected]> wrote:
> >> cc: [email protected] [email protected]
> >> Subject: Re: Re: Re: [uwin-developers] [ast-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.
>
> I don't understand it either.
>
> David, is there a reason why you try to reinvent the wheel, or is
> there anything fundamentally wrong with Roland Mainz's
> astksh20130814_math_constants001.diff.txt patch?
>
> I think that Roland's patch deals with all issues I can imagine of
> (except predefining some constants, which is IMO easy to solve), adds
> headroom for further enhancements (e.g. if we wish to implement
> typeset -D to gain access to _Decimal32, _Decimal64 and _Decimal128
> types to please COBOL migratory people), AFAIK can solve bool b;
> b.true/b.false and other enum constants with little or no extra code,
> supports ${var.fooconst} and supports user defined constants (IMO very
> important)
+1
The other question if supporting var.fooconst in $(()) but not in
${var.fooconst} would be in the spirit of POSIX. I think not. It'll
look like a cumbersome hack, plus will break so many useful use cases.
BTW: bool is an integer type in ANSI C, right? So bool b;
${b.max}/$((b.max)) should work, right?
Simon
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers