From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/15744 Path: main.gmane.org!not-for-mail From: Vit Zyka Newsgroups: gmane.comp.tex.context Subject: key=value parameters Date: Fri, 23 Jul 2004 10:46:10 +0200 Sender: ntg-context-bounces@ntg.nl Message-ID: <4100D052.5070801@seznam.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1090572465 5722 80.91.224.253 (23 Jul 2004 08:47:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Jul 2004 08:47:45 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jul 23 10:47:34 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BnviI-00062b-00 for ; Fri, 23 Jul 2004 10:47:34 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B29021277C; Fri, 23 Jul 2004 10:47:33 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11619-06; Fri, 23 Jul 2004 10:47:33 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5E45312777; Fri, 23 Jul 2004 10:45:47 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7714212777 for ; Fri, 23 Jul 2004 10:45:45 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11724-01 for ; Fri, 23 Jul 2004 10:45:44 +0200 (CEST) Original-Received: from smtp.seznam.cz (unknown [212.80.76.43]) by ronja.ntg.nl (Postfix) with SMTP id CE5121276F for ; Fri, 23 Jul 2004 10:45:44 +0200 (CEST) Original-Received: (qmail 4609 invoked from network); 23 Jul 2004 08:45:43 -0000 Original-Received: from unknown (HELO ?192.168.1.45?) (vit.zyka@82.142.74.35) by smtp.seznam.cz with SMTP; 23 Jul 2004 08:45:43 -0000 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: cs, en-us, en Original-To: ConTeXt X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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 X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:15744 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:15744 Hallo ConTeXters, I am playing with defining my own macro with key=value parameters. Please, consider definition: \def\setupField[#1]#2[#3]{\getparameters[Field!#1!][#3]} \setupField[name][mykey=value,textwidth=2cm] If you let ConTeXt to show the values by \message{ } you obtain While 'mykey' is OK, predefined keys (like textwidth, text, style, ...) lead to undefined parameter, that behave like \relax. I can imagine next solutions: 1) Do not use predefined keys in my macros, e.g. textWidth instead of textwidth [=user unfriendly]. 2) Use original (mostly Dutch) keys inside of my macros [=developer unfriendly]. 3) Define: \unprotect \def\getparametersALL{\dogetparameters\dosetvalueALL} \def\dosetvalueALL#1#2{\@EA\def\csname#1#2\endcsname} \protect and use: \def\setupField[#1]#2[#3]{\getparametersALL[Field!#1!][#3]} \setupField[name][mykey=value,textwidth=2cm] \message{ } it gives: Is there any other (more elegant and not-so-dirty) solution? Thankx Vit Zyka