procs.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef SCM_PROCS_H
  2. #define SCM_PROCS_H
  3. /* Copyright 1995-1996,1998-2001,2006,2008-2009,2012-2013,2018
  4. Free Software Foundation, Inc.
  5. This file is part of Guile.
  6. Guile is free software: you can redistribute it and/or modify it
  7. under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Guile is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  13. License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with Guile. If not, see
  16. <https://www.gnu.org/licenses/>. */
  17. #include "libguile/boolean.h"
  18. #include <libguile/error.h>
  19. #define SCM_VALIDATE_THUNK(pos, thunk) \
  20. do { \
  21. SCM_ASSERT (scm_is_true (scm_thunk_p (thunk)), thunk, pos, FUNC_NAME); \
  22. } while (0)
  23. #define SCM_VALIDATE_PROC(pos, proc) \
  24. do { \
  25. SCM_ASSERT (scm_is_true (scm_procedure_p (proc)), proc, pos, FUNC_NAME); \
  26. } while (0)
  27. SCM_API SCM scm_procedure_p (SCM obj);
  28. SCM_API SCM scm_thunk_p (SCM obj);
  29. SCM_API SCM scm_procedure_with_setter_p (SCM obj);
  30. SCM_API SCM scm_make_procedure_with_setter (SCM procedure, SCM setter);
  31. SCM_API SCM scm_procedure (SCM proc);
  32. SCM_API SCM scm_setter (SCM proc);
  33. SCM_INTERNAL void scm_init_procs (void);
  34. #endif /* SCM_PROCS_H */