yes, 'apply' has a stack limit, you could change that when starting up newlisp using the -s commandline option, but I believe for what you are trying to do, you don't need it.
If you are looking for the longest string in your parsed text you could just sort it by length this way:
Code: Select all
> (set 'txt "this is an example for corumullion")
"this is an example for corumullion"
> (first (sort (parse txt { |\n} 2) (fn (x y) (> (length x) (length y)))))
"corumullion"
>
when sorting, you can tell 'sort' what function to use when sorting. In this case:
(fn (x y) (> (length x) (length y))
This is a typical LISP thing: passing a function as a parameter to another function.
Lutz