(mapcan #'(lambda (x) (and (numberp x) (list x))) list)
(loop for x in list
when (numberp x) collect x)
I agree with this example. Once I learned LOOP I never used the
above idiom again.
[noise]
Robert L. <No_spamming@noWhere_7073.org> wrote:
[noise]Wow, the quoted text in this post seems to be from 1994. Trolls gonna
troll, I suppose.
Comments on LISP are not noise in comp.lang.lisp.
Answering an old post is not trolling.
(mapcan #'(lambda (x) (and (numberp x) (list x))) list)
(loop for x in list
when (numberp x) collect x)
I agree with this example. Once I learned LOOP I never used the
above idiom again.
Barry Margolin wrote:
(mapcan #'(lambda (x) (and (numberp x) (list x))) list)
(loop for x in list
when (numberp x) collect x)
I agree with this example. Once I learned LOOP I never used the
above idiom again.
(filter number? '(a b c 1 2 3))
(1 2 3)
(mapcan #'(lambda (x) (and (numberp x) (list x))) list)
(loop for x in list
when (numberp x) collect x)
I agree with this example. Once I learned LOOP I never used the
above idiom again.
Barry Margolin wrote:
(mapcan #'(lambda (x) (and (numberp x) (list x))) list)
(loop for x in list
when (numberp x) collect x)
I agree with this example. Once I learned LOOP I never used the
above idiom again.
(filter number? '(a b c 1 2 3))
(1 2 3)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 403 |
Nodes: | 16 (2 / 14) |
Uptime: | 43:30:41 |
Calls: | 8,407 |
Calls today: | 2 |
Files: | 13,171 |
Messages: | 5,905,019 |