IRC channel logs


back to list of logs

<janneke>hi amz3
<ayys>what are some good resources to understand continuations in general?
<void_pointer>ayys: that depends on whether you mean really simple usage or more complicated usage
<void_pointer>ayys: I learned continuations from
<void_pointer>never had to use them for anything other than very simple usage
<void_pointer>so I can't speak about resources for advanced usage
<ayys>thanks! I'll give it a try. I don't really understand continuations, so a basic introduction would sufice
<void_pointer>I just used them for deep returns/breaks (e.g. like return in many languages and break but more than one loop deep)
<ayys>would they be useful for implementing python-like generators?
<ayys>so for example, a list of infinite size?
<void_pointer>they can be used for many things
<void_pointer>a common usage is cooperative multi-threading
<void_pointer>infinite sequences, sometimes called streams, are usually implemented using promises in scheme if I understand it correctly
<void_pointer>not sure how promises are actually implemented
<void_pointer>one could probably implement them with continuations
<void_pointer>so, maybe
<ayys>ah I see. thanks for the pointers(pun intended). I am simply looking to learn scheme, so i am not focusing on implementations as such
<void_pointer>but I am a rather beginner scheme programmer and I am rusty since I haven't programmed in it for a bit as I have had other projects (currently have ones in C, Python + C++, and common lisp)
<void_pointer>by the way, I found immensely useful for learning scheme
<void_pointer>the other chapters in addition to the one on continuations
<void_pointer>after that, some practice, and a few other sources; it is often possible to learn things from reading the scheme standard documents themselves since the language itself is fairly small
<void_pointer>the R7RS-small document is particularly easy to understand
<void_pointer>do note, Guile does not yet implement R7RS small, but most of the functions and types are there, just not the library mappings, some functions, and slightly different behavior of some functions
<void_pointer>Guile implements R5RS and R6RS
<void_pointer>speaking of which, when learning scheme, pay attention to what version the resources are using since you might have to change a few things depending on the implementation you use. Many resources out there are for R4RS or R5RS in which case you are in good shape in Guile
<void_pointer>but you need to be careful with recent resources if they are based on R7RS
<amz3>ayys: my advice would be to no spend too much time in call/cc
<amz3>it's a useful language construct, but you rarely need it
<amz3>it's like metaclass in python
***ayys_ is now known as ayys
<civodul>scm_i_misc_mutex grmbll