这使得Lisp具有很强的适应性和可扩展性。 表达式的多重语义:Lisp的元语言(S-表达式,Symbolic Expression)允许使用同一代码表示不同的用途。例如,可以用列表和嵌套列表表示对象,也可以用函数和嵌套函数表示函数式编程函数。这种表示方式让程序员可以灵活地构建自己的数据结构和算法。 模块化:Lisp的S表达式允许将代码和数...
函数在Lisp中是一种可执行的数据,可以作为参数传递给其他函数,也可以作为返回值返回给调用者。 Lisp使用S表达式(Symbolic Expression)作为语法结构。S表达式是由括号包围的列表,列表中的元素可以是符号、数字、字符串或其他S表达式。这种简单的语法结构使得Lisp非常灵活和易于解析。 Lisp具有动态类型系统,变量不需要提前声...
看了一点LISP的书,猛然觉得,LISP的原理很简单。LISP里面只有1种数据结构:Symbolic Expression,简称sexp。程序本身也是sexp,处理的数据也是sexp。也就是,如果你能解释用sexp写成的程序,你就制成了LISP解释器。 LISP里面,sexp分为两种:表和原子。list(表),内部有序地包含0个或多个sexp。除此之外,其他东西都是at...
列表,它比较特殊,即是原子又是列表。 3. 符号表达式(symbolic expression) 原子和列表的书面表示都被称为符号表达式。在elisp的列表中的空格数量可以任意,所以我们可以使用空格来排版 列表使我们易于阅读 4. 表达式求值 表达式求值遵循下面简单的规则 - 对数字求值就是它本身 - 对双引号括起来的字符串求值就是它本身...
Symbolic computations can be nested and even mixed with numeric computations. The following expression builds a list of names in a slightly different way than we saw before, using the built-in function list. We then see how to find the number of elements in the list, using the built-in fu...
LISP语言又称符号式语言(SymbolicLanguage)、函数式语言(functionallanguage)。在LISP语言中,最基本的数据类型是符号表达式(symbolicexpression),LISP程序看起来是一个一个的函数调用。LISP语言的一个突出的特点是程序和数据二者都取符号表达式的形式,也就是说一个LISP程序可以把另一个LISP程序作为它的数据处理。LISP...
数字、单个字符(如+)等都是lisp中的原子。在列表中,原子是由空格一一分隔的。原子可以紧接着括号。 LISP中的原子只有数字和符号两种。 原子和列表都被称作符号表达式(symbolic expression)或者更简洁的“s-expression” 三、LISP解释器的工作方式 a.'(this is a quoted list)b. (*4(+23)) ...
"Symbolic expression": 6 syllables, long in written form too "S-expression": 4 syllables, I find this name confusing at least partially because it is a single-letter acronym which is unusual. In addition, it is long in written form. "Sexpuh" / "sex-p" / "sexpr": 2 syllables, shor...
After 1962, the development of LISP became multistranded, and different ideas were pursued in different places. As a programming language, LISP is characterized by the following ideas: (1) computing with symbolic expressions rather than numbers, (2) representation of symbolic expressions and other ...
Symbols (symbolic identifiers) Numerical types: Machine integers and arbitrary precision integers IEEE floats (single and double) Rational and complex numbers Characters Containers: Arrays (simple or indirect, with varying element types) Lists (containing mixed and arbitrary kinds of typed objects) ...