Jump to content

PC-LISP: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Blake1024 (talk | contribs)
No edit summary
Blake1024 (talk | contribs)
No edit summary
Line 1: Line 1:
'''PC-LISP''' is an implementation of the [[Franz Lisp]] dialect for [[DOS]] by Peter Ashwood-Smith.
'''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.


Ashwood-Smith says of his interpreter: "PC-LISP is a small implementation of LISP for ANY MS-DOS machine. While small, it is capable of running a pretty good subset of Franz LISP."<ref>from the distribution's readme file</ref> Currently, PC-LISP has been ported to 32 & 64 bit Linux, Mac, and Windows.
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))

References