I did poke around a bit at this with my morning coffee and I'd say it is not necessarily intuitively obvious to the casual observer on how to go from the internal "type" representation constructed via Class and Instance to a usable type predicate accepted in a base-env.rkt type declaration.<div>
<br></div><div>Example of attempting to type spawn-node-supervise-place-at which returns (values (Instanceof remote-node%) (Instanceof remote-connection%)).</div><div><br></div><div>Seeking to do something along the lines of this:</div>
<div><br></div><div><div>[spawn-node-supervise-place-at (->key -String -Module-Path Sym </div><div> #:listen-port -NonNegFixnum #f</div><div> #:initial-message Univ #f</div>
<div> #:racket-path -Path #f</div><div> #:ssh-bin-path -Path #f</div><div> #:distributed-launch-path (-opt -Path) #f</div>
<div> #:restart-on-exit Univ #f</div><div> #:place-name (-opt Sym) #f</div><div> #:thunk -Boolean #f</div><div>
(-values (list (-inst remote-node%)</div><div> (-inst remote-connection%))))] </div></div><div><br></div><div><br></div><div>With the companion decl along the lines of thus:</div>
<div><br></div><div>[remote-connection% (make-pred-ty (make-Class '(...)'(...)'(...)))]<br></div><div><br></div><div>But this and thus thon't, I mean don't, work for me.</div><div><br></div><div>Hints? </div>
<div><br></div><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 8, 2012 at 1:10 PM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@ccs.neu.edu" target="_blank">samth@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wed, Nov 7, 2012 at 4:02 PM, Ray Racine <<a href="mailto:ray.racine@gmail.com">ray.racine@gmail.com</a>> wrote:<br>
> Given racket/place/distributed then the typing should go into base-env.rkt<br>
> true?<br>
> Assuming so, we face the situation that the place/distributed API uses class<br>
> instances.<br>
><br>
> e.g. spawn-node-supervise-place-at returns (values remote-node%<br>
> remote-connection%)<br>
><br>
> I know how to do it a la collects/types/mred but I couldn't spot an example<br>
> of class/instance typing in directly in base-env.rkt's DSL typing syntax.<br>
<br>
</div></div>Here's a quick untested example:<br>
<br>
(make-Class<br>
(list -Integer) ;; positional init args<br>
(list (list 'x -Symbol)) ;; named init args<br>
(list (list 'm (-> -String -String)))) ;; methods<br>
<br>
then (make-Instance some-class-type) is the type of an instance.<br>
<br>
--<br>
sam th<br>
<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a><br>
</blockquote></div><br></div>