Re: [NTG-context] expansion and \processaction

2012-06-07 Thread Wolfgang Schuster
Am 07.06.2012 um 18:16 schrieb Hans Hagen: > On 7-6-2012 18:02, Wolfgang Schuster wrote: > >> You can also try to use a Lua variant. >> >> \def\states_entry_indeed[#1][#2]% >> {\startlua >> local entries = utilities.parsers.settings_to_array("#1") >> local entry = entries[#2] >> if ent

Re: [NTG-context] expansion and \processaction

2012-06-07 Thread Hans Hagen
On 7-6-2012 18:02, Wolfgang Schuster wrote: You can also try to use a Lua variant. \def\states_entry_indeed[#1][#2]% {\startlua local entries = utilities.parsers.settings_to_array("#1") local entry = entries[#2] if entry then context(entry) else context("\\tttf NO ENTR

Re: [NTG-context] expansion and \processaction

2012-06-07 Thread Wolfgang Schuster
Am 07.06.2012 um 17:34 schrieb Philipp Gesang: > Hi Wolfgang! > > · > >> >> Am 07.06.2012 um 14:05 schrieb Philipp Gesang: >> >>> Hi all, >>> >>> my goal is a macro \definestates[foo][...,...] which takes a comma >>> list and creates a monadic macro \foo[n]. \foo[n] should return >>>

Re: [NTG-context] expansion and \processaction

2012-06-07 Thread Philipp Gesang
Hi Wolfgang! · > > Am 07.06.2012 um 14:05 schrieb Philipp Gesang: > > > Hi all, > > > > my goal is a macro \definestates[foo][...,...] which takes a comma > > list and creates a monadic macro \foo[n]. \foo[n] should return > > either the nth item or, if (n > list length), a default. I

Re: [NTG-context] expansion and \processaction

2012-06-07 Thread Wolfgang Schuster
Am 07.06.2012 um 14:05 schrieb Philipp Gesang: > Hi all, > > my goal is a macro \definestates[foo][...,...] which takes a comma > list and creates a monadic macro \foo[n]. \foo[n] should return > either the nth item or, if (n > list length), a default. I > thought the right tools were \processco

[NTG-context] expansion and \processaction

2012-06-07 Thread Philipp Gesang
Hi all, my goal is a macro \definestates[foo][...,...] which takes a comma list and creates a monadic macro \foo[n]. \foo[n] should return either the nth item or, if (n > list length), a default. I thought the right tools were \processcommalist to generate the mapping n->, as well as \processactio