OK. Got your point at least in principle.
However, the void target can be encountered much further down in the
call stack. How is the correlation to the violated precondition done?
The precondition exception might be very confusing, if the void target
is encountered far away. But I understand, that it can work the way you
described.
This gives me another issue. The CAP could be done by an object test
local also. e.g.
class B feature
some_routine(a: ?A)
require {o:A}
do
o.some_feature
...
end
...
end
class ROOT create make feature
make
local
v: ?A
b: B
do
create b
b.some_routine(v)
end
end
Now the object test local will not get initialized, if precondition
monitoring is switched off. So you will get a void target even if the
target is attached? (assertion with side effect).
ardjussi wrote:
> --- In
eiffel_software@..., Helmut Brandl
> <helmut.brandl@...> wrote:
>
>> But what, if precondition monitoring is not switched on? How will
>>
> you
>
>> get a precondition exception if monitoring is not switched on?
>>
>
> This is how the compiler works on this CAP: void target detection
> fakes by emitting precondition violation exception. Notice that there
> is no detection of precondition violation. This is an exception
> situation anyway, but there does not appear a VOID TARGET exception.
> Thus voidsafe...
>
> br Jussi
>
>> Helmut
>>
>> ardjussi wrote:
>>
>>> --- In
eiffel_software@..., Helmut Brandl
>>> <helmut.brandl@> wrote:
>>>
>>>
>>>> Peter,
>>>>
>>>> the example I gave will pass the compiler validity checks,
>>>>
> because
>
>>>>
>>>>
>>> it is
>>>
>>>
>>>> a certified attachment pattern. But nothing no validity rule
>>>>
> will
>
>>>> inhibit, that I call the routine with a void target. E.g. the
>>>>
>>>>
>>> following
>>>
>>>
>>>> will pass the validity checks, but produce a call on a void
>>>>
> target:
>
>>>> class B feature
>>>>
>>>> some_routine(a: ?A)
>>>> require a /= Void
>>>> do
>>>> a.some_feature
>>>> ...
>>>> end
>>>> ...
>>>> end
>>>>
>>>> class ROOT create make feature
>>>> make
>>>> local
>>>> v: ?A
>>>> b: B
>>>> do
>>>> create b
>>>> b.some_routine(v)
>>>> end
>>>> end
>>>>
>>>> Do you get my point. The feature "b.some_routine(v)" will call
>>>> "a.some_feature" with a void targe a. This call on void target
>>>>
> will
>
>>>>
>>>>
>>> only
>>>
>>>
>>>> be detected at runtime, if assertion (in this case precondition)
>>>> monitoring is on.
>>>>
>>>>
>>> In pre-voidsafe Eiffel the result was a void target exception.
>>> Voidsafe Eiffel differs here by emitting a precondition
>>>
> exception,
>
>>> not void target exception. Reason is void target, but exception
>>>
> is
>
>>> precondition violation, thus no void target exceptions. No?
>>>
>>> br Jussi
>>>
>>>
>>>> Helmut
>>>>
>>>> Peter Gummer wrote:
>>>>
>>>>
>>>>> Helmut Brandl wrote:
>>>>>
>>>>>
>>>>>
>>>>>> What happens, if precondition monitoring is not activated? Are
>>>>>>
>>>>>>
>>> void
>>>
>>>
>>>>>> calls only eradicated if assertion monitoring is on?
>>>>>>
>>>>>>
>>>>>>
>>>>> Assertion monitoring occurs at run time.
>>>>>
>>>>> Void-safety validity checks occur at compile time.
>>>>>
>>>>> I don't see why turning off assertion monitoring would
>>>>>
> influence
>
>>>>> void-safety.
>>>>>
>>>>> - Peter Gummer
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------
>>>>>
>>>>> Yahoo! Groups Links
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>> ------------------------------------
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/eiffel_software/<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/eiffel_software/join (Yahoo! ID required)
<*> To change settings via email:
mailto:
eiffel_software-digest@...
mailto:
eiffel_software-fullfeatured@...
<*> To unsubscribe from this group, send an email to:
eiffel_software-unsubscribe@...
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/