Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.awk > #9856

Re: UID: Generating pointers in awk

From Kaz Kylheku <643-408-1753@kylheku.com>
Newsgroups comp.lang.awk
Subject Re: UID: Generating pointers in awk
Date 2024-10-16 18:49 +0000
Organization A noiseless patient Spider
Message-ID <20241016114310.131@kylheku.com> (permalink)
References <67098add$0$711$14726298@news.sunsite.dk> <vegube$oouk$1@dont-email.me> <20241013110940.843@kylheku.com> <veokj4$29jvm$1@dont-email.me>

Show all headers | View raw


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

Back to comp.lang.awk | Previous | NextPrevious in thread | Find similar


Thread

Re: UID: Generating pointers in awk "digi_cs" <cosmogen@gmail.com> - 2024-10-11 23:26 +0300
  Re: UID: Generating pointers in awk Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-10-13 19:00 +0200
    Re: UID: Generating pointers in awk Kaz Kylheku <643-408-1753@kylheku.com> - 2024-10-13 18:19 +0000
      Re: UID: Generating pointers in awk Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-10-13 20:55 +0200
      Re: UID: Generating pointers in awk Manuel Collado <mcollado2011@gmail.com> - 2024-10-16 17:03 +0200
        Re: UID: Generating pointers in awk Kaz Kylheku <643-408-1753@kylheku.com> - 2024-10-16 18:49 +0000

csiph-web