Discussion:
[ast-developers] AT&T Software Technology ast alpha software download update
Glenn Fowler
2013-08-14 10:58:22 UTC
Permalink
the AT&T Software Technology ast alpha 2013-08-14 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 ab18ae3ed80758d27adc2937d1877cae
ast-ksh 7aade4e56a21b5fdbf64504cd2c5cd29
the md5 sums should match the ones listed on the download page

this alpha is limited to ast-ksh mainly to verify that recent
portability/emulation changes are working
in particular please report any problems with O_SEARCH and cd -@
these will be addressed first so we can move on to other things

we've gone through a couple of rounds of this because we want
gnarly patches to be consolidated in one part of the code
and in that process dgk+gsf have had a few disconnects with the patches
basically we would really like to have the bulk of ast #ifdef's
in the libast and a few other libs and leave the commands/plugins
fairly clean

changes since 2013-08-07

:::::::: ksh93 ::::::::

13-08-12 --- Release ksh93v- ---
13-08-12 A bug in which background jobs where not removed after the
user was notified about completion has been fixed.
13-08-11 A bug in which subscripts were evaluated twice for subscripts
on the left hand side of assignments make by typeset has been fixed.
13-08-11 +namespace was modified so that namespace names can be a compound
variable rather than just an identifier and namespace are no
longer nested.
13-08-07 typeset -p (and print -v) now display the sort attribute for
typeset -sF and typeset -sE.

:::::::: libast ::::::::

13-08-11 features/lib: add `lib fdatasync,fssync,sync' tests
13-08-11 features/fcntl.c: another round for { O_DIRECTORY O_SEARCH }, stabilize ast extension values
13-08-11 port/intercept.c: add RATIFY() to check for paths with embeded directory fd refs
13-08-11 convert strcopy() usage to stpcpy(); strncopy() will not change
13-08-08 path/pathcanon.c: add PATH_ABSOLUTE to canonicalize relative path to absolute (rooted) path
13-08-08 comp/resolvepath.c: now a veneer to pathdev+PATH_ABSOLUTE...
13-08-08 string/stpcpy.c,string/stpncpy.c: add { stpcpy() stpncpy() } emulations
13-08-08 include/ast.h,path/pathcanon.c: add { /dev/file at flag1,.../path /dev/file at flag1,..././path } to pathdev
13-08-08 port/intercept.c: handle O_ASYNC anomalies in ast_openat()
13-08-07 sfio.h,sftmp.c: add SF_TMPFILE notification for sftmp() switch from buf to file
13-08-07 include/ast.h: add getconf("string") macro using astconf()
13-08-07 features/fcntl.c: add more macro guards to cover diffs between iffe time and compile time
13-08-07 features/limits.c: { _POSIX_NAME_MAX _POSIX_PATH_MAX } failsafes for systems (like darwin) that omit them

:::::::: libcmd ::::::::

13-08-11 strcopy() => stpcpy()
Irek Szczesniak
2013-08-14 19:27:00 UTC
Permalink
Post by Glenn Fowler
the AT&T Software Technology ast alpha 2013-08-14 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 ab18ae3ed80758d27adc2937d1877cae
ast-ksh 7aade4e56a21b5fdbf64504cd2c5cd29
the md5 sums should match the ones listed on the download page
this alpha is limited to ast-ksh mainly to verify that recent
portability/emulation changes are working
these will be addressed first so we can move on to other things
we've gone through a couple of rounds of this because we want
gnarly patches to be consolidated in one part of the code
and in that process dgk+gsf have had a few disconnects with the patches
basically we would really like to have the bulk of ast #ifdef's
in the libast and a few other libs and leave the commands/plugins
fairly clean
changes since 2013-08-07
13-08-12 --- Release ksh93v- ---
13-08-12 A bug in which background jobs where not removed after the
user was notified about completion has been fixed.
13-08-11 A bug in which subscripts were evaluated twice for subscripts
on the left hand side of assignments make by typeset has been fixed.
13-08-11 +namespace was modified so that namespace names can be a compound
variable rather than just an identifier and namespace are no
longer nested.
Doesn't work for math expressions:
ksh -o nounset -c 'namespace com.test.demo { integer i=5 ; function
printme { print $((i+i)) ; } ; } ; .com.test.demo.printme'
/home/irek/bin/ksh: .com.test.demo.printme: line 1: i: parameter not set
Post by Glenn Fowler
13-08-07 typeset -p (and print -v) now display the sort attribute for
typeset -sF and typeset -sE.
Which sort attribute? You mean 'short' as in short integer or 'short
double' alias C99 float, right? :)
Post by Glenn Fowler
13-08-11 features/lib: add `lib fdatasync,fssync,sync' tests
13-08-11 features/fcntl.c: another round for { O_DIRECTORY O_SEARCH }, stabilize ast extension values
13-08-11 port/intercept.c: add RATIFY() to check for paths with embeded directory fd refs
13-08-11 convert strcopy() usage to stpcpy(); strncopy() will not change
13-08-08 path/pathcanon.c: add PATH_ABSOLUTE to canonicalize relative path to absolute (rooted) path
13-08-08 comp/resolvepath.c: now a veneer to pathdev+PATH_ABSOLUTE...
13-08-08 string/stpcpy.c,string/stpncpy.c: add { stpcpy() stpncpy() } emulations
Thanks! now I can crush all the old Unices which don't care about POSIX :)
Post by Glenn Fowler
13-08-08 include/ast.h,path/pathcanon.c: add { /dev/file at flag1,.../path /dev/file at flag1,..././path } to pathdev
13-08-08 port/intercept.c: handle O_ASYNC anomalies in ast_openat()
13-08-07 sfio.h,sftmp.c: add SF_TMPFILE notification for sftmp() switch from buf to file
13-08-07 include/ast.h: add getconf("string") macro using astconf()
13-08-07 features/fcntl.c: add more macro guards to cover diffs between iffe time and compile time
13-08-07 features/limits.c: { _POSIX_NAME_MAX _POSIX_PATH_MAX } failsafes for systems (like darwin) that omit them
13-08-11 strcopy() => stpcpy()
readlink?

Irek
Glenn Fowler
2013-08-14 19:35:21 UTC
Permalink
Post by Irek Szczesniak
Post by Glenn Fowler
the AT&T Software Technology ast alpha 2013-08-14 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 ab18ae3ed80758d27adc2937d1877cae
ast-ksh 7aade4e56a21b5fdbf64504cd2c5cd29
the md5 sums should match the ones listed on the download page
this alpha is limited to ast-ksh mainly to verify that recent
portability/emulation changes are working
these will be addressed first so we can move on to other things
we've gone through a couple of rounds of this because we want
gnarly patches to be consolidated in one part of the code
and in that process dgk+gsf have had a few disconnects with the patches
basically we would really like to have the bulk of ast #ifdef's
in the libast and a few other libs and leave the commands/plugins
fairly clean
changes since 2013-08-07
13-08-12 --- Release ksh93v- ---
13-08-12 A bug in which background jobs where not removed after the
user was notified about completion has been fixed.
13-08-11 A bug in which subscripts were evaluated twice for subscripts
on the left hand side of assignments make by typeset has been fixed.
13-08-11 +namespace was modified so that namespace names can be a compound
variable rather than just an identifier and namespace are no
longer nested.
ksh -o nounset -c 'namespace com.test.demo { integer i=5 ; function
printme { print $((i+i)) ; } ; } ; .com.test.demo.printme'
/home/irek/bin/ksh: .com.test.demo.printme: line 1: i: parameter not set
Post by Glenn Fowler
13-08-07 typeset -p (and print -v) now display the sort attribute for
typeset -sF and typeset -sE.
Which sort attribute? You mean 'short' as in short integer or 'short
double' alias C99 float, right? :)
Post by Glenn Fowler
13-08-11 features/lib: add `lib fdatasync,fssync,sync' tests
13-08-11 features/fcntl.c: another round for { O_DIRECTORY O_SEARCH }, stabilize ast extension values
13-08-11 port/intercept.c: add RATIFY() to check for paths with embeded directory fd refs
13-08-11 convert strcopy() usage to stpcpy(); strncopy() will not change
13-08-08 path/pathcanon.c: add PATH_ABSOLUTE to canonicalize relative path to absolute (rooted) path
13-08-08 comp/resolvepath.c: now a veneer to pathdev+PATH_ABSOLUTE...
13-08-08 string/stpcpy.c,string/stpncpy.c: add { stpcpy() stpncpy() } emulations
Thanks! now I can crush all the old Unices which don't care about POSIX :)
Post by Glenn Fowler
13-08-08 include/ast.h,path/pathcanon.c: add { /dev/file at flag1,.../path /dev/file at flag1,..././path } to pathdev
13-08-08 port/intercept.c: handle O_ASYNC anomalies in ast_openat()
13-08-07 sfio.h,sftmp.c: add SF_TMPFILE notification for sftmp() switch from buf to file
13-08-07 include/ast.h: add getconf("string") macro using astconf()
13-08-07 features/fcntl.c: add more macro guards to cover diffs between iffe time and compile time
13-08-07 features/limits.c: { _POSIX_NAME_MAX _POSIX_PATH_MAX } failsafes for systems (like darwin) that omit them
13-08-11 strcopy() => stpcpy()
readlink?
still figuring out how to handle that w.r.t. ast pathcanon() which now handles all the ops required
Irek Szczesniak
2013-08-15 09:50:26 UTC
Permalink
Post by Glenn Fowler
the AT&T Software Technology ast alpha 2013-08-14 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 ab18ae3ed80758d27adc2937d1877cae
ast-ksh 7aade4e56a21b5fdbf64504cd2c5cd29
the md5 sums should match the ones listed on the download page
this alpha is limited to ast-ksh mainly to verify that recent
portability/emulation changes are working
these will be addressed first so we can move on to other things
we've gone through a couple of rounds of this because we want
gnarly patches to be consolidated in one part of the code
and in that process dgk+gsf have had a few disconnects with the patches
basically we would really like to have the bulk of ast #ifdef's
in the libast and a few other libs and leave the commands/plugins
fairly clean
changes since 2013-08-07
13-08-12 --- Release ksh93v- ---
13-08-12 A bug in which background jobs where not removed after the
user was notified about completion has been fixed.
13-08-11 A bug in which subscripts were evaluated twice for subscripts
on the left hand side of assignments make by typeset has been fixed.
13-08-11 +namespace was modified so that namespace names can be a compound
variable rather than just an identifier and namespace are no
longer nested.
13-08-07 typeset -p (and print -v) now display the sort attribute for
typeset -sF and typeset -sE.
13-08-11 features/lib: add `lib fdatasync,fssync,sync' tests
13-08-11 features/fcntl.c: another round for { O_DIRECTORY O_SEARCH }, stabilize ast extension values
13-08-11 port/intercept.c: add RATIFY() to check for paths with embeded directory fd refs
13-08-11 convert strcopy() usage to stpcpy(); strncopy() will not change
13-08-08 path/pathcanon.c: add PATH_ABSOLUTE to canonicalize relative path to absolute (rooted) path
13-08-08 comp/resolvepath.c: now a veneer to pathdev+PATH_ABSOLUTE...
13-08-08 string/stpcpy.c,string/stpncpy.c: add { stpcpy() stpncpy() } emulations
13-08-08 include/ast.h,path/pathcanon.c: add { /dev/file at flag1,.../path /dev/file at flag1,..././path } to pathdev
13-08-08 port/intercept.c: handle O_ASYNC anomalies in ast_openat()
13-08-07 sfio.h,sftmp.c: add SF_TMPFILE notification for sftmp() switch from buf to file
13-08-07 include/ast.h: add getconf("string") macro using astconf()
13-08-07 features/fcntl.c: add more macro guards to cover diffs between iffe time and compile time
13-08-07 features/limits.c: { _POSIX_NAME_MAX _POSIX_PATH_MAX } failsafes for systems (like darwin) that omit them
13-08-11 strcopy() => stpcpy()
On Fedora the basics.sh test fails:

test basic(en_US.UTF-8) begins at 2013-08-14+21:02:42
cat: /dev/fd/4: No such file or directory
basic.sh[372]: process substitution not working outside for or
while loop
test basic(en_US.UTF-8) failed at 2013-08-14+21:03:29 with exit code 1
[ 109 tests 1 error ]

Irek
Irek Szczesniak
2013-08-15 09:57:38 UTC
Permalink
Post by Glenn Fowler
the AT&T Software Technology ast alpha 2013-08-14 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 ab18ae3ed80758d27adc2937d1877cae
ast-ksh 7aade4e56a21b5fdbf64504cd2c5cd29
the md5 sums should match the ones listed on the download page
this alpha is limited to ast-ksh mainly to verify that recent
portability/emulation changes are working
these will be addressed first so we can move on to other things
we've gone through a couple of rounds of this because we want
gnarly patches to be consolidated in one part of the code
and in that process dgk+gsf have had a few disconnects with the patches
basically we would really like to have the bulk of ast #ifdef's
in the libast and a few other libs and leave the commands/plugins
fairly clean
changes since 2013-08-07
13-08-12 --- Release ksh93v- ---
13-08-12 A bug in which background jobs where not removed after the
user was notified about completion has been fixed.
13-08-11 A bug in which subscripts were evaluated twice for subscripts
on the left hand side of assignments make by typeset has been fixed.
13-08-11 +namespace was modified so that namespace names can be a compound
variable rather than just an identifier and namespace are no
longer nested.
13-08-07 typeset -p (and print -v) now display the sort attribute for
typeset -sF and typeset -sE.
13-08-11 features/lib: add `lib fdatasync,fssync,sync' tests
13-08-11 features/fcntl.c: another round for { O_DIRECTORY O_SEARCH }, stabilize ast extension values
13-08-11 port/intercept.c: add RATIFY() to check for paths with embeded directory fd refs
13-08-11 convert strcopy() usage to stpcpy(); strncopy() will not change
13-08-08 path/pathcanon.c: add PATH_ABSOLUTE to canonicalize relative path to absolute (rooted) path
13-08-08 comp/resolvepath.c: now a veneer to pathdev+PATH_ABSOLUTE...
13-08-08 string/stpcpy.c,string/stpncpy.c: add { stpcpy() stpncpy() } emulations
13-08-08 include/ast.h,path/pathcanon.c: add { /dev/file at flag1,.../path /dev/file at flag1,..././path } to pathdev
13-08-08 port/intercept.c: handle O_ASYNC anomalies in ast_openat()
13-08-07 sfio.h,sftmp.c: add SF_TMPFILE notification for sftmp() switch from buf to file
13-08-07 include/ast.h: add getconf("string") macro using astconf()
13-08-07 features/fcntl.c: add more macro guards to cover diffs between iffe time and compile time
13-08-07 features/limits.c: { _POSIX_NAME_MAX _POSIX_PATH_MAX } failsafes for systems (like darwin) that omit them
13-08-11 strcopy() => stpcpy()
Types do not work in namespaces, we get a
.sh.type.com.gelifesciences.tst1: no parent error:
------------------------------------------
namespace com.gelifesciences.tst1
{
typeset -T integer_container_t=(
integer i=-1
function printobj
{
printf "%d\n" _.i
}
)
}

.com.gelifesciences.tst1.integer_container_t ic

ic.printobj
------------------------------------------

ksh tst1.sh
tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent

Irek
Irek Szczesniak
2013-08-15 10:06:03 UTC
Permalink
Post by Glenn Fowler
the AT&T Software Technology ast alpha 2013-08-14 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 ab18ae3ed80758d27adc2937d1877cae
ast-ksh 7aade4e56a21b5fdbf64504cd2c5cd29
the md5 sums should match the ones listed on the download page
this alpha is limited to ast-ksh mainly to verify that recent
portability/emulation changes are working
these will be addressed first so we can move on to other things
cd -@ is now working again and even returns the correct error messages
in case of failures:

ksh -c 'mkdir tmpx; cd -@ tmp; print $?; ls -l'
0
total 2
-r--r--r-- 1 root root 116 Aug 15 12:01 SUNWattr_ro
-rw-r--r-- 1 root root 408 Aug 15 12:01 SUNWattr_rw

ksh -c 'cd -@ tmpx; print $?'
/home/irek/bin/ksh: cd: tmpx: [No such file or directory]
1

Thank you for fixing it

Irek
Glenn Fowler
2013-08-15 14:06:12 UTC
Permalink
I get this to work after changing "tmp" => "tmpx" -- must be a typo

but fiddling with your test uncovered an errno leak

ksh -c 'mkdir tmpx; cd -@ tmpx; ls -l; cd ..; rmdir tmpx; cd -@ tmpx'

produces

ksh: cd: tmpx: [Bad file number]

this is a problem in the ksh cd O_XATTR logic -- just fixed
Irek Szczesniak
2013-08-15 10:09:25 UTC
Permalink
Post by Glenn Fowler
the AT&T Software Technology ast alpha 2013-08-14 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 ab18ae3ed80758d27adc2937d1877cae
ast-ksh 7aade4e56a21b5fdbf64504cd2c5cd29
the md5 sums should match the ones listed on the download page
this alpha is limited to ast-ksh mainly to verify that recent
portability/emulation changes are working
these will be addressed first so we can move on to other things
we've gone through a couple of rounds of this because we want
gnarly patches to be consolidated in one part of the code
and in that process dgk+gsf have had a few disconnects with the patches
basically we would really like to have the bulk of ast #ifdef's
in the libast and a few other libs and leave the commands/plugins
fairly clean
changes since 2013-08-07
13-08-12 --- Release ksh93v- ---
13-08-12 A bug in which background jobs where not removed after the
user was notified about completion has been fixed.
13-08-11 A bug in which subscripts were evaluated twice for subscripts
on the left hand side of assignments make by typeset has been fixed.
13-08-11 +namespace was modified so that namespace names can be a compound
variable rather than just an identifier and namespace are no
longer nested.
13-08-07 typeset -p (and print -v) now display the sort attribute for
typeset -sF and typeset -sE.
str=$( ) is seriously broken if there are more than a few megabytes
put into str. I'm still trying to debug the issue. Something cuts the
data off in the middle.

Irek
David Korn
2013-08-15 22:45:26 UTC
Permalink
cc: ast-developers at research.att.com
Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha software download update
--------
Post by Irek Szczesniak
ksh tst1.sh
tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent
Irek
Try this patch and see if it fixed the types problem in namespaces.
=====================cut here======================
--- old/sh/xec.c Mon Aug 12 13:22:06 2013
+++ new/sh/xec.c Thu Aug 15 18:01:37 2013
@@ -1124,11 +1124,20 @@
#if SHOPT_NAMESPACE
if(shp->namespace)
{
+ char *sp,*xp;
if(!shp->strbuf2)
shp->strbuf2 = sfstropen();
sfprintf(shp->strbuf2,"%s%s%c",NV_CLASS,nv_name(shp->namespace),0);
shp->prefix = strdup(sfstruse(shp->strbuf2));
- nv_open(shp->prefix,shp->var_base,NV_VARNAME);
+ xp = shp->prefix+strlen(NV_CLASS);
+ for(sp=xp+1;sp;)
+ {
+ if(sp = strchr(sp,'.'))
+ *sp = 0;
+ nv_open(shp->prefix,shp->var_base,NV_VARNAME);
+ if(sp)
+ *sp++ = '.';
+ }
}
else
#endif /* SHOPT_NAMESPACE */
=====================cut here======================

David Korn
dgk at research.att.com
Roland Mainz
2013-08-16 04:42:10 UTC
Permalink
Post by David Korn
cc: ast-developers at research.att.com
Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha software download update
--------
Post by Irek Szczesniak
ksh tst1.sh
tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent
Irek
Try this patch and see if it fixed the types problem in namespaces.
=====================cut here======================
--- old/sh/xec.c Mon Aug 12 13:22:06 2013
+++ new/sh/xec.c Thu Aug 15 18:01:37 2013
[snip]
Post by David Korn
=====================cut here======================
The patch seems to fix half the problems. The types can now be defined
but a variable declared with such a type can't find it's type
functions:
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 )
; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; } ; .a.b.c.x_t var
; var.pi'
/bin/ksh: var.pi: not found
-- snip --
AFAIK this should print "10" ...

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
Roland Mainz
2013-08-16 05:18:50 UTC
Permalink
Post by Roland Mainz
Post by David Korn
cc: ast-developers at research.att.com
Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha software download update
--------
Post by Irek Szczesniak
ksh tst1.sh
tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent
Irek
Try this patch and see if it fixed the types problem in namespaces.
=====================cut here======================
--- old/sh/xec.c Mon Aug 12 13:22:06 2013
+++ new/sh/xec.c Thu Aug 15 18:01:37 2013
[snip]
Post by David Korn
=====================cut here======================
The patch seems to fix half the problems. The types can now be defined
but a variable declared with such a type can't find it's type
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 )
; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; } ; .a.b.c.x_t var
; var.pi'
/bin/ksh: var.pi: not found
-- snip --
AFAIK this should print "10" ...
... and it does... if I would've put the ')' at the right place:
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 ;
function pi { printf "i=%d\n" $((_.i+_.i)) ; } ) ; } ; .a.b.c.x_t var
; var.pi'
i=10
-- snip --

Sorry for the mess... |ENOCOFFEE| ... ;-(
... the patch works... thanks... :-)

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
Cedric Blancher
2013-08-16 08:18:53 UTC
Permalink
Post by Roland Mainz
Post by Roland Mainz
Post by David Korn
cc: ast-developers at research.att.com
Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha software download update
--------
Post by Irek Szczesniak
ksh tst1.sh
tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent
Irek
Try this patch and see if it fixed the types problem in namespaces.
=====================cut here======================
--- old/sh/xec.c Mon Aug 12 13:22:06 2013
+++ new/sh/xec.c Thu Aug 15 18:01:37 2013
[snip]
Post by David Korn
=====================cut here======================
The patch seems to fix half the problems. The types can now be defined
but a variable declared with such a type can't find it's type
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 )
; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; } ; .a.b.c.x_t var
; var.pi'
/bin/ksh: var.pi: not found
-- snip --
AFAIK this should print "10" ...
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 ;
function pi { printf "i=%d\n" $((_.i+_.i)) ; } ) ; } ; .a.b.c.x_t var
; var.pi'
i=10
-- snip --
Sorry for the mess... |ENOCOFFEE| ... ;-(
... the patch works... thanks... :-)
Arithmetic expressions still don't work in namespaces:
ksh -c 'namespace a1.a2 { integer n=2 ; print $((i+i)) ; }'
0

It should print '4'.

Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Cedric Blancher
2013-08-16 08:28:27 UTC
Permalink
Post by Cedric Blancher
Post by Roland Mainz
Post by Roland Mainz
Post by David Korn
cc: ast-developers at research.att.com
Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha software download update
--------
Post by Irek Szczesniak
ksh tst1.sh
tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent
Irek
Try this patch and see if it fixed the types problem in namespaces.
=====================cut here======================
--- old/sh/xec.c Mon Aug 12 13:22:06 2013
+++ new/sh/xec.c Thu Aug 15 18:01:37 2013
[snip]
Post by David Korn
=====================cut here======================
The patch seems to fix half the problems. The types can now be defined
but a variable declared with such a type can't find it's type
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 )
; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; } ; .a.b.c.x_t var
; var.pi'
/bin/ksh: var.pi: not found
-- snip --
AFAIK this should print "10" ...
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 ;
function pi { printf "i=%d\n" $((_.i+_.i)) ; } ) ; } ; .a.b.c.x_t var
; var.pi'
i=10
-- snip --
Sorry for the mess... |ENOCOFFEE| ... ;-(
... the patch works... thanks... :-)
ksh -c 'namespace a1.a2 { integer n=2 ; print $((i+i)) ; }'
0
It should print '4'.
Copying .sh.sig data in a namespace doesn't work either:
namespace a.b
{
compound c
compound -a c.car
integer c.cari=0

trap 'c.car[$((c.cari++))]=.sh.sig' USR1 USR2 RTMIN

kill -q4 -s USR1 $$
kill -q17 -s USR2 $$

print -v c
}

This prints:

ksh x.sh
x.sh: line 9: .sh.sig.value.ptr: is read only
x.sh: line 10: .sh.sig.value.ptr: is read only
(
typeset -C -a car=(
[0]=(
typeset -C value
)
[1]=(
typeset -C value
)
)
typeset -l -i cari=2
)

This is dead wrong. It should print the copied siginfo (.sh.sig) data.

Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Cedric Blancher
2013-08-16 09:03:38 UTC
Permalink
Post by Roland Mainz
Post by Cedric Blancher
Post by Roland Mainz
Post by Roland Mainz
Post by David Korn
cc: ast-developers at research.att.com
Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha software download update
--------
Post by Irek Szczesniak
ksh tst1.sh
tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent
Irek
Try this patch and see if it fixed the types problem in namespaces.
=====================cut here======================
--- old/sh/xec.c Mon Aug 12 13:22:06 2013
+++ new/sh/xec.c Thu Aug 15 18:01:37 2013
[snip]
Post by David Korn
=====================cut here======================
The patch seems to fix half the problems. The types can now be defined
but a variable declared with such a type can't find it's type
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 )
; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; } ; .a.b.c.x_t var
; var.pi'
/bin/ksh: var.pi: not found
-- snip --
AFAIK this should print "10" ...
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 ;
function pi { printf "i=%d\n" $((_.i+_.i)) ; } ) ; } ; .a.b.c.x_t var
; var.pi'
i=10
-- snip --
Sorry for the mess... |ENOCOFFEE| ... ;-(
... the patch works... thanks... :-)
ksh -c 'namespace a1.a2 { integer n=2 ; print $((i+i)) ; }'
0
It should print '4'.
namespace a.b
{
compound c
compound -a c.car
integer c.cari=0
trap 'c.car[$((c.cari++))]=.sh.sig' USR1 USR2 RTMIN
kill -q4 -s USR1 $$
kill -q17 -s USR2 $$
print -v c
}
ksh x.sh
x.sh: line 9: .sh.sig.value.ptr: is read only
x.sh: line 10: .sh.sig.value.ptr: is read only
(
typeset -C -a car=(
[0]=(
typeset -C value
)
[1]=(
typeset -C value
)
)
typeset -l -i cari=2
)
This is dead wrong. It should print the copied siginfo (.sh.sig) data.
namespace a.b
{
print -v .sh.stats
}

prints

(
)

which is dead wrong, too.

Using .sh.match in namespace a.b { } however works.

Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Tina Harriott
2013-08-17 09:37:35 UTC
Permalink
Post by Cedric Blancher
Post by Roland Mainz
Post by Roland Mainz
Post by David Korn
cc: ast-developers at research.att.com
Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha software download update
--------
Post by Irek Szczesniak
ksh tst1.sh
tst1.sh: line 3: .sh.type.com.gelifesciences.tst1: no parent
Irek
Try this patch and see if it fixed the types problem in namespaces.
=====================cut here======================
--- old/sh/xec.c Mon Aug 12 13:22:06 2013
+++ new/sh/xec.c Thu Aug 15 18:01:37 2013
[snip]
Post by David Korn
=====================cut here======================
The patch seems to fix half the problems. The types can now be defined
but a variable declared with such a type can't find it's type
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 )
; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; } ; .a.b.c.x_t var
; var.pi'
/bin/ksh: var.pi: not found
-- snip --
AFAIK this should print "10" ...
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 ;
function pi { printf "i=%d\n" $((_.i+_.i)) ; } ) ; } ; .a.b.c.x_t var
; var.pi'
i=10
-- snip --
Sorry for the mess... |ENOCOFFEE| ... ;-(
... the patch works... thanks... :-)
ksh -c 'namespace a1.a2 { integer n=2 ; print $((i+i)) ; }'
0
It should print '4'.
That's IMO the biggest limitation of the new namespace system. Its
getting hard to use them in any practical application if arithmetics
with variables don't work.

Tina
--
Tina Harriott - Women in Mathematics
Contact: tina.harriott.math at gmail.com
David Korn
2013-08-19 19:55:09 UTC
Permalink
cc: ast-developers at research.att.com iszczesniak at gmail.com
Subject: Re: Re: [ast-developers] AT&T Software Technology ast alpha software download update
--------
Post by Roland Mainz
The patch seems to fix half the problems. The types can now be defined
but a variable declared with such a type can't find it's type
-- snip --
$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5 )
; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; } ; .a.b.c.x_t var
; var.pi'
/bin/ksh: var.pi: not found
-- snip --
AFAIK this should print "10" ...
----
Bye,
Roland
This example looks wrong. typeset -T x_t=( integer i=5 ) is
a complete type definition and pi is not part of the type


I assume you meant the following which does print 10.

$ ksh -o nounset -c 'namespace a.b.c { typeset -T x_t=( integer i=5
; function pi { printf "i=%d\n" $((_.i+_.i)) ; } ; }) ; .a.b.c.x_t var
; var.pi'

David Korn
dgk at research.att.com

Loading...