Quine
Quine
Q0034075 (kwīn), Willard Van Orman 1908-2000.quine
(kwəɪn)Quine
(kwaɪn)Noun | 1. | Quine - United States philosopher and logician who championed an empirical view of knowledge that depended on language (1908-2001) |
单词 | quine | |||
释义 | QuineQuineQ0034075 (kwīn), Willard Van Orman 1908-2000.quine(kwəɪn)Quine(kwaɪn)
quineQuinequine(programming)In most interpreted languages, any constant, e.g. 42, is aquine because it "evaluates to itself". In certain Lispdialects (e.g. Emacs Lisp), the symbols "nil" and "t" are"self-quoting", i.e. they are both a symbol and also the valueof that symbol. In some dialects, the function-formingfunction symbol, "lambda" is self-quoting so that, whenapplied to some arguments, it returns itself applied to thosearguments. Here is a quine in Lisp using this idea: ((lambda (x) (list x x)) (lambda (x) (list x x))) Compare this to the lambda expression: (\\ x . x x) (\\ x . x x) which reproduces itself after one step of beta reduction.This is simply the result of applying the combinator fixto the identity function. In fact any quine can beconsidered as a fixed point of the language's evaluationmechanism. We can write this in Lisp: ((lambda (x) (funcall x x)) (lambda (x) (funcall x x))) where "funcall" applies its first argument to the rest of itsarguments, but evaluation of this expression will neverterminate so it cannot be called a quine. Here is a more complex version of the above Lisp quine, whichwill work in Scheme and other Lisps where "lambda" is notself-quoting: ((lambda (x)(list x (list (quote quote) x)))(quote(lambda (x)(list x (list (quote quote) x))))) It's relatively easy to write quines in other languages suchas PostScript which readily handle programs as data; muchharder (and thus more challenging!) in languages like Cwhich do not. Here is a classic C quine for ASCIImachines: char*f="char*f=%c%s%c;main() printf%c";main()printf For excruciatingly exact quinishness, remove the interior linebreak. Some infamous Obfuscated C Contest entries have beenquines that reproduced in exotic ways. Ken Thompson's back door involved an interesting variantof a quine - a compiler which reproduced part of itself whencompiling (a version of) itself. Quine
Synonyms for Quine
|
|||
随便看 |
|
英语词典包含2567994条英英释义在线翻译词条,基本涵盖了全部常用单词的英英翻译及用法,是英语学习的有利工具。