[erlang-questions] Why isn't erlang strongly typed?

Ulf Wiger ulf@REDACTED
Thu Oct 23 23:57:41 CEST 2008


What the OP could do is to make use of the
mnesia:activity(Type, Fun) function, and
use the functions mnesia:read/1 and mnesia:write/1
etc. throughout.

If Type is set to e.g. async_dirty, all operations
will be remapped to their dirty counterparts.

I strongly recommend going with transactions until
it's abundantly clear that dirty ops are required.
In my experience, they very seldom are, but YMMV,
of course.

BR,
Ulf W

2008/10/23 Richard O'Keefe <ok@REDACTED>:
>
> On 23 Oct 2008, at 7:45 pm, Dan Gudmundsson wrote:
>> Agree, but I think that was the motivation.
>> mnesia:read/1 was the original api function which was kept
>> when the 'new'* dirty_read/2 and read/3 was introduced.
>>
>> So what do you want?
>>
>> mnesia:read({Tab,key}, Lock) ->
>>  mnesia:read(Tab,Key,Lock);
>> or
>> mnesia:read(Tab,Key) ->
>>  mnesia:read(Tab,Key,read).
>
> The second of them is the definition I actually posted.
> The point, after all, was to satisfy the OP's desire
> for an interface that was compatible with dirty_read/2.
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list