Talk:Shell one-liner: Difference between revisions
Content deleted Content added
→Incorrect solutions: Add comment. |
→Incorrect solutions: what is correctness |
||
Line 42:
: The current task description requires to "specify and execute a short program in the language". I think that examples can pipe source to file, compile it and run the resulting exe; because nothing in the task description prohibits such actions. The ZX Spectrum Basic example looks correct because it runs from the "system prompt". The AutoHotkey example looks wrong; it goes backwards and solves [[Execute a system command]], not this task. --[[User:Kernigh|Kernigh]] 21:06, 25 September 2011 (UTC)
:: This is again the issue of "letter of the task" vs "spirit of the task", which is always muddy. The utility value of a shell one-liner is that for certain simple jobs, you can invoke an intepreter in a simple manner without undesired side effects such as having to open an editor or leaving behind intermediate files. The echo-compile-run methods don't quite achieve that. Plus, if that's allowed, then pretty much any program can be written this way (editor of the champions is 'cat', you know) which renders the task pointless.
:: As to the ZX basic thing, you can argue that it's one line under a prompt, but there's the fact that it's using current interpreter prompt, not quite the same as invoking a separate interpreter. You probably would agree that typing 'ls' under current interactive shell is not a 'shell one-liner', but typing 'sh -c ls' is, same idea. --[[User:Ledrug|Ledrug]] 00:16, 26 September 2011 (UTC)
|