ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: [NTG-context] Re: unprotecting when defining in Lua
Date: Mon, 29 Apr 2024 19:32:26 +0200	[thread overview]
Message-ID: <c844f61b-f9f8-5aeb-6d35-9ed4eb91c963@gmail.com> (raw)
In-Reply-To: <3b443759-3c31-b291-a286-d50e7ea2e3a9@gmx.es>

Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 18:21:
> On 4/29/24 18:04, Wolfgang Schuster wrote:
>> Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22:
>>> [...]
>>> Which is the right way to use "interfaces.definecommand" to get a simple
>>> command as in standard TeX?
>>>
>>> I mean, no a non \permanent or non \protected command.
>> You can't create unprotected command with interfaces.definecommand
>> but this not a problem because you can just use interfaces.implement
>> to create your command which is then unprotected by default. Using
>> implement instead of definecommand doesn't matter because
>> definecommand is just a wrapper for the implement function with the
>> option to create a environment.
> Many thanks for your fast reply, Wolfgang.
>
> I’m reading it now in cld-mkiv.pdf.
>
> Is \protected the same as \unexpanded?

Yes they are the same (\protected is the primitive and \unexpanded is a 
copy) but this wasn't always the case.

Original TeX didn't provide a mechanism to create protected commands and 
creators of macro packages
had to create their own mechanism for this, the ConTeXt solution was 
\unexpanded. With the etex extensions
the \protected primitive was added and \unexpanded uses the new 
primitive when you used a engine
which supported it.

Wolfgang

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2024-04-29 17:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 15:22 [NTG-context] " Pablo Rodriguez via ntg-context
2024-04-29 16:04 ` [NTG-context] " Wolfgang Schuster
2024-04-29 16:21   ` Pablo Rodriguez via ntg-context
2024-04-29 17:32     ` Wolfgang Schuster [this message]
2024-04-29 18:21       ` Pablo Rodriguez via ntg-context

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=c844f61b-f9f8-5aeb-6d35-9ed4eb91c963@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=oinos@gmx.es \
    /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).