While awaiting for some example(s) of provisioning class/instances for racket/... libs in base-env.rkt, I've make satisfactory progress in TRing a core of racket/place and racket/place/distributed with the following approach:<div>
<br></div><div>1) Provision procedures based on prim data types / structure datatypes in base-env.rkt. Rote stuff.</div><div>2) TRing procedures using classes/instances using the typed/mred/mred approach using require/typed, similar what I did in wrapping the plot library.</div>
<div><br></div><div>So far this is looking good in getting what I need from the Place API lifted into TR so I can get back to working on my app code. </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 9, 2012 at 11:32 AM, Ray Racine <span dir="ltr"><<a href="mailto:ray.racine@gmail.com" target="_blank">ray.racine@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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 class="HOEnZb"><div class="h5">
<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><div>On Wed, Nov 7, 2012 at 4:02 PM, Ray Racine <<a href="mailto:ray.racine@gmail.com" target="_blank">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" target="_blank">samth@ccs.neu.edu</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>