So I solved why TR was giving me an "unknown identifier place?" which I was assuming needed some sort of additional work in base-special-env.rkt (it doesn't). <br><div><br></div><div>This works just fine in TR.</div>
<div><br></div><div><div>#lang typed/racket/base</div><div><br></div><div>(require racket/place/distributed</div><div> racket/place)</div><div><br></div><div>(: hello-world (-> Place))<br></div><div>(define (hello-world) </div>
<div> </div><div> (place ch </div><div> (let ((ch ch)) ;; for illustration purposes only</div><div> (when (place? ch)</div><div> (printf "hello-world received: ~a\n" </div><div>
(place-channel-get ch))</div><div> (define HW "Hello World")</div><div> (place-channel-put ch (format "~a\n" HW))</div><div> (printf "hello-world sent: ~a\n" HW)))))</div>
</div><div><br></div><div><br></div><div>Expanding to:</div><div><br></div><div><div> (#%require racket/place/distributed)</div><div> (#%require racket/place)</div><div> (define-values ()</div><div> (begin</div><div>
(quote-syntax (:-internal hello-world (-> Place)))</div><div> (#%plain-app values)))</div><div> (define-values (lifted.0)</div><div> (lambda:22 (ch)</div><div> (let-values (((ch) ch))</div><div>
(if:26 (#%app:27 place? ch)</div><div> (let-values ()</div><div> (let-values ((()</div><div> (begin</div><div> (#%app:28</div><div> printf</div>
<div> (quote "hello-world received: ~a\n")</div><div> (#%app:29 place-channel-get ch))</div><div> (#%app values))))</div><div>
(let-values (((HW) (quote "Hello World")))</div><div> (#%app:31</div><div> place-channel-put</div><div> ch</div><div> (#%app:32 format (quote "~a\n") HW))</div>
<div> (#%app:33 printf (quote "hello-world sent: ~a\n") HW))))</div><div> (#%app:26 void:26)))))</div><div> (define-values (hello-world)</div><div> (lambda ()</div><div> (#%app</div>
<div> place/proc</div><div> (#%variable-reference)</div><div> 'place/anon/code/ecomm-analytics/redtop/rkt/hello-world.rkt1</div><div> 'place</div><div> start-place</div><div> (quote #f)</div>
<div> (#%app current-output-port)</div><div> (#%app:18 current-error-port))))</div></div><div><br></div><div>As clearly explained in the Racket Doc for 'place', given (place ch body0 ...) the bodies are lifted to the module top level. As generated binding, lift.0 is lifted to the top level there is no Type declaration for TR to see, so the single 'ch' arg of the lifted wrapping lambda is of type Any. Hence, the necessity of the added (when (place? ch) ...).</div>
<div><br></div><div>Where I got bogged down was attempting to solve the TR type check error of lift.0 having (ch : Any) when (ch : Place) is required in place-channel-get using TR syntax using some variation of TR syntax. Something along the lines of the following.</div>
<div><br></div><div><div>(: hello-world (-> Place))<br></div><div>(define (hello-world) </div><div> </div><div> (place ch </div><div> (let: ((ch : Place ch)) ;; fails with "unknown identifier place?"</div>
<div> (printf "hello-world received: ~a\n" </div><div> (place-channel-get ch))</div><div> (define HW "Hello World")</div><div> (place-channel-put ch (format "~a\n" HW))</div>
<div> (printf "hello-world sent: ~a\n" HW)))))</div></div><div><br></div><div>I ended up burning cycles on why place? was not being seen by RT, ie as a base-special-env.rkt issue (which it is not). </div>
<div><br></div><div>Appears the place top level lifting macro and the accompany use of the let-values misplaces (pun intended) the type annotation (ch : Place) in the let-values bindings, causing the unknown place? identifier error. But it is an unknown identifier in let bindings and _not_ some sort of failure to correctly import 'place?' into TR.</div>
<div><br></div>