问题
I have a strange problem that couple of hours can't implement in Scheme. Let's say we have:
(define x '( (Orlando (NY 3))
(Chicago (Montana 5) (Orlando 8))
...and so on ...
)
I want to transform it to
'( (Orlando NY)
(Chicago Montana Orlando)
...and so on ...
)
Any help would be greatly appreciated.
回答1:
You could also try
(map
(lambda (x) (cons (car x) (map car (cdr x))))
x)
来源:https://stackoverflow.com/questions/20749277/remove-integers-from-list