From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/71890 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: metapost question Date: Fri, 21 Oct 2011 17:13:21 +0200 Message-ID: <4EA18C11.1040502@gmx.net> References: <0E2E620E-1148-41AD-9966-54A594FCCE94@xs4all.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1319210033 7579 80.91.229.12 (21 Oct 2011 15:13:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 Oct 2011 15:13:53 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Oct 21 17:13:49 2011 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 1RHGn5-0002w6-Fn for gctc-ntg-context-518@m.gmane.org; Fri, 21 Oct 2011 17:13:47 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5A8FCCB084; Fri, 21 Oct 2011 17:13:43 +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 hVYl3hAcz3en; Fri, 21 Oct 2011 17:13:37 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CFCC1CB081; Fri, 21 Oct 2011 17:13:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0825BCB081 for ; Fri, 21 Oct 2011 17:13:37 +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 UyfQnK1uhkFa for ; Fri, 21 Oct 2011 17:13:25 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id A4CDCCAFFB for ; Fri, 21 Oct 2011 17:13:25 +0200 (CEST) Original-Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with SMTP id p9LFDOlj032721 for ; Fri, 21 Oct 2011 17:13:24 +0200 Original-Received: (qmail invoked by alias); 21 Oct 2011 15:13:23 -0000 Original-Received: from ip-95-222-36-122.unitymediagroup.de (EHLO [192.168.178.3]) [95.222.36.122] by mail.gmx.net (mp038) with SMTP; 21 Oct 2011 17:13:23 +0200 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX19hn4FSTiVhx3ircAIdKAXnvz+o0P2BPdb6j26Rha T6B803HvxE2nJw User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: <0E2E620E-1148-41AD-9966-54A594FCCE94@xs4all.nl> X-Enigmail-Version: 1.3.2 X-Y-GMX-Trusted: 0 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.22; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0cFLrdosz - b811ce03c8f8 - 20111021 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 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:71890 Archived-At: Am 21.10.2011 15:05, schrieb Hans van der Meer: > I cannot find the answer to the following question in Knuth's Metafont book. > The following definition with a trailing text argument: > > def mydef (expr a, b, c) text modifier = > if : Have you already tried if modifier = "" : > else: > fi > enddef; > > How can I do the switch on an empty or nonempty modifier argument? It is not a string because calling its length fails with an error. > I must do the switch, because "fill modifier" with an empty "modifier" gives horrible results. > > Usage would be calls like: > mydef(1,2,3) withcolor green; % with modifier text > mydef(1,2,3); % without modifier text > > Thanks in advance. > Hans van der Meer > > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ > ___________________________________________________________________________________ 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 ___________________________________________________________________________________