• Re: I cannot find a word better than "CAR"

    From B. Pym@21:1/5 to Rob Warnock on Wed Aug 13 16:41:23 2025
    Rob Warnock wrote:

    The one place I find myself frequently using CDD*R
    is in destructuring lists by "gulps" in LOOP, e.g.:

    > (defun group-by-triples (list)
    (loop for (a b c) on list by #'cdddr
    collect (list a b c)))

    GROUP-BY-TRIPLES
    > (group-by-triples '(0 1 2 3 4 5 6 7 8 9 10 11 12))

    ((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12 NIL NIL))

    Gauche Scheme

    (define (triples s)
    (do ((r () (cons (& list 3 (pop~ s)) r)))
    ((null? s) (reverse r))))

    (triples (iota 13))
    ===>
    ((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12 #f #f))

    Given:

    (define-macro &
    (lambda (op n expr) `(,op ,@(make-list n expr))))

    (define-syntax pop~
    (syntax-rules ()
    [ (_ xs)
    (if (pair? xs)
    (begin0 (car xs) (set! xs (cdr xs)))
    #f) ] ))

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cor@21:1/5 to All on Mon Aug 18 20:53:53 2025
    'Lorry would ne maahty fine 2

    cc
    --

    Any marginally usable programming language approaches an ill
    defined barely usable re-implementation of half of common-lisp
    'Paraphrased

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence =?iso-8859-13?q?D=FFOlivei@21:1/5 to All on Mon Aug 18 23:31:30 2025
    POP-2 had “hd” and “tl” (short for “head” and “tail”, obviously).

    Actually its lists were made up of “pairs” -- records with two fields, named “front” and “back” -- probably the closest equivalents to traditional Lisp “car” and “cdr”. But the list data model included lazy evaluation as standard. So “tl” would look at “back”, and if that was a pointer to another pair, it would return that.

    But if it was a pointer to a special object which meant “evaluate me to
    get the next element in the list”, then it would do so, substitute the returned pair as “back”, and return it. That returned pair could have another version of the same object as its “back” to continue the list, or “nil” to mark its end.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cor@21:1/5 to All on Mon Aug 18 23:56:50 2025
    Some entity, AKA Lawrence D’Oliveiro <[email protected]d>
    wrote this mindboggling stuff:
    (selectively-snipped-or-not-p)

    POP-2 had “hd” and “tl” (short for “head” and “tail”, obviously).

    fi and la sound more musical as first/last.

    but anyways ... ;-)

    My reaction was to that Pymlical endless postings about all
    kinds of more or less trivial stuff.
    Which by the way makes me wonder if his pymliness has ever produced
    anything halfway usefull to the nooby mouse clicking user given all the timewasting postings.

    cc

    --

    Any marginally usable programming language approaches an ill
    defined barely usable re-implementation of half of common-lisp
    'Paraphrased

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From George Neuner@21:1/5 to Cor on Tue Aug 19 12:07:59 2025
    On Mon, 18 Aug 2025 23:56:50 +0000, Cor <[email protected]> wrote:

    Some entity, AKA Lawrence D’Oliveiro <[email protected]d>
    wrote this mindboggling stuff:
    (selectively-snipped-or-not-p)

    POP-2 had “hd” and “tl” (short for “head” and “tail”, obviously).

    fi and la sound more musical as first/last.

    except that 'la' follows 'sew'
    8-)

    https://en.wikipedia.org/wiki/Do-Re-Mi



    but anyways ... ;-)

    My reaction was to that Pymlical endless postings about all
    kinds of more or less trivial stuff.
    Which by the way makes me wonder if his pymliness has ever produced
    anything halfway usefull to the nooby mouse clicking user given all the >timewasting postings.

    cc

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