[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

overload rb_protect

Thomas Sondergaard

10/2/2003 10:56:00 AM

To use rb_protect you have to wrap the function you want to protect so it
accepts a single VALUE parameter. Would it not make sense to overload
rb_protect, so it could protect the three normal signatures for ruby
methods, ie:

1) VALUE func(VALUE self[, VALUE arg1, VALUE arg2, ...]);
2) VALUE func(int argc, VALUE *argv, VALUE self);
3) VALUE func(VALUE self, VALUE args);

The existing rb_protect(VALUE (*proc)(VALUE), VALUE data, int *state)
matches the third of the common signatures, so if

VALUE rb_protect2(int *state, VALUE (*proc)(ANYARGS), VALUE self, ...);

and

VALUE rb_protect3(int *state, VALUE (*proc)(int, VALUE*, VALUE), int argc,
VALUE *argv, VALUE self);

were added it would be easier to do exception handling in C. Doesn't that
make good sense? Or maybe rb_protect could be macroized, so you could do
something like

RB_EXCEPTION_INIT // declare int exception_state among other things
RB_TRY
... do something that you want to protect here
RB_RESCUE
... examine exception_state here

Hm, okay, maybe not :-)

Thomas




3 Answers

PV

9/3/2012 11:34:00 PM

0

The Doctor wrote:
> In article <y691s.2100$Wo5.1639@newsfe21.iad>,
> PV <edrnouser@ spam telus.net> wrote:
>> The Doctor wrote:
>>> In article <7M71s.2094$Wo5.999@newsfe21.iad>,
>>> PV <edrnouser@ spam telus.net> wrote:
>>>> The Doctor wrote:
>>>>> In article <0E71s.1508$wr2.88@newsfe08.iad>,
>>
>> <Snip>
>>
>>>>>>>> Feel free to look at what you call the "fundamentals", just
>>>>>>>> don't try and impose them on others.
>>>>>>>>
>>>>>>>
>>>>>>> So then you must be against the 10 Commandments being part of
>>>>>>> the judicial code after all that is am imposition of
>>>>>>> beliefs by YOUR standards.
>>>>>>
>>>>>> No that is a total red herring thrown by you to confuse the
>>>>>> situation, I suspect all you have done is confuse yourself
>>>>>>
>>>>>> Keep your fundamentalist theology to yourself and your "Church".
>>>>>> You are more then welcome to your beliefs as long as you stop
>>>>>> attempting to force them on others. The world would be a much
>>>>>> happier place if only people would follow this simple rule.
>>>>>>
>>>>>>
>>>>>
>>>>> No red herring. Thatis YOUR Logic PV.
>>>>
>>>> Please don't attempt to force your "logic" onto me, you and logic
>>>> are not even passing acquaintances, never mind being close friends.
>>>>
>>>> Your statement "you must be against" is your words, not mind, and
>>>> therefore makes the whole statement a red herring.
>>>>
>>>> Do you need to project your beliefs on others because you are not
>>>> secure enough to stand alone?
>>>>
>>>>
>>>
>>> Typical PV always living in denial of the Truth.
>>
>> Typical Doc, unable to give a straight answer to anything, you
>> haven't the foggiest notion as to what "truth" is, all you have is
>> ideas given to you by others.
>>
>>
>
> Yes PV you prove you live in lies with that statement.

If that is what it takes to get you through the day then please continue to
live in your fantasy world.

--
PV

"If Inflammable means more flammable, then what does incompetent mean?'


John Fleming

9/3/2012 11:35:00 PM

0

[Default] On Mon, 3 Sep 2012 15:16:12 -0600, while chained to a desk
in the scriptorium "PV" <edrnouser@ spam telus.net> wrote:
> $The Doctor wrote:
> $> In article <7M71s.2094$Wo5.999@newsfe21.iad>,
> $> PV <edrnouser@ spam telus.net> wrote:
> $>> The Doctor wrote:
> $>>> In article <0E71s.1508$wr2.88@newsfe08.iad>,
> $
> $<Snip>
> $
> $>>>>>> Feel free to look at what you call the "fundamentals", just don't
> $>>>>>> try and impose them on others.
> $>>>>>>
> $>>>>>
> $>>>>> So then you must be against the 10 Commandments being part of the
> $>>>>> judicial code after all that is am imposition of
> $>>>>> beliefs by YOUR standards.
> $>>>>
> $>>>> No that is a total red herring thrown by you to confuse the
> $>>>> situation, I suspect all you have done is confuse yourself
> $>>>>
> $>>>> Keep your fundamentalist theology to yourself and your "Church".
> $>>>> You are more then welcome to your beliefs as long as you stop
> $>>>> attempting to force them on others. The world would be a much
> $>>>> happier place if only people would follow this simple rule.
> $>>>>
> $>>>>
> $>>>
> $>>> No red herring. Thatis YOUR Logic PV.
> $>>
> $>> Please don't attempt to force your "logic" onto me, you and logic
> $>> are not even passing acquaintances, never mind being close friends.
> $>>
> $>> Your statement "you must be against" is your words, not mind, and
> $>> therefore makes the whole statement a red herring.
> $>>
> $>> Do you need to project your beliefs on others because you are not
> $>> secure enough to stand alone?
> $>>
> $>>
> $>
> $> Typical PV always living in denial of the Truth.
> $
> $Typical Doc, unable to give a straight answer to anything, you haven't the
> $foggiest notion as to what "truth" is, all you have is ideas given to you by
> $others.

I think you are wasting your breath PV. When you need a break, I know
a lonely noise attenuation wall that would give you some interesting
and stimulating conversation.
--


John Fleming
Edmonton, Canada


Old MacDonald had a farm E-I-E-I-O
And on that farm he had a genome E-I-E-I-O
With a SNP SNP here and a SNP SNP there,
Here a SNP, there a SNP, everywhere a SNP SNP
Old MacDonald had a farm E-I-E-I-O

Mr.Smartypants

9/3/2012 11:36:00 PM

0

On Sep 3, 4:15 pm, doc...@doctor.nl2k.ab.ca (The Doctor) wrote:
> In article <y691s.2100$Wo5.1...@newsfe21.iad>,
> PV <edrnouser@ spam telus.net> wrote:
>
>
>
>
>
> >The Doctor wrote:
> >> In article <7M71s.2094$Wo5....@newsfe21.iad>,
> >> PV <edrnouser@ spam telus.net> wrote:
> >>> The Doctor wrote:
> >>>> In article <0E71s.1508$wr2...@newsfe08.iad>,
>
> ><Snip>
>
> >>>>>>> Feel free to look at what you call the "fundamentals", just don't
> >>>>>>> try and impose them on others.
>
> >>>>>> So then you must be against the 10 Commandments being part of the
> >>>>>> judicial code after all that is am imposition of
> >>>>>> beliefs by YOUR standards.
>
> >>>>> No that is a total red herring thrown by you to confuse the
> >>>>> situation, I suspect all you have done is confuse yourself
>
> >>>>> Keep your fundamentalist theology to yourself and your "Church".
> >>>>> You are more then welcome to your beliefs as long as you stop
> >>>>> attempting to force them on others.  The world would be a much
> >>>>> happier place if only people would follow this simple rule.
>
> >>>> No red herring.  Thatis YOUR Logic PV.
>
> >>> Please don't attempt to force your "logic" onto me, you and logic
> >>> are not even passing acquaintances, never mind being close friends.
>
> >>> Your statement "you must be against" is your words, not mind, and
> >>> therefore makes the whole statement a red herring.
>
> >>> Do you need to project your beliefs on others because you are not
> >>> secure enough to stand alone?
>
> >> Typical PV always living in denial of the Truth.
>
> >Typical Doc, unable to give a straight answer to anything, you haven't the
> >foggiest notion as to what "truth" is, all you have is ideas given to you by
> >others.
>
> Yes PV you prove I live in lies with that statement.
> --
> Member - Mr. SmartyPants Fan Club This is twat...@nl2k.ab.ca Ici doc...@nl2k.ab.ca
> God,Queen and country!Never Satan President Republic!Beware AntiChrist rising!http://www.fullyfollow.m...
> Quebec le 4 Sept 2012 ne votez pas pour le PQ!


fixed.