3 ms·
How do you prevent common Lisp idioms from being quadratic in that case? I noticed this about Norvig's toy Lispy: https://norvig.com/lispy.html https://norvig
by chubot 3y ago
How do you prevent common Lisp idioms from being quadratic in that case?
I noticed this about Norvig's toy Lispy:
https://norvig.com/lispy.html https://norvig.com/lispy.html
It implements cdr as mylist[1:]
So if you recurse on a list with cdr, then you will get mylist[1:] mylist[2:] ... mylist[n:], which is a quadratic algortihm