ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: serial definition
Date: Tue, 03 Jan 2006 18:22:50 +0100	[thread overview]
Message-ID: <43BAB2EA.1080706@wxs.nl> (raw)
In-Reply-To: <43BA5746.3080907@elvenkind.com>

Taco Hoekwater wrote:

>
>
> Peter Rolf wrote:
>
>>>
>>> Why do I get K0/V0 for \Get{3}? - it works with \recurselevel!
>>>
>
> You need to expand the \Set commands in that first loop,
> otherwise you store the literal token \recursevelel inside
> the definitions of the Key and Val macros (\setvalue{}{}
> autoexpands its first argument, but not its second argument).
>
> When not inside a recursion, \recurselevel expands to the number
> 0  (zero) in the "manual bit", and you are actually re-evaluating
> the macro using the then current \recurselevel definition
> when inside the  "looping" bit.
>
> So you need:
>
>   \dostepwiserecurse{1}{9}{1}{
>     \expanded{\Set{\recurselevel}{K\recurselevel}{V\recurselevel}}
>   }
>
> I hope this is clear enough?

even this works (#1 being the expanded \recurselevel):

\dostepwiserecurse{1}{9}{1}{
  \setvalue{hi there #1}{#1 indeed}
}

\getvalue{hi there 4}

  reply	other threads:[~2006-01-03 17:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-02 14:54 Henning Hraban Ramm
2006-01-02 18:20 ` Peter Rolf
2006-01-02 21:46   ` Henning Hraban Ramm
2006-01-03 10:33     ` Peter Rolf
2006-01-03 10:51       ` Taco Hoekwater
2006-01-03 17:22         ` Hans Hagen [this message]
2006-01-03 14:11 Henning Hraban Ramm
2006-01-06 21:25 ` Willi Egger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43BAB2EA.1080706@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).