From: Roedy Green on 26 Mar 2010 16:59 On Fri, 26 Mar 2010 09:40:20 -0700 (PDT), SolutionMonkey <valuemonkey(a)telus.net> wrote, quoted or indirectly quoted someone who said : > >Thanks for the info Thomas. I can see what you're saying about java >not being appropriate for one-liners. That's why I'm looking for >another tool that would (hopefully) make some assumptions about things >like package imports, etc. It was a long shot. There are other scripting languages that use the JVM. They are better for this sort of thing than Java with its verbose strong typing. see http://mindprod.com/jgloss/scripting.html -- Roedy Green Canadian Mind Products http://mindprod.com If you tell a computer the same fact in more than one place, unless you have an automated mechanism to ensure they stay in sync, the versions of the fact will eventually get out of sync.
From: Arne Vajhøj on 26 Mar 2010 19:25
On 26-03-2010 12:57, SolutionMonkey wrote: > On Mar 25, 5:15 pm, Arne Vajh�j<a...(a)vajhoej.dk> wrote: >> On 25-03-2010 09:47, bugbear wrote: >> >>> Stefan Ram wrote: >>>> bugbear<bugbear(a)trim_papermule.co.uk_trim> writes: >>>>> Well, one *could* create a script to invoke the compiler >>>>> and runtime components sequentially, to give the effect >>>>> you request, but I see little benefit. >> >>>> One benefit would be the possibility to use Java package >>>> in command lines, such as Perl is used in, say, >> >>>> cat cljp | perl -pe 's/\n\nFrom/\nFrom /mg' | grep ... >> >>> Yes - I understand the "idea" but question wether >>> Java can (in practice) express anything very useful >>> in one line. >> >> The line would be too long to be useful. > Yeah, I think this is the crux of the problem. A one-liner tool is > only valuable if you can write a succinct code snippet. It is all about picking the right tool for the job. Java is not the right tool for one liners. > I was hoping there was a tool in the JDK that helps with this. I know > groovy and beanshell could be of assistance, but I don't think either > of these is packaged with the JDK. Newer JDK's comes with an embedded JavaScript engine. Arne |