Re: coerce lists to records
Re: coerce lists to records
- Subject: Re: coerce lists to records
- From: Allen Watson <email@hidden>
- Date: Fri, 17 Nov 2000 10:51:23 -0800
On or near 11/16/00 10:24 PM, Patrick Wynne at email@hidden observed:
>
Hi all,
>
>
I have a feeling that this isn't possible, but is there any way to
>
coerce a list of strings into a record, with the odd-numbered strings
>
as the record labels?
>
>
Example:
>
>
{"firstname", "Robert", "lastname", "Robertson"}
>
becomes
>
{firstname: "Robert", lastname: "Robertson"}
>
>
I would prefer to do this without using an osax, but I will if I have
>
to.
I know you don't want to use an osax, but there is one just in case:
Eric Grant, <email@hidden>, also has authored the
Sigma's Coercions scripting addition, which has coercions
for
Class user record:
{"a", 1, "b", 2, "c", 3} as user record
-- > {a: 1, b: 2, c: 3}
Class user list:
{a: 1, b: 2, c: 3} as user record
-- > {"a", 1, "b", 2, "c", 3}
http://home.earthlink.net/~eagrant/
--
Peace be with you!
Allen <email@hidden> XNS Name: =Allen Watson
My web page: <
http://home.earthlink.net/~allenwatson/>