emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Noweb: Same function, two string results differ one with double-quotes the other without
@ 2015-09-12  1:41 Grant Rettke
  2016-01-31  8:30 ` [babel] is there a chance to split arguments in src block calls or noweb syntax O.Hamann
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Rettke @ 2015-09-12  1:41 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Good evening,

I am studying Noweb-Ref usage. I set up this example:

;; ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
#+begin_src emacs-lisp :tangle "test.el" :results value table drawer
replace :noweb yes
(let ((a <<ucase("hEllO, yOU.")>>)
      (b <<ucase(emacs-lisp-data)>>))
  (list a
        (type-of a)
        b
        (type-of b)))
#+end_src

#+RESULTS:
:RESULTS:
| HELLO, YOU. | string | "HELLO, WORLD." | string |
:END:

#+name: ucase
#+begin_src emacs-lisp :var x="WeAthEr" :results value scalar drawer replace
(upcase x)
#+end_src

#+RESULTS: ucase
:RESULTS:
"WEATHER"
:END:

#+name: emacs-lisp-data
#+begin_src emacs-lisp :results value scalar drawer replace
"Hello, world."
#+end_src

#+RESULTS: emacs-lisp-data
:RESULTS:
"Hello, world."
:END:
;; ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

Then I executed each source block.

I was expecting as a result of the first source block to be a list
containing 4 items: double-quoted string, symbol,
double-quoted-string, symbol. Instead what I got was the first string
was not double quoted and the second was. Why doesn't the first value
have double quotes and the third value does have them? The scalar
values return the string and output with double quotes in the last two
source blocks.

Here is how I set up this ECM.

Emacs version: "GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS
apple-appkit-1265.21)\n of 2015-03-16 on orion"

Org-Mode: "8.3.1" from Git at commit 8c85c990521cc833df9179894f6f8b2934d2231a

Updated autoloads.

I use a ECM startup file to start emacs and org mode for ECMS like this:

=open /Applications/Emacs.app --args --quick --load
~/src/help/.org-mode-ecm.emacs.el= which contains

;; ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
;; -*- lexical-binding: t -*-
(setq load-prefer-newer t)
(add-to-list 'load-path "~/src/org-mode/lisp")
(add-to-list 'load-path "~/src/org-mode/contrib/lisp")
(setq org-list-allow-alphabetical t)
(setq org-enforce-todo-checkbox-dependencies t)
(require 'org)
;; ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-05  7:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-12  1:41 Noweb: Same function, two string results differ one with double-quotes the other without Grant Rettke
2016-01-31  8:30 ` [babel] is there a chance to split arguments in src block calls or noweb syntax O.Hamann
2016-01-31 19:34   ` Charles C. Berry
2016-02-05  7:49     ` O.Hamann

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).