[QBS] Increasing verbosity of targetOS-based on conditions in user code

Oswald Buddenhagen oswald.buddenhagen at digia.com
Thu Jun 13 12:03:04 CEST 2013

On Thu, Jun 13, 2013 at 10:37:59AM +0300, Alberto Mardegan wrote:
> On 06/13/2013 10:02 AM, Joerg Bornemann wrote:
> > Is it really worth it, given that we want extend Array to have a 
> > contains method anyway, which would make the code less verbose again?
> I find
>   condition: qbs.targetOS.contains("windows") ||
>              qbs.targetOS.contains("darwin")
> much more readable than a "filter" property.
this is certainly the language-wise more minimalistic approach.

however, one should consider that the filter-based approach is purely
declarative, which facilitates tooling (as opposed to the functional
code above).

> Do you plan to allow the contains() method to receive a list of
> parameters in order to make the above even shorter, or would it be
> possible to write something like:
>   condition: qbs.targetOS in ["windows", "darwin"]
targetOS will be a list once jake's changes are in. the semantics of
'in' on a list are blurry at best. the dedicated filter syntax seems
less confusing to me.

More information about the Qbs mailing list