Re: [classad-users] ClassAd Transform?


Date: Thu, 3 Jun 2004 15:00:57 -0500 (CDT)
From: Joe Nelson <jnelson@xxxxxxxxxxx>
Subject: Re: [classad-users] ClassAd Transform?
> How easily would it be for me to use the new ClassAd library to take an
> input ClassAd I, a "tranform" ClassAd T, and produce an output ClassAd
> O? For example:
> 
> I: [A = 2; B = 3;]
> T: [A = $(A); B = $(B); C = $(A) * $(B);]
> O: [A = 2; B = 3; C = 6;]
> 
> Is this a job for CAFL?

Sure, it would be pretty straightforward in CAFL. The transform would just be a
function taking one argument.

{fun, {I},
  [A=I.A; B=I.B; C=I.A*I.B]
}

Say we called that function T. Then to apply it to the input, you can do this:
{T, [A=2; b=3]}
Which would reduce into
[A=2; B=3; C=6]

If you'd like, I can come visit you and show you the details of running the CAFL
interpreter and getting it all working. It's not hard at all.

--Joe

Condor Classads Info:
http://www.cs.wisc.edu/condor/classad/



[← Prev in Thread] Current Thread [Next in Thread→]