[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [babel] Export problem (Wrong type argument: consp, nil)
From: |
Eric Schulte |
Subject: |
Re: [O] [babel] Export problem (Wrong type argument: consp, nil) |
Date: |
Thu, 08 Sep 2011 11:33:31 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Hi Seb,
All variables must be given a default value, which is why it is an error
to write a code block like the following.
#+source: circle(x)
#+begin_src python
return x*x
#+end_src
I've just pushed up a change which provides a better error message in
this case.
Best -- Eric
"Sebastien Vauban" <address@hidden> writes:
> Hi,
>
> #+TITLE: Export problem
> #+AUTHOR: Seb Vauban
> #+DATE: 2011-09-08
> #+LANGUAGE: en
>
> * Works OK
>
> #+source: square(x=6)
> #+begin_src python
> return x*x
> #+end_src
>
> * Does not work
>
> If there is no value assigned to the code block...
>
> #+source: circle(x)
> #+begin_src python
> return x*x
> #+end_src
>
> ... there is no an error when exporting:
>
> #+begin_src text
> Debugger entered--Lisp error: (wrong-type-argument consp nil)
> setcdr(nil "nil=x")
> (setf (cddr (nth variable-index vars)) (concat (symbol-name ...) "=" (cdr
> pair)))
> (prog1 (setf (cddr ...) (concat ... "=" ...)) (incf variable-index))
> (if name (setq vars (append ... ...)) (prog1 (setf ... ...) (incf
> variable-index)))
> (let ((name ...)) (if name (setq vars ...) (prog1 ... ...)))
> (cond ((eql ... ...) (let ... ...)) ((eql ... ...) (setq results ...))
> ((eql ... ...) (when ... ... ... ...)) ((eql ... ...) (setq exports ...))
> ((eql ... ...) (setq tangle ...)) ((eql ... ...) (setq noweb ...)) ((eql ...
> ...) (setq cache ...)) ((eql ... ...) (setq padline ...)) ((eql ... ...)
> (setq shebang ...)) ((eql ... ...) (setq comments ...)) (t (setq params ...)))
> (case (car pair) (:var (let ... ...)) (:results (setq results ...)) (:file
> (when ... ... ... ...)) (:exports (setq exports ...)) (:tangle (setq tangle
> ...)) (:noweb (setq noweb ...)) (:cache (setq cache ...)) (:padline (setq
> padline ...)) (:shebang (setq shebang ...)) (:comments (setq comments ...))
> (t (setq params ...)))
> (lambda (pair) (case (car pair) (:var ...) (:results ...) (:file ...)
> (:exports ...) (:tangle ...) (:noweb ...) (:cache ...) (:padline ...)
> (:shebang ...) (:comments ...) (t ...)))((:var . "x"))
> mapc((lambda (pair) (case (car pair) (:var ...) (:results ...) (:file ...)
> (:exports ...) (:tangle ...) (:noweb ...) (:cache ...) (:padline ...)
> (:shebang ...) (:comments ...) (t ...))) ((:var . "x")))
> (lambda (plist) (mapc (lambda ... ...) plist))(((:var . "x")))
> mapc((lambda (plist) (mapc (lambda ... ...) plist)) (((:var . "x"))
> ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb .
> "no") (:tangle . "no") (:exports . "code") (:results . "replace")
> (:padnewline . "yes") (:hlines . "no") (:session . "none"))))
> (progn (fset (quote e-merge) (function* ...)) (mapc (lambda ... ...)
> plists))
> (unwind-protect (progn (fset ... ...) (mapc ... plists)) (if
> --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
> (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect
> (progn ... ...) (if --cl-letf-bound-- ... ...)))
> (letf ((... ...)) (mapc (lambda ... ...) plists))
> (letf* ((... ...)) (mapc (lambda ... ...) plists))
> (flet ((e-merge ... ...)) (mapc (lambda ... ...) plists))
> (let ((results-exclusive-groups ...) (exports-exclusive-groups ...)
> (variable-index 0) params results exports tangle noweb cache vars shebang
> comments padline) (flet (...) (mapc ... plists)) (setq vars (reverse vars))
> (while vars (setq params ...)) (mapc (lambda ... ...) (quote ...)) params)
> org-babel-merge-params(((:var . "x")) ((:comments . "") (:shebang . "")
> (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports .
> "code") (:results . "replace") (:padnewline . "yes") (:hlines . "no")
> (:session . "none")))
> (setcar (nthcdr 2 info) (org-babel-merge-params (mapcar ... ...) (nth 2
> info)))
> (setf (nth 2 info) (org-babel-merge-params (mapcar ... ...) (nth 2 info)))
> (progn (setf (nth 2 info) (org-babel-merge-params ... ...)))
> (if (match-string 6) (progn (setf ... ...)))
> (when (match-string 6) (setf (nth 2 info) (org-babel-merge-params ... ...)))
> (progn (setq name (org-babel-clean-text-properties ...)) (when
> (match-string 6) (setf ... ...)))
> #+end_src
>
> Best regards,
> Seb
--
Eric Schulte
http://cs.unm.edu/~eschulte/
- [O] [babel] Export problem (Wrong type argument: consp, nil), Sebastien Vauban, 2011/09/08
- Re: [O] [babel] Export problem (Wrong type argument: consp, nil),
Eric Schulte <=
- Re: [O] [babel] Export problem (Wrong type argument: consp, nil), Sebastien Vauban, 2011/09/14
- Re: [O] [babel] Export problem (Wrong type argument: consp, nil), Martyn Jago, 2011/09/14
- Re: [O] [babel] Export problem (Wrong type argument: consp, nil), Eric Schulte, 2011/09/15
- Re: [O] [babel] Export problem (Wrong type argument: consp, nil), Sebastien Vauban, 2011/09/16
- Re: [O] [babel] Export problem (Wrong type argument: consp, nil), Sebastien Vauban, 2011/09/16
- Re: [O] [babel] Export problem (Wrong type argument: consp, nil), Eric Schulte, 2011/09/16