newLISP DLL command-line options?

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

newLISP DLL command-line options?

Post by Sammo »

Hi Lutz,

The manual says, "When starting newLISP from the command line, options ... can be specified ..." and then proceeds with explanations of the various switches. Are some or any of these options available or useful with the newLISP.DLL? In particular, is the stack size switch (-s) available with the DLL?

Thanks,
-- Sam

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

At the moment none of the options are available in the DLL. The stacks size currently defined as 1024 in CPU_STACK in newlisp.c seems to be enough for all applications I know. Personally I never ran into that limit and I don't know of any user who did. For many years it was at 256 and nobody seemed to care, as newLISP grew I punped it up to 1024.

Some LISP programmers insist on doing all interations through lists with recursion. In most cases a 'dolist' or other iterative formulation of an algorithm is possible and faster or not necessary at all. I.e. 'append' and many other functions in newLISP take an unlimited number of arguments.

Where recursion is necessary or preferred for a more elegant, understandable solution the limit of 1024 seems to be sufficient.

It is also not clear to me how this limit is handled on Windows these days. It used to be that a DLL shares the max call stack and size with the parent process.

If you think that, this is important for your application I will reconsider and put something in the DLL (would be relatively easy) so you can reset it.

Lutz

Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Post by Sammo »

I don't think I need any of the options although I may have to change my coding style a bit. Is newLISP tail recursive? I ask because I am familiar with Scheme and I'm used to writing loops "recursion style" without worrying about stack limits.

Thanks,
-- Sam

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

newLISP does no tail-recursion optimization. Fortunately those tail-recursive routines are also the easiest to re-write them to an iterative pattern.

Lutz

Locked