Changeset 39670 in project


Ignore:
Timestamp:
03/11/21 21:39:22 (6 weeks ago)
Author:
Kon Lovett
Message:

fix compiled test (rebinds so no strict-types

Location:
release/5/srfi-45/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-45/trunk/srfi-45.scm

    r39663 r39670  
    3434  check-errors)
    3535
     36;unsafe
    3637(include "chicken-primitive-object-inlines")
    3738
     
    142143;; Predicates
    143144
    144 (define (lazy-promise? obj) (%lazy-promise? obj))
    145 (define (eager-promise? obj) (%eager-promise? obj))
    146 (define (recursive-promise? obj) (%recursive-promise? obj))
     145(define (lazy-promise? obj)       (%lazy-promise? obj))
     146(define (eager-promise? obj)      (%eager-promise? obj))
     147(define (recursive-promise? obj)  (%recursive-promise? obj))
    147148
    148149(define (promise? obj) (or (r5rs:promise? obj) (%recursive-promise? obj)))
     
    168169;; Force
    169170
    170 #; ;
    171171(define (force promise)
    172172  ;What kind of promise?
     
    266266      promise ) ) )
    267267
    268 ;#; ;Essentially the reference implmenentation
     268#; ;Essentially the reference implmenentation
    269269(define (force promise)
    270270  (cond
     
    304304
    305305#|
    306 ;=========================================================================
    307 ; Boxes
    308 
    309 (define (box x) (list x))
    310 (define unbox car)
    311 (define set-box! set-car!)
    312 
    313 ;=========================================================================
    314 ; Primitives for lazy evaluation:
    315 
    316 (define-syntax lazy
    317   (syntax-rules ()
    318     ((lazy exp)
    319      (box (cons 'lazy (lambda () exp))))))
    320 
    321 (define (eager x)
    322   (box (cons 'eager x)))
    323 
    324 (define-syntax delay
    325   (syntax-rules ()
    326     ((delay exp) (lazy (eager exp)))))
    327 
    328 (define (force promise)
    329   (let ((content (unbox promise)))
    330     (case (car content)
    331       ((eager) (cdr content))
    332       ((lazy)  (let* ((promise* ((cdr content)))
    333                       (content  (unbox promise)))                      ; *
    334                  (if (not (eqv? (car content) 'eager))                 ; *
    335                      (begin (set-car! content (car (unbox promise*)))
    336                             (set-cdr! content (cdr (unbox promise*)))
    337                             (set-box! promise* content)))
    338                  (force promise))))))
    339 
    340 ; (*) These two lines re-fetch and check the original promise in case
    341 ;     the first line of the let* caused it to be forced.  For an example
    342 ;     where this happens, see reentrancy test 3 below.
    343 |#
    344 
    345 #|
    346306Copyright (C) AndrŽ van Tonder (2003). All Rights Reserved.
    347307
  • release/5/srfi-45/trunk/tests/run.scm

    r39663 r39670  
    66
    77(define EGG-NAME "srfi-45")
     8
     9;! no -strict-types 4 srfi-45 !
     10;no -disable-interrupts or -no-lambda-info
     11(define *csc-options* "-inline-global -local -inline \
     12  -specialize -optimize-leaf-routines -clustering -lfa2 \
     13  -no-trace -unsafe")
    814
    915;chicken-install invokes as "<csi> -s run.scm <eggnam> <eggdir>"
     
    2834(define *current-directory* (cond-expand (unix "./") (else #f)))
    2935(define *egg* (egg-name *args*))
    30 
    31 ;no -disable-interrupts or -no-lambda-info
    32 (define *csc-options* "-inline-global -local -inline \
    33   -specialize -optimize-leaf-routines -clustering -lfa2 \
    34   -no-trace -unsafe \
    35   -strict-types")
    3636
    3737(define *test-files-rx* (irregex '(: (+ graph) #\- "test" #\. "scm")))
  • release/5/srfi-45/trunk/tests/srfi-45-test.scm

    r39663 r39670  
    11;;;; srfi-45 test
     2
     3;NOTE -strict-types will not work due to re-binding
    24
    35(import
Note: See TracChangeset for help on using the changeset viewer.