Constructing quines (self-reproducing functions)

前端 未结 5 1504
走了就别回头了
走了就别回头了 2021-02-19 03:47

Has anyone constructed a quine (\"A program that generates a copy of its own source text as its complete output\": http://www.nyx.net/~gthompso/quine.htm) in R? (The [quine] ta

5条回答
  •  执念已碎
    2021-02-19 04:21

    This is the shortest I can come up with:

    > "f" <- function() call("<-", "f", f)
    > f()
    "f" <- function () 
    call("<-", "f", f)
    

提交回复
热议问题