Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z - Internet FAQ Archives

FAQ: Lisp Frequently Asked Questions 2/7 [Monthly posting]
Section - [2-11] How do I save an executable image of my loaded Lisp system? How do I run a Unix command in my Lisp? How do I exit Lisp?

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]

Top Document: FAQ: Lisp Frequently Asked Questions 2/7 [Monthly posting]
Previous Document: [2-10] What is garbage collection?
Next Document: [2-12] I'm porting some code from a Symbolics Lisp machine to some other platform, and there are strange characters in the code.
See reader questions & answers on this topic! - Help others by sharing your knowledge
                Access environment variables?

There is no standard for dumping a Lisp image. Here are the
commands from some lisp implementations:
   Lucid:               DISKSAVE
   Symbolics:           Save World  [CP command]
   CMU CL:              SAVE-LISP
   Franz Allegro:       EXCL:DUMPLISP (documented) 
                        SAVE-IMAGE (undocumented)
   Medley:              IL:SYSOUT or IL:MAKESYS
   MCL:                 SAVE-APPLICATION <pathname>
                          &key :toplevel-function  :creator :excise-compiler
                          :size :resources :init-file :clear-clos-caches
   KCL:                 (si:save-system "saved_kcl")
   LispWorks:		LW:SAVE-IMAGE
Be sure to garbage collect before dumping the image. You may need to
experiment with the kind of garbage collection for large images, and
may find better results if you build the image in stages.

There is no standard for running a Unix shell command from Lisp,
especially since not all Lisps run on top of Unix. Here are the
commands from some Lisp implementations:
   Allegro:             EXCL:RUN-SHELL-COMMAND (command &key input output
                                  error-output wait if-input-does-not-exist
                                  if-output-exists if-error-output-exists)
   Lucid:               RUN-PROGRAM (name 
                                     &key input output
                                          error-output (wait t) arguments
                                          (if-input-does-not-exist :error)
                                          (if-output-exists :error)
                                          (if-error-output-exists :error))
   KCL:                 SYSTEM 
                        For example, (system "ls -l").
                        You can also try RUN-PROCESS and EXCLP, but they
                        don't work with all versions of KCL.
   CMU CL:              RUN-PROGRAM (program args
			   &key (env *environment-list*) (wait t) pty input
			   if-input-does-not-exist output
			   (if-output-exists :error) (error :output) 
			   (if-error-exists :error) status-hook before-execve)

To toggle source file recording and cross-reference annotations, use
   Allegro:             excl:*record-source-file-info*
   LispWorks:           (toggle-source-debugging nil)

Memory management:
   CMU CL:              (bytes-consed-between-gcs)  [this is setfable]
   Lucid:		(change-memory-management 
      			   &key growth-limit expand expand-reserved)
   Allegro:		*tenured-bytes-limit*
   LispWorks:           LW:GET-GC-PARAMETERS
                        (use LW:SET-GC-PARAMETERS to change them)

Environment Variable Access:
   Allegro:             (sys:getenv var)
                        (sys:setenv var value) or (setf (sys:getenv var) value)
   Lucid:               (environment-variable var)
                        (set-environment-variable var value)
   CMU CL 17:           (cdr (assoc (intern var :keyword) *environment-list*))
   {A}KCL, GCL:         (system:getenv var)
   CLISP:               (system::getenv var)

   CLISP:               EXIT
   Allegro:             EXIT (&optional excl::code &rest excl::args
                              &key excl::no-unwind excl::quiet)
   LispWorks:           BYE (&optional (arg 0))
   Lucid:               QUIT (&optional (lucid::status 0))
   CMU CL:              QUIT (&optional recklessly-p)

User Contributions:

Comment about this article, ask questions, or add new information about this topic: