[Ur] obtain signal's value on a server side

Adam Chlipala adamc at csail.mit.edu
Thu Mar 5 15:27:17 EST 2015


On 03/04/2015 01:39 PM, Sergey Mironov wrote:
> Hm. I think I know a workaround now. I can define my own version of
> sources like this:
>
> datatype sourceDef x = SourceDef of (source x * x)
>
> fun source v = s <- Basis.source v; return (s*v)
>
> and then re-define all the default API for them, including [set],
> [get], [current], [signal] plus write an additional [get_def]
> returning the second element of a pair. Having signals defined this
> way makes it possible to call [get_def] in the first line of [mapsig]
> body. I would prefer to weaken restrictions of the [Basis.get] if it
> doesn't break any invariants, but I think I'm also fine with this
> solution.

That seems like a good workaround to me.  It would be 
interesting-in-a-bad-way to have to represent signals on the server 
side, in a way that allows them to be embedded inside bits of 
client-side code that reference variables defined in server-side code!



More information about the Ur mailing list