emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Leo Butler <Leo.Butler@umanitoba.ca>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [RFC/PATCH] naming src/bin files in ob-C.el
Date: Sun, 14 May 2023 20:19:29 +0000	[thread overview]
Message-ID: <878rdqd5tc.fsf@t14.reltub.ca> (raw)
In-Reply-To: <87bkio1y4n.fsf@localhost> (Ihor Radchenko's message of "Sat, 13 May 2023 07:36:24 +0000")

On Sat, May 13 2023, Ihor Radchenko <yantar92@posteo.net> wrote:

> Leo Butler <Leo.Butler@umanitoba.ca> writes:
>>> IMHO, it will be more consistent with other backends to use :results file :file /path/to/executable
>> No, I don't think this is the way to do it. What happens in this
>> case is:
>> 1. `org-babel-C-execute' creates a named source file, compiles it to the
>>    named binary file;
>> 2. then executes that binary file, producing output;
>> 3. that output is inserted into the named binary file, overwriting its
>>    contents.
> What I am suggesting is making :results file :file /path/to stop after 1
> and produce a link to the binary file.

Ok, stopping after 1 seems reasonable when the code block is meant to
produce just the executable. But, your suggestion would mean that the
code block can *only* produce an executable file. Maybe that is ok, but
since the current semantics allow something like

#+begin_src C++ :includes <iostream> <fstream> :results file :file ./results.csv
  using namespace std;
  for(int i=0; i<10; i++){ cout << i << "," << i*i << endl; }

so I am not sure that we should break that.

On the other hand, I don't see any sense in producing a link to the
binary file. Org can't do anything with that link, so the user would
need to write something like ":results file :file /path/to :wrap
comment". That is why I would prefer something like a :bin-file header.


  reply	other threads:[~2023-05-14 20:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 15:05 [RFC/PATCH] naming src/bin files in ob-C.el Leo Butler
2023-05-12 15:41 ` Leo Butler
2023-05-12 16:39   ` Ihor Radchenko
2023-05-12 20:25     ` Leo Butler
2023-05-13  7:36       ` Ihor Radchenko
2023-05-14 20:19         ` Leo Butler [this message]
2023-05-15 11:15           ` Ihor Radchenko
2023-05-15 11:46             ` Leo Butler
2023-05-15 14:02               ` [POLL] ob-C: Should we allow saving compiled src block to specified binary excecutable? (was: [RFC/PATCH] naming src/bin files in ob-C.el) Ihor Radchenko
2023-08-21 12:06                 ` 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:

  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=878rdqd5tc.fsf@t14.reltub.ca \
    --to=leo.butler@umanitoba.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \


* 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


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).