emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Exploring picolisp
Date: Sat, 03 Mar 2018 15:34:17 +0100	[thread overview]
Message-ID: <87vaed9qja.fsf@gmail.com> (raw)
In-Reply-To: CAFAhFSWYj33vfz=+dYyXKQOm3rez4hoO0Hmkx_iQ-sPyR_v2iw@mail.gmail.com

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

      reply	other threads:[~2018-03-03 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  1:29 Exploring picolisp Lawrence Bottorff
2018-03-03 14:34 ` Thorsten Jolitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vaed9qja.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).