Re: [classad-users] Constraint Question


Date: Wed, 18 Jan 2006 15:44:57 -0600
From: Marvin Solomon <solomon@xxxxxxxxxxx>
Subject: Re: [classad-users] Constraint Question


Alain Roy wrote:
> You're mixing syntax for old and new ClassAds, but yes. In new
> ClassAds, you can write:
>
> Requirements = A isnt defined && B is undefined;

I think you meant
    Requirements = other.A isnt undefined && other.B is undefined;

>
> In old classAds, you'll use =!= and =?= (not ==).
>

Old classads must be destroyed! :-).

Nicholas Coleman wrote:

> I would suggest a user defined function that returns the number of
> attributes in a ClassAd.  It would have to iterate through the attributes
> in the ClassAd and tally the number, but this could be implemented without
> any changes to the ClassAd API.
>
> - Nick

Better still, how about a function atributes(Expr) that returns all the
attribute names as a list of strings?  You could use the existing function
size() to find out how many.

    Requirements = other.A isnt undefined && size(attributes(other)) == 1;
[← Prev in Thread] Current Thread [Next in Thread→]