From: Sam S. <sd...@gn...> - 2008-11-10 01:16:12
|
> * Bruno Haible <oe...@py...t> [2008-11-09 23:56:24 +0100]: > > Sam Steingold wrote: >> > The default value of a public API should be public. It'd >> > be good to make #'sys::main-loop public (either as a function, or as a >> > constant, I don't mind.) >> >> I made as explicit :INIT-FUNCTION NIL argument reset *DRIVER* to >> SYS::MAIN-LOOP. >> I think this is better than exposing MAIN-LOOP because it is >> counter-intuitive for an INIT-function to be called main-LOOP, >> while :INIT-FUNCTION NIL clearly means that there is no init, just the REPL. > > What if the user wants an init function which does some initialization > and then starts a REPL? > > :init-function (lambda () (my-init) (...what comes here??...)) in that case one can do it in two easy steps: 1. use :INIT-FUNCTION NIL to create a pristine CLISP REPL image 2. use :INIT-FUNCTION #'MY-INIT on that image to get what you are asking > Therefore I think we need to make the MAIN-LOOP function public. You are > certainly right about the name. How about > (defun ext:standard-read-eval-print-loop () (sys::main-loop)) > or > (defconstant ext:+standard-read-eval-print-loop+ #'sys::main-loop) > ? this looks like some extra complexity for a marginal win. let us not get carried away: most normal CLISP users have access to normal CLISP REPL images - either in their distribution or they build them themselves. this :INIT-FUNCTION NIL trick is for those people who have been given a CLISP-based application and who want to get a normal CLISP REPL out of it. I think these people are now well served. -- Sam Steingold (http://sds.podval.org/) on Ubuntu 8.04 (hardy) http://memri.org http://jihadwatch.org http://truepeace.org http://israelunderattack.slide.com http://palestinefacts.org http://camera.org Takeoffs are optional. Landings are mandatory. |