liberty-eiffel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Liberty-eiffel] Inline agent


From: Raphael Mack
Subject: Re: [Liberty-eiffel] Inline agent
Date: Sat, 20 Feb 2016 23:39:22 +0100

Hi,

I think the compiler is right. It is better to have the open arguments
explicit and it would be good to change your code.

Nevertheless this makes me think of warning levels. Currently we have
two types of warnings: style and ordinary and we have no fine grained
way to suppress warnings. Maybe it would be good to give each warning an
ID, which can be suppressed in liberty.se or even in a comment of the
related lines "-- LEWC:ID:<justification>" or something similar.

I strongly believe that our warnings are worth fixing, so I will
probably not use such a feature and I would object to have no warnings
in our libs, but some users might like such things.

In the short we could make the "missing open argument warning" a style
warning.

What do you think?

Cheers,
Rapha

Am Freitag, den 19.02.2016, 10:17 +0100 schrieb Cyril ADRIAN:
> Hi,
> 
> 
> There is no right or wrong here. The compiler—and I—just consider best
> practice to write the open arguments after an agent declaration.
> 
> 
> It is always the same trend with SmartEiffel and Liberty Eiffel: be
> explicit rather than implicit.
> 
> 
> 
> 
> It may be slightly overkill for inline agents since it is quite
> legible as it is; but it is a good check for the non-inline agent
> declarations as it allows to at least make the number of arguments
> locally visible, and to ensure that the number of arguments is right.
> It could have been worse; the best thing would be to spell out the
> type of the arguments too (with curly brackets instead of question
> marks).
> 
> 
> Also note that in all cases you will have to add the arguments part if
> you have closed arguments; in that case, the remaining open arguments
> still have to be explicitly written.
> 
> 
> Anyway, in its current form just add (?) after the closing end of your
> agent declaration.
> 
> 
> 
> Cheers
> 
> 
> 2016-02-19 10:01 GMT+01:00 Paolo Redaelli <address@hidden>:
>         I always overlooked this. 
>         
>         My code is full of inline agents like this:
>         
>         headers.for_each(agent (a_string: ABSTRACT_STRING) do
>         
>            .... some stuff...
>         
>            std_error.put_string(a_string)
>            ... 
>         
>            end)
>         
>         
>         And the compiler tells me
>         
>         
>         ****** Warning: Please consider writing an explicit open
>         argument list for your agent creation.
>         
>         Line 203 column 36 in WRAPPERS_GENERATOR
>         
> (/home/paolo/current-liberty/src/tools/wrappers-generator/wrappers_generator.e):
>                           headers.for_each(agent (a_string:
>         ABSTRACT_STRING)
>         
>         
>         
>         I perfectly know it's a silly question.... who is right? Me or
>         the compiler? 
>         
>         
> 
> 
> 
> -- 
> Cyril ADRIAN
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]