CSC 330 Assignment 4

Assignment 5 and 6 Setup Details



Setting Up GCL on falcon/hornet

Login to falcon or hornet, and run the following commands:

~gfisher/classes/330/bin/install-gcl
source ~/.cshrc
This will put the installed path for GCL on your own path variable, so that it can be invoked directly from the command line. I.e., to run GCL, just type "gcl" at the UNIX command prompt.

Downloading and Installing GCL on Windows

Goto the GCL website, which is linked to in the 330 doc directory; it's here:


http://www.gnu.org/software/gcl/gcl.html.

At that site, click on "Get Latest Release", which is the first item under the main Menu. This link is to an FTP server, so it may take a bit for it to come up. When it does, click on binaries and then stable from there. At that page, select the second-to-the-last item, which is gcl_2.6.2.mingw32_... .exe.

This will start a typical download process. When the download is done, open the download item, which will launch an installer. Follow the installer instructions, using all of the default values at the prompts. The second-to- last step of the installation will pop up a command shell, with a "Hit any key to continue" prompt at the bottom. After that, click "Finish".

This will install a GCL shortcut on the desktop. Double click it, and a GCL command window will come up.

Downloading, Installing, and Running Emacs

Get the Emacs-for-Windows download, which is linked to in the 330 doc directory; it's here:


http://ftp.gnu.org/gnu/windows/emacs/emacs-21.3-fullbin-i386.tar.gz.

Unpack and run the installer, using all of the default settings. This will install Emacs in the program menu, which you run in the normal way.

The Windows-native version of Emacs runs just like Notepad, with a typical menubar and a text-typing area. There is quite a bit more to Emacs than its Notepad-like subset, but you don't need to deal with it for 330 if you don't want. You can learn about Emacs features by browsing the topics in its Help menu. For 330, you can use Emacs to edit your Lisp programs. Any program with a ".l" extension will automatically open in Lisp editing mode, which includes nice features like paren matching and auto-indent. You can enable colored syntax highlighting by selecting the 'Syntax Highlighting' item in the Options Menu.

You can edit Lisp programs in Emacs, then switch to the GCL window and use the regular Lisp load function to load the file. An even more convenient development environment is to run GCL in a shell within Emacs. To do so, perform the following steps:

  1. At the Windows level, open the Settings->Control Panel->System dialog. Select the Advanced tab, click Environment Variables, select and edit the Path system variable, and add the path of the GCL bin folder to the end of Path, delimited by a semi-colon. The default install location of this folder is C:\Program Files\GCL-2.6.6-CLtL1\bin.
  2. Goto the GCL bin folder and copy the file named "gcl.bat" to "gcle.bat".
  3. Start Emacs, open the gcle.bat file, remove the "start " prefix on line 3, and save the file.
  4. In Emacs, type escape-X, which runs an extended Emacs command. Emacs prompts for the command at the very bottom of its window, with the prompt "M-X", which stands for "Meta-X". (Note that typing escape-X is a two-keystroke sequence, i.e., the escape key first, followed by the x key. On most keyboards, you can use the alt key as a modifier key, instead of a separate escape keystroke; e.g., to run an extended command, hold down the alt and x keys at the same time.)
  5. Type the command named "shell" after the prompt, and hit the enter key (leave off the double quotes).
  6. This will open a Windows Command Prompt shell within emacs. In the shell, run the command "gcle.bat", which should run directly if you properly edited the Path environment variable.
  7. At this point, you have GCL running in one Emacs window. You can run the Emacs File->Split Window command to divide the screen into two separate windows. In one of them, you can open and edit Lisp files, then switch to the GCL window, load the file, and run any of its functions.

We'll go through a demo of this in class on Wednesday.