Talk:Shell one-liner: Difference between revisions
Content deleted Content added
→Incorrect solutions: different meaning of utility |
Heads up! Is the Liberty BASIC solution glitched? |
||
(12 intermediate revisions by 7 users not shown) | |||
Line 23:
The idea was to invoke the language - in this case BASIC, from a command shell outside of the language, together with one line of text which would become the program for the language to run. The basic example seems to be invoking a command shell and another program from within the BASIC shell. --[[User:Paddy3118|Paddy3118]] 06:23, 26 January 2010 (UTC)
: I guess I misunderstood the task. There's no standard way to do ''that'' for BASIC (many implementations don't have a non-interactive mode, or else can't take their input from stdin). I'll remove it. -- [[User:Eriksiers|Eriksiers]] 00:51, 28 January 2010 (UTC)
:: I think I also misinterpreted the task. When I read SPECIFY and EXECUTE, I understood that to mean to input a program for a particular language and then run it from the (shell) command line. If you had said, "show how to execute a program in a language from a shell (command line or "prompt") ...", and the point here is that it shouldn't matter if the program is 45,000 statements long (or only 3), I would've assumed you wanted example(s) to show the syntax of how to run a program (for a particular language). Of course, I'm assuming that "short" had to do with the size of the program, not the duration of it's execution or smallness of output. -- [[User:Gerard Schildberger|Gerard Schildberger]] 18:49, 23 March 2012 (UTC)
==One Line?==
Line 36 ⟶ 38:
Second class of incorrectness: not running from shell at all. These include AutoHotkey, ZX spectrum basic, Matlab, MUMPS, and REXX. REXX example talks about how to run an executable file which is way off topic; all others substitute "shell" with "intepreter". These, in my mind, are undoubtedly incorrect, more so than the previous category even.
: --- Where does the REXX example talk about anything? For that matter, where is the REXX example? -- [[User:Gerard Schildberger|Gerard Schildberger]] 00:13, 23 March 2012 (UTC)
:: See the history, the example mentioned was [http://rosettacode.org/mw/index.php?title=Shell_one-liner&oldid=121477#REXX marked for deletion] Sept 25, 2011 along with several others, and was later deleted when it was not fixed. [[User:Xenoker|Xenoker]] 17:46, 23 March 2012 (UTC)
There is actually a third category, where the braindead compiler/intepreter can eval a file without producing an exe but would not do so with text supplied on commandline or stdin. These include second example of Go and Oz. I'm a bit indifferent about this category, it sort of fits the spirit of the task.
Line 49 ⟶ 54:
:::: That does not depend much on what string eval capability is present in the language, but rather what other stuff is present on the system. Suppose you pull the full source code of Linux kernel and type <code>make && make modules && make install</code>, then proceed to claim that the most significant part of the kernel is make's one-liner power -- no you wouldn't. Would you? --[[User:Ledrug|Ledrug]] 04:17, 26 September 2011 (UTC)
:::::I was thinking of a hypothetical compiled language that came with a web server as part of its standard libraries (Boo perhaps)? Sitting around waiting for Linux to compile from source would be of little practical use. cat'ing a small program to compile and link to a pre-compiled web server library ''might''. but as I was alluding to earlier - its in a grey and fuzzy area. --[[User:Paddy3118|Paddy3118]] 04:41, 26 September 2011 (UTC)
Currently, the C implementation has this "incorrect" notice:
:<nowiki>{{incorrect|C|Solution doesn't have much to do with the C language, but rather a shell and compiler example. Pending objections (or in the unlikely event, a true fix), code probably should be removed and task omitted.}}</nowiki>
But this is not a meaningful objection. The task asks for a shell one liner, so objecting to a shell example is pointless. Likewise, the C language is typically implemented using a compiler, so objecting to the compiler is also pointless.
So I am going to remove this from the main page. --[[User:Rdm|Rdm]] 13:47, 26 September 2011 (UTC)
:: Good, I left the note there in case people think differently about it. Now that I seem to be holding the minority opinion, I guess the concensus is C and Java etc examples are ok. --[[User:Ledrug|Ledrug]] 21:49, 26 September 2011 (UTC)
::: As a general rule, I think we encourage "best efforts" here. We are trying to encourage cross/language understandings and representations. --[[User:Rdm|Rdm]] 22:09, 26 September 2011 (UTC)
:::: I agree, to the extent that the example provides for good or common practice. For C a one-liner is actually used often (to find out a system constant when porting stuff, for example). But for Go or Java it would appear quite unnatural -- how often do you see a java programmer coding without an IDE? --[[User:Ledrug|Ledrug]] 22:28, 26 September 2011 (UTC)
==Whilst/while==
I didn't know that whilst was [http://oxforddictionaries.com/definition/whilst used mainly in Britain]. Some sentences still seem somehow better with the word rather than using while, but now that I am aware of my parochial Englishness I am quite happy to go along with swapping it :-) --[[User:Paddy3118|Paddy3118]] 04:07, 26 September 2011 (UTC)
:Heh I didn't know either. You don't need to change if you don't want to. They mean the same thing. I guess I understand now why I thought it was an unnecessary word: in my country, it isn't necessary. In any case, I guess the nature of this site means we should accept all sorts of language subtleties (spoken, written, programmed, or otherwise, where it doesn't get in the way of clarity). You can stick with "whilst" where you like it and I'll stick with "while" everywhere. --[[User:Mwn3d|Mwn3d]] 19:52, 26 September 2011 (UTC)
==Liberty BASIC oddity==
Is the Liberty BASIC one correct? Looks like it got doubled somehow.
[[User:Axtens|Axtens]] 00:57, 21 September 2012 (UTC)
|