On Thu, Apr 22, 2010 at 10:47:21AM -0400, David Korn wrote:
> Subject: Re: [ast-users] Discipline function with array values
> --------
> 
> 
> > Are discipline functions supposed to work with indexed array assignments?
> > In ksh 2010-03-05, I find that the set and append disciplines are never 
> > called
> > for variables assigned to with e.g. x=(a b) or set -A x a b.  Curiously, 
> > they
> > do work with associative arrays.  Also, once I've tried one of the above 
> > type
> > of assignments, the functions are no longer called for associative array or
> > scalar assignments.  But I specifically need indexed arrays.
> > 
> >         John
> > 
> 
> This is not clearly defined.
> 
>       x=(....)
> currently does an unset on x and the does the assignments.
> 
> So I would expect the the unset disciplines would be called for each of
> the elements that existed before the assignment.  However, any disciplines
> should be removed.
> 
> Since there is no discipline funtion yet defined, no set discipline should
> be called.
> 
> For
>       x+=(....)
> I would expect the set discipline to be called for each element.

Thanks for the explanation.  If it's in keeping with ksh syntax, it would be
very useful to be able to use arrays and compound variables as transparently as
the native data types are.  My hope was that .sh.value would appear as an array
containing all of the values.

I was also hoping that this would work:
function x.get { .sh.value=( a b c d ); }
But $x has only element 0 set.

        John
-- 
John DuBois     [email protected]   KC6QKZ/AE
I wish to God these calculations had been executed by steam. - Charles Babbage
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to