emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [ANN] BREAKING CHANGE -- removing #+BABEL file-wide property lin


From: Eric Schulte
Subject: Re: [O] [ANN] BREAKING CHANGE -- removing #+BABEL file-wide property lines
Date: Sat, 22 Oct 2011 09:25:33 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

>
> Just to clarify my understanding: on a #+PROPERTY line, you *have* to
> say
>
> #+PROPERTY: var a=1, b=2
>
> but in the code block itself, you can say *either*
>
> #+begin_src emacs-lisp :var a=1, b=2
> ...
>
>
> *or*
>
> #+begin_src emacs-lisp :var a=1 :var b=2
> ...
>

correct

>
> Experimentally, both of these currently work: do you have any plans to
> outlaw the last form?
>

no

>
> Also, how does the comma-separated list of variable assignments interact
> with a language where comma has syntactic significance? I was primarily
> thinking of python where e.g. a=[1,2,3] or a=(1,2) is a legal
> construct. AFAICT, that never worked in babel[fn:1], so it may not
> matter much, but it may be a good idea to come up with a quoting
> mechanism so things like that can be added in the future if necessary.
>

The syntax of the language is not used in the header argument form, only
code-block constructs are used here, which largely amounts to data and
code block references, indexing into variables, and emacs-lisp forms.
There are cases where the above do contain ", " but they are parsed
correctly, e.g.,

#+headers: :var data=foo(bar=1, baz=2), fuz=5

and

#+headers: :var data=table[0,0]

will both be parsed correctly.

>
> Thanks,
> Nick
>
> Footnotes:
>
> [fn:1] I checked in 7.7 to avoid the recent churn with the following
> code block
>
>
> #+begin_src python :var a='(1,2)'
> len(a)
> #+end_src
>
> and I get 
>
> ,----
> |   File "<stdin>", line 3
> |     a=[1, [\,, 2]]
> |                  ^
> | SyntaxError: unexpected character after line continuation character
> `----
>
> in the org babel error output buffer.

you can use elisp in assignment forms, but not syntax from the language
of the code block, so the above could be re-written as

#+begin_src python :var a='(1 2)
  len(a)
#+end_src

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



reply via email to

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