ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] MP keyval interface
@ 2002-10-17 13:02 Jens-Uwe Morawski
  2002-10-17 14:03 ` Emil Hedevang Lohse
  0 siblings, 1 reply; 3+ messages in thread
From: Jens-Uwe Morawski @ 2002-10-17 13:02 UTC (permalink / raw)



Ahoi MP experts,

i've tried to implement a keyval-interface in MP.

Currently it looks like

def keyvalFunc (text t) =
	begingroup;
	save status, col ;
	numeric status; string col ;
		t ;
	show status;
	show col ;
	endgroup;
enddef;

keyvalFunc(status=1.0; col="Hallo" ) ;

This works, of course, but i would prefer if i could
use a comma instead of the ";" to separate the keyval-pairs.

Any ideas, how i can make "," be locally like ";"?

Thanks in advance.

Jens
_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [NTG-context] MP keyval interface
  2002-10-17 13:02 [NTG-context] MP keyval interface Jens-Uwe Morawski
@ 2002-10-17 14:03 ` Emil Hedevang Lohse
  2002-10-18  9:45   ` Jens-Uwe Morawski
  0 siblings, 1 reply; 3+ messages in thread
From: Emil Hedevang Lohse @ 2002-10-17 14:03 UTC (permalink / raw)
  Cc: ConTeXt

Jens-Uwe Morawski <morawski@gmx.net> writes:

> Ahoi MP experts,
> 
> i've tried to implement a keyval-interface in MP.
> 
> Currently it looks like
> 
> def keyvalFunc (text t) =
> 	begingroup;
> 	save status, col ;
> 	numeric status; string col ;
> 		t ;
> 	show status;
> 	show col ;
> 	endgroup;
> enddef;
> 
> keyvalFunc(status=1.0; col="Hallo" ) ;
> 
> This works, of course, but i would prefer if i could
> use a comma instead of the ";" to separate the keyval-pairs.
> 
> Any ideas, how i can make "," be locally like ";"?

Perhaps 

begingroup
let ,=;;
endgroup

will do the job.


-- 
Emil Hedevang Lohse <http://home.imf.au.dk/emil/> 

Alle spørgsmål er lige dumme. 
Og spørgsmålet "Kan ænder flyve?" er ikke dumt.
_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [NTG-context] MP keyval interface
  2002-10-17 14:03 ` Emil Hedevang Lohse
@ 2002-10-18  9:45   ` Jens-Uwe Morawski
  0 siblings, 0 replies; 3+ messages in thread
From: Jens-Uwe Morawski @ 2002-10-18  9:45 UTC (permalink / raw)


On 17 Oct 2002 16:03:26 +0200
Emil Hedevang Lohse <emil@imf.au.dk> wrote:

> Jens-Uwe Morawski <morawski@gmx.net> writes:
> 
> > Ahoi MP experts,
> > 
> > i've tried to implement a keyval-interface in MP.
> > 
> > Currently it looks like
> > 
> > def keyvalFunc (text t) =
> > 	begingroup;
> > 	save status, col ;
> > 	numeric status; string col ;
> > 		t ;
> > 	show status;
> > 	show col ;
> > 	endgroup;
> > enddef;
> > 
> > keyvalFunc(status=1.0; col="Hallo" ) ;
> > 
> > This works, of course, but i would prefer if i could
> > use a comma instead of the ";" to separate the keyval-pairs.
> > 
> > Any ideas, how i can make "," be locally like ";"?
> 
> Perhaps 
> 
> begingroup
> let ,=;;
> endgroup
> 
> will do the job.

Thanks. I've already tried this. The problem was that it changes
the meaning globally, since MP groups do nothing until one 'save's
variables inside the group. But surprisingly (for me) this works:

 begingroup
 save , ;
 let ,=; ;
 endgroup

Jens
_______________________________________________
ntg-context mailing list
ntg-context@ref.ntg.nl
http://ref.ntg.nl/mailman/listinfo/ntg-context


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-18  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-17 13:02 [NTG-context] MP keyval interface Jens-Uwe Morawski
2002-10-17 14:03 ` Emil Hedevang Lohse
2002-10-18  9:45   ` Jens-Uwe Morawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).