[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Geiser-users] elisp-like "function"-ality in org-mode?
From: |
Jose A. Ortega Ruiz |
Subject: |
Re: [Geiser-users] elisp-like "function"-ality in org-mode? |
Date: |
Fri, 03 Mar 2017 02:21:12 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
On Mon, Feb 27 2017, Lawrence Bottorff wrote:
> Here's a code block in org-mode:
>
> #+name:myflatten1
> #+begin_src scheme :session f1
> (define (flatten sexpr)
> (let loop ((sexpr sexpr)
> (res '()))
> (format #t "sexpr: ~s; res: ~s\n" sexpr res)
> (cond
> ((null? sexpr) res)
> ((pair? sexpr)
> (append (flatten (car sexpr)) (flatten (cdr sexpr))))
> (else
> (cons sexpr res)))))
> #+end_src
>
> Now, had I done this in elisp I'd be able to call it somewhere else in
> my org-mode world by its babel code-block name -- and throw in lots of
> other variables and such and then activate/call it in a REPL session
> outside of another Scheme function. AFAIK, only elisp has this ability
> in org-mode. It may seem a minor thing, but it adds a new level of
> meta/modular, IMHO. For example, the org-mode literal programming
> paradigm is a real improvement (again IMHO) over traditional "tangle,"
> especially if you don't have to pull all the code out and deal with it
> separately. You can call up code blocks on the fly. Could geiser learn
> to do this elisp trick?
Hmm, i'm not sure if this is what you mean, but org extras already comes
with ob-scheme.el which features some integration with geiser:
http://orgmode.org/cgit.cgi/org-mode.git/plain/lisp/ob-scheme.el
Cheers,
jao
--
If a listener nods his head when you're explaining your program, wake
him up.
- Alan Perlis, Epigrams on Programming
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Geiser-users] elisp-like "function"-ality in org-mode?,
Jose A. Ortega Ruiz <=