From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/44915 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: What's the difference between \dodoubleargument and \dodoubleempty? Date: Tue, 21 Oct 2008 14:17:14 +0200 Message-ID: <115224fb0810210517k5670ea63t8ac826bae5fc1ffd@mail.gmail.com> References: <48FDBF73.2000706@wxs.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: ger.gmane.org 1224591533 8014 80.91.229.12 (21 Oct 2008 12:18:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2008 12:18:53 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 21 14:19:47 2008 connect(): Connection refused Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1KsGDB-0001fH-A4 for gctc-ntg-context-518@m.gmane.org; Tue, 21 Oct 2008 14:19:45 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 06B771FB7F; Tue, 21 Oct 2008 14:18:38 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03559-02; Tue, 21 Oct 2008 14:17:49 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5F3021FB82; Tue, 21 Oct 2008 14:17:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9354E1FB82 for ; Tue, 21 Oct 2008 14:17:47 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01470-03-6 for ; Tue, 21 Oct 2008 14:17:14 +0200 (CEST) Original-Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by ronja.ntg.nl (Postfix) with ESMTP id A0CE11FB49 for ; Tue, 21 Oct 2008 14:17:14 +0200 (CEST) Original-Received: by ug-out-1314.google.com with SMTP id s2so922111uge.1 for ; Tue, 21 Oct 2008 05:17:14 -0700 (PDT) Original-Received: by 10.103.49.12 with SMTP id b12mr1316275muk.134.1224591434292; Tue, 21 Oct 2008 05:17:14 -0700 (PDT) Original-Received: by 10.103.215.10 with HTTP; Tue, 21 Oct 2008 05:17:14 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:44915 Archived-At: On Tue, Oct 21, 2008 at 2:03 PM, Ruini Xue wrote: > Hans Hagen wxs.nl> writes: > >> >> Ruini Xue wrote: >> > It's difficult to understand them from the code. >> >> the first one issues a warning when no argument is given > > You mean both of them ask the following \command to take two mandatory > arguments? I try this example: > > ====================================== > \def\test > {\dodoubleargument\dotest} % use \dodoubleempty > > \def\dotest[#1][#2] You need a comment sign at the end of the line. \def\dotest[#1][#2]% > {\iffirstargument > First arg: #1 > \fi > \ifsecondargument > Second arg: #2 > \fi} > > \test[ok][ok] % 1. this is ok > > \test [ok] [] % 2. warning? This is just a empty argument. > \test [wrong] % 3. Error: lack one arg > ================================== > > both 1 and 2 can print "First arg" and "Second arg", so I am confused what's > "no argument is given" Wolfgang ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________