<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: cast code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 08:53:58 GMT</pubDate>
    <description>DZone Snippets: cast code</description>
    <item>
      <title>CAST</title>
      <link>http://snippets.dzone.com/posts/show/3006</link>
      <description>&lt;code&gt;&lt;br /&gt;cast: func [value type] [to type value]&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 16 Nov 2006 05:07:50 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3006</guid>
      <author>gregg.irwin (Gregg Irwin)</author>
    </item>
    <item>
      <title>CAN-CAST?</title>
      <link>http://snippets.dzone.com/posts/show/3005</link>
      <description>&lt;code&gt;&lt;br /&gt;can-cast?: func [value type] [not error? try [to type value]]]&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 16 Nov 2006 05:07:28 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3005</guid>
      <author>gregg.irwin (Gregg Irwin)</author>
    </item>
    <item>
      <title>Java - int2bin</title>
      <link>http://snippets.dzone.com/posts/show/2751</link>
      <description>// Stampa la versione binaria di un numero&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;int numero = 15;&lt;br /&gt;System.out.println(Integer.toBinaryString(numero));&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 01 Oct 2006 22:05:56 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2751</guid>
      <author>whitetiger ()</author>
    </item>
    <item>
      <title>CAST function - Convert a value referenced by a word to a new datatype. Dialected</title>
      <link>http://snippets.dzone.com/posts/show/2098</link>
      <description>&lt;code&gt;&lt;br /&gt;    cast: func [ ; convert coerce&lt;br /&gt;        "Convert a value referenced by a word to a new datatype."&lt;br /&gt;        input [block!] "A word, and the target datatype."&lt;br /&gt;        /local words type val&lt;br /&gt;    ] [&lt;br /&gt;        parse input [&lt;br /&gt;            some [&lt;br /&gt;                copy words to 'to skip set type any-type! (&lt;br /&gt;                    ;while [pos: find words 'and] [remove pos]&lt;br /&gt;                    remove-each word words [word = 'and]&lt;br /&gt;                    foreach word words [&lt;br /&gt;                        val: get/any word&lt;br /&gt;                        set/any word to either word? type [get type] [type] val&lt;br /&gt;                    ]&lt;br /&gt;                )&lt;br /&gt;            ]&lt;br /&gt;        ]&lt;br /&gt;    ]&lt;br /&gt;    comment {&lt;br /&gt;        a: "A-0001"&lt;br /&gt;        b: #B002&lt;br /&gt;        c: 300&lt;br /&gt;        d: &lt;H1&gt;&lt;br /&gt;        e: 'test&lt;br /&gt;        cast [a to issue!]      print mold :a&lt;br /&gt;        cast [b to tag!]        print mold :b&lt;br /&gt;        cast [c to decimal!]    print mold :c&lt;br /&gt;        cast [a b c to string!] print remold [:a :b :c]&lt;br /&gt;        cast [a b and c to issue!] print remold [:a :b :c]&lt;br /&gt;        cast [&lt;br /&gt;            a b and c to tag!&lt;br /&gt;            and&lt;br /&gt;            d and e to issue!&lt;br /&gt;        ] print remold [:a :b :c :d :e]&lt;br /&gt;        cast [a b c to &lt;x&gt;  d e to "x"] print remold [:a :b :c :d :e]&lt;br /&gt;    } &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 25 May 2006 03:09:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2098</guid>
      <author>gregg.irwin (Gregg Irwin)</author>
    </item>
  </channel>
</rss>
