emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Grant Rettke <gcr@wisdomandwonder.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Noweb: Same function, two string results differ one with double-quotes the other without
Date: Fri, 11 Sep 2015 20:41:14 -0500	[thread overview]
Message-ID: <CAAjq1mfpesmRmfVnGmMhErZDH4Y+6h9xupgdxMtocF-ENkFtgg@mail.gmail.com> (raw)

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)
;; ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂

             reply	other threads:[~2015-09-12  1:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-12  1:41 Grant Rettke [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAjq1mfpesmRmfVnGmMhErZDH4Y+6h9xupgdxMtocF-ENkFtgg@mail.gmail.com \
    --to=gcr@wisdomandwonder.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).