From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Org-Babel - Clojure & Lazy Sequences Bug Date: Fri, 26 Nov 2010 15:49:55 -0700 Message-ID: <871v67lmy4.fsf@gmail.com> References: <87k4kqpc4q.fsf@gmail.com> <87vd3lz4i0.fsf@gmail.com> <87k4jzltfi.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=51290 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PM77D-00087S-1a for emacs-orgmode@gnu.org; Fri, 26 Nov 2010 17:50:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PM77B-0001MD-So for emacs-orgmode@gnu.org; Fri, 26 Nov 2010 17:50:02 -0500 Received: from mail-pw0-f41.google.com ([209.85.160.41]:40110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PM77B-0001Kz-MA for emacs-orgmode@gnu.org; Fri, 26 Nov 2010 17:50:01 -0500 Received: by pwi6 with SMTP id 6so2283184pwi.0 for ; Fri, 26 Nov 2010 14:50:00 -0800 (PST) In-Reply-To: (Rick Moynihan's message of "Fri, 26 Nov 2010 20:53:10 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rick Moynihan Cc: emacs-orgmode@gnu.org, Joel Boehland Rick Moynihan writes: > > Basically it looks like the different :results types haven't yet been > implemented... The one I was missing was 'code' e.g. the following > works for elisp: > > #+begin_src emacs-lisp :results code > '(+ 10 1) > #+end_src > > displaying: > > #+results: > #+BEGIN_SRC emacs-lisp > (+ 10 1) > #+END_SRC > > But in clojure I get: > > #+begin_src clojure :results code > '(+ 10 1) > #+end_src > > #+results: > | + | 10 | 1 | > I've just pushed up an implementation of this feature. It uses Clojure's pretty printer which has different settings for printing code and data. This can be controlled through use of the "code" (for code) and "pp" (for data) arguments to :results, here's example output with the new implementation. #+begin_src clojure :results pp '(defn cl-format "An implementation of a Common Lisp compatible format function" [stream format-in & args] (let [compiled-format (if (string? format-in) (compile-format format-in) format-in) navigator (init-navigator args)] (execute-format stream compiled-format navigator))) #+end_src #+results: #+begin_example (defn cl-format "An implementation of a Common Lisp compatible format function" [stream format-in & args] (let [compiled-format (if (string? format-in) (compile-format format-in) format-in) navigator (init-navigator args)] (execute-format stream compiled-format navigator))) #+end_example #+begin_src clojure :results code '(defn cl-format "An implementation of a Common Lisp compatible format function" [stream format-in & args] (let [compiled-format (if (string? format-in) (compile-format format-in) format-in) navigator (init-navigator args)] (execute-format stream compiled-format navigator))) #+end_src #+results: #+BEGIN_SRC clojure (defn cl-format "An implementation of a Common Lisp compatible format function" [stream format-in & args] (let [compiled-format (if (string? format-in) (compile-format format-in) format-in) navigator (init-navigator args)] (execute-format stream compiled-format navigator))) #+END_SRC