News for hackers. Stuff that matters.
Re:Lisphp is a Lisp dialect written in PHP. by Scriptor on Monday July 05, 2010 @12:34PM (#1488554)
It could be mitigated in some cases as long as the garbage collector is working fine. For example, in a tail-recursive function that uses a first/rest pattern to go through an array a new copy would normally be allocated with each recurse. If LispHP can do some form of tail recursion elimination, it will theoretically take up constant memory and hopefully the GC takes care of the practical part.
Re:Lisphp is a Lisp dialect written in PHP. by jules on Monday July 05, 2010 @01:45PM (#1488694)
Even if memory usage weren't a problem you still have O(n) time for cdr. This may not be a problem if you implement the higher level functions (map, filter, etc.) efficiently.
Re:Lisphp is a Lisp dialect written in PHP. by eru on Tuesday July 06, 2010 @09:24AM (#1490871)
Yes, higher order functions (especially foldr (resp. reduce)) are the way to go.