From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/59858 Path: news.gmane.org!not-for-mail From: Vyatcheslav Yatskovsky Newsgroups: gmane.comp.tex.context Subject: Re: checking for an undefined constant Date: Sat, 26 Jun 2010 00:36:30 +0300 Message-ID: <4C25215E.3060500@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1277501823 26566 80.91.229.12 (25 Jun 2010 21:37:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Jun 2010 21:37:03 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 25 23:36:58 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OSGa1-0002ly-Qo for gctc-ntg-context-518@m.gmane.org; Fri, 25 Jun 2010 23:36:57 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5FF88C9AF9; Fri, 25 Jun 2010 23:36:57 +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 2roCSCnMLi7t; Fri, 25 Jun 2010 23:36:54 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 97B99C9A9C; Fri, 25 Jun 2010 23:36:54 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B6CA1C9A9C for ; Fri, 25 Jun 2010 23:36:52 +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 173tmu1jUDrg for ; Fri, 25 Jun 2010 23:36:40 +0200 (CEST) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by balder.ntg.nl (Postfix) with ESMTP id E8B0CC9A8A for ; Fri, 25 Jun 2010 23:36:40 +0200 (CEST) Original-Received: by fg-out-1718.google.com with SMTP id l26so310785fgb.2 for ; Fri, 25 Jun 2010 14:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=2wsLbYGjqw8fxjiv6AdCfUbjLspLCZoCMzB/uxqvXvA=; b=I+31/Pv0Sk3PFKkvQ1Cgn6yX7Mk8vqOO8+4NAon7lDxPJAcst/zAcKD9HbC7v+8Q9M ZtFzMWZfrZW4NSL/zsqx6MNDzq0ODvTFjhm7Crhit2occRE1Sh+3k1k3PvMQy47gJmtO /Z4ysOjWwAlWQp8P/AdjOkZHzYYHBw76rNcz0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=MJt3VMdaEKPV8pCLjtf5UCNgSKpnga3JBSpHv8C6GTR+QiJ2wx7Fq57zBggUCKh8G/ 2lGb2TYRAIgWHTvw4q1faua5X+gXxQMfixW63mI2XnCwIJREX6CvTemqve2nkQa+bjm/ gT50RA09qmFoaMzyKqp6JJ8s8YbbCr29ADaDM= Original-Received: by 10.86.6.39 with SMTP id 39mr2043650fgf.4.1277501800343; Fri, 25 Jun 2010 14:36:40 -0700 (PDT) Original-Received: from [10.0.22.59] ([194.242.119.74]) by mx.google.com with ESMTPS id k29sm187692fkk.45.2010.06.25.14.36.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 25 Jun 2010 14:36:39 -0700 (PDT) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:59858 Archived-At: Thank you all for such a variety of solutions! Gonna look into it. )) >> %D \macros >> %D {doifundefined,doifdefined, >> %D doifundefinedelse,doifdefinedelse, >> %D doifalldefinedelse} >> %D >> %D The standard way of testing if a macro is defined is >> %D comparing its meaning with another undefined one, usually >> %D \type{\undefined}. To garantee correct working of the next >> %D set of macros, \type{\undefined} may never be defined! >> %D >> %D \starttyping >> %D \doifundefined {string} {...} >> %D \doifdefined {string} {...} >> %D \doifundefinedelse {string} {then ...} {else ...} >> %D \doifdefinedelse {string} {then ...} {else ...} >> %D \doifalldefinedelse {commalist} {then ...} {else ...} >> %D \stoptyping >> %D >> >> \doifdefined{Homeworks}{...} > > > Low level (etex) solutions: > > \ifdefined\Homeworks ... \fi > > \unless\ifx\Homeworks\undefined ... \fi -- Best Regards, Vyatcheslav Yatskovsky ___________________________________________________________________________________ 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 ___________________________________________________________________________________