UP | HOME

Quine in R: an expression that evaluates to itself

This R expression evaluates to itself. The trick is that substitute(), when called inside a function, will substitute for the values of the variables in the expression using values from the current environment.

(function (x) substitute(x(x)))(function(x) substitute(x(x)))

Author: Steven Bagley

Date: 2015-09-29 Tue