| dbpprop:abstract
|
- The term S-expression or sexp (for symbolic expression) refers to a convention for representing semi-structured data in human-readable textual form. Symbolic expressions are mostly made of symbols and lists. S-expressions are probably best known for their use in the Lisp family of programming languages. Other uses of S-expressions are in Lisp-derived languages such as DSSSL, and as mark-up in communications protocols like IMAP and John McCarthy's CBCL. The details of the syntax and supported data types vary in the different languages, but the most common feature among these languages is the use of S-expressions as parenthesized prefix notation (sometimes known as Cambridge Polish notation). S-expressions are used for both code and data in Lisp. S-expressions were originally intended only for data to be manipulated by M-expressions, but the first implementation of Lisp was an interpreter of S-expression encodings of M-expressions, and Lisp programmers soon became accustomed to using S-expressions for both code and data. S-expressions can either be single objects (atoms) such as numbers, symbols including the special symbols nil and t, or cons pairs, written as (x . y). Longer lists are made up of nested cons pairs, for example (. ) which can also be written more intelligibly as (2 3). Nested lists can also be written as S-expressions: . S-expressions are independent of whitespace such as space and newline. Whitespace is used as a boundary between atoms. Example: a simple grammar written as s-expression (Gazdar/Melish, Natural Language Processing in Lisp): Program code can be written in S-expressions, usually using prefix notation. An extra piece of syntactic sugar for writing Lisp programs is that the common expression (quote x) can be written with the abbreviation 'x. Example in Common Lisp: (defun factorial) Example in Scheme: (define) S-Expressions can be read in Lisp using the function READ. READ reads the textual representation of an s-expression and returns Lisp data. The function PRINT can be used to output an s-expression. The output then can be read with the function READ, when all printed data objects have a readable representation. Lisp has readable representations for numbers, strings, symbols, lists and many other data types. Program code can be formatted as pretty printed S-expressions using the function PPRINT. Lisp progams are valid s-expressions, but not all s-expressions are valid Lisp programs. (.0 + 3. ) is a valid s-expression, but not a valid Lisp program, since Lisp uses prefix notation and a floating point number (here .0) is not valid as an operation (the first element of the expression).
- S-lauseke (symbolinen lauseke) on tapa esittää dataa tekstuaalisessa muodossa. S-lausekkeita käytetään mm. Lisp-ohjelmointikielissä. S-lauseke voi olla yksittäinen arvo, kuten numero, symboli tai cons-pari (x . y). Listat ovat cons-ketjuja (x .). Sama voidaan kirjoittaa yksinkertaisemmin muodossa (x y z). Lisp-ohjelmointikielille ominaista on esittää myös koodi S-lausekkeina. Tällöin käytetään prefix-esitysmuotoa, jolloin listan ensimmäinen alkio on funktio tai operaattori ja loput alkiot sen parametreja. Esimerkiksi S-lausekkeen (+ 1 2) voi tulkita funktiokutsuna, jolloin operaattorille + välitetään parametrit 1 ja 2. Saman S-lausekkeen voi tulkita myös tavallisena listana, jonka ensimmäinen alkio on symboli +, toinen alkio on numero 1 ja kolmas alkio numero 2.
- Une S Expression (ou Expression Symbolique) est une convention pour la représentation de données ou d'expressions d'un programme sous forme textuelle. Les s-expressions sont utilisées dans la famille de langages Lisp, incluant Scheme et DSSSL, ainsi que comme métalangage dans des protocoles de communication tels IMAP ou le langage CBCL (Common Business Communication Language) de John McCarthy. Les détails de la syntaxe et les types de données supportés diffèrent en fonction du langage, mais la propriété la plus commune est l'utilisation de la notation préfixée parenthésée (affectueusement connue sous le nom de Notation polonaise de Cambridge).
- Con il termine S-expression o sexp (dove S sta per simbolico) ci si riferisce, in informatica ad una convenzione per la rappresentazione di dati semi-strutturati in forma testuale. Le S-expression sono principalmente conosciute per il loro impiego nella famiglia di linguaggi di programmazione lisp. Altri usi di S-expression si trovano nei linguaggi derivati dal Lisp come il DSSSL e come mark-up in protocolli di communicazione come l'IMAP ed il CBCL, sviluppato da John McCarthy. I dettagli della sintassi e dei dati supportati variano nei differenti linguaggi, ma la caratteristica comune a tutti sta nell'uso delle S-expression come notazione prefissa (prefix notation) racchiusa tra parentesi (conosciuta anche come Cambridge Polish notation). Le S-expression sono utilizzate sia per il codice che per i dati. Inizialmente venivano impiegate solo come rappresentazione interna alla macchina delle M-expression, più leggibili da parte dell'uomo. Tuttavia i programmatori Lisp iniziarono presto ad utilizzare le S-expression come notazione di default. Le S-expression possono sia essere singoli oggetti come numeri, atomi LISP inclusi gli atomi speciali nil e t, o coppie cons, scritte come (x . y). Liste più lunghe vengono create nidificando coppie cons, per esempio (1 . ) che può venire anche scritto in maniera più intelligibile come (1 2 3). Il codice di un programma può essere scritto sottoforma di S-expression, utilizzando la notazione prefissa. La stesura di programmi Lisp viene resa più semplice da una serie di facilitazioni della sintassi, che permettono di scrivere S-expression di uso comune con una sintassi equivalente ma abbreviata. Per esempio, l'espressione di uso comune (quote x) può essere abbreviata in 'x. Esempio in Common Lisp: (defun fattoriale) Esempio in Scheme: (define)
- S式(エスしき、英: S-expression)とは、LISPで導入され、主にLISPで用いられる論理記述方式。「S」は「Symbol」のイニシャルである。 形式的にS式は次のように定義される。 シンボルはS式である S式同士のペアはS式である ペアとは、シンボルまたは他のペアを2つ組み合わせた構造のことで、通常はドット対(A . B)として表記される。これに加えて、便宜上(A . )のような連結リスト型のペアを(A B C)と略記する。 S式は、ラムダ算法を紙の上に表記する手段としてジョン・マッカーシー(John McCarthy)によって考案されたが、それをそのままコンピュータ上に移植したものが最初のLISPとなった。S式は表記に大量の括弧を使用するため、非常に好き嫌いが別れるが、コードとデータを均質に記述でき、また構造の解析が容易でマクロが書きやすいことなどから、高い記述力を誇る。LISPとS式は密接に結びついており、両者を分離しようとする試みもいくつかあったが、いずれも成功していない。
- 所谓“S-表达式”或“sexp”(其中“S”代表“符号的”),是指一种以人类可读的文本形式表达半结构化数据的约定。S-表达式可能以其在Lisp家族的编程语言中的使用而为人所知。其他应用则见于由Lisp衍生的语言,如DSSSL,以及如IMAP之类通信协议中作为标记出现和约翰·麦卡锡的CBCL。语法细节和所支持的数据类型虽因语言而异,但这些语言间最通用的特性则是使用S-表达式作为括号化的前缀表示法(有时亦作剑桥波兰表示法)。 S-表达式在Lisp中既用作代码,也用作数据(见McCarthy Recursive Functions of Symbolic Expressions )。S-表达式原本被用于将被M-表达式处理的数据,但Lisp的首个实现是一个S-表达式的解释器,以S-表达式编码M-表达式,而Lisp程序员很快习惯于对代码和数据都使用S-表达式。 S-表达式可以是如数字这样的单个对象,包括特殊原子nil和t在内的LISP 原子,或写作 (x . y)的cons pair。更长的列表则由嵌套的cons pair组成,例如(1 . )(,亦可写作更易理解的(1 2 3))。 使用前缀表示法,程序代码可写作S-表达式。书写Lisp程序中额外的语法糖则是,一般的表达式(quote x)可以省略为'x。 Common Lisp范例: (defun factorial) Scheme范例: (define)
|
| rdfs:comment
|
- The term S-expression or sexp (for symbolic expression) refers to a convention for representing semi-structured data in human-readable textual form. Symbolic expressions are mostly made of symbols and lists. S-expressions are probably best known for their use in the Lisp family of programming languages. Other uses of S-expressions are in Lisp-derived languages such as DSSSL, and as mark-up in communications protocols like IMAP and John McCarthy's CBCL.
- S-lauseke (symbolinen lauseke) on tapa esittää dataa tekstuaalisessa muodossa. S-lausekkeita käytetään mm. Lisp-ohjelmointikielissä. S-lauseke voi olla yksittäinen arvo, kuten numero, symboli tai cons-pari (x . y). Listat ovat cons-ketjuja (x .). Sama voidaan kirjoittaa yksinkertaisemmin muodossa (x y z). Lisp-ohjelmointikielille ominaista on esittää myös koodi S-lausekkeina.
- Une S Expression (ou Expression Symbolique) est une convention pour la représentation de données ou d'expressions d'un programme sous forme textuelle. Les s-expressions sont utilisées dans la famille de langages Lisp, incluant Scheme et DSSSL, ainsi que comme métalangage dans des protocoles de communication tels IMAP ou le langage CBCL (Common Business Communication Language) de John McCarthy.
- Con il termine S-expression o sexp (dove S sta per simbolico) ci si riferisce, in informatica ad una convenzione per la rappresentazione di dati semi-strutturati in forma testuale. Le S-expression sono principalmente conosciute per il loro impiego nella famiglia di linguaggi di programmazione lisp. Altri usi di S-expression si trovano nei linguaggi derivati dal Lisp come il DSSSL e come mark-up in protocolli di communicazione come l'IMAP ed il CBCL, sviluppato da John McCarthy.
- S式(エスしき、英: S-expression)とは、LISPで導入され、主にLISPで用いられる論理記述方式。「S」は「Symbol」のイニシャルである。 形式的にS式は次のように定義される。 シンボルはS式である S式同士のペアはS式である ペアとは、シンボルまたは他のペアを2つ組み合わせた構造のことで、通常はドット対(A . B)として表記される。これに加えて、便宜上(A .
|