IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New They are names of concepts, at least one analog you know
There is a fairly good introduction to them in Perl at [link|http://perl.plover.com/Stream/stream.html|http://perl.plover.c...tream/stream.html].

Put simply, a stream is an infinite stream of data from somewhere. Any amount of data you want, you have. You can implement one by having a list of data and then a function at the end that can generate as many more as you might want. Depending on who you talk to, that function might be called a promise or a generator. (The linked article calls them promises.)

The obvious analogy is a Unix pipeline. The difference is that streams and generators exist within your program, and not due to processes communicating. All of the things that you can do with pipelines translate fairly directly to streams. (And streams have other tricks as well, for instance it is easy to build a stream that merges two others, while it is hard to write that in a Unix pipleline.)

Obviously this is just a set of techniques. But it is a very powerful set of techniques to know about when you need it.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New Giggle
So you could have code that's "on a promise", then?

</silly>


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New Yes. And you're hoping that the promises are kept. :-)
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
     Interesting iterating in JavaScript trick - (ben_tilly) - (19)
         Ooooo. I like... -NT - (FuManChu)
         Very elegant. -NT - (static) - (17)
             I must be missing something - (drewk) - (16)
                 Very likely. - (static) - (4)
                     Define "streams or generators" - (drewk) - (3)
                         They are names of concepts, at least one analog you know - (ben_tilly) - (2)
                             Giggle - (pwhysall) - (1)
                                 Yes. And you're hoping that the promises are kept. :-) -NT - (ben_tilly)
                 There are several benefits - (ben_tilly) - (10)
                     Much better - (drewk) - (5)
                         Anonymous functions and closures - (ben_tilly) - (4)
                             Looks like it's treating 'i' as a reference - (drewk) - (3)
                                 I said "invocation of the function" for a reason - (ben_tilly) - (2)
                                     You're right about not getting it without using it - (drewk) - (1)
                                         I'm sure that you AREN'T using closures - (ben_tilly)
                     Can't make your example work - (drewk) - (2)
                         I think you're missing the 'anonymous' part. - (FuManChu) - (1)
                             Got it, example works now, woot -NT - (drewk)
                     I like this one better - (tuberculosis)

Narf!
92 ms