emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] JShell support in Babel?


From: Ken Mankoff
Subject: Re: [O] JShell support in Babel?
Date: Tue, 15 Oct 2019 13:28:34 +0200
User-agent: mu4e 0.9.18; emacs 26.3

On 2019-10-15 at 13:04 +02, Jarmo Hurri <address@hidden> wrote...
> JShell is a pretty nifty tool for exploring and demonstrating basic Java
> features. Has anyone happened to write support for it in Babel?

You can start working with it even without official Babel support:

#+BEGIN_SRC bash :results verbatim
jshell
int a[] = {0,1,3,5,8}
a
a[3] = 42
a

""
#+END_SRC
#+RESULTS:
#+begin_example
|  Welcome to JShell -- Version 11.0.4
|  For an introduction type: /help intro

jshell> int a[] = {0,1,3,5,8}
a ==> int[5] { 0, 1, 3, 5, 8 }

jshell> a
a ==> int[5] { 0, 1, 3, 5, 8 }

jshell> a[3] = 42
$3 ==> 42

jshell> a
a ==> int[5] { 0, 1, 3, 42, 8 }

jshell> 

jshell> ""
#+end_example


The last line doesn't P (from REPL) until I added the "". You can probably find 
a more elegant solution using :post.

  -k.
  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]