Subject: Re: ACL 4.3 For Linux license concerns
From: Erik Naggum <erik@naggum.no>
Date: 1999/01/03
Newsgroups: comp.lang.lisp
Message-ID: <3124350472579338@naggum.no>

* Johan Kullstam <johan19@idt.net>
| i now get franz-lisp-mode when i visit a file with a .l (for *l*isp)
| ending.  first it cursed about me not having rsh.  i installed rsh and it
| made eli happy to fire off a slave lisp process.  (i don't use rsh for
| anything else, can i remove the dependency on it?)

  it is probably not a good idea to retain the franz-lisp mode in Franz
  Inc.'s ELI, but I'm not sure here.  there is no "Franz Lisp", anymore
  that I know of, and the stuff that applies to its files are different
  from that which applies to Common Lisp and Allegro CL.  so I took out
  the franz-lisp-mode stuff in my local version.

  for Allegro CL, the canonical Lisp file type is "lisp" or "cl".  lots of
  things become needlessly harder if you don't use either of these.

| i can pop between source editor and slaved lisp process with C-c l.  C-c
| C-b compiles.  so far so good.  i can type in the little function
| examples from grahams books and try them out in the lisp slave.  is this
| how you do it in general?

  I compile forms with C-M-x all the time, look at the value of special
  variables with C-u C-c C-s, request arglists with C-c a, macroexpand with
  C-c m, describe symbols with C-c d, and most usefully jump to definitions
  with C-c . and list callers with C-c c.  I also use fi:edit-who-calls
  (bound to C-c e) when I change the signature of a function.  all very
  useful stuff.  I also use the :edit top-level command a lot, and even use
  the ED function to edit files with logical pathnames, since Emacs doesn't
  (yet) interface to Allegro CL in that way.

| i am still a bit stumped about how the process is supposed to work.

  I find it hard to explain.  the way I use Allegro CL is a function of
  what I have discovered that I can do.  I fire up a number of listeners as
  the need arises and basically leave the Initial Lisp Listener alone (the
  trace output from Lisp processes go there, so it gets really cluttered if
  I try to do anything useful while tracing something).

| using make and command line compile commands and getting a normal unix
| executable as with C or fortran doesn't seem to be the right thing with
| lisp.

  that's right.  however, if you view the Unix way a little differently,
  it's actually a _subset_ of the way you do it in Lisp.  with Unix, you
  edit a file, invoke some function to make its definitions available in
  your environment, then invoke the function you just defined.  Unix stores
  its functions in files, while Lisp stores them in memory.  either way,
  you invoke them basically the same way: you give each command loop a form
  to evaluate (the parentheses are implied in Unix, and you get a PROGN
  wrapper for free if you use the ; syntax).  (the first word is even the
  name of the function.  prefix syntax rules!)

  the functions you invoke are just a little different between the two
  otherwise quite similar modes of operation.  take "foo.c" and "bar.cl".
  you would invoke the compiler on "foo".c and get "foo".  you would invoke
  COMPILE-FILE on "bar.cl" (or use FI:COMPILE-AND-LOAD-FILE directly from
  the buffer, which can conveniently be bound to the same key you bound M-x
  compile to in other modes).  Lisp needs you to LOAD the file if you
  hadn't already done that.  Allegro CL comes with three top-level commands
  that can save you some typing.  :cf (compile-file), :ld (load), and :cl
  (compile-and-load), and all abbreviated with wild abandon, just like Unix
  tools.  they also remember what you did last.  (I think they should have
  had the same memory, though.)

  Unix `make' is convenient in that it has a bunch of predefined ways to
  compile a number of files, and the Makefile is a nice place to store
  variable settings.  if you want to make use the DEFSYSTEM facility in
  Allegro CL, you'll find that the defaults are less elaborate and you
  might need to say something like

(defsystem :foo
    (:pretty-name "Functional Object Orientation"
     :default-pathname #L"foo:src;")
  (:serial "foo" "bar" "zot"))

  then you'd say (compile-system :foo) or (load-system :foo :compile t) or
  the like, and things are taken care of.  (it would have be nice if the
  top-level loop had had commands like :cs and :ls, but when I take the
  time to figure out how to make top-level commands, I'll post something.)

  all in all, I think of Unix depriving me of the conveniences, and being
  rather limited in functions that have to do everything to remember their
  previous state themselves, but, really, a Unix command is no different
  from calling a Lisp function:

  Lisp: (foo "x" 14 :mumble t :frotz nil)

  GNU style: foo --mumble --no-frotz x 14

  Unix style: foo -m -n x 14

  the conveniences in Unix (like `make') are there because the lack of them
  would be inconvenient.  that's how it usually goes with conveniences.  to
  see how that would work in a language that doesn't have those particular
  conveniences, step back a little and think of what you'd do without them:
  you'd call the C compiler yourself on the particular file, and specify
  the output file.  the conveniences of `make' is that it compiles only if
  needed and you don't need to tell it any file types.  unsurprisingly,
  that's what the :cl command does in Allegro CL.  the command :cl foo
  looks for a file foo.cl (or foo.lisp), sees if it is newer than the
  foo.fasl (or similar) file, compiles it if necessary, then loads it.  and
  just as `make' takes a list of files to make something from, :cl takes a
  list of files to compile and load.

  another bonus with LOAD-SYSTEM, by the way, is that it only loads the
  files it needs to load, so you don't run initializatio code unless you
  need to.  the same applies to forms you compile with C-M-x: they are
  compiled in the same environment they are expected to run: with all the
  other functions and variables loaded.  obviously, it works best to start
  off your work session by loading the last working version of your code.
  both LOAD (:ld) and LOAD-SYSTEM default to loading compile files rather
  than source files, so you're "safe" in that regard, too.

  I hope this helps.  I don't know any people who use Allegro CL exactly
  the same way, and what works for me may not even be useful advice for
  others.  and remember: nothing beats reading the manual.
  
#:Erik
-- 
  if people came with documentation, could men get the womanual?