Quine: Difference between revisions
m
→{{header|Binary Lambda Calculus}}
m (Update Lang example: Fix spelling of Lang) |
|||
(10 intermediate revisions by 7 users not shown) | |||
Line 261:
<syntaxhighlight lang="lisp">(let((q"(let((q~x0))(cw q q))"))(cw q q))</syntaxhighlight>
=={{header|Acornsoft Lisp}}==
<syntaxhighlight lang="lisp">((lambda (s) (list s (list (quote quote) s)))
(quote (lambda (s) (list s (list (quote quote) s)))))
</syntaxhighlight>
=={{header|Ada}}==
Line 595 ⟶ 601:
=={{header|Binary Lambda Calculus}}==
As explained at https://tromp.github.io/cl/Binary_lambda_calculus.html#
<
<code>16 46 80 05 bc bc fd f6 80 16 46 80 05 bc bc fd f6 80</code>
=={{header|Bob}}==
Line 1,362 ⟶ 1,370:
=={{header|Ecstasy}}==
<syntaxhighlight lang="java">
module test {
@Inject Console console;
void run() {
console.print($./test.x);
}
}
</syntaxhighlight>
{{out}}
<pre>
module test {
@Inject Console console;
void run() {
console.print($./test.x);
}
}
</pre>
Line 1,519 ⟶ 1,523:
=={{header|Fōrmulæ}}==
{{FormulaeEntry|page=https://formulae.org/?script=examples/Quine}}
'''Solution'''
'''Preamble. Symbolic computation'''
Symbolic computation works different than traditional one. In symbolic computation, the program becomes gradually in its output, by the application of [[wp:Rewriting|rewriting rules]].
'''Example 1. The simplest program'''
The simplest program is a Null expression. Please notice that it is not an empty program (which is disallowed). It is just a one expression program: the Null expression, which has no rewriting rules.
[[File:Fōrmulæ - Quine 01.png]]
[[File:Fōrmulæ - Quine 02.png]]
'''Example 2. A program with non-reducible expressions'''
According to symbolic computation, if a program contains only non-reducible expressions (expression with no rewriting rules), then it will no be transformed to anything else, and it will be its own output.
[[File:Fōrmulæ - Quine 03.png]]
[[File:Fōrmulæ - Quine 04.png]]
[[File:Fōrmulæ - Quine 05.png]]
[[File:Fōrmulæ - Quine 06.png]]
[[File:Fōrmulæ - Quine 07.png]]
[[File:Fōrmulæ - Quine 08.png]]
=={{header|Furor}}==
Line 1,766 ⟶ 1,796:
=={{header|Inform 7}}==
<syntaxhighlight lang="inform7">R is a room. To quit: (- quit; -). When play begins: say entry 1 in Q; say Q in brace notation; quit. Q is a list of text variable. Q is {"R is a room. To quit: (- quit; -). When play begins: say entry 1 in Q; say Q in brace notation; quit. Q is a list of text variable. Q is "}</syntaxhighlight>
=={{header|Insitux}}==
<syntaxhighlight lang="insitux">(#(join(char-code 34)[% %(char-code 41)])"(#(join(char-code 34)[% %(char-code 41)])")</syntaxhighlight>
=={{header|INTERCAL}}==
Line 2,839 ⟶ 2,872:
=={{header|Maxima}}==
<syntaxhighlight lang="maxima">
/* Using ?format from the underlying Lisp system */
lambda([],block([q:ascii(34),s:"lambda([],block([q:ascii(34),s:~A~A~A],print(?format(false,s,q,s,q))))()$"],print(?format(false,s,q,s,q))))()$
</syntaxhighlight>
=={{header|MiniScript}}==
Line 4,469 ⟶ 4,504:
=={{header|Wren}}==
{{libheader|Wren-fmt}}
<syntaxhighlight lang="
var a = "import $c./fmt$c for Fmt$c$cvar a = $q$cFmt.lprint(a, [34, 34, 10, 10, a, 10])"
Fmt.lprint(a, [34, 34, 10, 10, a, 10])</syntaxhighlight>
|