ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@xs4all.nl>, Taco Hoekwater <taco@bittext.nl>
Subject: Re: nil from TeX to Lua
Date: Tue, 10 Aug 2021 09:59:37 +0200	[thread overview]
Message-ID: <e56c3c40-a5ce-3b36-571b-60f528d5ed4f@xs4all.nl> (raw)
In-Reply-To: <894692B1-E744-4FA1-A1FB-D3CA9EADD93D@bittext.nl>

On 8/10/2021 9:23 AM, Taco Hoekwater via ntg-context wrote:
> 
> 
>> On 9 Aug 2021, at 22:05, Aditya Mahajan via ntg-context <ntg-context@ntg.nl> wrote:
>>
>> On Mon, 9 Aug 2021, Hans van der Meer via ntg-context wrote:
>>
>>> In the TeX to Lua interface with
>>>
>>> \def\Macro#1{\directlua{luafunction("#1")}}
>>>
>>> the transfer from TeX to Lua is by string. However what to do at the Lua end when calling \Macro{}?
>>> As I understand it, then on the Lua side an empty argument and an empty string are indistinguishable.
>>
> 
> On the TeX side, these are always indistinguishable (as TeX doesn’t have ’strings’) so depending
> on the called macro, you could just assume str == "” actually means nil?

indeed, just check for ""

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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:[~2021-08-10  7:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09 19:58 Hans van der Meer via ntg-context
2021-08-09 20:05 ` Aditya Mahajan via ntg-context
2021-08-10  7:23   ` Taco Hoekwater via ntg-context
2021-08-10  7:59     ` Hans Hagen via ntg-context [this message]

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=e56c3c40-a5ce-3b36-571b-60f528d5ed4f@xs4all.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.nl \
    --cc=taco@bittext.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).