[mercury-users] Converting time_t to int using common library?

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Feb 13 23:03:54 AEDT 2007


On Tue, 13 Feb 2007, Julian Fondren wrote:

> On 2/13/07, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>> On Tue, 13 Feb 2007, Julian Fondren wrote:
>> > :- func random.init = (random.supply::uo) is det.
>
> No, it doesn't.  I had the idea that it would allow random-using
> code to not depend on IO, but if anything it should just throw
> an error if called more than once.
>
>> BTW, you should avoid using the old foreign language interface (as you did
>> in the attached patch) in favour of the new one, e.g.
>> 
>>    pragma foreign_proc("C", ...       instead of pragma c_code
>>    pragma foreign_decl("C", ...  instead of pragma c_header_code
>> 
>> The old interface is deprecated and we will be removing support for it
>> at some point.  (Also the implementation of pragma c_code is a bit
>> unpredictable w.r.t to the purity system.)
>
> Oh.  Although I've used it, I've mainly focused on other areas
> of the Mercury Language Reference Manual -- the Purity section,
> for instance, which is -really interesting-, and which
> accidentally teaches everything you need to know to use... the
> old interface to C :-)

I bet it won't do that soon ;-)

Julien.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list