From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: Denis Maier via ntg-context <ntg-context@ntg.nl>
Cc: Hans Hagen <j.hagen@xs4all.nl>
Subject: Re: \getcommacommandsize not working in lmtx
Date: Mon, 2 May 2022 11:53:59 +0200 [thread overview]
Message-ID: <65bbc048-570c-1d72-06f4-6d3cbe939f23@xs4all.nl> (raw)
In-Reply-To: <938cfee877fa4cd287ace8e3775528ed@unibe.ch>
On 5/2/2022 9:37 AM, Denis Maier via ntg-context wrote:
> Hi,
>
> I’ve just ran into a behaviour that runs against what is shown on the
> wiki, https://wiki.contextgarden.net/System_Macros/Comma_Separated_Lists
> <https://wiki.contextgarden.net/System_Macros/Comma_Separated_Lists>
>
> Maybe a bug?
More a feature as \define defines a protected macro.
\starttext
\define\somelist{foo,bar,baz}
{\tt\meaningasis\somelist}
\getcommacommandsize[\somelist] \commalistsize
\defineexpandable\somelist{foo,bar,baz}
{\tt\meaningasis\somelist}
\getcommacommandsize[\somelist] \commalistsize
\starttexdefinition protected somelist
foo,
bar,
baz
\stoptexdefinition
{\tt\meaningasis\somelist}
\getcommacommandsize[\somelist] \commalistsize
\starttexdefinition somelist
foo,
bar,
baz
\stoptexdefinition
{\tt\meaningasis\somelist}
\getcommacommandsize[\somelist] \commalistsize
\semiprotected\def\somelist{foo,bar,baz}
\getcommacommandsize[\somelist] \commalistsize
\getcommacommandsize[\semiexpanded{\somelist}] \commalistsize
% also in next version:
%
% \starttexdefinition semiprotected somelist
% foo,
% bar,
% baz
% \stoptexdefinition
%
% {\tt\meaningasis\somelist}
%
% \getcommacommandsize[\somelist] \commalistsize
% \getcommacommandsize[\semiexpanded{\somelist}] \commalistsize
\stoptext
The semiprotected is something lmtx and only expands when explicitly
asked for (like in an \edef or so). Something that we might apply in the
core some day.
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
___________________________________________________________________________________
prev parent reply other threads:[~2022-05-02 9:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-02 7:37 Denis Maier via ntg-context
2022-05-02 9:53 ` 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=65bbc048-570c-1d72-06f4-6d3cbe939f23@xs4all.nl \
--to=ntg-context@ntg.nl \
--cc=j.hagen@xs4all.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).