cc: rbtneville at gmail.com
Subject: Re: [ksh93-integration-discuss] Tree variable?
--------

> While combing through the list archives I found the term 'tree
> variable' multiple times which is not documented in the ksh manual
> page. Is this an undocumented feature or am I just not looking hard
> enough? How do I use tree variables in ksh?
>

I beleive that the term 'tree variable' is a synonym for compound
variable which is documented in "The New Kornshell Command and
Programming Language Book" and in the man page.

However. there have been many improvements to compound variables
since the original ksh93, not all if which have been documents.

In ksh93s+ both indexed and assoiative array variables can be compound
themselves and can even be part of a compound variable.
        food=(
                [meat]=(
                        integer quantity=100
                        float price=10.40
                )
                [milk]=(
                        integer quantity=100
                        float price=2.05
                )
        )
so that
        print ${food[meat].price}
outputs
        10.40
        
Name references work for compound variables so that
        nameref item=food[meat]
        print $((item.price))
will output 10.40.

David Korn
dgk at research.att.com

Reply via email to