0% found this document useful (0 votes)
52 views2 pages

Lisp

ACSL LISP is a simplified version of LISP with uppercase keywords and more verbose syntax. LISP uses S-expressions which are nested parenthetical lists to represent both code and data, giving it properties like being self-hosting and useful for metaprogramming. LISP functions like CAR, CDR operate on lists, and code is defined with DEF and applied with lists of the function name and arguments.

Uploaded by

whitenoise2000
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views2 pages

Lisp

ACSL LISP is a simplified version of LISP with uppercase keywords and more verbose syntax. LISP uses S-expressions which are nested parenthetical lists to represent both code and data, giving it properties like being self-hosting and useful for metaprogramming. LISP functions like CAR, CDR operate on lists, and code is defined with DEF and applied with lists of the function name and arguments.

Uploaded by

whitenoise2000
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

LISP

Nick Haliday December 16, 2011

Introduction

ACSL LISP is a pretty simple topic. Like assembly the main thing is simply that you know the language. ACSL LISP is somewhat dierent from modern Common Lisp. The keywords are all-caps and the syntax more verbose, and the language itself is greatly simplied. Just learn the functions and youll be ne.

Basics and Some History

Lisp in general has a uniform syntax. It is composed of S-expressions, parenthesized lists built out of smaller lists or atoms. This simplicity made it very easy to implement in the past. Lisp is one of the oldest programming language (not counting assembly and machine code), second only to Fortran. A couple of unique aspects of Lisp are the congruence between code and data. Lisp code corresponds almost exactly with the internal representation used by the compiler or interpreter. Everything is a list. Many assert this makes it useful for metaprogramming and the like. Unsurprisingly, Lisp was the rst language to use a self-hosting compiler.

Syntax

As mentioned before, Lisp code is just a series of S-expressions. The rst element in a list represents a function and the rest represents its arguments. CAR and CDR are two functions unique to Lisp. The bizarre names are a holdover from some ancient computer the original Lisp ran on. They refer to the head and tail of a list, respectively. Quoting ( (1 2 3)) prevents

evaluation of the list, signaling that you want a simple list of atoms. Function denition is slightly inconsistent with function application. Heres an example of a user-dened function: (DEF F (A B) (PLUS A (MULT 2 B ) ) ) (DEF SECOND (LST) (CAR (CDR LST ) ) ) (F 1 2 ) ; ; 5 (SECOND ( 1 2 3 4 5 ) ) ; ; 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy