[erlang-questions] Drive by mention of new features without explaination

Zoltan Lajos Kis kiszl@REDACTED
Mon Dec 7 21:55:00 CET 2009


Ulf Wiger wrote:
> Zoltan Lajos Kis wrote:
>>
>> The on_load function expects 'true' to be returned, whereas 
>> erlang:load_nif returns with 'ok' (which is definitely not 'true'). 
>> This will result in your module being unloaded.
>> Solution:
>>
>> run_me() ->
>>      erlang:load_nif("./niftest", 0),
>>      true.
>
> Hmm...
>
> Given that the NIF support is flagged as experimental,
> could this perhaps be fixed?
>
> BR,
> Ulf W
I'd give a +1 on changing the on_load handler to expect 'ok' instead of 
'true'. The documentation states that "there may be 
backward-incompatible changes in the feature in future releases.", so 
that should not be a problem. But there might be plans unknown to us 
with on_load that makes 'true' the preferable choice. Who knows...

btw, we could use this for now:

run_me() ->
     ok == erlang:load_nif("./niftest", 0).

Regards,
Zoltan.


More information about the erlang-questions mailing list