From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/81717 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: the difference between \def and \define Date: Mon, 15 Apr 2013 16:04:10 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: multipart/mixed; boundary="===============0209228741==" X-Trace: ger.gmane.org 1366034656 19676 80.91.229.3 (15 Apr 2013 14:04:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Apr 2013 14:04:16 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 15 16:04:20 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1URk15-0004N4-PI for gctc-ntg-context-518@m.gmane.org; Mon, 15 Apr 2013 16:04:19 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 35AEB101EC; Mon, 15 Apr 2013 16:04:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Xwj2EnOiTF8m; Mon, 15 Apr 2013 16:04:13 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id A08A6101F5; Mon, 15 Apr 2013 16:04:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9F838101F5 for ; Mon, 15 Apr 2013 16:04:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WAR45I3E43sw for ; Mon, 15 Apr 2013 16:04:11 +0200 (CEST) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 8CEAB101EC for ; Mon, 15 Apr 2013 16:04:11 +0200 (CEST) Original-Received: from mail-bk0-x235.google.com (mail-bk0-x235.google.com [IPv6:2a00:1450:4008:c01::235]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3FE4AAM003460 for ; Mon, 15 Apr 2013 16:04:10 +0200 Original-Received: by mail-bk0-f53.google.com with SMTP id e19so2363766bku.26 for ; Mon, 15 Apr 2013 07:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:content-type:message-id:mime-version:subject:date :references:to:in-reply-to:x-mailer; bh=JKyZxsfSxAyCx08eCJW85zJtxyb4PW0LOzwb/SxAffc=; b=JA2COFnYtFGdFB6dvwcBsL5DqaVfEjcqWgtfuMsMuRvCl1/hff8vmVQ8dYRXaPWTSP DfS0fXS8FebfNJcJJPvfYngJctqMMDw+7fdD1xamkQGwqWpagrCmpBmj7CmlzOHZk1oN jgpsGiOSfZ0f35VCgyS57PPd3mu0kra0Rgzqo8kdltrBENuCJQ7LgIC9Ve5D14X76EUi dt9qMXdDVQiIsinTCLmJFjVYdRvD6N+jGn9dgvanDZifK1c98/H64IPtdhnO7XI+sicr hBkxVRjrTkWv0J50ayYugu9zYo/7rLsDdwYqZlXe9Zn+dD5GYmkebyhf4wn0Zm52HaPB cMhA== X-Received: by 10.205.65.81 with SMTP id xl17mr8317452bkb.90.1366034650244; Mon, 15 Apr 2013 07:04:10 -0700 (PDT) Original-Received: from keima.localdomain (nrbg-4d073c87.pool.mediaWays.net. [77.7.60.135]) by mx.google.com with ESMTPS id gm14sm8624174bkc.7.2013.04.15.07.04.09 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Apr 2013 07:04:09 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1503) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4008:c01::235; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07Joe4aLT - c6aa99a44f90 - 20130415 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:81717 Archived-At: --===============0209228741== Content-Type: multipart/alternative; boundary="Apple-Mail=_B49481F3-59E0-416D-81AE-1888B4A061DB" --Apple-Mail=_B49481F3-59E0-416D-81AE-1888B4A061DB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=GB2312 Am 15.04.2013 um 15:47 schrieb Tim Li : > In plain TeX, we always use \def for creating a new macro, but in = ConTeXt, sometimes it won't work, especially when making own chapter = titles. The \def can produce the error message like this : "Argument of = \... has an extra }". \define in ConTeXt can solve this problem. > =20 > What's the difference between \def and \define? Can I use \define to = replace all \def? The \define command is a short form for \unexpanded\def which prevents = commands to be expanded when used inside \edef or when passed to Lua. Most of the high level commands are created to be unexpanded and = expandable commands are used for internal functions. Wolfgang --Apple-Mail=_B49481F3-59E0-416D-81AE-1888B4A061DB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=GB2312
Am 15.04.2013 um = 15:47 schrieb Tim Li <timli2013@outlook.com>:
=
In plain TeX, we = always use \def for creating a new macro, but in ConTeXt, sometimes it = won't work, especially when making own chapter titles. The \def can = produce the error message like this : "Argument of \... has an extra }". = \define in ConTeXt can solve this problem.
 
What's the = difference between \def and \define? Can I use \define to replace all = \def?

The \define command is = a short form for \unexpanded\def which prevents commands to be expanded = when used inside \edef or when passed to = Lua.

Most of the high level commands are = created to be unexpanded and expandable commands are used for internal = functions.

Wolfgang

= --Apple-Mail=_B49481F3-59E0-416D-81AE-1888B4A061DB-- --===============0209228741== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0209228741==--