emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Gary Oberbrunner <garyo@oberbrunner.com>
Cc: Orgmode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: Org-mode as a metalanguage: calling SQL "functions"
Date: Fri, 05 Apr 2013 10:31:01 -0600	[thread overview]
Message-ID: <87wqshlz22.fsf@gmail.com> (raw)
In-Reply-To: CAFChFyg+_BnV448wfATTY+PZmZzLb87S9g3rsNeauCq_TYNVzg@mail.gmail.com

Hi Gary,

I agree.

Gary Oberbrunner <garyo@oberbrunner.com> writes:

> What I'd really like in the org-mode doc somewhere (or on worg?) is the
> babel syntax broken out like a traditional programming language, by which I
> mean describe the syntax[es] for *defining* a function in one place
> (including all the ways to define args and their default values),

I believe this information is currently split between the following two
manual pages.

    (info "(org)Structure of code blocks")
    (info "(org)var")

> and describe the syntax[es] for *calling* a function in a separate
> section (including how to pass args).

This should be fairly completely addressed in the following manual page.

    (info "(org)Evaluating code blocks")

> If the variable semantics vary by language (as they do), just say so
> (e.g. when defining a SQL function, vars are substituted into the body
> by prefixing the names with $, but in python they are local vars in
> non-session mode and global vars in session mode and so on.  Maybe
> this doc section shouldn't try to enumerate all those languages, but
> just redirect to the proper worg babel language page for details on
> arg handling.
>

Yea, this could be a simple note, e.g., "the method by which variables
are applied to code blocks are language-specific and determined by the
semantics of the programming language of the code block, see ...".

>
> I think all this info is already there in one place or another, but IMHO
> it's not organized in such a way that a newbie can start to use org-mode as
> a metaprogramming language without lots of false starts and reading the
> source (like I did).
>

I agree.  I think this information would be best included as a new page
in the manual under the working with source code section.  It could link
to, and be linked from the pages I reference above.

I don't think it'd be overly difficult to write, and shouldn't be more
than a page or two of prose, and as you say it would be very helpful for
beginners.  Alternately this could be a page on Worg, but I think it is
important enough to be included in the manual.

Would you want to take a first pass at such an addition?  If not I can,
but it may be a while before I get to it.

Cheers,

p.s. These two publications could help; a journal article on code blocks
     in Org-mode [1] and a shorter magazine piece on the same [2].  They
     both deal with meta-programming in Org-mode documents.

>
>
>
> On Thu, Apr 4, 2013 at 4:10 PM, Sebastien Vauban <wxhgmqzgwmuf@spammotel.com
>> wrote:
>
>> Eric,
>>
>> Eric Schulte wrote:
>> > "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
>> >> Eric Schulte wrote:
>> >>>>> At this point I'm not sure if the documentation or the code should be
>> >>>>> amended.  I've personally never liked the args-in-block-name syntax,
>> but
>> >>>>> I don't recall if we formally decided to abandon it, or if it has
>> simply
>> >>>>> been broken in a recent commit.
>> >>>>
>> >>>> I am not sure if I have any say here, but I agree that the args in
>> >>>> name notation looks not as good and might be considered for
>> >>>> abolishment.
>> >>>
>> >>> Great, I agree wholeheartedly and I'll update the documentation
>> >>> accordingly (and take a look at lob-ingest to ensure it no longer uses
>> >>> this var-in-name style).
>> >>
>> >> I confirm that, following a discussion we had, you had decided to drop
>> the
>> >> alternate syntax, a couple of months ago (more than 2 ;-)).
>> >
>> > Great, so I'm not imagining things.  Thanks Seb.
>>
>> For the sake of clarity, it all began (in September 2011) with the fact it
>> was
>> more difficult to trap errors such as missing default value, in the
>> functional-syntax style. See
>> http://article.gmane.org/gmane.emacs.orgmode/46888.
>>
>> This also lead, a couple of weeks later (October 2011), to questionning the
>> multiple keywords used for code blocks, such as #+source: and #+srcname:.
>> See
>> http://article.gmane.org/gmane.emacs.orgmode/48399.
>>
>> Best regards,
>>   Seb
>>
>> --
>> Sebastien Vauban
>>
>>
>>


Footnotes: 
[1]  http://www.jstatsoft.org/v46/i03

[2]  http://cs.unm.edu/~eschulte/data/CISE-13-3-SciProg.pdf

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

  reply	other threads:[~2013-04-05 16:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01 19:28 Org-mode as a metalanguage: calling SQL "functions" Gary Oberbrunner
2013-04-01 20:41 ` Mike Gauland
2013-04-02  1:19 ` Eric Abrahamsen
2013-04-02  1:45   ` Eric Schulte
2013-04-02  2:46     ` Eric Abrahamsen
2013-04-02  2:54     ` Gary Oberbrunner
2013-04-02 21:54       ` Eric Schulte
2013-04-03  5:50         ` Andreas Röhler
2013-04-03  5:54         ` Carsten Dominik
2013-04-03 13:09           ` Eric Schulte
2013-04-04 12:26             ` Sebastien Vauban
2013-04-04 12:49               ` Eric Schulte
2013-04-04 20:10                 ` Sebastien Vauban
2013-04-05 15:43                   ` Gary Oberbrunner
2013-04-05 16:31                     ` Eric Schulte [this message]
2013-04-05 17:51                       ` Andreas Röhler
2013-04-06 20:44                       ` Bastien

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=87wqshlz22.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=garyo@oberbrunner.com \
    /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).