[Ur] Random numbers/strings?

Adam Chlipala adamc at impredicative.com
Tue Dec 29 12:35:46 EST 2009


Daniel Patterson wrote:
> What is the best way of getting a random string of characters? Either
> built in (a random primitive) or a way of exploiting the features of the
> database (I'm using sqlite, so for example this gives a decent string:
> SELECT hex(randomblob(30)); within the database interface, but I'm not
> sure how to get that back into ur).
>    

Right now, the compiler isn't set up so nicely to make it easy to expose 
new primitive functions of the database engine.  The easiest way to get 
what you're looking for is to expose a C function via the FFI.  Does the 
manual include enough information to show how to do this?



More information about the Ur mailing list