RE: Init file commands crashing
> -----Original Message-----
> From: owner-lisp-hug@lispworks.com
> [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Thomas Summerall
> Sent: Thursday, February 07, 2008 12:45 PM
> To: lisp-hug@lispworks.com
> Subject: Init file commands crashing
>
>
>
> I have set up an initialization file (.lispworks) so I can
> have LW execute some commands I am constantly typing in after
> it launches.
>
> There are two commands I always use after loading and
> compiling my project file:
>
> (in-package..)
> (start-my-code)
>
> If I load and compile my project file then type those two
> commands in the listener everything is fine.
>
> If I instead put a (compile-if-needed "myfile" :load t) in
> the init file followed by the two commands above I get a
> crash into my command line:
>
> "/tmp/LWtemp.MYCOMPUTERNAME.local.235.0.command; exit
> my-routine.nfasl ;Loading fasl file
> /Users/MYUSERNAME/myproject/myfilename.fasl
> ;Loading fasl file /Users/MYUSERNAME/myproject/abotherfilename.fasl
> etc
>
> ERROR: Bad arguments to MYROUTINENAME: NIL NIL"
>
> So my questions is, what's different about putting the
> commands in the init file? Or is there a difference I need
> to know about between (compile-file-if-needed) and the
> process of opening the project file and clicking the compile button?
>
> I tried this using the model init file and adding the
> commands at the end and also with an init file that only has
> these commands.
>
> Thanks for any help on this.
>
Hi Thomas,
I guess you should make sure, your code is run after certain
LispWorks initialization code, so your code finds a sufficient environment.
I think this is typically done be define-action.
Here is my .lispworks which start my personal project manager for example:
;; Starting the Project Manager
(in-package "CL-USER")
(load "~/.repository")
(define-action "Initialize Lispworks Tools" "Start Project Manager"
(lambda (&rest args)
(load (pm-file "prod/projects/pr-ld"))
(funcall (find-symbol "PM-RUN" "PMAN"))
(use-package "PMAN")))
Happy Lisping
Andreas