On Fri, Apr 16, 2010 at 10:18 PM, Chris Marshall <[email protected]> wrote:

> An idea I had from working some of the PDL::Matlab
> features was supporting a string argument to pdl
> which would evaluate the input data according to
> matlab rules, so:
>
>   $a = pdl <<EOPDL;
>    [
>     [1 0 8]
>     [6 3 5]
>     [3 0 5]
>     [2 4 2]
>   ]
>    EOPDL
>
> would be one way to do this.  The nice thing about
> this extension is that it could be done without
> breaking existing code (I think) and it would support
> better interoperability with Matlab and Octave as
> well as easier cut-and-paste of examples.
>
> --Chris


Let me make sure I understand everything. Right now, as I recall, the
function pdl() can process different kinds of arguments. You can pass it (1)
a piddle, which it copies, or (2) an array reference, which it converts into
a piddle, or (3) a collection of scalars, which it converts to a piddle. It
seems like you are suggesting modifying the pdl() function to also handle
string arguments which has a matlab formatted array, or for that matter
formatted like PDL stringifies piddles. Is that correct? If so, I'm with
Maggie. I think it's a great idea. It may be a bit tricky differentiating
between a single scalar argument passed to pdl() vs a string containing an
array, but that's still a very doable task.

At this point we'll need to have the code written, tests written, and
documentation written. Do you have any tuits for this? I'd be happy to help
with any of those pieces.

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

Reply via email to