From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100693 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Characters allowed in macro names Date: Sun, 22 Apr 2018 20:08:34 +0200 Message-ID: <5ADCCFA2.4030908@gmail.com> References: <87r2n7e03v.fsf@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1227321732611669185==" X-Trace: blaine.gmane.org 1524420612 16315 195.159.176.226 (22 Apr 2018 18:10:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Apr 2018 18:10:12 +0000 (UTC) User-Agent: Postbox 5.0.25 (Macintosh/20180328) To: "N. Raghavendra" , mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Apr 22 20:10:08 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fAJR9-00048e-M8 for gctc-ntg-context-518@m.gmane.org; Sun, 22 Apr 2018 20:10:07 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E711B62020F; Sun, 22 Apr 2018 20:09:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gV4zun9DrwjC; Sun, 22 Apr 2018 20:09:05 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 3FD02620210; Sun, 22 Apr 2018 20:09:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8702C620210 for ; Sun, 22 Apr 2018 20:09:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H64p916ejl9C for ; Sun, 22 Apr 2018 20:09:04 +0200 (CEST) Original-Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 1408F62020F for ; Sun, 22 Apr 2018 20:08:54 +0200 (CEST) Original-Received: by mail-wr0-f172.google.com with SMTP id d1-v6so35172973wrj.13 for ; Sun, 22 Apr 2018 11:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=t8LgVs2kHJFJyUgYclV+ZRSk+uw+pt0VGoIvnCWX8+g=; b=bFKDbRQBSTVSa+J8v8DZBdHP5qeXyNfMOUQ1SIS0k5prdWSvL7Mscztbj/zlhgSB2m tNNQwq/NSMDh6E2fRcYSrsWwwve8QIUqZfqgE4RlNDE0Q3MF5ysUhhsdjbITc79sXYV/ aZqcDr25W6l/kSGuf+r4Zttlx0xhL/ZDLgCP4NqNpfRWXWMA5tzJ0y/nWQSknYZZ910O pS3Pydpk5JpsAVBajD0+tn7jpL7tQHA3RB6MLervUU1adJgY4kGLKYXfjVn9uewfVeJY HysIOxG9BRX+3fdroCfn64/uIy6e05edT7cLnZFWOBKQ6GoP6esk3EzvMYawnfCoRCo8 N7ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=t8LgVs2kHJFJyUgYclV+ZRSk+uw+pt0VGoIvnCWX8+g=; b=cb7T3kz2qU7L+w29Q1ktFwa51V74VT1scgHePsMfFPck94lbbu3c3+TuSRrrJyGSn7 2DY5wJfWJlPkLfg5QQN5fg005xujlWilY4Ex/k/xc5tkP1caBqWXStcFqoa5KrLvn66R RdNvD1xZwIx9F4+ECb9r804lYjjC4dV7SKg3qm4XTLVydfqrnWDGanLq78TMzq4bBhGz gClqn5u2xNlWxIP6BZ9R+NTj6685aZW4lx+bovKIs6Pq1yNrfGbcR7OWb0/LWE5UzywW peQHjrsOpU9/Yhm7zlbXVwdmv/BmujIsfGs3kPIGdqTEuLmwfLuQImf12vtaiYDupzFo HOYw== X-Gm-Message-State: ALQs6tAIIiqPqL+Y0CSZo1vTUaWIUF9f1TTbtw8Z1b4s1VOD9MbKipcS TLVDIri6WfPyW5O47GqzDB0= X-Google-Smtp-Source: AIpwx4+OIKPKnsh2y7RMfcre8H4WTGqEsIsv4tVkcz3wvD3ZXp+IWyaPkDmOEevCBI1sL/sC+EBNdA== X-Received: by 2002:adf:8186:: with SMTP id 6-v6mr15645316wra.160.1524420533678; Sun, 22 Apr 2018 11:08:53 -0700 (PDT) Original-Received: from [192.168.1.11] (x4dbd1190.dyn.telefonica.de. [77.189.17.144]) by smtp.gmail.com with ESMTPSA id r75sm4169306wmf.34.2018.04.22.11.08.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Apr 2018 11:08:52 -0700 (PDT) In-Reply-To: <87r2n7e03v.fsf@gmail.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:100693 Archived-At: This is a multi-part message in MIME format. --===============1227321732611669185== Content-Type: multipart/alternative; boundary="------------060000050304090503060504" This is a multi-part message in MIME format. --------------060000050304090503060504 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > N. Raghavendra > 22. April 2018 um 17:23 > I was wondering if it is alright to use underscores in the names of > macros, e.g, as in the following file. It looks like \startsetups, and > \def accept names with hyphens, underscores, and numerals, but > \starttexdefinition doesn't tolerate any of them. > > 1. In general, what characters are allowed in macro names? Are Unicode > characters admissible? > > 2. Apart from the fact that one can use whitespace freely in > \starttexdefinition, is there any reason to prefer it over \def? > > Thanks, > Raghu. > > ------------------------------------------------------------ > \starttext > > \startsetups [hello-world_1] > Hello, world 1! > \stopsetups > > \setups [hello-world_1] > > \def\hello-world_2{Hello, world 2!} You’re defining a command named \hello which has to be followed by the string "-world_2". You can use the following example as test. %%%% begin example \starttext \def\hello-1{Hello \letterhash 1} \def\hello-2{Hello \letterhash 2} \hello-1 \hello-2 \stoptext %%%% end example Here I create a command named \hello which has to be followed by “-1" and "-2". When you run TeX on this example you get the following error message: %%%% begin error message tex error > tex error on line 7 in file /Users/wolf/TeX/test/test.tex: ! Use of \hello doesn't match its definition l.7 \hello-1 %%%% end error message Wolfgang --------------060000050304090503060504 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

22. April 2018 um 17:23
I was wondering if it is alright to use underscores in the names of
macros, e.g, as in the following file. It looks like \startsetups, and
\def accept names with hyphens, underscores, and numerals, but
\starttexdefinition doesn't tolerate any of them.

1. In general, what characters are allowed in macro names? Are Unicode
characters admissible?

2. Apart from the fact that one can use whitespace freely in
\starttexdefinition, is there any reason to prefer it over \def?

Thanks,
Raghu.

------------------------------------------------------------
\starttext

\startsetups [hello-world_1]
Hello, world 1!
\stopsetups

\setups [hello-world_1]

\def\hello-world_2{Hello, world 2!}
You’re defining a command named \hello which has to be followed by the string "-world_2".


You can use the following example as test.

%%%% begin example
\starttext

\def\hello-1{Hello \letterhash 1}

\def\hello-2{Hello \letterhash 2}

\hello-1

\hello-2

\stoptext
%%%% end example

Here I create a command named \hello which has to be followed by “-1" and "-2".

When you run TeX on this example you get the following error message:

%%%% begin error message
tex error       > tex error on line 7 in file /Users/wolf/TeX/test/test.tex: ! Use of \hello doesn't match its definition

l.7 \hello-1
%%%% end error message

Wolfgang
--------------060000050304090503060504-- --===============1227321732611669185== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============1227321732611669185==--