• Re: UID: Generating pointers in awk

    From Janis Papanagnou@21:1/5 to All on Sun Oct 13 19:00:29 2024
    On 11.10.2024 22:26, digi_cs wrote:
    Janis: What do you mean by "strong values"?

    See documentation: hid

    This answer makes no sense, and it explains nothing.

    If you introduce arbitrary terms (here the attribute "strong"),
    and have not even enclosed the whole term in quotes (as I did)
    to indicate that you want to express some specific own concept,
    you should at least explain (here in your post) what you mean.

    Also, instead of issuing yet another new posts in a new threads
    please followup in your original thread to my post for a reply
    to my question so that I can see if and when you answered. That
    makes it also easier to ignore threads completely. That's what
    threads in Usenet are for.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Kaz Kylheku on Sun Oct 13 20:55:49 2024
    On 13.10.2024 20:19, Kaz Kylheku wrote:
    On 2024-10-13, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    On 11.10.2024 22:26, digi_cs wrote:
    Janis: What do you mean by "strong values"?

    See documentation: hid

    This answer makes no sense, and it explains nothing.

    I suspect "strong value" might be a superfluous synonym for "object".

    I wouldn't have associated that term with "object orientation" or
    some such. - I assume you have read his github docs?

    [ snip elaborations ]

    Is there a point in adding that to Awk? (Just interested in your
    opinion.) Personally if I want OO in scripting I'd rather choose
    any [scripting] language that supports it inherently (by design).

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Janis Papanagnou on Sun Oct 13 18:19:47 2024
    On 2024-10-13, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    On 11.10.2024 22:26, digi_cs wrote:
    Janis: What do you mean by "strong values"?

    See documentation: hid

    This answer makes no sense, and it explains nothing.

    I suspect "strong value" might be a superfluous synonym for "object".

    I.e. something that keeps its identity and state as you pass
    it around anywhere you like. It's strong because its pieces stay
    together, accessible through the same handle.

    In Awk, you can't pass aggregate values around other than strings.

    You can pass associative arrays down into functions, but not
    return them, or assign them from one variable to another.

    If arrays could be returned and assigned, they could be used to simulate objects with fields, like the way dicts are used in JS. (Which is not
    great, but better than hacks like indices into global arrays to simulate pointers.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Manuel Collado on Wed Oct 16 18:49:00 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to All on Fri Oct 11 18:07:27 2024
    On 11.10.2024 17:35, digi_cs wrote:
    Hello Everybody

    For those who write long programs in AWK, pointers and working with
    strong values are essential.

    What do you mean by "strong values"?


    I would like to introduce to my small project - a compact user-level
    awk library designed for generating "unique" strings that is may be
    used as the abstract pointers in awk.

    Do you (maybe) mean "references"? Or really "pointers" as we know them
    from C or C++?


    The library contains (I hope) good documentation

    In my opinion, this library is key for the further development of
    programming in awk as a whole. It provides users with pointers.

    In the documentation, I tried not only to describe the programming
    interface but also to briefly demonstrate the main techniques for
    using pointers in awk.

    Link to the project: https://github.com/digics/UID10

    I would really appreciate hearing any feedback, comments, and
    evaluations of my work. This applies to both the code itself and the documentation.

    A quick general comment...

    Awk is a HLL, abstracting from low-level constructs. It's beyond me
    why you think that pointers would be necessary or even "key for the
    further development of programming in awk as a whole".

    I might say more if I'll have read the documentation.

    BTW; I would have appreciated it if you'd have provided some minimum
    more concrete information here in this newsgroup about the features,
    rationale, and similar useful information, before directing us to
    external Web-links to github trees.

    Janis


    Best regards, Denis



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)