From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/15602 Path: main.gmane.org!not-for-mail From: Giuseppe Bilotta Newsgroups: gmane.comp.tex.context Subject: Re: High level user macro (howto?) Date: Mon, 28 Jun 2004 11:18:17 +0200 Sender: ntg-context-admin@ntg.nl Message-ID: <1929849379.20040628111817@iol.it> References: <"m2hdtw92rn.fs f"@levana.de> <6.1.1.1.2.20040601200608.01eb9640@server-1> <"m2n032tvs8.fs f"@levana.de> <20040622161300.GA5608@swordfish> <34371.80.58.5.46.1087924408.squirrel@bitmail.bitmailer.com> <0D45B077-C4DA-11D8-972E-000A9595B57C@ensta.fr> <40D944A4.5030402@gmx.de> <43DEE2EE-C510-11D8-972E-000A9595B57C@ensta.fr> <72D4BC80-C612-11D8-9706-0030659899AA@fiee.net> <40DC4CDF.2090904@wxs.nl> <5CAF4C26-C756-11D8-AE54-000A95C38698@chello.fr> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1088414569 7431 80.91.224.253 (28 Jun 2004 09:22:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Jun 2004 09:22:49 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Mon Jun 28 11:22:40 2004 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BesLY-0005j4-00 for ; Mon, 28 Jun 2004 11:22:40 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 08D5B10B61; Mon, 28 Jun 2004 11:22:38 +0200 (MEST) Original-Received: from mbox.dmi.unict.it (mbox.dmi.unict.it [151.97.252.66]) by ref.ntg.nl (Postfix) with ESMTP id E7D1D10AE8 for ; Mon, 28 Jun 2004 11:19:38 +0200 (MEST) Original-Received: from localhost (localhost [127.0.0.1]) by mbox.dmi.unict.it (Postfix) with ESMTP id 3D8A419777 for ; Mon, 28 Jun 2004 11:20:29 +0200 (CEST) Original-Received: from mbox.dmi.unict.it ([127.0.0.1]) by localhost (mbox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13662-06 for ; Mon, 28 Jun 2004 11:20:29 +0200 (CEST) Original-Received: from oblomov.dipmat.unict.it (oblomov.dipmat.unict.it [151.97.252.27]) by mbox.dmi.unict.it (Postfix) with ESMTP id 11F271978A for ; Mon, 28 Jun 2004 11:20:29 +0200 (CEST) X-Priority: 3 (Normal) Original-To: ntg-context@ntg.nl In-Reply-To: <5CAF4C26-C756-11D8-AE54-000A95C38698@chello.fr> X-Virus-Scanned: by amavisd-new at dmi.unict.it Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:15602 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:15602 Saturday, June 26, 2004 Maurice Diamantini dom wrote: > Bonjour =E0 tous, > One thing is missing in context (or not documented in reference manual?) > is a standard and easy way to build arbitrary parametrised high level > macros. > For exemple, instead of > \def\myCommand#9{...} > That I should call by > \myCommand{param1}{param2}{...} {param9} > Id'like too keep default value for most of the parameters but param7 > and write something like: > \myCommand[param7=3Dvalue7]{body} It is true, we need a "programming in ConTeXt" manual. It is still possible to 'know' how to do things by looking at the way things are done in ConTeXt itself. For example, in your case you want something like this: \def\myCommand[#1]#2{% \rawgetparameters[myCommand][param1=3Ddefaultvalue1,param2=3Ddefaultvalue2= ,#1]% do something with \csname myCommandparam1\endcsname and #2} This is of course very draft, and can be highly tuned and done multilingual, but that's much more complex. --=20 Giuseppe "Oblomov" Bilotta