Re: UID: Generating pointers in awk

Liste des GroupesRevenir à cl awk 
Sujet : Re: UID: Generating pointers in awk
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.awk
Date : 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/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
11 Oct 24 * Re: UID: Generating pointers in awk6digi_cs
13 Oct 24 `* Re: UID: Generating pointers in awk5Janis Papanagnou
13 Oct 24  `* Re: UID: Generating pointers in awk4Kaz Kylheku
13 Oct 24   +- Re: UID: Generating pointers in awk1Janis Papanagnou
16 Oct 24   `* Re: UID: Generating pointers in awk2Manuel Collado
16 Oct 24    `- Re: UID: Generating pointers in awk1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal