Tina Harriott
2013-08-19 13:57:15 UTC
The concept of bool b; (( b.true )) reminds me of java, python and
other programming languages which tie limits and constants to a
specific type instead of littering the global namespace with the
definitions (like C).
Could the numeric types, i.e. typeset -i/-E have a similar
functionality like b.true to access the minimum, maximum, epsilon, ...
values?
For example:
typeset -lE i; (( i.MIN )) would be the equivalent to C's LDBL_MIN
typeset -lE i; (( i.MAX )) would be the equivalent to C's LDBL_MAX
typeset -lE i; (( i.EPSILON )) would be the equivalent to C's LDBL_EPSILON
typeset -lE i; (( i.MAX_10_EXP )) would be the equivalent to C's LDBL_MAX_10_EXP
typeset -sE i; (( i.MIN )) would be the equivalent to C's FLT_MIN
typeset -sE i; (( i.MAX )) would be the equivalent to C's FLT_MAX
typeset -sE i; (( i.EPSILON )) would be the equivalent to C's FLT_EPSILON
typeset -sE i; (( i.MAX_10_EXP )) would be the equivalent to C's FLT_MAX_10_EXP
Tina
---------- Forwarded message ----------
From: Wendy Lin <wendlin1974 at gmail.com>
Date: 12 August 2013 08:53
Subject: Re: [ast-developers] "${_Bool.true}" not working... / was:
Re: AT&T Software Technology ast alpha software download update
To: Roland Mainz <roland.mainz at nrubsig.org>, David Korn <dgk at research.att.com>
Cc: ast-developers at research.att.com
$ ~/bin/ksh -o nounset -c 'print "${_Bool.true}"'
/home/test001/bin/ksh: _Bool.true: parameter not set
$ ~/bin/ksh -o nounset -c 'print "$((_Bool.true))"'
/home/test001/bin/ksh: _Bool.true: parameter not set
-- snip --
It works for me:
ksh -o nounset -c 'bool b ; print $((b.true))'
1
But there is still a bug left:
var.true/var.false don't work for array elements:
./arch/linux.i386-64/bin/ksh -o nounset -c 'bool -a b=( [4][5]=true )
; print $((b[4][5].true))'
./arch/linux.i386-64/bin/ksh: b[4][5].true: parameter not set
./arch/linux.i386-64/bin/ksh -o nounset -c 'bool -A b=( [lin]=true ) ;
print $((b[lin].true))'
./arch/linux.i386-64/bin/ksh: b[lin].true: parameter not set
Wendy
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
other programming languages which tie limits and constants to a
specific type instead of littering the global namespace with the
definitions (like C).
Could the numeric types, i.e. typeset -i/-E have a similar
functionality like b.true to access the minimum, maximum, epsilon, ...
values?
For example:
typeset -lE i; (( i.MIN )) would be the equivalent to C's LDBL_MIN
typeset -lE i; (( i.MAX )) would be the equivalent to C's LDBL_MAX
typeset -lE i; (( i.EPSILON )) would be the equivalent to C's LDBL_EPSILON
typeset -lE i; (( i.MAX_10_EXP )) would be the equivalent to C's LDBL_MAX_10_EXP
typeset -sE i; (( i.MIN )) would be the equivalent to C's FLT_MIN
typeset -sE i; (( i.MAX )) would be the equivalent to C's FLT_MAX
typeset -sE i; (( i.EPSILON )) would be the equivalent to C's FLT_EPSILON
typeset -sE i; (( i.MAX_10_EXP )) would be the equivalent to C's FLT_MAX_10_EXP
Tina
---------- Forwarded message ----------
From: Wendy Lin <wendlin1974 at gmail.com>
Date: 12 August 2013 08:53
Subject: Re: [ast-developers] "${_Bool.true}" not working... / was:
Re: AT&T Software Technology ast alpha software download update
To: Roland Mainz <roland.mainz at nrubsig.org>, David Korn <dgk at research.att.com>
Cc: ast-developers at research.att.com
the AT&T Software Technology ast alpha 2013-08-07 source release
has been posted to the download site
http://www.research.att.com/sw/download/alpha/
the package names and md5 checksums are
INIT 47f2073fae4b73fe5210cc4e287556ca
ast-open e6927faa687a2af8ee94431b793c08ac
ast-ksh 43b7379fdf573811c66f41ce231cbac0
the md5 sums should match the ones listed on the download page
[snip]has been posted to the download site
http://www.research.att.com/sw/download/alpha/
the package names and md5 checksums are
INIT 47f2073fae4b73fe5210cc4e287556ca
ast-open e6927faa687a2af8ee94431b793c08ac
ast-ksh 43b7379fdf573811c66f41ce231cbac0
the md5 sums should match the ones listed on the download page
13-07-30 +An experimental change to each enumeration variable have subvariables
for each enumeration constant. ${enum.name} will expand to the
numerical value of the enumeration name associatied with enum.
-- snip --for each enumeration constant. ${enum.name} will expand to the
numerical value of the enumeration name associatied with enum.
$ ~/bin/ksh -o nounset -c 'print "${_Bool.true}"'
/home/test001/bin/ksh: _Bool.true: parameter not set
$ ~/bin/ksh -o nounset -c 'print "$((_Bool.true))"'
/home/test001/bin/ksh: _Bool.true: parameter not set
-- snip --
ksh -o nounset -c 'bool b ; print $((b.true))'
1
But there is still a bug left:
var.true/var.false don't work for array elements:
./arch/linux.i386-64/bin/ksh -o nounset -c 'bool -a b=( [4][5]=true )
; print $((b[4][5].true))'
./arch/linux.i386-64/bin/ksh: b[4][5].true: parameter not set
./arch/linux.i386-64/bin/ksh -o nounset -c 'bool -A b=( [lin]=true ) ;
print $((b[lin].true))'
./arch/linux.i386-64/bin/ksh: b[lin].true: parameter not set
Wendy
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
Tina Harriott - Women in Mathematics
Contact: tina.harriott.math at gmail.com
Tina Harriott - Women in Mathematics
Contact: tina.harriott.math at gmail.com