One issue to think about is that the exception type becomes 'throw'
when done this way. I think that is an improvement over the current
behaviour but it would be nice if there was a throw/2.

On Tue, Feb 8, 2011 at 10:26 PM, Martin Logan <[email protected]> wrote:
> Anyone else have a problem with this?
>
> On Tue, Feb 8, 2011 at 8:36 PM, Jordan Wilberding <[email protected]> 
> wrote:
>> Go for it man.
>> On Tue, Feb 8, 2011 at 9:26 PM, Martin Logan <[email protected]> wrote:
>>>
>>> same with me, that is what I was going for, and what I have had to
>>> replace pmap with for the time being because of the lack of this
>>> exception functionality. So if no one else objects then I am going to
>>> make the refactoring which will be a major rev over the current api.
>>>
>>> On Tue, Feb 8, 2011 at 8:19 PM, Jordan Wilberding <[email protected]>
>>> wrote:
>>> > I think we should emulate the behavior of regular map as much as
>>> > possible.
>>> > JW
>>> >
>>> > On Tue, Feb 8, 2011 at 9:12 PM, Martin Logan <[email protected]>
>>> > wrote:
>>> >>
>>> >> Guys,  pmap needs to pass through exceptions. The implementation will
>>> >> be fairly straightforward, anyone against this?
>>> >>
>>> >> In the do_f function we have the line. I would change this line to
>>> >> something like
>>> >>
>>> >>
>>> >>        Parent ! {self(), {error, ErrType, Error}}
>>> >>
>>> >>
>>> >>         Parent ! {self(), {'$exception$', ErrType, Error}}
>>> >>
>>> >> This would be to sufficiently distinguish an exception from a passed
>>> >> back error. Right now we autoconvert exceptions into errors which does
>>> >> not look quite correct to me. There may be caveats to passing back the
>>> >> exception though and that is what I am asking you to think on. Anyhow,
>>> >> If this response above comes back into
>>> >>
>>> >> wait(Parent, Child, Timeout) ->
>>> >>    receive
>>> >>        {Child, Ret} ->
>>> >>            Parent ! {self(), Ret}
>>> >>
>>> >> which would then be recognized there and passed back to Parent. When
>>> >> Parent receives an exception message it would rethrow it. Anyone
>>> >> wishing to collect all responses would need to catch exceptions at an
>>> >> application level. Exceptions would serve to short circuit the
>>> >> execution of any map functions in this way.
>>> >>
>>> >> Cheers,
>>> >> Martin
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Martin Logan
>>> >> Erlang & OTP in Action (Manning) http://manning.com/logan
>>> >> http://twitter.com/martinjlogan
>>> >> http://erlware.org
>>> >>
>>> >> --
>>> >> You received this message because you are subscribed to the Google
>>> >> Groups
>>> >> "erlware-dev" group.
>>> >> To post to this group, send email to [email protected].
>>> >> To unsubscribe from this group, send email to
>>> >> [email protected].
>>> >> For more options, visit this group at
>>> >> http://groups.google.com/group/erlware-dev?hl=en.
>>> >>
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "erlware-dev" group.
>>> > To post to this group, send email to [email protected].
>>> > To unsubscribe from this group, send email to
>>> > [email protected].
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/erlware-dev?hl=en.
>>> >
>>>
>>>
>>>
>>> --
>>> Martin Logan
>>> Erlang & OTP in Action (Manning) http://manning.com/logan
>>> http://twitter.com/martinjlogan
>>> http://erlware.org
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "erlware-dev" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/erlware-dev?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "erlware-dev" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/erlware-dev?hl=en.
>>
>
>
>
> --
> Martin Logan
> Erlang & OTP in Action (Manning) http://manning.com/logan
> http://twitter.com/martinjlogan
> http://erlware.org
>



-- 
Martin Logan
Erlang & OTP in Action (Manning) http://manning.com/logan
http://twitter.com/martinjlogan
http://erlware.org

-- 
You received this message because you are subscribed to the Google Groups 
"erlware-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/erlware-dev?hl=en.

Reply via email to