|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
As the dictionary implementation seems to be based upon, or closely
related to arrays, I tried to loop over a dict as if it where a Array.
This doesnt work and yes, the docs are silent on this.
Is it possible?
Can it be made possible? (Are dicts kept in order?)
get the length / dimension_size and loop over a dict getting a key value
pair as pseudo tuple as result.
#while (i < dimension_size(dict,1)-1)
#local (key, value) = dict[i];
#end
It would be useful when working with splines or boning and inverse
kinematics to have both ways of accessing a dict. Another one would be
appending dictionaries without knowing all the exact keys.
ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 01.12.2018 um 20:45 schrieb ingo:
> As the dictionary implementation seems to be based upon, or closely
> related to arrays, I tried to loop over a dict as if it where a Array.
> This doesnt work and yes, the docs are silent on this.
>
> Is it possible?
> Can it be made possible? (Are dicts kept in order?)
/Some/ mechanism to make it possible is on the ToDo list, but the plans
are still quite fuzzy.
You could work around the lack of such a feature by maintaining a
separate array of keys.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
in news:5c036710@news.povray.org clipka wrote:
> Am 01.12.2018 um 20:45 schrieb ingo:
>>[...]
>> Is it possible?
>> Can it be made possible? (Are dicts kept in order?)
> [...]
>
> You could work around the lack of such a feature by maintaining a
> separate array of keys.
>
That's what I've done so far, keeping several Arrays as 'indexes' in the
dict.
Thanks,
ingo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |