liberty-eiffel
[Top][All Lists]
Advanced

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

Re: [Liberty-eiffel] Inline agent


From: Cyril ADRIAN
Subject: Re: [Liberty-eiffel] Inline agent
Date: Mon, 22 Feb 2016 08:43:51 +0100

Hi Raphael,

Thanks for the reminder :-) You are right of course. Let the compiler talk to responsible persons.

If we implement what you suggest, it may be interesting to add a count of "muted" warnings at the end of the compilation (in verbose mode).

Cheers,

Cyril

2016-02-21 20:15 GMT+01:00 Raphael Mack <address@hidden>:
Am Sonntag, den 21.02.2016, 08:34 +0100 schrieb Cyril ADRIAN:
> I think that any warning needs to be fixed.

Yes and no. In general I agree - I work the same way but I also had real
cases, where it was the best to accept (not ignore) the warning and then
it is good to be able to explicitly disable that single one, to be able
to concentrate on the others. And I want to work with developers able to
judge the single case and taking the responsibility for what they do,
not with guys who just obey rules (or warnings).

In the current case I totally agree, that it is better to give the open
argument explicitly, and the compiler should warn. But still the
standard allows to skip the argument list altogether and I see no reason
why we should fight against users who would like to do so. In this case
I think it would be good to be able to switch off this warning even
though I will never do it...

But of course we have more important things to do at the moment, so I
won't code this (and it is not even a suggestion for a GSoC idea), but
I'd argue to go into this direction. We want to be down from the ivory
tower, you remember?

Regards,
Rapha
> Cheers
>
> 2016-02-20 23:39 GMT+01:00 Raphael Mack <address@hidden>:
>         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
>         >
>
>
>
>
>
>
>
>
> --
> Cyril ADRIAN
>





--
Cyril ADRIAN

reply via email to

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