[REBOL] Re: Building an Associate List from a string
From: andrew:martin:colenso:school at: 24-Dec-2003 22:42
> I would like to employ a strategy that converts any value to the best
guess for a rebol datatype. IOWS, "54"[string!] would become
> It occurs to me that a brute-force method would be to process via a
nested attempt[any] loop.
> Any more "elegant" ideas?
probe parse/all test [
copy Word to tab skip (probe Word: to word! Word)
copy Value integer^ (Value: to integer! Value)
| copy Value money^ (Value: to money! Value)
| copy Value [to tab | to end]
] (probe Value)
[tab | end]
You'll need my %Patterns.r script to get values for integer^ and money^
(there's other patterns there as well). You need to put the above into a
function and make 'Word and 'Value into local words and take out
I hope that helps!
Andrew J Martin
Speaking in tongues and performing miracles
Colenso High School
Arnold Street, Napier.
Tel: 64-6-8310180 ext 826
DISCLAIMER: Colenso High School and its Board of Trustees is not responsible (or legally
liable) for materials distributed to or acquired from user e-mail accounts. You can report
misuse of an e-mail account to our ICT Manager and the complaint will be investigated.
(Misuse can come in many forms, but can be viewed as any material sent/received that
indicate or suggest pornography, unethical or illegal solicitation, racism, sexism, inappropriate
language and/or other issues described in our Acceptable Use Policy.)
All outgoing messages are certified virus-free by McAfee GroupShield Exchange 5.10.285.0
Phone: +64 6 843 5095 or Fax: +64 6 833 6759 or E-mail: [postmaster--colenso--school--nz]