Quine: Difference between revisions

513 bytes added ,  2 months ago
m
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#A_quinea_quine
<syntaxhighlightpre lang="blc">000101100100011010000000000001011011110010111100111111011111011010000101100100011010000000000001011011110010111100111111011111011010</syntaxhighlightpre>A byte oriented version is given by the 18 byte program
 
<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}}
Fōrmulæ programs are not textual, visualization/edition of programs is done showing/manipulating structures but not text. Moreover, there can be multiple visual representations of the same program. Even though it is possible to have textual representation &mdash;i.e. XML, JSON&mdash; they are intended for storage and transfer purposes more than visualization and edition.
 
'''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]]
Programs in Fōrmulæ are created/edited online in its [https://formulae.org website], However they run on execution servers. By default remote servers are used, but they are limited in memory and processing power, since they are intended for demonstration and casual use. A local server can be downloaded and installed, it has no limitations (it runs in your own computer). Because of that, example programs can be fully visualized and edited, but some of them will not run if they require a moderate or heavy computation/memory resources, and no local server is being used.
 
[[File:Fōrmulæ - Quine 08.png]]
In '''[https://formulae.org/?example=Quine this]''' page you can see the program(s) related to this task and their results.
 
=={{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 unerlying Lisp system */
/* 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>
</syntaxhighlight>
 
=={{header|MiniScript}}==
Line 4,469 ⟶ 4,504:
=={{header|Wren}}==
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Fmt
 
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>
 
56

edits