On 4/24/2016 1:36 PM, Benjamin Eberlei wrote:
> On Sun, Apr 24, 2016 at 10:24 AM, Fleshgrinder <p...@fleshgrinder.com> wrote:
> 
>> The invariant could also be added as an additional branch to the class
>> instead of a method, since it would not work like a method.
>>
>>   class A {} invariant {}
>>
>>   function f() {} require {} ensure {}
>>
>> This would also align nicely with closures and anonymous classes, which
>> is kind a problematic with annotations.
>>
> 
> You are way off topic with this imho.
> 

No, not at all!

The RFC explicitly mentions design by contract (DbC) and that is why I
am responding to that. I do not think that annotations should or could
be used for DbC and want to raise this issue here. Of course all of the
above is a completely different story and requires its own RFC as well
as implementation. However, DbC should not be used to justify the
addition of annotations to PHP. (If libraries choose to use it for that,
different story.)

On 4/24/2016 1:36 PM, Benjamin Eberlei wrote:
> Attributes as proposed by Dimitry are not executing functions, they are
> only metadata
> that can be retrieved through reflection API. I think a python style
> decorator approach
> that you propose here, executing functions is not what the different
> pro-annotations,
> pro-attributes or pro-DesignByContract fractions want/need.
> 
> You are proposing something along the lines of AOP, which is an entirely
> different beast
> in my opinion.
> 

I know and that is why I am writing that the usage of brackets is not a
good idea because it suggests exactly that. We need to think about a
possible feature as outlined by myself (reactive annotations or /Python
style decorator approach/ as you call it) in order to not implement
annotations in a way that would kill exactly such a feature in a
possible future.

Hence, I am not off topic because I am thinking outside of the box in
the context of the whole ecosystem. Something that I see not happening
in this RFC nor its discussion.

-- 
Richard "Fleshgrinder" Fussenegger

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to