Narcissist: Difference between revisions

→‎{{header|Tcl}}: Added a "purer" way to do this
(→‎Tcl: Added implementation)
(→‎{{header|Tcl}}: Added a "purer" way to do this)
Line 23:
 
=={{header|Tcl}}==
With the use of explicit reflexive introspection:
<lang tcl>apply {{} {puts [string equalexpr {[gets stdin] eq [info level 0]}]}}</lang>
Without such commands, using pure generation of strings and lists:
<lang tcl>apply {s {puts [expr {[gets stdin]eq[list {*}$s $s]}]}} {apply {s {puts [expr {[gets stdin]eq[list {*}$s $s]}]}}}</lang>
Anonymous user