[Ur] Random numbers/strings?

Adam Chlipala adamc at impredicative.com
Tue Dec 29 13:33:28 EST 2009


Daniel Patterson wrote:
> Not totally - I'm pretty sure I understand how the code should be
> written (ie, function has signature:
> uw_Basis_string ur_Random_str(uw_context ctx); - which will translate to
> Random.str : string within Ur),
>    

I think you want to use this signature instead:
     val Random.str : transaction string

This is because random number generation is not referentially 
transparent: two calls may return different results.

> ...
> trying to include the header (with the 'header' directive) the compiler
> responded "Unrecognized command 'header'".
>    

Oops.  That's a bug in the manual.  The command is 'include', not 'header'.

> Is there a trivial example of a .c/.h/.urp/.urs setup to define
> something like Example.hello to return "hello"?
>    

Nothing like that is online yet.



More information about the Ur mailing list