#| -*-Scheme-*-
-$Id: udata.scm,v 14.17 1995/07/27 21:23:12 adams Exp $
+$Id: udata.scm,v 14.18 1997/07/09 14:39:36 adams Exp $
Copyright (c) 1988-1995 Massachusetts Institute of Technology
(error "Promise already forced" promise))
(if (promise-non-expression? promise)
(error "Promise has no environment" promise))
- (system-pair-car promise))
\ No newline at end of file
+ (system-pair-car promise))
+
+(define (force promise)
+ (cond ((not (promise? promise))
+ (error:wrong-type-argument promise "promise" 'FORCE))
+ ((eq? #T (system-pair-car promise))
+ (system-pair-cdr promise))
+ ((eqv? 0 (system-pair-car promise)) ; compiled promise
+ (let ((result ((system-pair-cdr promise))))
+ (system-pair-set-cdr! promise result)
+ (system-pair-set-car! promise #T)
+ result))
+ (else ; losing old style
+ ((ucode-primitive force 1) promise))))
#| -*-Scheme-*-
-$Id: global.scm,v 14.52 1996/12/01 17:22:31 adams Exp $
+$Id: global.scm,v 14.53 1997/07/09 14:40:07 adams Exp $
Copyright (c) 1988-1996 Massachusetts Institute of Technology
;;;; Primitive Operators
(define-primitives
- force error-procedure
+ error-procedure
set-interrupt-enables! enable-interrupts! with-interrupt-mask
get-fixed-objects-vector with-history-disabled
(primitive-procedure-arity 1)
#| -*-Scheme-*-
-$Id: gconst.scm,v 1.3 1997/06/27 14:06:10 adams Exp $
+$Id: gconst.scm,v 1.4 1997/07/09 14:39:47 adams Exp $
Copyright (c) 1987-93 Massachusetts Institute of Technology
FLO:VECTOR-REF
FLO:VECTOR-SET!
FLO:ZERO?
- FORCE
GENERAL-CAR-CDR
GET-FIXED-OBJECTS-VECTOR
GET-NEXT-CONSTANT