emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Daniel Kraus <daniel@kraus.my>
Cc: Ag <agzam.ibragimov@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [BUG] Tangling of clojure code blocks is broken [9.7 (9.7-??-0807107 @ /Users/ag/.emacs.d/.local/straight/build-30.0.50/org/)]
Date: Mon, 08 May 2023 15:21:30 +0000	[thread overview]
Message-ID: <87pm7aluh1.fsf@localhost> (raw)
In-Reply-To: <87lehzb0k1.fsf@kraus.my>

Daniel Kraus <daniel@kraus.my> writes:

> The problem is that or :results value (/the default) I only want the
> result of the last expression and I do that `binding` of stdout to surpress
> all other output.
> But I guess during tangle this should just be ignored?
> Is there a simple way to find out if `org-babel-execute:clojure` is
> executed or tangled?

You can just move this extra logic arranging :results to
org-babel-execute:clojure.

> If it should be ignored on tangle, what about the :var defines.

:var defines are affecting how the code is written. :results should not.
So, :var is expected to affect tangling.
If necessary, code block expansion can be disabled via :no-expand header
argument:

       By default Org expands code blocks during tangling.  The ‘no-expand’
    header argument turns off such expansions.  Note that one side-effect of
    expansion by ‘org-babel-expand-src-block’ also assigns values (see *note
    Environment of a Code Block::) to variables.  Expansions also replace
    noweb references with their targets (see *note Noweb Reference
    Syntax::).  Some of these expansions may cause premature assignment,
    hence this option.  This option makes a difference only for tangling.
    It has no effect when exporting since code blocks for execution have to
    be expanded anyway.

> We recently discussed this for ob-scheme where there was a problem with the
> `let` wrapper.
> Is it ok or expected that a the tangled code is wrapped in a let block?
> Should I change it to a global `def`?

I think that keeping `let' should be fine as long as it does not break
things. In the previous discussion, the whole issue was that `let' was
not always safe in that particular lisp dialect.

We just need to make sure that it is documented.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2023-05-08 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-06  3:27 [BUG] Tangling of clojure code blocks is broken [9.7 (9.7-??-0807107 @ /Users/ag/.emacs.d/.local/straight/build-30.0.50/org/)] Ag Ibragimov
2023-05-06  6:30 ` Ihor Radchenko
2023-05-08  5:18   ` Ag Ibragimov
2023-05-08  5:26     ` Ag
2023-05-08 10:05       ` Daniel Kraus
2023-05-08 15:21         ` Ihor Radchenko [this message]
2023-05-08  6:49     ` Ihor Radchenko

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=87pm7aluh1.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=agzam.ibragimov@gmail.com \
    --cc=daniel@kraus.my \
    --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).