From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: How does Library of Babel actually work? Date: Sat, 31 Oct 2015 11:29:21 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e010d8ab2519a1405236835a1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsY5s-0004TA-5N for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:29:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsY5q-0007dE-NC for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:29:24 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:33256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsY5q-0007cv-5p for emacs-orgmode@gnu.org; Sat, 31 Oct 2015 11:29:22 -0400 Received: by wijp11 with SMTP id p11so27709972wij.0 for ; Sat, 31 Oct 2015 08:29:21 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Lawrence Bottorff Cc: emacs-orgmode Mailinglist --089e010d8ab2519a1405236835a1 Content-Type: text/plain; charset=UTF-8 I think you are mistaken in what you think it does. I am pretty sure what it does is allow you to call named src-blocks with this syntax: #+call: some-func-in-lob(args) It doesn't make the functions in the code blocks necessarily available in another code block (although through side effects for emacs-lisp, that might happen). I think what you want (this works for emacs-lisp) is a file, say f1.org containing #+BEGIN_SRC emacs-lisp :tangle f1.el (defun mfe () 8) #+END_SRC Then, in another file you can do: #+BEGIN_SRC emacs-lisp (org-babel-load-file "f1.org") (mfe) #+END_SRC and you will get 8. org-babel-load This isn't possible in other languages. You can of course have an elisp block to tangle f1.org, and then if it was python, for example, you could import the functions in a python block. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Sat, Oct 31, 2015 at 11:10 AM, Lawrence Bottorff wrote: > New thread. Anyway, putting lisp/SLIME aside, I experimented with emacs > lisp -- and got the same results, i.e., no real LOB functionality, despite > proper loading. I must be doing something wrong? I'll describe my process > again: > > Load a.org and b.org into `org-babel-library-of-babel` with > `org-babel-lob-ingest`. Good. Check -- and yes, both functions are > in `org-babel-library-of-babel` and seem to be ready and "live." But when I > try to call them in c.org, org-mode has no knowledge of them. Then I try > #+call and #+lob on a b.org function. Still no knowledge of it. At this > point I'm not sure LOB works -- or I have a mistaken idea of what it is and > what it does. > > LB > > > --089e010d8ab2519a1405236835a1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I think you are mistaken in what you think it does. I am p= retty sure what it does is allow you to call named src-blocks with this syn= tax:

#+call: some-func-in-lob(args)

=
It doesn't make the functions in the code blocks necessarily avail= able in another code block (although through side effects for =C2=A0emacs-l= isp, that might happen).

I think what you want (th= is works for emacs-lisp)

is a file, say f1.org containing

#+BEGIN= _SRC emacs-lisp :tangle f1.el
(defun mfe () 8)
#+END_SR= C


Then, in another file you c= an do:
#+BEGIN_SRC emacs-lisp
(org-babel-load-file= "f1.org")
(mfe)
#+END_SRC

and you will get 8. org-babel-lo= ad

This isn't possible in other languages. You= can of course have an elisp block to tangle f1.o= rg, and then if it was python, for example, you could import the functi= ons in a python block.


John

-----------------------------------
Profe= ssor John Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical Eng= ineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7= 803

On Sat, Oct 31, 2015 at 11:10 AM, Lawrence B= ottorff <borgauf@gmail.com> wrote:
New thread. Anyway, putting lisp/SLIME aside, I= experimented with emacs lisp -- and got the same results, i.e., no real LO= B functionality, despite proper loading. I must be doing something wrong? I= 'll describe my process again:

Load a.org and b.org into=C2=A0`org-babel-library-of-babel` with `org-babel-l= ob-ingest`. Good. Check -- and yes, both functions are in=C2=A0`org-babel-l= ibrary-of-babel` and seem to be ready and "live." But when I try = to call them in c.org, org-m= ode has no knowledge of them. Then I try #+call and #+lob on a b.org function. Still no knowledge of it= . At this point I'm not sure LOB works -- or I have a mistaken idea of = what it is and what it does.

LB


=

--089e010d8ab2519a1405236835a1--