The Roots of Lisp
In “The Roots of Lisp”
we see a very in depth and specific description of how the lisp language
came to be, explaining how John McCarthy created a “list processing” language that
used structures called lists for both the data and the code of a program. This
way of processing data is not just something that stayed in the past but
something that paves the way programming is going at the moment. With better and
more powerful computers, we can see why this programming structure is becoming
more common. The article continues giving us the seven primitive operators of Lisp.
The seven primitive operators are quote, atom, eq, car, cdr,
cons, and cond, these form the base of Lisp. “quote” returning whatever arguments
are given after it, “atom” returning “t” if the argument is an atom or an empty
list and returning () otherwise; in Lisp the “t” represents truth and () represents
false, “eq” returns “t” if the values of the arguments given are equal and ()
otherwise, “car” returns the first element of the given list where it is
implied that the argument is a list, “cdr” returns the elements after the first
in the given argument list. Cons returns a list with the first argument given followed
by the elements of the second argument given which should be a list, and “cond”
is evaluated where it is arguments are also evaluated until one of them returns
“t” and returns the value after the correct argument.
As we can see, Lisp contains elements we are familiar with
from other programing languages and that would be expected to have, yet the way
these arguments are evaluated, gives Lisp a very different use as to what we
are used to from other languages and provide us with a different way of processing
data
Comentarios
Publicar un comentario