[kepler-dev] Re: zero-length arrays

Edward A Lee eal at eecs.berkeley.edu
Fri Aug 13 04:34:46 PDT 2004


At 11:44 AM 8/12/2004 -0700, Tobin Fricke wrote:
>Another way would involve using matlab-esque
>array dereferencing:
>
>{1, 2, 3, 4, 5}.extract({true, false, false, true, true}) --> {1, 4, 5}
>{1, 2, 3, 4, 5}.extract({2, 3, 4, 1}) --> {2, 3, 4, 1}
>{1, 2, 3, 4, 5}.extract(0,2) --> {1, 2}
>find({true, false, false, true, true}) --> {0, 3, 4}
>
>What do you think of overloading the 'get' method with these (int,int)
>[subarray], ({int}) [list item dereferencing], and ({boolean})
>[inclusion/exclusion] forms?

I think this would be extremely useful... I would make this part
of an overall audit of the array operations available in the
expression language to create a complete set...

Edward


------------
Edward A. Lee, Professor
518 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0455, fax: 510-642-2739
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal




More information about the Kepler-dev mailing list