In my use of the print statement, I've run up against the 'TOO LONG TO
PRINT' issue when passing large one dimensional data sets.  Looks like I'll
have to do this by hand, but if anybody could point me to the source code
for the print statement, I'm sure that would still be quite useful.

Thanks.
David

On Fri, Jun 26, 2009 at 9:36 AM, David Mertens <[email protected]> wrote:

> Hey folks -
>
> I am pretty new to PDL but I'm having a lot of fun learning the language.
> I'm working on a graphics module that allows me to interface with Asymptote,
> a vector graphics scripting language.  Asymptote has no interface to its
> internals so instead I open a pipe to the interpreter and send commands
> directly to the interpreter.
>
> My question is this.  I would like to send piddles to Asymptote and have it
> read them in as arrays.  This way, I could use PDL for my file handling and
> data processing and then easily send the data to be plotted to Asymptote.  I
> could almost do this with pdl's print function, simply printing the pdl
> straight to the pipe, except that Asymptote expects braces and comma
> delimiters, so in PDL I would get
> [
>  [ 1 2 3 ]
>  [ 4 5 6 ]
>  [ 7 8 9 ]
> ]
> but for Asymptote I would want to have, preferably without the newlines,
> {
>  {1, 2, 3},
>  {4, 5, 6},
>  {7, 8, 9}
> }
>
> I think I could implement this with PDL::PP (though I'm not sure how to
> handle the output with C code and I've not played around with PP yet), but
> I'd rather just find the original code for pdl's print statement and hijack
> it for my command.
>
> Presently, by the way, I'm accomplishing this by opening a filehandle to a
> perl *string*, using pdl's print statment to print to that, processing it
> using regexp's, and then sending that along to the Asymptote pipe.  It works
> but I'm sure it's memory inefficient and slow; there's gotta be a better
> way.
>
> Thanks!
> David
>
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to