Limited printing?

Nicolas Sicard dransic at gmail.com
Wed Jan 16 03:29:34 PST 2013


On Wednesday, 16 January 2013 at 11:16:41 UTC, bearophile wrote:
> In Mathematica and NumPy (and other systems used with REPL) if 
> you print a very large array you receive a shortened output. In 
> Mathematica:
>
> http://reference.wolfram.com/mathematica/tutorial/ShortAndShallowOutput.html
>
> Mathematica uses a representation like (but on default it shows 
> more items. There is a way to print them all):
>
> Range[100]
>
> {0, 1, 2, <<94>>, 97, 98, 99}
>
>
> While numpy visualization is a bit simpler:
>
>>>> from numpy import array
>>>> array([0] * 10)
> array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
>>>> array([0] * 10000)
> array([0, 0, 0, ..., 0, 0, 0])
>
>
> Currently In D this shows all the items:
>
> writeln(iota(10_000));
>
> Do you desire some way to have a shortened printing if the 
> generated text is going to be huge?
>
> Bye,
> bearophile

writeln(iota(10_000).take(10)); ?



More information about the Digitalmars-d mailing list