emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Exploring picolisp


From: Thorsten Jolitz
Subject: Re: [O] Exploring picolisp
Date: Sat, 03 Mar 2018 15:34:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Lawrence Bottorff <address@hidden> writes:


Hi Lawrence,

> I'm looking at picolisp -- and wondering how it works, or better, why it
> doesn't really work work with babel. First problem, I couldn't get any
> form of picolisp to work in Emacs -- until I stopped starting Emacs with
> [...]
> I don't mean to complain or sound negative, but picolisp as is can't
> really be included as a babel language, can it? Maybe it worked once,
> but doesn't now?

sometimes the bug actually sits in front of the computer, as we all know
;-)

Apparently you are not aware of the 'session' concept of org source
blocks (please refer to the org manual). 
This is nothing specific to ob-picolisp, but holds for all ob languages
that do allow for sessions:

,----
| * Picolisp scr-block test
| 
| #+BEGIN_SRC picolisp  :session pil1
|  (setq X1 (+ 3 4))
| #+END_SRC
| 
| #+results:
| : 7
| 
| 
| #+BEGIN_SRC picolisp  :session pil1
| (setq X2 (+ X1 1))
| #+END_SRC
| 
| #+results:
| : 8
| 
| 
| #+BEGIN_SRC picolisp  :session pil1
| (de foo1 (X) (+ X 2))
| #+END_SRC
| 
| #+results:
| : foo1
| 
| #+BEGIN_SRC picolisp  :session pil1 :results raw
| (setq X3 (foo1 8))
| #+END_SRC
| 
| #+results:
| 10
`----

And, with a session, you do have a related interactive repl buffer in
Emacs called "pil1", thats reflects all evaluations of the code blocks
in the org file, and allows for user input just like the PicoLisp repl:

,----
| (setq X1 (+ 3 4))
| 'org-babel-picolisp-eoe
| : -> 7
| : -> org-babel-picolisp-eoe
| : (setq X2 (+ X1 1))
| 'org-babel-picolisp-eoe
| -> 8
| : -> org-babel-picolisp-eoe
| : (de foo1 (X) (+ X 2))
| 'org-babel-picolisp-eoe
| -> foo1
| : -> org-babel-picolisp-eoe
| : (setq X3 (foo1 8))
| 'org-babel-picolisp-eoe
| -> 10
| : -> org-babel-picolisp-eoe
| : 
`----

Hope that helps

-- 
cheers,
Thorsten




reply via email to

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