Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Your lucky number has been disconnected.


comp / comp.lang.lisp / (lambda (x) (list (car x) (length x))) using Cut or Cute?

SubjectAuthor
* (lambda (x) (list (car x) (length x))) using Cut or Cute?HenHanna
`- Re: (lambda (x) (list (car x) (length x))) using Cut or Cute?Kaz Kylheku

1
Subject: (lambda (x) (list (car x) (length x))) using Cut or Cute?
From: HenHanna
Newsgroups: comp.lang.scheme, comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 11 Jul 2024 09:30 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: HenHanna@devnull.tb (HenHanna)
Newsgroups: comp.lang.scheme,comp.lang.lisp
Subject: (lambda (x) (list (car x) (length x))) using Cut or Cute?
Date: Thu, 11 Jul 2024 02:30:37 -0700
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <v6o8nv$2d5j8$1@dont-email.me>
References: <v45dl4$3s5s5$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Jul 2024 11:30:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5997fecf5cbee109c90816f0e589a653";
logging-data="2528872"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5QGIntX/Fy61CAlkrb9jNsbThmghMuU8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:6G0dx7vHspFB5ZaNN9i+Bwbhdow=
In-Reply-To: <v45dl4$3s5s5$2@dont-email.me>
Content-Language: en-US
View all headers

There's no way to write

  (lambda (x) (list (car x) (length x)))

       using Cut or Cute ???

Subject: Re: (lambda (x) (list (car x) (length x))) using Cut or Cute?
From: Kaz Kylheku
Newsgroups: comp.lang.scheme, comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 11 Jul 2024 10:13 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.scheme,comp.lang.lisp
Subject: Re: (lambda (x) (list (car x) (length x))) using Cut or Cute?
Date: Thu, 11 Jul 2024 10:13:50 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <20240711030229.170@kylheku.com>
References: <v45dl4$3s5s5$2@dont-email.me> <v6o8nv$2d5j8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 11 Jul 2024 12:13:51 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1c1b3c01db2e58828e57902abb355a3e";
logging-data="2539091"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rX8nYY+jBmG5Ru0O7G+cXURkYwmdfY3Y="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:WtCERu+061tyKygmWWGVS+QpDGU=
View all headers

On 2024-07-11, HenHanna <HenHanna@devnull.tb> wrote:
>
> There's no way to write
>
>   (lambda (x) (list (car x) (length x)))
>
>        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.
1> [juxt car length]
#<intrinsic fun: 0 param + variadic>
2> [*1 '(1 2 3)]
(1 3)
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

1

rocksolid light 0.9.8
clearnet tor