0
$\begingroup$

This function prints it self, can someone please explain how it works?

Print[ToString[#0][]]& []
$\endgroup$
3
  • $\begingroup$ Technically it prints Print[ToString[#0][]]& as a string and [] appended to it. Just replace Print with CellPrint or copy the output as InputText and you'll see what I mean. $\endgroup$
    – swish
    Commented May 13, 2017 at 0:03
  • 1
    $\begingroup$ Examine Print[ToString[#0][]] &[] // Trace. Convert the output to input to help distinguish strings from symbols. $\endgroup$
    – Michael E2
    Commented May 13, 2017 at 1:01
  • 1
    $\begingroup$ This is related. $\endgroup$ Commented May 17, 2017 at 11:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.