Changeset 36746 in project


Ignore:
Timestamp:
11/01/18 11:57:07 (2 weeks ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [176.52.204.58]: Update for new version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/forcible

    r33125 r36746  
    3131  handling.
    3232
    33 * {{Future}}s are syntactically similar to {{delay}} but evaluated in
     33* {{Future}}s are syntactically similar to {{lazy}} but evaluated in
    3434  another SRFI-18 thread.
    3535
     
    8383
    8484<syntax>(future EXPRESSION) -> PROMISE</syntax>
     85<syntax>(&begin BODY ...) -> PROMISE</syntax>
    8586
    8687Returns a promise, a delayed evaluation of {{EXPRESSION}}.  The
     
    8889{{PROMISE}} will cache exceptions returned by {{EXPRSSION}}.
    8990
     91{{&begin}} is analogous to {{future}} with {{BODY ...}} wraped in
     92{{begin}}.
     93
    9094<syntax>(future/timeout TIMEOUT EXPRESSION) -> PROMISE</syntax>
     95<syntax>(&begin/timeout TIMEOUT BODY ...) -> PROMISE</syntax>
    9196
    9297Variation of {{future}}.  The evaluation of {{EXPRESSION}} receives an
    9398exceptions for which {{timeout-condition?}} holds after {{TIMEOUT}}.
     99
     100{{&begin/timeout}} is the same as {{future/timeout}} with {{BODY ...}}
     101waped in {{begin}}.
    94102
    95103<syntax>(order EXPRESSION) -> PROMISE</syntax>
     
    117125now, otherwise returns {{#f}}.
    118126
    119 <procedure>(force OBJECT [FAIL]) -> . *</procedure>
    120 
    121 Force {{OBJECT}}.  Returns {{OBJECT}} if it is NOT a promise.
    122 Otherwise returns the values the suspended {{EXPRESSION}} returned.
     127<procedure>(force OBJECT [FAIL] [SUCCESS]) -> . *</procedure>
     128
     129Force {{OBJECT}}.  Applies {{SUCCESS}} (which defaults to {{values}})
     130to the results of the suspended {{EXPRESSION}} (or {{OBJECT}} if it is
     131NOT a promise).
    123132
    124133If {{FAIL}} is provided it must be a procedure of one argument.
    125134Exceptions raised from the {{EXPRESSION}} are passed to {{FAIL}}.
    126 
    127 This is equivalent to (but more efficiently implemented)
     135{{FAIL}} defaults to {{raise}}.
     136
     137This is equivalent to (but may be more efficiently implemented than)
    128138 (handle-exceptions ex (FAIL ex) (force OBJECT))
    129139
     
    163173=== Version History
    164174
     1750.3.9: Ported to CHICKEN 5.
     176
     1770.3.8: Bugfix.
     178
     1790.3.6: Attempted fix implementation wrt. execution in bounded space
     180actally creating a leak.
     181
    1651820.3: Added {{/timeout}}.
    166183
Note: See TracChangeset for help on using the changeset viewer.