J
Jim Bob
I understand, in a woozy sort of way, what callcc does. What I
don't understand is what it's really good for, and furthermore, what
it's doing in Ruby.
It seems like all the explanations of callcc, in its various
implementations, stick to pretty simple examples, and almost always with
the proviso "you could more easily do this another way, but...". The
exception might be with regard to Scheme, which, I guess, lacks a
catch/throw-like mechanism, so that callcc might be the best way to
escape from a deeply nested loop. Ruby, though, obviously has catch and
throw.
With some other languages, I wouldn't think much of the inclusion of
such an apparently abstruse feature. But, from my reading of this list,
it seems like Matz is pretty conservative about adding features that
won't get used, for whatever reason. I can only guess that he'd be twice
less likely to add features that don't get used and are just plain
*weird*, as callcc seems to me even after having spent no short amount
of time trying to wrap my thick head around it.
So, how'd it get there? Is there some killer use for callcc that I'm
missing? Was it just for the "gee whiz" factor?
don't understand is what it's really good for, and furthermore, what
it's doing in Ruby.
It seems like all the explanations of callcc, in its various
implementations, stick to pretty simple examples, and almost always with
the proviso "you could more easily do this another way, but...". The
exception might be with regard to Scheme, which, I guess, lacks a
catch/throw-like mechanism, so that callcc might be the best way to
escape from a deeply nested loop. Ruby, though, obviously has catch and
throw.
With some other languages, I wouldn't think much of the inclusion of
such an apparently abstruse feature. But, from my reading of this list,
it seems like Matz is pretty conservative about adding features that
won't get used, for whatever reason. I can only guess that he'd be twice
less likely to add features that don't get used and are just plain
*weird*, as callcc seems to me even after having spent no short amount
of time trying to wrap my thick head around it.
So, how'd it get there? Is there some killer use for callcc that I'm
missing? Was it just for the "gee whiz" factor?