[kepler-dev] Re: zero-length arrays

Shawn Bowers bowers at sdsc.edu
Thu Aug 12 11:43:29 PDT 2004

Doh! thanks; I wasn't paying enough attention there. Actually, I haven't 
looked at the record operations in Ptolemy.

 From the documentation, it sounds like the intersect operation is 
really just a set-based intersection over the attribute names. It 
returns a new record with one component for each resulting attribute 
name in the intersection such that the value of the component is the 
value of the component with the same name in the first record.

I think it makes sense here for empty records, since there is a 
distinction between records and sets/arrays as types in Ptolemy and 
there is probably some motivation for having intersect be closed. It 
seems like there might be some strange cases though where distinguishing 
records from sets/arrays isn't quite correct.  For example, if we could 
do set (i.e., array) based intersection, should intersect({f=1},{g=1}) 
== intserect({1},{0}) be true or false.  Since records are really just 
special forms of sets, the answer should probably be true -- but by 
separating the two data types, the answer would probably be false.


Tobin Fricke wrote:

> On Thu, 12 Aug 2004, Shawn Bowers wrote:
>>>But it seems that Ptolemy allows empty records: intersect({foo=0},{bar=0})
>>These aren't empty records though, right? They both have one component:
>>one has foo and the other bar.  Maybe I don't understand your example.
> That expression evaluates to the empty record:
> {}
> tobin
> _______________________________________________
> kepler-dev mailing list
> kepler-dev at ecoinformatics.org
> http://www.ecoinformatics.org/mailman/listinfo/kepler-dev

More information about the Kepler-dev mailing list