Another challenge
Posted: Mon Mar 07, 2011 7:05 pm
I thought this thread on comp.lang.lisp was quite entertaining https://groups.google.com/d/topic/comp. ... discussion. It's to produce the list:
Can you provide a newLISP alternative to the various loops, mapcans, collects, iters, and nconcs? Can you avoid creating intermediate storage? Can you do all this while resisting the urge to insult other programmers?! :)
Obviously, there's a simple iterator solution, using two dolists. I found a shortcut in newLISP. Can you find it?
Code: Select all
((1 "a") (1 "b") (1 "c") (1 "d") (2 "a") (2 "b") (2 "c") (2 "d") (3 "a")
(3 "b") (3 "c") (3 "d") (4 "a") (4 "b") (4 "c") (4 "d") (5 "a") (5
"b") (5 "c") (5 "d"))
Can you provide a newLISP alternative to the various loops, mapcans, collects, iters, and nconcs? Can you avoid creating intermediate storage? Can you do all this while resisting the urge to insult other programmers?! :)
Obviously, there's a simple iterator solution, using two dolists. I found a shortcut in newLISP. Can you find it?