PC-LISP

Last updated

PC-LISP is an implementation of the Franz Lisp dialect by Peter Ashwood-Smith.

Contents

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(setqmyglobal"this is my global variable");; Another global variable(setqyourglobal"this is my global variable");; a function which prints the symbols(defundosomething(mineyours)(princ" * Mine is  - ")(princmine)(princ"\n")(princ" * Yours is - ")(princyours)(princ"\n"));; override the symbols(defunnolocals()(setqmine"I have set mine to a new value")(setqyours"I have set yours to a new value")(dosomethingmineyours))(defunmain();; define two symbols(setqminemyglobal)(setqyoursyourglobal);; print them(princ"calling dosomething\n")(dosomethingmineyours)(princ"calling nolocals\n")(nolocals)(princ"calling dosomething again\n")(dosomethingmineyours))

Another example showing the use of backquote and the power of LISP. This is a differentiation example.

; D(e,X) -;          Will compute the symbolic derivative of expression e with respect; to variable X. We take the expression in standard lisp prefix form and will; use the following rules of differentiation.;;         D(x)    = 1;         D(a)    = 0;         D(ln u) = D(u)/u ;         D(u+v)  = D(u)+D(v);         D(u-v)  = D(u)-D(v);         D(u*v)  = D(u)*v + u*D(v);         D(u/v)  = D(u)*v + (u*D(v))/v^2;         D(v^u)  = (v^u)*(u*D(v)/v + D(u)*ln(v));(defunD(eX&auxuv)(cond((equaleX)1)((atome)0)(t(setqu(cadre)v(caddre))(caseq(care)(ln`(/,(DuX),u))(+`(+,(DuX),(DvX)))(-`(-,(DuX),(DvX)))(*`(+(*,(DuX),v)(*,(DvX),u)))(/`(-(/,(DuX),v)(/(*,u,(DvX))(^,v2))))(^`(*,e(+(/(*,v,(DuX)),u)(*,(DvX)(ln,u)))))(t(princ"ERROR")(exit)]

Related Research Articles

<span class="mw-page-title-main">ALGOL</span> Family of programming languages

ALGOL is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the Association for Computing Machinery (ACM) in textbooks and academic sources for more than thirty years.

<span class="mw-page-title-main">Common Lisp</span> Programming language standard

Common Lisp (CL) is a dialect of the Lisp programming language, published in American National Standards Institute (ANSI) standard document ANSI INCITS 226-1994 (S20018). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived from the ANSI Common Lisp standard.

<span class="mw-page-title-main">Emacs Lisp</span> Dialect of Lisp used as an Emacs scripting language

Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs. It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter. Emacs Lisp is also termed Elisp, although there are also older, unrelated Lisp dialects with that name.

<span class="mw-page-title-main">Lisp (programming language)</span> Programming language family

Lisp is a family of programming languages with a long history and a distinctive, fully parenthesized prefix notation. Originally specified in 1960, Lisp is the second-oldest high-level programming language still in common use, after Fortran. Lisp has changed since its early days, and many dialects have existed over its history. Today, the best-known general-purpose Lisp dialects are Common Lisp, Scheme, Racket and Clojure.

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named after French mathematician, philosopher and physicist Blaise Pascal.

<span class="mw-page-title-main">Scheme (programming language)</span> Dialect of Lisp

Scheme is a dialect of the Lisp family of programming languages. Scheme was created during the 1970s at the MIT Computer Science and Artificial Intelligence Laboratory and released by its developers, Guy L. Steele and Gerald Jay Sussman, via a series of memos now known as the Lambda Papers. It was the first dialect of Lisp to choose lexical scope and the first to require implementations to perform tail-call optimization, giving stronger support for functional programming and associated techniques such as recursive algorithms. It was also one of the first programming languages to support first-class continuations. It had a significant influence on the effort that led to the development of Common Lisp.

Maclisp is a programming language, a dialect of the language Lisp. It originated at the Massachusetts Institute of Technology's (MIT) Project MAC in the late 1960s and was based on Lisp 1.5. Richard Greenblatt was the main developer of the original codebase for the PDP-6; Jon L. White was responsible for its later maintenance and development. The name Maclisp began being used in the early 1970s to distinguish it from other forks of PDP-6 Lisp, notably BBN Lisp.

In a computer language, a reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label – it is "reserved from use". This is a syntactic definition, and a reserved word may have no user-defined meaning.

AutoLISP is a dialect of the programming language Lisp built specifically for use with the full version of AutoCAD and its derivatives, which include AutoCAD Map 3D, AutoCAD Architecture and AutoCAD Mechanical. Neither the application programming interface (API) nor the interpreter to execute AutoLISP code is included in the AutoCAD LT product line. A subset of AutoLISP functions is included in the browser-based AutoCAD web app.

In computer programming, the scope of a name binding is the part of a program where the name binding is valid; that is, where the name can be used to refer to the entity. In other parts of the program, the name may refer to a different entity, or to nothing at all. Scope helps prevent name collisions by allowing the same name to refer to different objects – as long as the names have separate scopes. The scope of a name binding is also known as the visibility of an entity, particularly in older or more technical literature—this is from the perspective of the referenced entity, not the referencing name.

In programming languages, a closure, also lexical closure or function closure, is a technique for implementing lexically scoped name binding in a language with first-class functions. Operationally, a closure is a record storing a function together with an environment. The environment is a mapping associating each free variable of the function with the value or reference to which the name was bound when the closure was created. Unlike a plain function, a closure allows the function to access those captured variables through the closure's copies of their values or references, even when the function is invoked outside their scope.

In computer science, hygienic macros are macros whose expansion is guaranteed not to cause the accidental capture of identifiers. They are a feature of programming languages such as Scheme, Dylan, Rust, Nim, and Julia. The general problem of accidental capture was well known in the Lisp community before the introduction of hygienic macros. Macro writers would use language features that would generate unique identifiers or use obfuscated identifiers to avoid the problem. Hygienic macros are a programmatic solution to the capture problem that is integrated into the macro expander. The term "hygiene" was coined in Kohlbecker et al.'s 1986 paper that introduced hygienic macro expansion, inspired by terminology used in mathematics.

In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier, constant, procedure and function in a program's source code is associated with information relating to its declaration or appearance in the source. In other words, the entries of a symbol table store the information related to the entry's corresponding symbol.

In computing, late binding or dynamic linkage—though not an identical process to dynamically linking imported code libraries—is a computer programming mechanism in which the method being called upon an object, or the function being called with arguments, is looked up by name at runtime. In other words, a name is associated with a particular operation or object at runtime, rather than during compilation. The name dynamic binding is sometimes used, but is more commonly used to refer to dynamic scope.

In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures. Some programming language theorists require support for anonymous functions as well. In languages with first-class functions, the names of functions do not have any special status; they are treated like ordinary variables with a function type. The term was coined by Christopher Strachey in the context of "functions as first-class citizens" in the mid-1960s.

newLISP

newLISP is a scripting language which is a dialect of the Lisp family of programming languages. It was designed and developed by Lutz Mueller. newLISP is free and open-source software released under the GNU General Public License, version 3 or later.

<span class="mw-page-title-main">Parent pointer tree</span>

In computer science, an in-tree or parent pointer tree is an N-ary tree data structure in which each node has a pointer to its parent node, but no pointers to child nodes. When used to implement a set of stacks, the structure is called a spaghetti stack, cactus stack or sahuaro stack. Parent pointer trees are also used as disjoint-set data structures.

<span class="mw-page-title-main">EuLisp</span>

EuLisp is a statically and dynamically scoped Lisp dialect developed by a loose formation of industrial and academic Lisp users and developers from around Europe. The standardizers intended to create a new Lisp "less encumbered by the past", and not so minimalist as Scheme. Another objective was to integrate the object-oriented programming paradigm well. It is a third-generation programming language.

<span class="mw-page-title-main">LFE (programming language)</span>

Lisp Flavored Erlang (LFE) is a functional, concurrent, garbage collected, general-purpose programming language and Lisp dialect built on Core Erlang and the Erlang virtual machine (BEAM). LFE builds on Erlang to provide a Lisp syntax for writing distributed, fault-tolerant, soft real-time, non-stop applications. LFE also extends Erlang to support metaprogramming with Lisp macros and an improved developer experience with a feature-rich read–eval–print loop (REPL). LFE is actively supported on all recent releases of Erlang; the oldest version of Erlang supported is R14.

In computer programming languages, an identifier is a lexical token that names the language's entities. Some of the kinds of entities an identifier might denote include variables, data types, labels, subroutines, and modules.

References