* module/srfi/srfi-45.scm (promise?): Export.
* doc/ref/srfi-modules.texi (SRFI-45): Update docs.
* test-suite/tests/srfi-45.test: Add test. Add FSF copyright for 2010
and 2013. Add missing year to André van Tonder's copyright notice.
break if those definition are replaced by the SRFI-45 definitions of
delay and force.
+Guile also adds @code{promise?} to the list of exports, which is not
+part of the official SRFI-45.
+
+@deffn {Scheme Procedure} promise? obj
+Return true if @var{obj} is an SRFI-45 promise, otherwise return false.
+@end deffn
+
@deffn {Scheme Syntax} delay expression
Takes an expression of arbitrary type @var{a} and returns a promise of
type @code{(Promise @var{a})} which at some point in the future may be
;;; srfi-45.scm -- Primitives for Expressing Iterative Lazy Algorithms
-;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2010, 2011, 2013 Free Software Foundation, Inc.
;; Copyright (C) 2003 André van Tonder. All Rights Reserved.
;; Permission is hereby granted, free of charge, to any person
;;; Commentary:
-;; This is the code of the reference implementation of SRFI-45, slightly
-;; modified to use SRFI-9.
+;; This is the code of the reference implementation of SRFI-45, modified
+;; to use SRFI-9 and to add 'promise?' to the list of exports.
;; This module is documented in the Guile Reference Manual.
#:export (delay
lazy
force
- eager)
- #:replace (delay force)
+ eager
+ promise?)
+ #:replace (delay force promise?)
#:use-module (srfi srfi-9))
(cond-expand-provide (current-module) '(srfi-45))
;;; -*- mode: scheme; coding: utf-8; -*-
-;; Copyright André van Tonder. All Rights Reserved.
+;; Copyright (C) 2010, 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2003 André van Tonder. All Rights Reserved.
;;
;; Permission is hereby granted, free of charge, to any person
;; obtaining a copy of this software and associated documentation
;; Commented out since it takes too long
#;
(test-equal 300000000 (force (times3 100000000))) ;==> bounded space
+
+
+;======================================================================
+; Test promise? predicate (non-standard Guile extension)
+
+(pass-if "promise? predicate"
+ (promise? (delay 1)))