promises.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* classes: h_files */
  2. #ifndef SCM_PROMISES_H
  3. #define SCM_PROMISES_H
  4. /* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003,2004,2008,2009
  5. * Free Software Foundation, Inc.
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public License
  9. * as published by the Free Software Foundation; either version 3 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. */
  22. #include "libguile/__scm.h"
  23. /* {Promises}
  24. */
  25. #define SCM_F_PROMISE_COMPUTED (1L << 0)
  26. #define SCM_PROMISE_COMPUTED_P(promise) \
  27. (SCM_F_PROMISE_COMPUTED & SCM_SMOB_FLAGS (promise))
  28. #define SCM_SET_PROMISE_COMPUTED(promise) \
  29. SCM_SET_SMOB_FLAGS ((promise), SCM_F_PROMISE_COMPUTED)
  30. #define SCM_PROMISE_MUTEX SCM_SMOB_OBJECT_2
  31. #define SCM_PROMISE_DATA SCM_SMOB_OBJECT
  32. #define SCM_SET_PROMISE_DATA SCM_SET_SMOB_OBJECT
  33. SCM_API scm_t_bits scm_tc16_promise;
  34. SCM_API SCM scm_make_promise (SCM thunk);
  35. SCM_API SCM scm_force (SCM x);
  36. SCM_API SCM scm_promise_p (SCM x);
  37. SCM_INTERNAL void scm_init_promises (void);
  38. #endif /* SCM_PROMISES_H */
  39. /*
  40. Local Variables:
  41. c-file-style: "gnu"
  42. End:
  43. */