[Ur] Passing non-Basis data types to javascript ffi?

Adam Chlipala adamc at csail.mit.edu
Tue Mar 12 16:18:51 EDT 2013


On 03/12/2013 04:16 PM, Daniel Patterson wrote:
> One odd thing about this - I have this signature in the .urs file:
>
> val init : ...
>            (float -> transaction unit) -> (* set function *)
>            ...
>            transaction unit
>
> But to use that function in javascript, I need to pass it _two_ 
> arguments, ie, call it as execF (execF (set_function, float_value), 
> ignored_value)) - where, as the name indicates, the second argument 
> seems to be ignored. It doesn't prevent it from working, but is that 
> expected behavior? ie is there some extra unit argument added to 
> functions, or something?

Yes, [transaction]s are represented as [unit]-domain functions.  I 
should add that to the manual. :)



More information about the Ur mailing list