From: Sam S. <sd...@gn...> - 2004-08-11 14:55:05
|
> * Goffioul Michael <tbssvbhy@vzrp.or> [2004-08-11 15:36:08 +0200]: > > 1) if I add "quit();" at the end of my test program, I get a > segmentation fault that's because it calls quit_sofort() which throws to a non-existent address (see my previous message). > 2) could anybody help me to write the correct CLISP engine > initialization and termination functions? Bruno can. While he is silent and you have some cycles to burn, :-) remove if (!(setjmp(original_context) == 0)) goto end_of_main; from clisp_main and place it to the location where you want CLISP death to take you. Note however that original_context is only used by quit_sofort(), which is called by * loadmem() fsubr_argtype() subr_argtype() init_module_2 -- init functions just replace it with returning an error value and check the return value and exit from clisp_init() with the error value A quick-and-dirty solution would be to keep the long jump and just replace "goto end_of_main" with "return failed" * print_license() usage() main/DumpProcessMemoryMap main/no_mem -- you don't need these anyway * quit() -- just remove quit_sofort() from there altogether > 3) how would one "setq"? (using "funcall" fails because it's not a > function) see eval() in genclisp.d (disabled at this time) > 4) how to do create a new symbol? (using "intern", maybe) yes, or maybe you want to try preprocessing your code if you are creating lots of constant symbols. see clisp/utils/modprep.lisp and modules/*/*.c for examples. > 5) is there an easy way to get a symbol value? (other than > "find-symbol" + "symbol-value") Symbol_value(S(name)) -- Sam Steingold (http://www.podval.org/~sds) running w2k <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.honestreporting.com> Are you smart enough to use Lisp? |