Merge commit 'origin/master' into vm
[bpt/guile.git] / libguile / eval.c
index 4defade..26dff82 100644 (file)
@@ -21,7 +21,7 @@
 /* SECTION: This code is compiled once.
  */
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
 
@@ -2121,7 +2121,7 @@ unmemoize_future (const SCM expr, const SCM env)
   return scm_list_2 (scm_sym_future, unmemoize_expression (thunk_expr, env));
 }
 
-#endif
+#endif /* futures disabled. */
 
 SCM_SYNTAX (s_gset_x, "set!", scm_i_makbimacro, scm_m_generalized_set_x);
 SCM_SYMBOL (scm_sym_setter, "setter");
@@ -3662,13 +3662,23 @@ scm_closure (SCM code, SCM env)
 
 scm_t_bits scm_tc16_promise;
 
-SCM 
-scm_makprom (SCM code)
-{
+SCM_DEFINE (scm_make_promise, "make-promise", 1, 0, 0, 
+           (SCM thunk),
+           "Create a new promise object.\n\n"
+            "@code{make-promise} is a procedural form of @code{delay}.\n"
+            "These two expressions are equivalent:\n"
+            "@lisp\n"
+           "(delay @var{exp})\n"
+           "(make-promise (lambda () @var{exp}))\n"
+            "@end lisp\n")
+#define FUNC_NAME s_scm_make_promise
+{
+  SCM_VALIDATE_THUNK (1, thunk);
   SCM_RETURN_NEWSMOB2 (scm_tc16_promise,
-                      SCM_UNPACK (code),
+                      SCM_UNPACK (thunk),
                       scm_make_recursive_mutex ());
 }
+#undef FUNC_NAME
 
 static SCM
 promise_mark (SCM promise)