From 1dee5e34a3d397eb96db0b6bcc8e9cb9858975d0 Mon Sep 17 00:00:00 2001 From: marcandre Date: Sat, 8 May 2010 04:50:09 +0000 Subject: * error.c: RDoc for subclasses of Exception. [ruby-core:28394] * cont.c: ditto * enumerator.c: ditto * io.c: ditto * math.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * thread.c: ditto * transcode.c: ditto. Thanks to Run Paint for some of the documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 9539f71445..30fc2475a6 100644 --- a/proc.c +++ b/proc.c @@ -2006,6 +2006,49 @@ proc_curry(int argc, VALUE *argv, VALUE self) return make_curry_proc(self, rb_ary_new(), arity); } +/* + * Document-class: LocalJumpError + * + * Raised when Ruby can't yield as requested. + * + * A typical scenario is attempting to yield when no block is given: + * + * def call_block + * yield 42 + * end + * call_block + * + * raises the exception: + * + * LocalJumpError: no block given (yield) + * + * A more subtle example: + * + * def get_me_a_return + * Proc.new { return 42 } + * end + * get_me_a_return.call + * + * raises the exception: + * + * LocalJumpError: unexpected return + */ + +/* + * Document-class: SystemStackError + * + * Raised in case of a stack overflow. + * + * def me_myself_and_i + * me_myself_and_i + * end + * me_myself_and_i + * + * raises the exception: + * + * SystemStackError: stack level too deep + */ + /* * Proc objects are blocks of code that have been bound to * a set of local variables. Once bound, the code may be called in -- cgit v1.2.3