• (lambda (x) (list (car x) (length x))) using Cut or Cute?

    From HenHanna@HenHanna@devnull.tb to comp.lang.scheme on Sun Jun 9 16:25:24 2024
    From Newsgroup: comp.lang.scheme


    There's no way to write (lambda (x) (list (car x) (length x)))
    using Cut or Cute???
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From HenHanna@HenHanna@devnull.tb to comp.lang.scheme,comp.lang.lisp on Thu Jul 11 02:30:37 2024
    From Newsgroup: comp.lang.scheme


    There's no way to write

    -a (lambda (x) (list (car x) (length x)))

    -a -a-a-a-a using Cut or Cute ???

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Kaz Kylheku@643-408-1753@kylheku.com to comp.lang.scheme,comp.lang.lisp on Thu Jul 11 10:13:50 2024
    From Newsgroup: comp.lang.scheme

    On 2024-07-11, HenHanna <HenHanna@devnull.tb> wrote:

    There's no way to write

    -a (lambda (x) (list (car x) (length x)))

    -a -a-a-a-a using Cut or Cute ???

    That's more of a job for a jig called juxt:

    This is the TXR Lisp interactive listener of TXR 294.
    Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
    TXR's car insurance now offers cdr coverage for bumper-to-bumper
    protection.
    [juxt car length]
    #<intrinsic fun: 0 param + variadic>
    [*1 '(1 2 3)]
    (1 3)
    [*1 '(1 2 3 4 5 6)]
    (1 6)

    juxt takes functions as its arguments and returns a function.
    When that function is invoked, it passes its argument to each
    of the child functions, and returns a list of the values.
    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca
    --- Synchronet 3.22a-Linux NewsLink 1.2