Pop-Up Thingie
Sidebar
Too Lazy BBS
Home
Forum
Files
Chat
Bulletins
Top doors
MOTD
BBS Stats
Radio
AvatarChat
Dark
Register
Log in
Username
Password
Sidebar
Forum
USENET
comp.lang.lisp
Merging strings
From
B. Pym
@Nobody447095@here-nor-there.org to
comp.lang.lisp,comp.lang.scheme
on Fri Jul 4 14:22:14 2025
From Newsgroup: comp.lang.lisp
You have a list contain both strings and numbers.
Generate a new list in which the adjacent strings
have been concatenated.
Scheme
(define (merge-strings List)
(reverse
(fold
(lambda (e accum)
(if (and (string? e) (pair? accum) (string? (car accum)))
(cons (string-append (car accum) e) (cdr accum))
(cons e accum)))
'()
List)))
(merge-strings '("1" "2" 3 4 "5" "6" 7 8 "9"))
===>
("12" 3 4 "56" 7 8 "9")
--- Synchronet 3.21d-Linux NewsLink 1.2
Who's Online
Recent Visitors
Geek2
Thu Jul 2 11:41:05 2026
from
Euclid, Oh
via
Telnet
Hannibal
Thu Jul 2 05:49:27 2026
from
Des Moines
via
SSH
Geek2
Wed Jul 1 16:31:20 2026
from
Euclid, Oh
via
Telnet
Hannibal
Tue Jun 30 16:45:42 2026
from
Des Moines
via
SSH
System Info
Sysop:
Amessyroom
Location:
Fayetteville, NC
Users:
70
Nodes:
6 (
0
/
6
)
Uptime:
37:48:36
Calls:
948
Calls today:
2
Files:
1,325
Messages:
280,560