Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

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



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: