> I just never found any good docs on how to do that. Near as I can tell, runtime linking of a unit is even MORE verbose and persnickety than just > manually typing in all the procedures you want to pass to a callback
Some of the verbosity of units can be reduced using the "inference" features that Racket's unit system provides. Here's one way to do this: ;; define a signature that contains info about your runtime data (define-signature runtime-data^ (runtime-value)) ;; define a unit that encapsulates the initialization of data you need at runtime (define-unit runtime-data@ (import) (export runtime-data^) (define runtime-value ...)) ;; Implement the rest of your program in a unit which imports the runtime-data^ signature (define-unit use-runtime-data@ (import runtime-data^) (export) ;; your main program code goes here ... ) ;; link together the units to run your program (invoke-unit/infer (link runtime-data@ use-runtime-data@)) There is still some syntactic overhead, but using unit inference does alleviate many of the confusing parts of manually linking and invoking units. Dan On Tue, Oct 13, 2015 at 7:07 PM, Nota Poin <notap...@gmail.com> wrote: > On Tuesday, October 13, 2015 at 11:40:12 PM UTC, Alexis King wrote: > > units > > Oh uh, conceivably you could have "code" that provided a live session > object on linking, and handled session refreshing internally, then just > link that with units that have session dependant code. I just never found > any good docs on how to do that. Near as I can tell, runtime linking of a > unit is even MORE verbose and persnickety than just manually typing in all > the procedures you want to pass to a callback. > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.