• HID: LIST - list array

    From digi_cs@cosmogen@gmail.com to comp.lang.awk on Thu Oct 17 07:44:41 2024
    From Newsgroup: comp.lang.awk



    @include �github.com/digics/UID10/uid.lib�

    LIST = hid::get( �LIST� )

    An array (A) in AWK can represent a list of unique items with an undefined order.
    To introduce the concept of an array with a defined sequence of its indexes (items),
    we need to specify this sequence in a subarray A[LIST] as a simple list.

    # items of A: first, next and last:

    A[ LIST ][ �� ] = �first�
    [ �first� ] = �next�
    [ �next� ] = �last�
    [ �last� [ = ��
    [ �first� ]...
    [ �next� ]...
    [ �last� ]...

    Thus, instead of a for-in loop for array A, we use:

    i = ��
    while ( �� != i = A[ LIST][ i ] )

    # process A[ i ]

    or

    for ( i = ��; �� != i = A[ LIST ][ i ]; )

    # process A[ i ]

    At the same time, we can still work with the main array in a for-in loop � with one caveat:

    for ( i in A )
    if ( i in HID )
    continue # this is hid (LIST)
    else
    # process A[ i ]


    --------------= Posted using GrabIt =----------------
    ------= Binary Usenet downloading made easy =---------
    -= Get GrabIt for free from https://www.shemes.com/ =-

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From digi_cs@cosmogen@gmail.com to comp.lang.awk on Thu Oct 17 07:54:20 2024
    From Newsgroup: comp.lang.awk

    HID: LIST

    @include �github.com/digics/UID10/uid.lib�

    LIST = hid::get( �LIST� )

    An array (A) in AWK can represent a list of unique items with an undefined order.
    To introduce the concept of an array with a defined sequence of its indexes (items),
    we need to specify this sequence in a subarray A[LIST] as a simple list.

    # items of A: first, next and last:

    A[ �LIST� ][ �� ] = �first�
    [ �first� ] = �next�
    [ �next� ] = �last�
    [ �last� [ = ��
    [ �first� ]...
    [ �next� ]...
    [ �last� ]...

    Thus, instead of a for-in loop for array A, we use:

    i = ��
    while ( �� != i = A[ LIST][ i ] )

    # process A[ i ]

    or

    for ( i = ��; �� != i = A[ LIST ][ i ]; )

    # process A[ i ]

    At the same time, we can still work with the main array in a for-in loop � with one caveat:

    for ( i in A )
    if ( i in HID )
    continue # this is hid (LIST)
    else
    # process A[ i ]


    --------------= Posted using GrabIt =----------------
    ------= Binary Usenet downloading made easy =---------
    -= Get GrabIt for free from https://www.shemes.com/ =-

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From gazelle@gazelle@shell.xmission.com (Kenny McCormack) to comp.lang.awk on Fri Oct 18 18:04:16 2024
    From Newsgroup: comp.lang.awk

    in article <67109719$0$715$14726298@news.sunsite.dk>,
    digi_cs <cosmogen@gmail.com> wrote:


    @include github.com/digics/UID10/uid.lib

    Why post it twice, and why all the ^Ss and ^Ts?
    --
    When I was growing up we called them "retards", but that's not PC anymore.
    Now, we just call them "Trump Voters".

    The question is, of course, how much longer it will be until that term is also un-PC.
    --- Synchronet 3.20a-Linux NewsLink 1.114