Sujet : Re: Returning no value
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.lispDate : 19. Jul 2024, 18:55:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240719095207.219@kylheku.com>
References : 1
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-07-18, B. Pym <
Nobody447095@here-nor-there.org> wrote:
Another way.
>
(define (foo) (let1 x (random-integer 10) (and (< 5 x) x)))
>
(filter-map (^_ (foo)) (iota 10))
===>
(7 8 9 6 6 7)
This is the TXR Lisp interactive listener of TXR 295.
Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
Please listen carefully to the following spec, as our Lisp has changed.
1> [keep-keys-if (op < 5) 0..10 (ret (rand 10))]
(9 9 7)
2> [keep-keys-if (op < 5) 0..10 (ret (rand 10))]
(6 8 8 7)
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca