On Fri, May 10, 2013 at 2:36 AM, David Korn <[email protected]> wrote: > cc: [email protected] > Subject: Re: Re: [ast-developers] bool type not documented > -------- > >> Erm... one thing which may need documentation is that "bool" returns >> the strings "true" and "false" when used as string but |1| and |0| >> when used as arithmetic expression. >> Otherwise this _may_ cause some confusion... > > In general the numerical value of an enumeration variable is the index > in the array of enumeration variables, starting at zero.
Right... but it may still be confusing for people not familiar with all of ksh93's finer details may trip over the following issue: bool b=true ; $b ; print $? # returns 0 bool b ; b=true ; print $((b)) # returns 1 bool b ; b=false ; print $((b)) # returns 0 bool b=false ; $b ; print $? # returns 1 Given that the "bool" datatype is very usefull (that's why it was added to ISO C99 and later was even proposed and implemented in ksh93) I'd like to avoid such confusion and/or related bogus bug reports from the beginning... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [email protected] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ ast-developers mailing list [email protected] http://lists.research.att.com/mailman/listinfo/ast-developers
