0
$\begingroup$

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

Print[ToString[#0][]]& []
$\endgroup$
  • $\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 May 13 '17 at 0:03
  • 1
    $\begingroup$ Examine Print[ToString[#0][]] &[] // Trace. Convert the output to input to help distinguish strings from symbols. $\endgroup$ – Michael E2 May 13 '17 at 1:01
  • 1
    $\begingroup$ This is related. $\endgroup$ – J. M. will be back soon May 17 '17 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.