Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #23599
| From | "WJ" <w_a_x_man@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: plist conversion |
| Date | 2013-06-14 15:16 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <kpfc55$86d$1@dont-email.me> (permalink) |
| References | <khg4gh$b7g$1@dont-email.me> |
WJ wrote:
>
> Convert a Lisp-style plist to a hash-table.
>
> Factor:
>
> USING: hashtables grouping ;
>
> : plist->hashtable ( seq -- seq )
> 2 group >hashtable ;
>
> { "foo" 22 "bar" 44 "fiz" 55 } plist->hashtable .
> H{ { "bar" 44 } { "foo" 22 } { "fiz" 55 } }
Ruby:
Hash[ *%w(name Bill food pizza) ]
==>{"name"=>"Bill", "food"=>"pizza"}
Back to comp.lang.forth | Previous | Next | Find similar
Re: plist conversion "WJ" <w_a_x_man@yahoo.com> - 2013-06-14 15:16 +0000
csiph-web