<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">What is the definition of Collection in your example? Your definition in collections.grace in GUnit looks different:<div><br></div><div><div>type IndexableCollection = {</div><div> size -> Number</div><div> at -> Object</div><div>}</div><div><br></div><div>type Collection = {</div><div> size -> Number</div><div> contains(a) -> Boolean</div><div>}</div><div><br></div><div>I'm trying to figure out the definition that you say doesn't work.</div><div><br></div><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div>Kim</div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On Feb 7, 2014, at 11:48 AM, Andrew P. Black <<a href="mailto:apblack@ownmail.net">apblack@ownmail.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I’ve posted a proposed resolution at the bottom of the wiki page: <a href="https://projects.cecs.pdx.edu:8443/~black/NewOOL/index.cgi/wiki/RevisedTypeSyntax">https://projects.cecs.pdx.edu:8443/~black/NewOOL/index.cgi/wiki/RevisedTypeSyntax</a><div>and appended to this message.<br><div><br></div><div>I think that this solves the immediately problem. However, in our discussions, we have identified two more:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(1) Overloading of ->, as Kim says below.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(2) Too many parameter syntaxes. Methods, types and blocks can all have parameters, and we use a different syntax for each. Having three parameter syntaxes is neither Graceful nor simple.</div><div><br></div><div><br>On 7 Feb 2014, at 11:20, Kim Bruce <<a href="mailto:kim@cs.pomona.edu">kim@cs.pomona.edu</a>> wrote:<br><br><blockquote type="cite">Is the main issue expressions like {a:Number -> a*a) which could be interpreted as an anonymous function or a type with method a with type Number -> a*a?<br>(Admittedly we wouldn't have a*a as a type, but you get the idea.)<br></blockquote></div><div><br></div><div><h2 id="ProposedResolution" style="font-family: Arial, Verdana, 'Bitstream Vera Sans', Helvetica, sans-serif; page-break-after: avoid; font-size: 16px; margin-left: -18px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">Proposed Resolution<a class="anchor" href="https://projects.cecs.pdx.edu:8443/~black/NewOOL/index.cgi/wiki/RevisedTypeSyntax#ProposedResolution" title="Link to this section" style="text-decoration: none; color: rgb(215, 215, 215); border: none; font-size: 0.8em; vertical-align: text-top; visibility: hidden;"></a></h2><p style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">Andrew Proposes the following resolution:</p><ol style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);"><li>On the right-hand-side of a type declaration<pre class="wiki" style="background-color: rgb(247, 247, 247); border: 1px solid rgb(215, 215, 215); margin-right: 1.75em; margin-left: 1.75em; padding: 0.25em; overflow: auto;">type NewTypeName = type { meth1(args) -> results; meth2(args2) -> results2 }
</pre>it is permissible to omit the second <strong>type</strong> keyword. To be omittable, <strong>type</strong> <em>must</em> appear immediately after = and immediately before { .</li></ol><ol start="2" style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);"><li>In all other cases, type literals <em>always</em> start with the word <strong>type</strong></li></ol><p style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">So, for example, we would write:</p><pre class="wiki" style="background-color: rgb(247, 247, 247); border: 1px solid rgb(215, 215, 215); margin-right: 1.75em; margin-left: 1.75em; padding: 0.25em; overflow: auto; font-size: 13px;">type IndexableCollection = Collection & type { at(ix:Number) -> Element; at(ix:Number) put(e:Element) }
</pre><p style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">where the second <strong>type</strong> is compulsory.</p><p style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">(As an aside, the above definition doesn't work, because IndexableCollection needs to match Collection: they need the <em>same</em> element type and SelfType. I'll leave that to the type theoreticians to figure out.)</p><p style="font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">This continues to distinguish type declarations from other declarations, and thus we can continue to allow type parameters in these declarations.</p></div></div></div>_______________________________________________<br>Grace-core mailing list<br><a href="mailto:Grace-core@cecs.pdx.edu">Grace-core@cecs.pdx.edu</a><br>https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core<br></blockquote></div><br></div></body></html>