Project

General

Profile

Bug #6706 ยป 0001-Improve-documentation-of-Continuation.patch

oscardelben (Oscar Del Ben), 07/08/2012 08:14 AM

View differences:

cont.c
799 799
/*
800 800
 *  Document-class: Continuation
801 801
 *
802
 *  Continuation objects are generated by <code>Kernel#callcc</code>,
803
 *  after having <code>require</code>d <i>continuation</i>. They hold
802
 *  Continuation objects are generated by Kernel#callcc,
803
 *  after having +require+d <i>continuation</i>. They hold
804 804
 *  a return address and execution context, allowing a nonlocal return
805 805
 *  to the end of the <code>callcc</code> block from anywhere within a
806
 *  program.  Continuations are somewhat analogous to a structured
806
 *  program. Continuations are somewhat analogous to a structured
807 807
 *  version of C's <code>setjmp/longjmp</code> (although they contain
808 808
 *  more state, so you might consider them closer to threads).
809 809
 *
......
849 849
 *  call-seq:
850 850
 *     callcc {|cont| block }   ->  obj
851 851
 *
852
 *  Generates a <code>Continuation</code> object, which it passes to
852
 *  Generates a Continuation object, which it passes to
853 853
 *  the associated block. You need to <code>require
854 854
 *  'continuation'</code> before using this method. Performing a
855
 *  <em>cont</em><code>.call</code> will cause the <code>callcc</code>
855
 *  <em>cont</em><code>.call</code> will cause the #callcc
856 856
 *  to return (as will falling through the end of the block). The
857
 *  value returned by the <code>callcc</code> is the value of the
857
 *  value returned by the #callcc is the value of the
858 858
 *  block, or the value passed to <em>cont</em><code>.call</code>. See
859
 *  class <code>Continuation</code> for more details. Also see
860
 *  <code>Kernel::throw</code> for an alternative mechanism for
859
 *  class Continuation for more details. Also see
860
 *  Kernel#throw for an alternative mechanism for
861 861
 *  unwinding a call stack.
862 862
 */
863 863

  
864
-