PC-LISP: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
'''PC-LISP''' is an implementation of the [[Franz Lisp]] dialect |
'''PC-LISP''' is an implementation of the [[Franz Lisp]] dialect by Peter Ashwood-Smith. |
||
Version 2.11 was released on May 15, 1986. A current version may be downloaded from the external link below. |
Version 2.11 was released on May 15, 1986. A current version may be downloaded from the external link below. |
||
Currently, PC-LISP has been ported to 32 & 64 bit Linux, Mac, and Windows. |
|||
Note that the Franz LISP dialect was the immediate, portable successor to the [[Incompatible Timesharing System|ITS]] version of [[Maclisp]] and is perhaps the closest thing to the LISP in the [[Steven Levy]] book ''[[Hackers: Heroes of the Computer Revolution|Hackers]]'' as is practical to operate. PC-LISP runs well in DOS emulators and on modern Windows versions. Because PC-LISP implements Franz LISP, it is a dynamically scoped predecessor to modern [[Common Lisp]]. This is therefore an historically important implementation. |
Note that the Franz LISP dialect was the immediate, portable successor to the [[Incompatible Timesharing System|ITS]] version of [[Maclisp]] and is perhaps the closest thing to the LISP in the [[Steven Levy]] book ''[[Hackers: Heroes of the Computer Revolution|Hackers]]'' as is practical to operate. PC-LISP runs well in DOS emulators and on modern Windows versions. Because PC-LISP implements Franz LISP, it is a dynamically scoped predecessor to modern [[Common Lisp]]. This is therefore an historically important implementation. |
Revision as of 19:22, 7 April 2015
PC-LISP is an implementation of the Franz Lisp dialect by Peter Ashwood-Smith.
Version 2.11 was released on May 15, 1986. A current version may be downloaded from the external link below.
Currently, PC-LISP has been ported to 32 & 64 bit Linux, Mac, and Windows.
Note that the Franz LISP dialect was the immediate, portable successor to the ITS version of Maclisp and is perhaps the closest thing to the LISP in the Steven Levy book Hackers as is practical to operate. PC-LISP runs well in DOS emulators and on modern Windows versions. Because PC-LISP implements Franz LISP, it is a dynamically scoped predecessor to modern Common Lisp. This is therefore an historically important implementation.
Example
The session is running the following code which demonstrates dynamic scoping in Franz LISP. Note that PC-LISP does not implement the let
special form that Emacs Lisp provides for local variables. Instead, all variables are what an ALGOL-based language would call "global". The first dialect of Lisp to incorporate ALGOL scoping rules (called lexical scoping) was Scheme although the Common Lisp language also added this feature.
;; Demonstration of dynamic scoping
;; This is a "global" variable
(setq myglobal "this is my global variable")
;; Another global variable
(setq yourglobal "this is my global variable")
;; a function which prints the symbols
(defun dosomething (mine yours)
(princ " * Mine is - ")
(princ mine)
(princ "\n")
(princ " * Yours is - ")
(princ yours)
(princ "\n"))
;; override the symbols
(defun nolocals ()
(setq mine "I have set mine to a new value")
(setq yours "I have set mine to a new value")
(dosomething mine yours))
(defun main ()
;; define two symbols
(setq mine myglobal)
(setq yours yourglobal)
;; print them
(princ "calling dosomething\n")
(dosomething mine yours)
(princ "calling nolocals\n")
(nolocals)
(princ "calling dosomething again\n")
(dosomething mine yours))