MOO-cows Mailing List Archive
[Prev][Next][Index][Thread]
RE: a programming prob.
-
Date: Tue, 13 Feb 1996 22:13:40 PST
-
From: Ron Stanions <chaeon@roc.clawpaw.com>
-
Content-Transfer-Encoding: 7bit
-
Content-Type: text/plain; charset="us-ascii"
----------
miked@freenet.edmonton.ab.ca wrote:
>
> I was wondering if anyone here could help me out. say I had a property
> that looked like this...
>
> OBJECT.PROP = {"foo", {"bar", {"hello", "there"},
> "qwerty", {"quaz", {"poi", {"moo", "cows"}}}}};
>
> and I had a verb that would return the numbers...
> {2, 4, 2, 2, 1}
>
> so OBJECT.PROP[2][4][2][2][1] would be "moo".
> How would I get another verb to find "moo" using those numbers without
> always having to have the same amount of numbers?
>
> Please post up any ideas. Thanks alot.
:index_find()
VALUE :index_find(LIST list, LIST element)
"return value in list[element] when";
" element is an arbitrary number of elements";
value = args[1];
for x in (args[2])
value = value[x];
endfor
return value;
Home |
Subject Index |
Thread Index