... the ... function ... the ... can ... two ... Just curious here, but if a, b and c are streams, how does a + b followed by a + c evaluate (probably in the...
... Well in my language you don't usually add streams, you add "patterns". Patterns are factories for streams, so it ends up being purely functional and you...
... Earlier you talked about passing generator type things as arguments to functions, do you mean passing streams or patterns? ... Surely c.next is a...
... ideally either one. With patterns the operations would functionally compose. ... Yes c.next is imperative. But asStream is always the last step, after you...
... Backtracking in Icon is different to producing another value from a coexpression: A := create 1 to 4 B := create 1 to 3 while write(@A + @B) will write 2,...
... {} is the syntax for a function - lexical closure. 'r' is a method on the function object that returns an instance of Routine, which is a co-routine. more...
... OK so this is a crucial distinction that I missed. So you are saying that every op(@create A, @create B) is different than: every op(A, B) hmm. I'll have...
... This is not at all how monads or arrows work. No monad conceptually is imperative; it's all purely functional. Most monads don't seem like they're ...
... what if the stream is a coroutine and next means resuming that coroutine? ... The problem with this is it is very inefficient. Patterns allow me to compose...
... So the following two examples have different behaviour in Icon : procedure main(args) every write( ((1 to 3) | (10 to 30 by 10)) ) end 1 2 3 10 20 30 ...
... It's true in most (all?) useful languages in some form. Take some Ruby code (which I don't know how to translate into SC, but it shouldn't be that hard): ...
... Does this have to modify the original coroutine? Why are you making it a coroutine anyway and not just a lazylist? ... I find this hard to belive. SC is...
... contrived ... OK this doesn't work: procedure or(a, b) return (a | b) end procedure main(args) every write( or{(1 to 3), (10 to 30 by 10)} ) end Run-time...
... I don't have call/cc. ... what would be at the head of the lazy list? a coroutine. I know of no other way of suspending a computation. ... I'm not sure...
... "Conceptually" or not, some point Haskell has to mutate the state of an I/O device, or it will get nothing done. So Haskell does use monads to hide...
... What does that have to do with it? ... Lazy lists are usually constructed with recursion, or other functions where the computation boils down to recursion....
... That doesn't seem contrived to me. I think you just don't grok Icon's execution model. ... What do you mean, "achieve the same thing"? Isn't that achieving...
... if you want to get the next value by resuming a co-routine and yet have an unmodified version of it, then you need to capture the continuation. ... Yes I...
... I understand the call mechanism well enough to implement it. I don't understand how to use that call mechanism and the create and @ operations well enough...
... this could be written as procedure or(x) while suspend @x[1] while suspend @x[2] end However in order to do what I think it is you want to do, you need to ...
... Using goal directed evaluation is another way of suspending a computation. In fact the version of Wrapl I'm working on now uses only one stack to allocate...
Kokogut is a compiler of the Kogut language written in itself. http://kokogut.sourceforge.net/ New in Kokogut-0.5.1 (10 November 2004), a release with Tetris: ...
... (If I understand what you're saying,) Kogut solves this problem by having two datatypes for non-strict collections: Lazylists and generators. Generators...
... Unfortunately conflating them with collections had a bad side effect. When I implemented integration with Python, including translation of iteration...
I'm trying to find a way to iterate through all slots of an object and it's protos. Going up the chain is easy, but I need to watch so I don't print duplicate...
ok, I am back now. recently, I have not really been keeping up on the recent thread (it didn't seem that interesting to me so I stopped reading it...). also,...