GCL(1L)

🌸 GCL πŸ’…

okay so bestie, welcome to gcl β€” the GCL Common Lisp interpreter/compiler, CVS snapshot edition. Yes, the whole thing. Buckle up, we're going lisp-mode. πŸ¦‹


✨ SYNOPSIS ✨

gcl [ options ]

πŸ’– DESCRIPTION πŸ’–

So gcl is an implementation of a subset of the Common Lisp Ansi standard. It's written in C and in Common Lisp (versatile queen πŸ‘‘), and it's highly portable. It's got the features from the original definition of Common Lisp (that's the Guy Steele version 1. thing) plus some features from the proposed new standard. It's giving heritage, it's giving range.

The best documentation is in texinfo/info form, and there are three groups of info, bestie, three:

  • gcl-si β€” for basic common lisp descriptions, and the features that are unique to gcl πŸ’…
  • gcl-tk β€” this one is about the connection with the tk window system, which lets you use all the power of the tcl/tk interaction system from lisp πŸ”₯
  • gcl β€” this third info file details the Ansi standard for common lisp, which this subset tries to adhere to
highly recommended: write your programs in the intersection of gcl and ansi common lisp. like, do that. 😭 Unfortunately the Ansi standard is huge, and covering all of it would take a substantial effort and would make gcl bigger. So. We do what we can. 🫢

When gcl gets invoked from the shell, the variable si::*command-args* is set to the list of command line arguments. And there are various options it understands, so let's go, one by one, no skipping, we don't do that here πŸ’–

✨ OPTIONS ✨

  • -eval command β€” calls read and then eval on the command you passed in. literally just reads it and evals it. iconic.
  • -- β€” stop processing arguments, and set si::*command-args* to a list containing the arguments after the --. periodt, we're done here πŸŽ€
  • -load pathname β€” load the file whose pathname is specified after -load. that's the whole vibe.
  • -f β€” opens the file following -f for input, skips the first line, and then reads and evals the rest of the forms in the file. It replaces si::*command-args* by the the list starting after -f. (yes, "the the". that's the original, I don't make the rules πŸ’€) This one can be used with the shells to write small shell programs:
#!/usr/local/bin/gcl.exe -f
(format t "hello world ~a~%" (nth 1 si::*command-args*))

The value si::*command-args* will have the appropriate value. So if the above 2 line file is made executable and called foo, then:

tutorial% foo billy
hello world billy
⚠️ NOTE: on many systems (eg SunOs) the first line of an executable script file such as: #!/usr/local/bin/gcl.exe -f only reads the first 32 characters! So if your pathname where the executable lives together with the '-f' amounts to more than 32 characters, the file will not be recognized. Also the executable must be the actual large binary file, [or a link to it], and not just a /bin/sh script. In the latter case the /bin/sh interpreter would get invoked on the file. 😭 not the vibe we wanted.

Alternately, one could invoke the file foo without making it executable:

tutorial% gcl -f foo "from bill"
hello world from bill
  • -batch β€” do not enter the command print loop. Useful if the other command line arguments actually do something. Also: do not print the License and acknowledgement information. Note that if your program does print any License information, it must print the GCL header information also. πŸ‘‘
  • -dir β€” the directory where the executable binary that is running is located. Needed by save and friends. This gets set as si::*system-directory*
  • -libdir β€” okay so for example, -libdir /d/wfs/gcl-2.0/ would mean that the files like gcl-tk/tk.o would be found by concatting the path to the libdir path, ie in /d/wfs/gcl-2.0/gcl-tk/tk.o 🌈
  • -compile β€” invoke the compiler on the filename following -compile. Other flags affect compilation. team work makes the dream work πŸ’…
  • -o-file β€” if nil follows -o-file then do not produce an .o file.
  • -c-file β€” if -c-file is specified, leave the intermediate .c file there. keep her πŸŽ€
  • -h-file β€” if -h-file is specified, leave the intermediate .h file there.
  • -data-file β€” if -data-file is specified, leave the intermediate .data file there.
  • -system-p β€” if -system-p is specified then invoke compile-file with the :system-p t keyword argument, meaning that the C init function will bear a name based on the name of the file, so that it may be invoked by name by C code. fancy fr fr ✨

This GNU package should not be confused with the proprietary program distributed by FRANZ, Inc. Nor should it be confused with any public domain or proprietary lisp system. 🚫 like, read the label bestie.

And for anything other than program development, use of the lisp compiler is strongly recommended in preference to use of the interpreter, due to much higher speed. πŸ”₯ speed. periodt.


πŸŽ€ FILES πŸŽ€

  • /usr/bin/gcl β€” executable shell script wrapper
  • /usr/lib/gcl-version/unixport/saved[_flavor]_gcl β€” executable lisp images

πŸ¦‹ SEE ALSO πŸ¦‹

  • Common LISP: The Language, Guy L. Steele, Jr., Digital Press, Bedford, MA, 1984.
  • Common LISPcraft, Robert Wilensky, W. W. Norton & Co., New York, 1984.

πŸ’œ AUTHORS πŸ’œ

The GCL system contains C and Lisp source files to build a Common Lisp system. CGL is derived from Kyoto Common LISP (kcl), which was written in 1984 by T. Yuasa and M. Hagiya (working under Professor R. Nakajima at the Research Institute for Mathematical Sciences, Kyoto University). The AKCL system work was begun in 1987 by William Schelter at the University of Texas, Austin, and continued through 1994. In 1994 AKCL was released as GCL (GNU Common Lisp) under the GNU public library license. πŸ’– history lesson, ate.


and that's the whole page bestie, mwah πŸ’…βœ¨ this was the GCL(1L) manual, dated 17 March 1997 β€” yeah she's vintage, she's iconic, she's still slaying 🫢🌸