I've recently started to learn J. If find it useful when learning a new language to be able to quickly map a bit of source code to an output and store it for later reference in Emacs org-mode.
But I'm having trouble with the cryptic jconsole
when I want to do the evaluation.
For instance jconsole --help
doesn't work.
And man jconsole
brings up something about a Java tool. Same applies to googling.
I have for instance this bit of code from the tutorial saved in temp.ijs
:
m =. i. 3 4
1 { m
23 23 23 23 (1}) m
Now when I run jconsole < temp.ijs
, the output is:
4 5 6 7
0 1 2 3
23 23 23 23
8 9 10 11
Ideally, I'd like the output to be:
4 5 6 7
0 1 2 3
23 23 23 23
8 9 10 11
Again, ideally I'd like to have this without changing the source code at all,
i.e. just by passing some flag to jconsole
.
Is there a way to do this?
The problem is with loose declarations. Every time you give the console a command, it replies with the answer. You should format your code in a verb and have it
echo
what you need.It can also be nameless and self executing if you're in a hurry: