ebmtra...@gmail.com
unread,Apr 23, 2013, 5:05:50 PM4/23/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pure...@googlegroups.com
Hi list,
I'm a new pure user and I already have one question about streams and interactive mode.
Suppose a stream of one's is created:
> let ones = [1 | i=1..inf] &;
Then use some of them:
> list $ take 3 ones;
[1,1,1]
Finally, inspect the current state about that stream:
> show ones
let ones = 1:1:1:#<thunk 0xb55ad578>;
All is allright. Now, suppose I want to create my stream like this:
> let ones = 1 : ones &;
I still can use it:
> list $ take 3 ones;
[1,1,1]
but now, I can't inspect it:
> show ones
terminate called after throwing an instance of 'St9bad_alloc'
what(): std::bad_alloc
Abandon (core dumped)
Is it a bug or is it intrinsicly unsafe to define a stream this way ?