geiser-users
[Top][All Lists]
Advanced

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

[Geiser-users] elisp-like "function"-ality in org-mode?


From: Lawrence Bottorff
Subject: [Geiser-users] elisp-like "function"-ality in org-mode?
Date: Mon, 27 Feb 2017 14:21:15 -0500

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?

Larry Bottoff

reply via email to

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