emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Exploring picolisp
@ 2018-02-26  1:29 Lawrence Bottorff
  2018-03-03 14:34 ` Thorsten Jolitz
  0 siblings, 1 reply; 2+ messages in thread
From: Lawrence Bottorff @ 2018-02-26  1:29 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]

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

emacsclient -c -a ''

which sets up my daemon first. Got abstruse error -- and it creates a file
called `editor-orig` in `~/.pil` which blocks any further attempts. After
tearing stuff out of my init diaspora for hours, I finally found that a
straight

>emacs &

made picolisp-mode work, otherwise, not. Very weird. But then I see this
<https://github.com/tj64/ob-picolisp> and, yes, picolisp babel seems to
work for all the examples. However, a regular function declaration

#+name: hello
#+begin_src picolisp
(de hello (X)
   (prinl "Hello " X) )
#+end_src

-- goes nowhere. But then C-c C-c in a picolisp code block isn't firing up
a REPL, so where can it go? Nowhere. Lisp, Scheme & Cie. all require a
running REPL that org-mode knows about. And if I just bring up
picolisp-mode with a picolisp file and fire up a REPL, that REPL doesn't
know anything about my org-mode picolisp code blocks.

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?

LB

[-- Attachment #2: Type: text/html, Size: 1621 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Exploring picolisp
  2018-02-26  1:29 Exploring picolisp Lawrence Bottorff
@ 2018-03-03 14:34 ` Thorsten Jolitz
  0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Jolitz @ 2018-03-03 14:34 UTC (permalink / raw)
  To: emacs-orgmode

Lawrence Bottorff <borgauf@gmail.com> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-03 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-26  1:29 Exploring picolisp Lawrence Bottorff
2018-03-03 14:34 ` Thorsten Jolitz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).