[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: should es have a recursion depth limit?



Bill Trost wrote
> The thing that most drives me up the wall about emacs lisp is the fact
> that it's completely impossible to write any serious recursive
> functions because of the stupid max-lisp-eval-depth.  I have the
> feeling I would very quickly bump into this "feature" [bah!] if you
> added it to es.

> As an option for debugging scripts, it might be reasonable, but the
> default very much needs to be infinite, but don't cripple the language
> to "protect" the programmer from their mistakes.

based on an off-line suggestion from Noah, the proposal now includes
the ability to turn the feature off (by setting the variable to 0).

i actually doubt very seriously whether you'll bump into the limit
very soon.  run this test, and see how high the numbers go:

	fn x { echo $#*; x 1 $* }
	x

i got to 71 on one machine and 244 on another.  (that 71 may be a
garbage collector bug, but the other was defintely a stack overflow.)

the lack of proper tail calling is what gets in the way of me writing
serious recursive functions.  such a limit is just meant to allow es
to fail properly.

i hope that this addresses your concerns.  if not, please let me know
how to make it better while still allowing es to run without crashing
when the user does something stupid (which many of us have done) like

	fn ls { ls -F $* }

paul