Powered By LookupPage LookupPage
Join LookupPage    

Curtis Stephens B.A

 
  

02146, United States

Contact Curtis Stephens Directly

Contact Directly

About Curtis Stephens

I installed gcl and clisp through yum in Fedora 8. Both equally seem to be typical deals in the Fedora distribution. Lisp is great and superb. There are some difficulties (as you are going to see under) in getting a variety of implementations to run, and there seem to be a plethora of rather incompatible (or non-transportable?) Lisp packages.

gcl is the GNU prevalent lisp compiler and interpreter. It can interpret code, and it can compile to binary executables.

clisp is a typical lisp interpreter. It is easy to use, but does not compile to binary executables.

gcl uses an inside Lisp purpose to magically produce an executable. The method supposedly includes compile Lisp to C, compile the Do an object file,hyperlink the object with some obscure libraries by means of an obscure approach. I was not in a position to discover a command to compile the Do code with gcc, nor was I capable to come across the locations of the website link libraries (object libraries), and examples command lines for ld.

You can make a .o file by working with -compile. You can make a .c file by working with -do-file. You can make a .h file by utilizing -h-file. Even so, I received url errors when I experimented with to compile the .do with gcc. I gave up and utilized the magic Lisp purpose. Much more on that under.

The executables are massive. On my machine "hello there earth" was 14MB. The very same binary created from a Do "hi globe" resource file was 4KB. Granted, Lisp ought to contain a total interpreter in every Lisp system, just in situation the code makes use of macros or some other code-created-on-the-fly attribute.

Generate a file cl_hw.lisp

(princ "hellow globe!")

Run this command
clisp cl_hw.lisp

Or you can operate this command to use gcl as an interpreter

gcl -batch -load cl_hw.lisp

-batch indicates "runs gcl devoid of printing the copyright detect, and do not enter the command line eval-print loop".

-load means "run the Lisp code". There is a special Lisp perform to compile and link an object file with the Lisp object library. More on that beneath. You do not need to use -compile to make an executable. You might optionally use -compile. You *have to* use -load and (systemsave-program).

Appropriate absent you will discover that Lisp looks to be lacking newline characters. I get the impact that there are no standard bindings for management characters in Lisp. I am certain there is some effortless way to take care of control chars, but I am spoiled by Perl (and C) in which n is transportable for newline (it will work on all running systems), and Perl has string interpolation.Portion of the Lisp resolution is to use (format) and maybe the % and linked macros. The % isn't going to work in clisp.

The gcl hello there term illustration is weird, and the author didn't make clear why the weirdness. As you can see over, a basic illustration functions great. On the other hand, the straightforward case in point are not able to be compiled to an executable. The only (somewhat) documented method to get an executable is to use a Lisp function (systemsave-system).

File hello1.lisp
(defun sitop-stage ()
(format t "howdy planet!%" )
)
(systemsave-system "hi")

Create an executable
gcl -batch -load hello1.lisp

The title of the exe is challenging coded in the script to be "hello". Here is a session transcript
zeus clisp$ cat hello1.lisp
(defun sitop-level ()
(format t "howdy planet!%" )
)
(systemsave-technique "hello there")
zeus clisp$
zeus clisp$ gcl -batch -load hello1.lispzeus clisp$ lltotal 13864-rwxrwxr-x 1 mst3k mst3k 14132764 2008-08-eleven 1028 hi there-rw-rw-r-- 1 mst3k mst3k90 2008-08-11 1025 hello1.lisp-rw-rw-r-- 1 mst3k mst3k332 2008-08-eleven 1021 hello1.lispzeus clisp$ ./hellohello earth!zeus clisp$

gcl needs to know the title of the function that will be main() in the Do code. This is sitop-degree() and by using (defun) we have defined this operate. We can (defun major() ...) but we have to use additional method calls, and we have to include a (stop) to our (defun). Even even worse, after this is done, I are unable to locate a way to avoid the GNU license communication from printing. Discover in the examples previously mentioned that the gcl license did not print, but in the up coming instance, the license *does* print. Heaven only is aware why.

The session transcript. I use "cat" so you can see the contents of hello2.lisp. I also attempted ./hi there -batch, to no avail. The license failed to print, but neither did my output.
zeus clisp$ cat hello2.lisp(defun primary ()(format t "hi earth!%" )(give up))(setf method*prime-level-hook* 'main)(systemsave-method "hello2")zeus clisp$ gcl -batch -load hello2.lispzeus clisp$ ls -l hello2*-rwxrwxr-x 1 mst3k mst3k 14132764 2008-08-11 1043 hello2-rw-rw-r-- one mst3k mst3k131 2008-08-eleven 1040 hello2.lisp-rw-rw-r-- one mst3k mst3k332 2008-08-11 1022 hello2.lispzeus clisp$ ./hello2GCL (GNU Widespread Lisp)2.6.seven ANSIAug 14 2007 173505Source License LGPL(gcl,gmp), GPL(unexec,bfd)Binary LicenseGPL due to GPL'ed elements (READLINE BFD UNEXEC)Modifications of this banner should keep discover of a compatible licenseDedicated to the memory of W. SchelterUse (support) to get some standard info on how to use GCL.hello there planet!zeus clisp$ ./hello2 -batchzeus clisp$

You could locate a lot more facts at these sites

http//en.wikibooks.org/wiki/Widespread_Lisp

http//clisp.disadvantages.org/impnotes/quickstart.html

Curtis Stephens Links

Contact Information
Email Curtis Stephens
LookupPage Directory
   
  Search other Lookup Pages like
Curtis Stephens
 
LookupPage | Enhanced Online Visibility