ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Rudolf Bahr <quasi@quasi.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Sending data from lua to context and back to lua
Date: Thu, 8 Feb 2018 15:34:01 +0100	[thread overview]
Message-ID: <20180208143401.34bgqz6ulcc27f5e@nan> (raw)
In-Reply-To: <064100bb-9909-3683-d2b6-af6a1ac0734f@uni-bonn.de>

On Thu, Feb 08, 2018 at 09:30:48AM +0100, Thomas A. Schmitz wrote:
> On 02/07/2018 06:39 PM, Rudolf Bahr wrote:
> > Sometimes the necessity could arise to send data from lua to context
> > and answers back to lua. I tried this by using "read" and
> > "immediate\write" commands in context. These commands are described
> > in chapter 21 and 22 of Donald E. Knuth's "The TeXbook".
> > 
> > My question is: Do there exist better and more simple solutions?
> 
> You can print (typeset) information from inside lua code with the "context"
> function. Have you seen the manual cld-mkiv.pdf? It's in the minimals.
> 
> Thomas

Yes, thank you. I tried "context()" several times, but without success.
Could be, that I have a false meaning how to use it: If I transfer data
from context to lua and vice versa then in my imagination there must be 
variables in both languages  where the sent data is to be found.

With the use of "\immediate\write" and "\read" in context and the read and write
functions in lua I know exactly from where to where the data goes. How to do 
the same with "context()"?

Rudolf
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2018-02-08 14:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 17:39 Rudolf Bahr
2018-02-08  5:51 ` Rudolf Bahr
2018-02-08  8:30 ` Thomas A. Schmitz
2018-02-08 14:34   ` Rudolf Bahr [this message]
2018-02-08 15:18     ` Thomas A. Schmitz
2018-02-08 15:25     ` Hans Hagen
2018-02-08 15:26     ` Henning Hraban Ramm
2018-02-08 16:28       ` Rudolf Bahr

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

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

  git send-email \
    --in-reply-to=20180208143401.34bgqz6ulcc27f5e@nan \
    --to=quasi@quasi.de \
    --cc=ntg-context@ntg.nl \
    /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.
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 NNTP newsgroup(s).