tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: make: new modifyer :Y
On Mon, Nov 7, 2011 at 6:32 PM, Alistair Crooks <agc%pkgsrc.org@localhost>
wrote:
> On Mon, Nov 07, 2011 at 11:56:27AM +0300, Aleksey Cheusov wrote:
>> [irrelevant example elided - no one is arguing about length here - agc]
>>
>> Won't the following be better and easier?
>>
>> 30 .if ${PKG_DEVELOPER:Y}
>> 31 CHECK_INTERPRETER?= yes
>> 32 .else
>
> No.
>
> .if ${PKG_DEVELOPER:M${YES}}
> CHECK_INTERPRETER=yes
> .endif
>
> is much more expressive
I don't think so. I see, we understand expressiveness and elegance
completely differently. :M{$YES} form is in my view as ugly as
!empty(:M{[Yy][Ee][Ss]}).
As I said :Y doesn't add new power to bmake language, just like != does not
add anything to == in combination with !, we can always write !(a ==
b) instead of just a !=b, like :U doesn't add anything new
to .ifdef or defined(), like :E, :H and :R modifiers do not add
anything to more power
:S. There are a lot of other examples even in bmake. I hope idea is clear.
:Y allows to implement widely used operation
easier in more readable and maintable form. :M${YES} doesn't.
Anyway, I hope someone with better knowledge of bmake's internals answers
to Anthony's proposal to treat "yes" and "no" in boolean context as 1
and 0 values, that is in .if statements, &&, || etc.
:M${YES} doesn't solve the problem I'm trying to raise.
But Anthony's one does if it is feasible to implement it.
It is even better than :Y.
Home |
Main Index |
Thread Index |
Old Index