The results of functions are all given by contracts. So, this is saying that the function named "boolean?" returns something that, when passed to "boolean?", returns #true. <br><br>This is a confusing example to start with, tho, if you had number?, you'd see:<br>
<br> (number? v) -> boolean?<br> v : any/c<br><br>which is saying that the function named "number?" returns something that, when passed to "boolean?" returns #true.<br><br>As for the any/c vs any: they are two separate things. "any/c" is general purpose contract that allows anything. "any" is special syntax that is only allowed inside function contracts. You can think of "any" as a more restricted form of "any/c" and that's 95% of the story.<br>
<br>Also, do check out this section for more on contracts:<br><br> <a href="http://docs.racket-lang.org/guide/contracts.html">http://docs.racket-lang.org/guide/contracts.html</a><br><br>Robby<br><br><div class="gmail_quote">
On Mon, May 30, 2011 at 9:07 AM, Yingjian Ma <span dir="ltr"><<a href="mailto:yingjian.ma1955@gmail.com">yingjian.ma1955@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0">
<tbody>
<tr>
<td>
<div><span>The lines are from </span></div>
<div><span><a href="http://pre.racket-lang.org/docs/html/reference/booleans.html" target="_blank">http://pre.racket-lang.org/docs/html/reference/booleans.html</a></span></div>
<div><span>section 3.1</span></div>
<div><span></span> </div>
<div><span>The lines are:</span></div>
<div><span>(</span><a name="130413b3feceb35a_(dep._((quote._~23~25kernel)._boolean~3f))"></a><a name="130413b3feceb35a_(def._((quote._~23~25kernel)._boolean~3f))"></a><span title="Provided from: racket/base, racket"><span><a href="http://pre.racket-lang.org/docs/html/reference/booleans.html#%28def._%28%28quote._%7E23%7E25kernel%29._boolean%7E3f%29%29" target="_blank">boolean?</a></span></span><span> </span><span>v</span><span>)</span><span> </span>→<span> </span><span><a href="http://pre.racket-lang.org/docs/html/reference/booleans.html#%28def._%28%28quote._%7E23%7E25kernel%29._boolean%7E3f%29%29" target="_blank">boolean?</a></span></div>
</td></tr>
<tr>
<td>
<div><span> </span><span>v</span><span> </span>:<span> </span><span><a href="http://pre.racket-lang.org/docs/html/reference/Data-structure_Contracts.html#%28def._%28%28lib._racket/contract/private/misc..rkt%29._any/c%29%29" target="_blank">any/c</a></span></div>
<div><span> </span></div></td></tr></tbody></table>
<div>Question 1</div>
<div>The result <span>(</span><a name="130413b3feceb35a_(dep._((quote._~23~25kernel)._boolean~3f))"></a><a name="130413b3feceb35a_(def._((quote._~23~25kernel)._boolean~3f))"></a><span title="Provided from: racket/base, racket"><span><a href="http://pre.racket-lang.org/docs/html/reference/booleans.html#%28def._%28%28quote._%7E23%7E25kernel%29._boolean%7E3f%29%29" target="_blank">boolean?</a></span></span><span> </span><span>v</span><span>) is a boolean. Why is it not </span></div>
<table cellspacing="0">
<tbody>
<tr>
<td><span>(</span><a name="130413b3feceb35a_(dep._((quote._~23~25kernel)._boolean~3f))"></a><a name="130413b3feceb35a_(def._((quote._~23~25kernel)._boolean~3f))"></a><span title="Provided from: racket/base, racket"><span><a href="http://pre.racket-lang.org/docs/html/reference/booleans.html#%28def._%28%28quote._%7E23%7E25kernel%29._boolean%7E3f%29%29" target="_blank">boolean?</a></span></span><span> </span><span>v</span><span>)</span><span> </span>→<span> </span><span>boolean</span></td>
</tr></tbody></table> instead of
<table cellspacing="0">
<tbody>
<tr>
<td><span>(</span><a name="130413b3feceb35a_(dep._((quote._~23~25kernel)._boolean~3f))"></a><a name="130413b3feceb35a_(def._((quote._~23~25kernel)._boolean~3f))"></a><span title="Provided from: racket/base, racket"><span><a href="http://pre.racket-lang.org/docs/html/reference/booleans.html#%28def._%28%28quote._%7E23%7E25kernel%29._boolean%7E3f%29%29" target="_blank">boolean?</a></span></span><span> </span><span>v</span><span>)</span><span> </span>→<span> </span><span><a href="http://pre.racket-lang.org/docs/html/reference/booleans.html#%28def._%28%28quote._%7E23%7E25kernel%29._boolean%7E3f%29%29" target="_blank">boolean?</a></span></td>
</tr></tbody></table>
<div>?</div>
<div> </div>
<div>
<div>Question 2</div>
<div><span>If v can be anything, why not just use any instead of using <span><a href="http://pre.racket-lang.org/docs/html/reference/Data-structure_Contracts.html#%28def._%28%28lib._racket/contract/private/misc..rkt%29._any/c%29%29" target="_blank">any/c</a>?</span></span></div>
<div><span><span></span></span> </div>
<div><span><span>
<div>Question 3</div>
<div>What does / and c mean?</div>
<div> </div>
<div>BTW, did I missed the definition of / and c? I have not read the entire document. </div>
<div> </div>
<div>Thanks a lot.</div></span></span></div></div>
<br>_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/dev" target="_blank">http://lists.racket-lang.org/listinfo/dev</a><br></blockquote></div><br>