Hi Kenjiro, As you noted, the alias operator (=>) does not work for fields of records or classes. FWIW, this a known bug in our implementation, and not a limitation in the language.
In the meantime, you might be able to get around this problem using a primitive that does the low level C assignment. I'll send you some notes off list. -- Sung On Wed, Aug 20, 2014 at 01:05:08PM +0900, Kenjiro Taura wrote: > > Dear Chapel developers: > > Sorry if this is a frequently-asked question (I > lightly searched the web and ML archive). > > Q: how to have two records or classes point to the > same array? > > For example, a list whose cells all point to the > same array, like this: > > list > +--+ +--+ +--+ +--+ +--+ > | |-->| |-->| |-->| |-->| | > +--+ +--+ +--+ +--+ +--+ > | | | | | > +---------------------------------+ > | array | > +---------------------------------+ > > Having an alias to an array always seems tricky in > Chapel, due to its copy assignment semantics (A = > B moves the content of B into A, not making A > share the same array with B). '=>' allows two > VARIABLES point to the same array, but the trick > cannot be applied to fields, as far as I know. > > Any help appreciated. > > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > Chapel-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/chapel-developers ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Chapel-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-developers
