Reminded by a recent query to the list, I often get
constructions like this to select portions of a
piddle for analysis:

  $a->where($a>3)

which doesn't seem so onerous until you have this:

  $a->mv(0,-1)->rotate(3)->where($a->mv(0,-1)->rotate(3)>3)

or worse.  Many interactive computational tools have
special tokens that represent the last result.  We
could probably use one for the PDL shells too.

However, in this case, there may be a more elegant
solution by using a special token that represents
$self for PDL method calls.  That has the advantage
of less duplication of computation or memory and
even could be optimized for threaded computation
via PP.  Say we have a self() routine that returns
the desired token, the above could then be
written:

  $a->mv(0,-1)->rotate(3)->where(self>3)

--Chris

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to