Author: Tord Romstad
Date: 06:02:55 08/10/04
Go up one level in this thread
On August 10, 2004 at 05:19:10, Daniel Clausen wrote: >"I hate watching those sources where *everything* is a useless list or part >of a one - is it just me?" Well, maybe it's not Lisp's fault but just me. But this isn't true, even for Lisp. Everything is not a list or part of a list. In addition to lists, there are numbers, functions, classes, hash tables, symbols, conditions, packages, readtables, and dozens of other first-class data types. Perhaps you were talking about the superficial syntax of the language. Virtually all compilers for C, C++, and any other programming language you can think of, parse the source code into some kind of tree representation before the final machine code is produced. The basic difference between Lisp and other programming languages in this respect is that in other languages, this tree structure is hidden in the internals of the compiler, and cannot be accessed by the programmer. In Lisp, the tree structure is directly accessible. Programs are represented internally as lists, which is one of the fundamental data structures of the language (but by no means the only one, as explained above). This means that you can effectively extend and modify the compiler in almost any way you wish. You can write code which manipulates the internal list representation of the program and makes arbitrarily complex transformations before the result is finally fed to the compiler. This is an exteremly powerful and time-saving programming technique, and one of the most important advantages of Lisp. One of the reasons for the myth that Lisp is slow is that people believe they are supposed to use lists for everything. The truth is that many (perhaps even most) large-scale Lisp programs don't use lists very much at runtime. The main use of lists is to make source code transformations at compile-time. Tord
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.