Talk:Runtime evaluation: Difference between revisions

→‎Joke solution for C: I signed it before, someone ate my sig
(It's still no clearer. Is this chainloading?)
(→‎Joke solution for C: I signed it before, someone ate my sig)
 
(2 intermediate revisions by 2 users not shown)
Line 50:
return 0;
}</lang>
:--[[User:Ledrug|Ledrug]] 00:53, 21 July 2011 (UTC)
{{unsigned|Ledrug}}
 
This does not meet the task requirements, because “You may not invoke a separate evaluator program…unless…that program…are considered part of your language/library/platform”, and gdb is not part of C. I would almost suggest adding it anyway for the amusement value, but I would not want the page to become cluttered with more not-about-practical-evaluation-and-not-enlightening-about-the-language answers. Good work anyway! —[[User:Kevin Reid|Kevin Reid]] 01:22, 20 July 2011 (UTC)
Line 68:
 
::It's still no clearer. Is this chainloading? [[User:Markhobley|Markhobley]] 09:04, 20 July 2011 (UTC)
:::No. If you wanted to something like this in C, you might create a function which took C source code, compiled and linked it in your process's own address space (with some of the current process's active symbols available to that compile/link procedure), and then called its entry point. In Perl, you would simply call eval($yourSourceCode), and it would execute Perl with all variables in-scope at the time of eval() available to the eval()'d code. --[[User:Short Circuit|Michael Mol]] 11:21, 20 July 2011 (UTC)
Anonymous user