Pop-Up Thingie
Sidebar
Too Lazy BBS
Home
Forum
Files
Chat
Bulletins
Dark
Register
Log in
Username
Password
Who's Online
Recent Visitors
Guest
Sun May 18 01:43:09 2025
from
n
via
SSH
Daniel Garrod
Thu May 15 08:12:31 2025
from
Cambridge, Uk
via
Telnet
Daniel Garrod
Wed May 14 09:33:55 2025
from
Cambridge, Uk
via
Telnet
Amr
Sun May 11 19:13:33 2025
from
Fayetteville, Nc
via
Telnet
System Info
Sysop:
Amessyroom
Location:
Fayetteville, NC
Users:
28
Nodes:
6 (
0
/
6
)
Uptime:
43:32:59
Calls:
422
Calls today:
1
Files:
1,024
Messages:
90,182
Sidebar
Forum
Usenet
COMP.LANG.LISP
Re: Multivalue tail recursion?
From
B. Pym
@21:1/5 to
Kent M. Pitman
on Tue Aug 27 22:19:41 2024
XPost: comp.lang.scheme
Kent M. Pitman wrote:
(loop for x in '(3 5 7)
for y in '(2 5 8)
when (= x y)
collect (cons x y))
What if there were more than two lists?
This will handle any number of lists:
Scheme:
(filter-map
(lambda xs (and (apply = xs) xs))
'(0 3 5 7 9)
'(0 2 5.0 8 9.0)
'(2 4 5 8 9))
((5 5.0 5) (9 9.0 9))
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)