Changeset 10035 in project


Ignore:
Timestamp:
03/22/08 03:15:13 (11 years ago)
Author:
kon
Message:

Rel 1.2, not unsafe but no proc/bnd chks. Registers feature.

Location:
release/3/srfi-45
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/3/srfi-45/tags/1.2/srfi-45-eggdoc.scm

    r8944 r10035  
    33(use eggdoc)
    44
    5 (define license #<<EOF
    6 "Copyright (c) 2006, Kon Lovett.  All rights reserved.
     5(define license
     6#<<EOF
     7Copyright (c) 2006, Kon Lovett.  All rights reserved.
    78
    89Permission is hereby granted, free of charge, to any person obtaining a
     
    3435                (author
    3536                        (url "mailto:klovett@pacbell.net" "Kon Lovett"))
    36                 (history
    37                         (version "1.1" "Bugfix for test run, added box requirement.")
    38                         (version "1.0" "Initial release"))
    3937                (usage)
    4038                (requires
     
    4442                (documentation
    4543
    46                         (p "Extends the interpretation of a "promise" to include "lazy"
    47                         and "eager" promises. Unlike the reference implementation this
    48                         version does not redefine 'delay'.")
     44                        (p "Extends the interpretation of a \"promise\" to include \"lazy\" "
     45                        "and \"eager\" promises. Unlike the reference implementation this "
     46                        "version does not redefine 'delay'.")
    4947
    5048                        (p "For more information see " (url
     
    5553                                "EXPRESSION") ".")
    5654
    57                                 (p "Note that 'delay' is " (i "not") " re-defined here.
    58                                 Mentioned only for completeness."))
     55                                (p "Note that 'delay' is " (i "not") " re-defined here. "
     56                                "Mentioned only for completeness."))
    5957
    6058                        (macro "(lazy EXPRESSION)"
    6159                                (p "Returns a promise for " (tt "EXPRESSION") ".")
    6260
    63                                 (p "The promise will be iteratively forced, overwriting the
    64                                 promise at each step before the next iteration, so as to avoid
    65                                 storage leaks."))
     61                                (p "The promise will be iteratively forced, overwriting the "
     62                                "promise at each step before the next iteration, so as to avoid "
     63                                "storage leaks."))
    6664
    6765                        (macro "(eager EXPRESSION)"
     
    6967                                "EXPRESSION") ".")
    7068
    71                                 (p "Not much of a promise, more of a boxed value. For exposition
    72                                 purposes in algorithms."))
     69                                (p "Not much of a promise, more of a boxed value. For exposition "
     70                                "purposes in algorithms."))
    7371
    7472                        (procedure "(force OBJECT)"
    75                                 (p "Assuming the " (tt "OBJECT") " is some kind of promise,
    76                                 returns the result of the delayed evaluation."))
     73                                (p "Assuming the " (tt "OBJECT") " is some kind of promise, "
     74                                "returns the result of the delayed evaluation."))
    7775
    7876                        (procedure "(standard-force OBJECT)"
    79                                 (p "Assuming the " (tt "OBJECT") " is a standard promise,
    80                                 returns the result of the delayed evaluation.")
     77                                (p "Assuming the " (tt "OBJECT") " is a standard promise, "
     78                                "returns the result of the delayed evaluation.")
    8179
    8280                                (p "The R5RS 'force'."))
     
    9694                        (procedure "(eager-promise? OBJECT)"
    9795                                (p "Eager recursive promise?"))
     96                )
    9897
    99                         (p "This egg is " (b "unsafe") "!")
    100                 )
     98                (history
     99                        (version "1.2" "Not unsafe, but no checks.")
     100                        (version "1.1" "Bugfix for test run, added box requirement.")
     101                        (version "1.0" "Initial release"))
    101102
    102103                (section "License" (pre ,license))
  • release/3/srfi-45/tags/1.2/srfi-45-support.scm

    r10025 r10035  
    4141    (usual-integrations)
    4242    (inline)
     43    (no-procedure-checks)
     44    (no-bound-checks)
    4345    (export
    4446      lazy-promise?
     
    5254(use box)
    5355
    54 (register-feature 'srfi-45)
     56(register-feature! 'srfi-45)
    5557
    5658;;; Originals
     
    6466(define (lazy-promise? obj)
    6567  (and (box? obj)
    66     (let ([boxed (box-ref obj)])
    67       (and (pair? boxed) (eq? 'lazy (car boxed))))) )
     68       (let ([boxed (box-ref obj)])
     69         (and (pair? boxed) (eq? 'lazy (car boxed))))) )
    6870
    6971(define (eager-promise? obj)
    7072  (and (box? obj)
    71     (let ([boxed (box-ref obj)])
    72       (and (pair? boxed) (eq? 'eager (car boxed))))) )
     73       (let ([boxed (box-ref obj)])
     74         (and (pair? boxed) (eq? 'eager (car boxed))))) )
    7375
    7476(define (recursive-promise? obj)
     
    7880  (or (standard-promise? obj) (recursive-promise? obj)) )
    7981
    80 ;;; The guts
     82;;; Force
    8183
    8284(define (force obj)
     
    8688        (if (pair? content)
    8789            (let ([value (cdr content)])
    88               (switch (car content)
    89                 ['eager
     90              (case (car content)
     91                [(eager)
    9092                  value]
    91                 ['lazy
     93                [(lazy)
    9294                  (cond [(standard-promise? value)  ; Wrapped baseline promise
    9395                          (standard-force value)]
  • release/3/srfi-45/tags/1.2/srfi-45.html

    r8944 r10035  
    156156<h3>Author</h3><a href="mailto:klovett@pacbell.net">Kon Lovett</a></div>
    157157<div class="section">
    158 <h3>Version</h3>
    159 <ul>
    160 <li>1.1 Bugfix for test run, added box requirement.</li>
    161 <li>1.0 Initial release</li></ul></div>
    162 <div class="section">
    163158<h3>Usage</h3><tt>(require-extension srfi-45)</tt></div>
    164159<div class="section">
     
    170165<div class="section">
    171166<h3>Documentation</h3>
    172 <p>Extends the interpretation of a promise to include lazy
    173                         and eager promises. Unlike the reference implementation this
    174                         version does not redefine 'delay'.</p>
     167<p>Extends the interpretation of a &quot;promise&quot; to include &quot;lazy&quot; and &quot;eager&quot; promises. Unlike the reference implementation this version does not redefine 'delay'.</p>
    175168<p>For more information see <a href="http://srfi.schemers.org/srfi-45/srfi-45.html">SRFI-45</a>.</p>
    176169<dt class="definition"><strong>macro:</strong> (delay EXPRESSION)</dt>
    177170<dd>
    178171<p>Returns a promise, a delayed evaluation of <tt>EXPRESSION</tt>.</p>
    179 <p>Note that 'delay' is <i>not</i> re-defined here.
    180                                 Mentioned only for completeness.</p></dd>
     172<p>Note that 'delay' is <i>not</i> re-defined here. Mentioned only for completeness.</p></dd>
    181173<dt class="definition"><strong>macro:</strong> (lazy EXPRESSION)</dt>
    182174<dd>
    183175<p>Returns a promise for <tt>EXPRESSION</tt>.</p>
    184 <p>The promise will be iteratively forced, overwriting the
    185                                 promise at each step before the next iteration, so as to avoid
    186                                 storage leaks.</p></dd>
     176<p>The promise will be iteratively forced, overwriting the promise at each step before the next iteration, so as to avoid storage leaks.</p></dd>
    187177<dt class="definition"><strong>macro:</strong> (eager EXPRESSION)</dt>
    188178<dd>
    189179<p>Returns a promise but immediately evaluates <tt>EXPRESSION</tt>.</p>
    190 <p>Not much of a promise, more of a boxed value. For exposition
    191                                 purposes in algorithms.</p></dd>
     180<p>Not much of a promise, more of a boxed value. For exposition purposes in algorithms.</p></dd>
    192181<dt class="definition"><strong>procedure:</strong> (force OBJECT)</dt>
    193182<dd>
    194 <p>Assuming the <tt>OBJECT</tt> is some kind of promise,
    195                                 returns the result of the delayed evaluation.</p></dd>
     183<p>Assuming the <tt>OBJECT</tt> is some kind of promise, returns the result of the delayed evaluation.</p></dd>
    196184<dt class="definition"><strong>procedure:</strong> (standard-force OBJECT)</dt>
    197185<dd>
    198 <p>Assuming the <tt>OBJECT</tt> is a standard promise,
    199                                 returns the result of the delayed evaluation.</p>
     186<p>Assuming the <tt>OBJECT</tt> is a standard promise, returns the result of the delayed evaluation.</p>
    200187<p>The R5RS 'force'.</p></dd>
    201188<dt class="definition"><strong>procedure:</strong> (promise? OBJECT)</dt>
     
    213200<dt class="definition"><strong>procedure:</strong> (eager-promise? OBJECT)</dt>
    214201<dd>
    215 <p>Eager recursive promise?</p></dd>
    216 <p>This egg is <b>unsafe</b>!</p></div>
     202<p>Eager recursive promise?</p></dd></div>
     203<div class="section">
     204<h3>Version</h3>
     205<ul>
     206<li>1.2 Not unsafe, but no checks.</li>
     207<li>1.1 Bugfix for test run, added box requirement.</li>
     208<li>1.0 Initial release</li></ul></div>
    217209<div class="section">
    218210<h3>License</h3>
    219 <pre>&quot;Copyright (c) 2006, Kon Lovett.  All rights reserved.
     211<pre>Copyright (c) 2006, Kon Lovett.  All rights reserved.
    220212
    221213Permission is hereby granted, free of charge, to any person obtaining a
  • release/3/srfi-45/tags/1.2/srfi-45.setup

    r8944 r10035  
    33(required-extension-version 'box "1.7")
    44
    5 (install-dynld+syntax+docu srfi-45 srfi-45-support *version* -O3 -d0)
     5(install-dynld+syntax+docu srfi-45 srfi-45-support *version*)
  • release/3/srfi-45/trunk/srfi-45-eggdoc.scm

    r8944 r10035  
    33(use eggdoc)
    44
    5 (define license #<<EOF
    6 "Copyright (c) 2006, Kon Lovett.  All rights reserved.
     5(define license
     6#<<EOF
     7Copyright (c) 2006, Kon Lovett.  All rights reserved.
    78
    89Permission is hereby granted, free of charge, to any person obtaining a
     
    3435                (author
    3536                        (url "mailto:klovett@pacbell.net" "Kon Lovett"))
    36                 (history
    37                         (version "1.1" "Bugfix for test run, added box requirement.")
    38                         (version "1.0" "Initial release"))
    3937                (usage)
    4038                (requires
     
    4442                (documentation
    4543
    46                         (p "Extends the interpretation of a "promise" to include "lazy"
    47                         and "eager" promises. Unlike the reference implementation this
    48                         version does not redefine 'delay'.")
     44                        (p "Extends the interpretation of a \"promise\" to include \"lazy\" "
     45                        "and \"eager\" promises. Unlike the reference implementation this "
     46                        "version does not redefine 'delay'.")
    4947
    5048                        (p "For more information see " (url
     
    5553                                "EXPRESSION") ".")
    5654
    57                                 (p "Note that 'delay' is " (i "not") " re-defined here.
    58                                 Mentioned only for completeness."))
     55                                (p "Note that 'delay' is " (i "not") " re-defined here. "
     56                                "Mentioned only for completeness."))
    5957
    6058                        (macro "(lazy EXPRESSION)"
    6159                                (p "Returns a promise for " (tt "EXPRESSION") ".")
    6260
    63                                 (p "The promise will be iteratively forced, overwriting the
    64                                 promise at each step before the next iteration, so as to avoid
    65                                 storage leaks."))
     61                                (p "The promise will be iteratively forced, overwriting the "
     62                                "promise at each step before the next iteration, so as to avoid "
     63                                "storage leaks."))
    6664
    6765                        (macro "(eager EXPRESSION)"
     
    6967                                "EXPRESSION") ".")
    7068
    71                                 (p "Not much of a promise, more of a boxed value. For exposition
    72                                 purposes in algorithms."))
     69                                (p "Not much of a promise, more of a boxed value. For exposition "
     70                                "purposes in algorithms."))
    7371
    7472                        (procedure "(force OBJECT)"
    75                                 (p "Assuming the " (tt "OBJECT") " is some kind of promise,
    76                                 returns the result of the delayed evaluation."))
     73                                (p "Assuming the " (tt "OBJECT") " is some kind of promise, "
     74                                "returns the result of the delayed evaluation."))
    7775
    7876                        (procedure "(standard-force OBJECT)"
    79                                 (p "Assuming the " (tt "OBJECT") " is a standard promise,
    80                                 returns the result of the delayed evaluation.")
     77                                (p "Assuming the " (tt "OBJECT") " is a standard promise, "
     78                                "returns the result of the delayed evaluation.")
    8179
    8280                                (p "The R5RS 'force'."))
     
    9694                        (procedure "(eager-promise? OBJECT)"
    9795                                (p "Eager recursive promise?"))
     96                )
    9897
    99                         (p "This egg is " (b "unsafe") "!")
    100                 )
     98                (history
     99                        (version "1.2" "Not unsafe, but no checks.")
     100                        (version "1.1" "Bugfix for test run, added box requirement.")
     101                        (version "1.0" "Initial release"))
    101102
    102103                (section "License" (pre ,license))
  • release/3/srfi-45/trunk/srfi-45-support.scm

    r10025 r10035  
    4141    (usual-integrations)
    4242    (inline)
     43    (no-procedure-checks)
     44    (no-bound-checks)
    4345    (export
    4446      lazy-promise?
     
    5254(use box)
    5355
    54 (register-feature 'srfi-45)
     56(register-feature! 'srfi-45)
    5557
    5658;;; Originals
     
    6466(define (lazy-promise? obj)
    6567  (and (box? obj)
    66     (let ([boxed (box-ref obj)])
    67       (and (pair? boxed) (eq? 'lazy (car boxed))))) )
     68       (let ([boxed (box-ref obj)])
     69         (and (pair? boxed) (eq? 'lazy (car boxed))))) )
    6870
    6971(define (eager-promise? obj)
    7072  (and (box? obj)
    71     (let ([boxed (box-ref obj)])
    72       (and (pair? boxed) (eq? 'eager (car boxed))))) )
     73       (let ([boxed (box-ref obj)])
     74         (and (pair? boxed) (eq? 'eager (car boxed))))) )
    7375
    7476(define (recursive-promise? obj)
     
    7880  (or (standard-promise? obj) (recursive-promise? obj)) )
    7981
    80 ;;; The guts
     82;;; Force
    8183
    8284(define (force obj)
     
    8688        (if (pair? content)
    8789            (let ([value (cdr content)])
    88               (switch (car content)
    89                 ['eager
     90              (case (car content)
     91                [(eager)
    9092                  value]
    91                 ['lazy
     93                [(lazy)
    9294                  (cond [(standard-promise? value)  ; Wrapped baseline promise
    9395                          (standard-force value)]
  • release/3/srfi-45/trunk/srfi-45.html

    r8944 r10035  
    156156<h3>Author</h3><a href="mailto:klovett@pacbell.net">Kon Lovett</a></div>
    157157<div class="section">
    158 <h3>Version</h3>
    159 <ul>
    160 <li>1.1 Bugfix for test run, added box requirement.</li>
    161 <li>1.0 Initial release</li></ul></div>
    162 <div class="section">
    163158<h3>Usage</h3><tt>(require-extension srfi-45)</tt></div>
    164159<div class="section">
     
    170165<div class="section">
    171166<h3>Documentation</h3>
    172 <p>Extends the interpretation of a promise to include lazy
    173                         and eager promises. Unlike the reference implementation this
    174                         version does not redefine 'delay'.</p>
     167<p>Extends the interpretation of a &quot;promise&quot; to include &quot;lazy&quot; and &quot;eager&quot; promises. Unlike the reference implementation this version does not redefine 'delay'.</p>
    175168<p>For more information see <a href="http://srfi.schemers.org/srfi-45/srfi-45.html">SRFI-45</a>.</p>
    176169<dt class="definition"><strong>macro:</strong> (delay EXPRESSION)</dt>
    177170<dd>
    178171<p>Returns a promise, a delayed evaluation of <tt>EXPRESSION</tt>.</p>
    179 <p>Note that 'delay' is <i>not</i> re-defined here.
    180                                 Mentioned only for completeness.</p></dd>
     172<p>Note that 'delay' is <i>not</i> re-defined here. Mentioned only for completeness.</p></dd>
    181173<dt class="definition"><strong>macro:</strong> (lazy EXPRESSION)</dt>
    182174<dd>
    183175<p>Returns a promise for <tt>EXPRESSION</tt>.</p>
    184 <p>The promise will be iteratively forced, overwriting the
    185                                 promise at each step before the next iteration, so as to avoid
    186                                 storage leaks.</p></dd>
     176<p>The promise will be iteratively forced, overwriting the promise at each step before the next iteration, so as to avoid storage leaks.</p></dd>
    187177<dt class="definition"><strong>macro:</strong> (eager EXPRESSION)</dt>
    188178<dd>
    189179<p>Returns a promise but immediately evaluates <tt>EXPRESSION</tt>.</p>
    190 <p>Not much of a promise, more of a boxed value. For exposition
    191                                 purposes in algorithms.</p></dd>
     180<p>Not much of a promise, more of a boxed value. For exposition purposes in algorithms.</p></dd>
    192181<dt class="definition"><strong>procedure:</strong> (force OBJECT)</dt>
    193182<dd>
    194 <p>Assuming the <tt>OBJECT</tt> is some kind of promise,
    195                                 returns the result of the delayed evaluation.</p></dd>
     183<p>Assuming the <tt>OBJECT</tt> is some kind of promise, returns the result of the delayed evaluation.</p></dd>
    196184<dt class="definition"><strong>procedure:</strong> (standard-force OBJECT)</dt>
    197185<dd>
    198 <p>Assuming the <tt>OBJECT</tt> is a standard promise,
    199                                 returns the result of the delayed evaluation.</p>
     186<p>Assuming the <tt>OBJECT</tt> is a standard promise, returns the result of the delayed evaluation.</p>
    200187<p>The R5RS 'force'.</p></dd>
    201188<dt class="definition"><strong>procedure:</strong> (promise? OBJECT)</dt>
     
    213200<dt class="definition"><strong>procedure:</strong> (eager-promise? OBJECT)</dt>
    214201<dd>
    215 <p>Eager recursive promise?</p></dd>
    216 <p>This egg is <b>unsafe</b>!</p></div>
     202<p>Eager recursive promise?</p></dd></div>
     203<div class="section">
     204<h3>Version</h3>
     205<ul>
     206<li>1.2 Not unsafe, but no checks.</li>
     207<li>1.1 Bugfix for test run, added box requirement.</li>
     208<li>1.0 Initial release</li></ul></div>
    217209<div class="section">
    218210<h3>License</h3>
    219 <pre>&quot;Copyright (c) 2006, Kon Lovett.  All rights reserved.
     211<pre>Copyright (c) 2006, Kon Lovett.  All rights reserved.
    220212
    221213Permission is hereby granted, free of charge, to any person obtaining a
  • release/3/srfi-45/trunk/srfi-45.setup

    r8944 r10035  
    33(required-extension-version 'box "1.7")
    44
    5 (install-dynld+syntax+docu srfi-45 srfi-45-support *version* -O3 -d0)
     5(install-dynld+syntax+docu srfi-45 srfi-45-support *version*)
Note: See TracChangeset for help on using the changeset viewer.