Load


Purpose

Large programs would be very tedious to type into the command line every time you wanted to run them. The "load" function allows you to evaluate expressions from a file.

Usage

To load a file, the function "load" is called with one argument, a string.

There is another, even quicker method for those using Emacs at ACCAD. Merely press Control-c, then Control-l, and the file currently in your emacs buffer will be loaded.

Examples

Assume you had a file called "objects.al" which contained the following:
  ox --> (world
           (separator
  	     (surface "wood" 'Ka .1 'grain .2)
	     (sphere))
	   (translate 0 -1 0)
           (separator
  	     (surface "stone" 'roughness .03)
	     (box))
	  )
If you then typed in ox:
  ox --> (load "spam.al")
  ()
A sphere and a box would be created just as if you had typed all of the commands into ox "by hand".

Return to Scheme Introduction


mrl