[erlang-questions] why doesn't int:attach(Pid, Function) take a fun?

Vlad Dumitrescu vladdu55@REDACTED
Thu Sep 18 14:52:26 CEST 2014


On Thu, Sep 18, 2014 at 2:43 PM, Fred Hebert <mononcqc@REDACTED> wrote:

> On 09/18, Vlad Dumitrescu wrote:
> > On Thu, Sep 18, 2014 at 12:36 PM, Leo Liu <sdl.web@REDACTED> wrote:
> >
> > > Is there any reason why int:attach or int:autoattach not take a fun?
> > >
> >
> > But it does: http://www.erlang.org/doc/man/int.html#auto_attach-2
> >
>
> It takes a {M,F} or {M,F,Args}, not a fun().
>
> https://github.com/erlang/otp/blob/maint/lib/debugger/src/int.erl#L180-L184
> :
>
>     auto_attach(Flags, {Mod, Func}) ->
>         auto_attach(Flags, {Mod, Func, []});
>     auto_attach(Flags, {Mod, Func, Args}) when
> is_atom(Mod),is_atom(Func),is_list(Args) ->
>         check_flags(Flags),
>         dbg_iserver:safe_cast({set_auto_attach, Flags, {Mod, Func, Args}}).
>

Ah, okay, I had misunderstood the question.

I would presume to guess that the reason is that the API just didn't follow
the language's development and nobody asked for an updated API.

regards,
Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140918/18c57cf5/attachment.htm>


More information about the erlang-questions mailing list