XPost: comp.lang.scheme
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.
[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
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)