Talk:Runtime evaluation: Difference between revisions

→‎Joke solution for C: I signed it before, someone ate my sig
(add a section heading, comment on the joke solution)
(→‎Joke solution for C: I signed it before, someone ate my sig)
 
(3 intermediate revisions by 3 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 66:
 
As the original author of the task, I declare: This task is about evaluation, not about starting processes. The task text does not mention "source code" or strings because it is OK to use ASTs as Lisp and E do. I've reworded the header to avoid talking about "programs". —[[User:Kevin Reid|Kevin Reid]] 01:17, 20 July 2011 (UTC)
 
::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