Sujet : Re: UID: Generating pointers in awk
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.awkDate : 16. Oct 2024, 19:49:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241016114310.131@kylheku.com>
References : 1 2 3 4
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-10-16, Manuel Collado <
mcollado2011@gmail.com> wrote:
El 13/10/24 a las 20:19, Kaz Kylheku escribió:
...
You can pass associative arrays down into functions, but not
return them, or assign them from one variable to another.
>
Well, instead of
arr = a_func(args)
you can modify a_func to have
a_func(args, arr)
I understand how to get array data out of a function.
This breaks the abstraction and is also monstrously inefficient.
Imagine that objects are modeled with associative arrays. Now you have
to copy every time you want to simulate returning an object
from a function.
If the objects are treated as having mutable properties, the semantics
is wrong. You can't return an object by copy if you need the caller
to be able to mutate the original.
HTH.
No, it doesn't, sorry.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca