![]() |
MCL: Mac Common Lisp | ![]() |
|
![]() |
chil home > lab only > polocies and procedures > |
The folder in which the MCL application resides is called the "CCL" folder, so I'll use that term throughout.
For MCL to run, certain folders must be present in the CCL folder. These are:
MCL-compiler-5.0
MCL-kernel-5.0
MCL-library-5.0
pmcl-OSX-kernel
When MCL launches, it will look for a file called "init.lisp" or "init.pfsl" and load that file. The default MCL setup in the lab has an "init.pfsl" file which will load every source or fasl file in the "Startup Items" folder in the CCL folder, in alphabetical order.
The CCL folder should contain a folder called "bincarbon". This is a special folder which contains library code. You invoke this code with the form REQUIRE. That is, if you say (require :seq-math), it will look in the "bincarbon" folder for a file called "seq-math.lisp", and if it's present, it will load that file. However, if the file contains a PROVIDE form, then the system will remember that it has been loaded and subsequent calls to REQUIRE won't load the file. Several bits of library code should be there, most of it stuff to support building experiments.
If you get a Lisp error 'The module "FOO" was required while loading' this means there's a REQUIRE form in the code and the expected file ("FOO") is not in the "bincarbon" folder. Check the directory
RedGiant/Public/Installers/MCL 5.0/bincarbon/
for the relevant file (which in my example would be "foo.lisp").
It is HIGHLY RECOMMENDED that you use the library code for writing experiments, especially "experiment-window.lisp." Talk to Byrne if you have questions about this file.
The MCL folder on RedGiant contains several extentions to the base Lisp environment which are loaded when MCL starts up. There are some variations on file names to get them to load in a particular order--this order is not always critical. These should include:
"00 convert-os-strings.lisp" Provides a menu on the "Edit" menu which will allow you to convert Mac/DOS/Unix line endings. Handy.
"01 load-color-coded.lisp" This is an extention that does Lisp source-code
coloring.
"25 sleep-wake.lisp" makes MCL behave nicely when it's active when a Mac wakes
up from sleep.
It mostly works the same as MCL 5.0 under OS X, with a particular modification. As noted with the subject running stuff, MCL needs to find certain files. These files are:
MCL-compiler-4.3.5
MCL-kernel-4.3.5
MCL-library-4.3.5
The application will look for these in two places: In the same folder as the application itself, and in the "Extensions" folder inside the active System Folder.
In the Listener, the symbol "*" refers to the last result returned at the toplevel, and "**" refers to the next to last one, and "***" to the one after that. This is often useful.
In the Listener, <option-g> will cycle through the last forms the Listener
evaluated. This is a very handy history mechanism.
"Apropos" on the "Lisp" menu is your friend. Command-period
cancels running Lisp code, and returns the Listener from an error break.
Your other best friend is "Backtrace" on the "Tools" menu. When you get some form of Lisp error, if you're trying to debug it, this thing rules. Select it (or just type <command-b>) and you'll see a window listing the call chain down to the current function. If you click on one of the functions in that window, you'll see a listing of the local variables (and many compiler-generated ones) for that function. This is really cool because it can give you a very clear picture of the system state when things died, including the values of pretty much any varible.
One of the cool things about Lisp is that you can always save pretty much
the entire current state of the MCL application at any given time. This is
referred
to as a Lisp "image", but in MCL it's accessed with the menu item
"Save Application..." on the "Tools" menu.
When you select this, a dialog box appears asking for certain information about
the application to be saved. You want to keep most of the defaults here, though
you generally want to set the "Minimum Size" to at least 10000 and
the "Preferred size" to 30000 or 40000. (This is how much RAM the
application will request when it launches.)
You also probably want to change the "Application Signature" to something else. This is the code the Mac OS uses to determine which files belong to which applications. When you launch a file with a particular signature (also called a "creator code"), Mac OS will look around for the newest application with that signature. Since you don't want all your MCL files to launch random other experiments, you should change this to something other than the default. For experiments, we use "CX##" where ## is replaced with the experiment number.
You may also need to specify a resource file. If your application uses a special set of resources (sounds, picts, icons, whatever) that the experiment needs, those should all be stored in a single file. Then point this at that file, and those resources will be copied into the new application being created.
![]() |
![]() |
![]() |
People Facilities Research Projects Miscellany Search | Home |
Last modified 2003.10.08