S-expressions
   HOME



picture info

S-expressions
In computer programming, an S-expression (or symbolic expression, abbreviated as sexpr or sexp) is an expression in a like-named notation for nested list (tree-structured) data. S-expressions were invented for, and popularized by, the programming language Lisp, which uses them for source code as well as data. Characteristics In the usual parenthesized syntax of Lisp, an S-expression is classically definedJohn McCarthy (1960/2006)Recursive functions of symbolic expressions. Originally published in Communications of the ACM. as # an atom of the form ''x'', or # an expression of the form (''x'' . ''y'') where ''x'' and ''y'' are S-expressions. This definition reflects LISP's representation of a list as a series of "cells", each one an ordered pair. In plain lists, ''y'' points to the next cell (if any), thus forming a list. The recursive clause of the definition means that both this representation and the S-expression notation can represent any binary tree. However, the represe ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Lisp (programming Language)
Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized prefix notation. Originally specified in the late 1950s, it 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. Lisp was originally created as a practical mathematical notation for computer programs, influenced by (though not originally derived from) the notation of Alonzo Church's lambda calculus. It quickly became a favored programming language for artificial intelligence (AI) research. As one of the earliest programming languages, Lisp pioneered many ideas in computer science, including tree data structures, automatic storage management, dynamic typing, conditionals, higher-order function ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Lisp Reader
In the programming language Lisp, the reader or read function is the parser which converts the textual form of Lisp objects to the corresponding internal object structure. In the original Lisp, S-expressions consisted only of symbols, integers, and the list constructors ( ''xi...'' ) and (''x'' . ''y''). Later Lisps, culminating in Common Lisp, added literals for floating-point, complex, and rational numbers, strings, and constructors for vectors. The reader is responsible for parsing list structure, interning symbols, converting numbers to internal form, and calling read macros. Read table The reader is controlled by the readtable, which defines the meaning of each character. Read macros Unlike most programming languages, Lisp supports parse-time execution of programs, called "read macros" or "reader macros". These are used to extend the syntax either in universal or program-specific ways. For example, the quoted form (quote ''x'') operator can be abbreviated as ''x''. ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Syntax (programming Languages)
In computer science, the syntax of a computer language is the rules that define the combinations of symbols that are considered to be correctly structured Statement (computer science), statements or Expression (computer science), expressions in that language. This applies both to programming languages, where the document represents source code, and to markup languages, where the document represents data. The syntax of a language defines its surface form. Text-based user interface, Text-based computer languages are based on sequences of Character (computing), characters, while visual programming languages are based on the spatial layout and connections between symbols (which may be textual or graphical). Documents that are syntactically invalid are said to have a syntax error. When designing the syntax of a language, a designer might start by writing down examples of both legal and illegal String (computer science), strings, before trying to figure out the general rules from these ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Binary Tree
In computer science, a binary tree is a tree data structure in which each node has at most two children, referred to as the ''left child'' and the ''right child''. That is, it is a ''k''-ary tree with . A recursive definition using set theory is that a binary tree is a triple , where ''L'' and ''R'' are binary trees or the empty set and ''S'' is a singleton (a single–element set) containing the root. From a graph theory perspective, binary trees as defined here are arborescences. A binary tree may thus be also called a bifurcating arborescence, a term which appears in some early programming books before the modern computer science terminology prevailed. It is also possible to interpret a binary tree as an undirected, rather than directed graph, in which case a binary tree is an ordered, rooted tree. Some authors use rooted binary tree instead of ''binary tree'' to emphasize the fact that the tree is rooted, but as defined above, a binary tree is always rooted. In ma ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

String (computing)
In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). A string is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. More general, ''string'' may also denote a sequence (or list) of data other than just characters. Depending on the programming language and precise data type used, a variable declared to be a string may either cause storage in memory to be statically allocated for a predetermined maximum length or employ dynamic allocation to allow it to hold a variable number of elements. When a string appears literally in source code, it is known as a string literal or an anonymous string. In formal languages, which are used in mathematical logic and theoretical computer science, a stri ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Format (Common Lisp)
Format is a function in Common Lisp that can produce formatted text using a format string similar to the print format string. It provides more functionality than print, allowing the user to output numbers in various formats (including, for instance: hex, binary, octal, roman numerals, and English), apply certain format specifiers only under certain conditions, iterate over data structures, output data tabularly, and even recurse, calling format internally to handle data structures that include their own preferred formatting strings. This functionally originates in MIT's Lisp Machine Lisp, where it was based on Multics. Specification The format function is specified by the syntax: : Directives in the control string are interpolated using the format arguments, and the thus constructed character sequence is written to the destination. Destination The destination may either be a stream, a dynamic string, T, or the NIL constant; the latter of which presents a special case in ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


John McCarthy (computer Scientist)
John McCarthy (September 4, 1927 – October 24, 2011) was an American computer scientist and cognitive scientist. He was one of the founders of the discipline of artificial intelligence. He co-authored the document that coined the term "artificial intelligence" (AI), developed the programming language family Lisp (programming language), Lisp, significantly influenced the design of the language ALGOL, popularized time-sharing, and invented Garbage collection (computer science), garbage collection. McCarthy spent most of his career at Stanford University. He received many accolades and honors, such as the 1971 Turing Award for his contributions to the topic of AI, the United States National Medal of Science, and the Kyoto Prize. Early life and education John McCarthy was born in Boston, Massachusetts, on September 4, 1927, to an Irish people, Irish immigrant father and a Lithuanian Jewish immigrant mother, John Patrick and Ida (Glatt) McCarthy. The family was obliged to relocat ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Symbol (programming)
A symbol in computer programming is a primitive data type whose instances have a human-readable form. Symbols can be used as identifiers. In some programming languages, they are called atoms. Uniqueness is enforced by holding them in a symbol table. The most common use of symbols by programmers is to perform language reflection (particularly for callbacks), and the most common indirectly is their use to create object linkages. In the most trivial implementation, they are essentially named integers; e.g., the enumerated type in C language. Support The following programming languages provide runtime support for symbols: Julia Symbols in Julia are interned strings used to represent identifiers in parsed Julia code( ASTs) and as names or labels to identify entities (for example as keys in a dictionary). Lisp A symbol in Lisp is unique in a namespace (or ''package'' in Common Lisp). Symbols can be tested for equality with the function EQ. Lisp programs can generate new symbo ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Latin Script
The Latin script, also known as the Roman script, is a writing system based on the letters of the classical Latin alphabet, derived from a form of the Greek alphabet which was in use in the ancient Greek city of Cumae in Magna Graecia. The Greek alphabet was altered by the Etruscan civilization, Etruscans, and subsequently their alphabet was altered by the Ancient Romans. Several Latin-script alphabets exist, which differ in graphemes, collation and phonetic values from the classical Latin alphabet. The Latin script is the basis of the International Phonetic Alphabet (IPA), and the 26 most widespread letters are the letters contained in the ISO basic Latin alphabet, which are the same letters as the English alphabet. Latin script is the basis for the largest number of alphabets of any writing system and is the List of writing systems by adoption, most widely adopted writing system in the world. Latin script is used as the standard method of writing the languages of Western and ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Literal (computer Programming)
In computer science, a literal is a textual representation (notation) of a value as it is written in source code. Almost all programming languages have notations for atomic values such as integers, floating-point numbers, and strings, and usually for Booleans and characters; some also have notations for elements of enumerated types and compound values such as arrays, records, and objects. An anonymous function is a literal for the function type. In contrast to literals, variables or constants are symbols that can take on one of a class of fixed values, the constant being constrained not to change. Literals are often used to initialize variables; for example, in the following, 1 is an integer literal and the three letter string in "cat" is a string literal: int a = 1; string s = "cat"; In lexical analysis, literals of a given type are generally a token type, with a grammar rule, like "a string of digits" for an integer literal. Some literals are specific keywords, ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Scheme (programming Language)
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 (MIT CSAIL) 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.Common LISP: The Language, 2nd Ed., Guy L. Steele Jr. Digital Press; 1981. . "Common Lisp is a new dialect of Lisp, a successor to MacLisp, influenced strongly by ZetaLisp and to some extent by Scheme and InterLisp." The Scheme language is standardized in the offic ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]