Wow - some great responses on the thread - I have some more questions to chime in and hopefully it's not too late ;) <br><br><span class="gmail_quote">On 6/11/07, <b class="gmail_sendername">Chongkai Zhu</b> <<a href="mailto:czhu@cs.utah.edu">
czhu@cs.utah.edu</a>> wrote:</span><br>
> Yes, at the C level, MzScheme knows the type tag. But, on the Scheme<br>
> level, everything is suppose to be transparent.<br>
<br>If scheme's type is really supposed to be transparent, I would venture that it isn't - because if it is, then I shouldn't have to test for types to call the right procedures, or write separate procedures that essentially do the same thing for different types (
i.e. no built-in generic programming). <br><br><div><span class="gmail_quote">On 6/11/07, <b class="gmail_sendername">Shriram Krishnamurthi</b> <<a href="mailto:sk@cs.brown.edu">sk@cs.brown.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> What is the type of ADD1? What is the type of CALL/CC? How<br>> about of (lambda (x) x)? Or<br><br>> (let ([x 3])<br>> (lambda (y)<br>> (when (= (random 2) 0)<br>> (set! x y))<br>
> x))<br><br>> ?</blockquote><div><br>Shouldn't mzscheme know the answer to these questions? It seems possible within Haskell or Ocaml to infer the types - below is my attempt but I probably have the syntax wrong.
<br><br><div style="margin-left: 40px;">add1 is int -> int<br>(lambda (x) x) is any -> any <br>I don't understand enough about call/cc so I won't attempt ;) <br>(let ((x 3)) (lambda (y) (when (= (random 2) 0) (set! x y)) x)) can be void -> (any -> (union int any))
<br></div></div><br>And the contract system does allow such specifications manually - running (add1 "a") returns a run-time type mismatch error. <br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> PS: In general, when asking questions about "every object" in<br>> a language like Scheme, it's imperative to remember the<br>> higher-order values also.</blockquote><div><br>Does this mean that Scheme doesn't know about the higher order value itself? This might be where my gap is - from my perspective as a user, I am used to having the language platform knows about the types of the values, and externally observing scheme's behavior - it does know.
<br><span class="gmail_quote"><br></span><span class="gmail_quote">On 6/11/07, <b class="gmail_sendername">Jos Koot</b> <<a href="mailto:jos.koot@telefonica.net">jos.koot@telefonica.net</a>> wrote:<br></span>> It appears to me that there is even no agreement about what the type of a type
<br>> would have to be, let alone the question when two types are the same ;) Please<br>> take notice that (as a fan of PLT) I am quite content with PLT's system of<br>> predicates, those for structs and object-classes included.
<br><br>I am also a fan and my reason to ask these questions is to understand how scheme's way work better (or worse, but I hope it's the former :P) than say C# or Python's way. My current feeling is that Scheme's type system requires explicit handling where I am used to handling implicitly. Perhaps as shown in the thread
<a href="http://www.cs.brown.edu/pipermail/plt-scheme/2007-May/018457.html">http://www.cs.brown.edu/pipermail/plt-scheme/2007-May/018457.html</a> this approach allows for type research and experimentations at the expense of normal programming - and if this is a conscious design decision, that's fine - I am just trying to understand ;)
<br><br>Cheers,<br>yc<br><br></div></div>