Han Dong <saviola7...@gmail.com> wrote on 06/19/2010 02:45:26 PM:

> Hi,
> 
> There is this function in ValRail:
> 
> *copyTo
> *(Int src_off, Place dst_place, x10.lang.Fun_0_0<Pair<Rail<T>,Int>> 
dst_finder, Int len)
> 
> I'm not really sure what
> "x10.lang.Fun_0_0<Rail<T>,Int>> dst_finder"
> is indicating. It states that it is a
> 
> dst_finder - a function returning a
> x10.util.Pair that
> consists of the reference to the destination Rail and the offset of
> the
> first element to copy to in the destination.
> 
> What kind of variable am I supposed to pass into it?
> 
> I am trying to copy a portion of a ValRail[Pair[]] from one place to 
another
> place. Such as, at place 0, I am copying elements 0 to 5 of the ValRail 
to a
> Rail[Pair[]] at place 1.

When reading X10Doc output, please keep in mind its current limitation 
that we
are building on the Javadoc HTML generator.  Thus, the signatures you see 
are
all Java-style, and may be missing some essential X10 information, or 
encoding
it in ways that make it hard to process.

For every method where there are constructs not easily expressible in the 
Java
style, we add a "Declaration" section that gives the X10-style signature 
of
the method.  For this particular copyTo, the Declaration section states
(modulo another bug that causes missing commas):

copyTo(src_off:x10.lang.Int, dst_place:x10.lang.Place, dst_finder:()=> 
x10.util.Pair[x10.lang.Rail[T], x10.lang.Int], len:x10.lang.Int): 
x10.lang.Void

So, dst_finder is a function that takes no arguments and returns a Pair,
whose first part is a reference to a Rail[T] and whose second part is an
Int.  The reference contained in the pair should be local at the
destination.

The idea here is that the function (closure) will be invoked at the
destination to figure out what the Rail is and into what offset in the
Rail to copy the data.

Hope this helps.
        Igor
-- 
Igor Peshansky  (note the spelling change!)
IBM T.J. Watson Research Center
X10: Parallel Productivity and Performance (http://x10-lang.org/)
XJ: No More Pain for XML's Gain (http://www.research.ibm.com/xj/)
"I hear and I forget.  I see and I remember.  I do and I understand" -- 
Confucius


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to