<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">In writing contracts for classes I always use the -&gt;m constructor for methods, so this example of section 5.1 of the Reference surprises me<div><br></div><div><table cellspacing="0" class="RktBlk" style="white-space: inherit; text-align: left; "><tbody><tr style="white-space: inherit; "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><table cellspacing="0" class="RktBlk" style="white-space: inherit; text-align: left; "><tbody><tr style="white-space: inherit; "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/define.html#(form._((lib._racket/private/base..rkt)._define))" class="RktStxLink" pltdoc="x" style="text-decoration: none; color: black; ">define</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); ">file-interface&lt;%&gt;</span></td></tr><tr style="white-space: inherit; "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><span class="hspace" style="font-family: monospace; ">&nbsp;&nbsp;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/createinterface.html#(form._((lib._racket/private/class-internal..rkt)._interface))" class="RktStxLink" pltdoc="x" style="text-decoration: none; color: black; ">interface</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/creatingunits.html#(form._((lib._mzlib/unit..rkt)._open))" class="RktStxLink" pltdoc="x" style="text-decoration: none; color: black; ">open</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); ">close</span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/Byte_and_String_Input.html#(def._((quote._~23~25kernel)._read-byte))" class="RktValLink" pltdoc="x" style="text-decoration: none; color: blue; ">read-byte</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/Byte_and_String_Output.html#(def._((quote._~23~25kernel)._write-byte))" class="RktValLink" pltdoc="x" style="text-decoration: none; color: blue; ">write-byte</a></span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span></td></tr><tr style="white-space: inherit; "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "></td></tr></tbody></table></td></tr><tr style="white-space: inherit; "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><table cellspacing="0"><tbody><tr style="white-space: inherit; "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "></td></tr></tbody></table></td></tr><tr style="white-space: inherit; "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><br class="Apple-interchange-newline"><table cellspacing="0" class="RktBlk" style="white-space: inherit; text-align: left; "><tbody><tr style="white-space: nowrap; font-family: serif; background-color: rgb(255, 255, 255); "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/define.html#(form._((lib._racket/private/base..rkt)._define))" class="RktStxLink" pltdoc="x" style="text-decoration: none; color: black; ">define</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); ">directory-interface&lt;%&gt;</span></td></tr><tr style="white-space: nowrap; font-family: serif; background-color: rgb(255, 255, 255); "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><span class="hspace" style="font-family: monospace; ">&nbsp;&nbsp;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/createinterface.html#(form._((lib._racket/private/class-internal..rkt)._interface))" class="RktStxLink" pltdoc="x" style="text-decoration: none; color: black; ">interface</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); ">file-interface&lt;%&gt;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span></td></tr><tr style="white-space: nowrap; font-family: serif; background-color: rgb(255, 255, 255); "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><span class="hspace" style="font-family: monospace; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">[</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); ">file-list</span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/function-contracts.html#(form._((lib._racket/contract/base..rkt)._-~3e))" class="RktStxLink" pltdoc="x" style="text-decoration: none; color: black; ">-&gt;</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/data-structure-contracts.html#(def._((lib._racket/contract/private/misc..rkt)._listof))" class="RktValLink" pltdoc="x" style="text-decoration: none; color: blue; ">listof</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">(</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); "><a href="file:///Applications/Racket%20v5.3/doc/reference/Object_and_Class_Contracts.html#(def._((lib._racket/class..rkt)._is-a~3f/c))" class="RktValLink" pltdoc="x" style="text-decoration: none; color: blue; ">is-a?/c</a></span><span class="hspace" style="font-family: monospace; ">&nbsp;</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); ">file-interface&lt;%&gt;</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">]</span></td></tr><tr style="white-space: nowrap; font-family: serif; background-color: rgb(255, 255, 255); "><td style="padding-left: 0px; padding-right: 0px; vertical-align: baseline; white-space: inherit; "><span class="hspace" style="font-family: monospace; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym" style="font-family: monospace; white-space: inherit; color: rgb(38, 38, 128); ">parent-directory</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span><span class="RktPn" style="font-family: monospace; white-space: inherit; color: rgb(132, 60, 36); ">)</span></td></tr><tr style="white-space: nowrap; font-family: serif; background-color: rgb(255, 255, 255); "></tr></tbody></table></td></tr></tbody></table><div><br></div><div><br></div><div><br></div><div>It looks like -&gt; contract constructor means the same thing except, of course, the context is an interface definition and a class contract, so it's clear from context that this a method and not a function.</div></div><div><br></div><div>Second question: Is the inclusion of contracts in interface definitions a new feature? I've always written interfaces using only method names and have missed the ability to specify the shape of the method (something more analogous to what a Java interface does). It's entirely possible that this has been in the Reference a long time and I just missed it. In fact, I'm continually amazed at how much is there that I've missed.</div></body></html>