eval.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef SCM_EVAL_H
  2. #define SCM_EVAL_H
  3. /* Copyright 1995-1996,1998-2004,2008-2012,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/struct.h"
  18. #include "libguile/memoize.h"
  19. /* {Options}
  20. */
  21. /* {Evaluator}
  22. */
  23. typedef SCM (*scm_t_trampoline_0) (SCM proc);
  24. typedef SCM (*scm_t_trampoline_1) (SCM proc, SCM arg1);
  25. typedef SCM (*scm_t_trampoline_2) (SCM proc, SCM arg1, SCM arg2);
  26. #define SCM_EXTEND_ENV scm_acons
  27. SCM_API SCM scm_call_0 (SCM proc);
  28. SCM_API SCM scm_call_1 (SCM proc, SCM arg1);
  29. SCM_API SCM scm_call_2 (SCM proc, SCM arg1, SCM arg2);
  30. SCM_API SCM scm_call_3 (SCM proc, SCM arg1, SCM arg2, SCM arg3);
  31. SCM_API SCM scm_call_4 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4);
  32. SCM_API SCM scm_call_5 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  33. SCM arg5);
  34. SCM_API SCM scm_call_6 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  35. SCM arg5, SCM arg6);
  36. SCM_API SCM scm_call_7 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  37. SCM arg5, SCM arg6, SCM arg7);
  38. SCM_API SCM scm_call_8 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  39. SCM arg5, SCM arg6, SCM arg7, SCM arg8);
  40. SCM_API SCM scm_call_9 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  41. SCM arg5, SCM arg6, SCM arg7, SCM arg8, SCM arg9);
  42. SCM_API SCM scm_call_n (SCM proc, SCM *argv, size_t nargs);
  43. SCM_API SCM scm_call (SCM proc, ...);
  44. SCM_API SCM scm_apply_0 (SCM proc, SCM args);
  45. SCM_API SCM scm_apply_1 (SCM proc, SCM arg1, SCM args);
  46. SCM_API SCM scm_apply_2 (SCM proc, SCM arg1, SCM arg2, SCM args);
  47. SCM_API SCM scm_apply_3 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM args);
  48. SCM_API SCM scm_nconc2last (SCM lst);
  49. SCM_API SCM scm_apply (SCM proc, SCM arg1, SCM args);
  50. #define scm_dapply(proc,arg1,args) scm_apply (proc, arg1, args)
  51. SCM_API SCM scm_map (SCM proc, SCM arg1, SCM args);
  52. SCM_API SCM scm_for_each (SCM proc, SCM arg1, SCM args);
  53. SCM_API SCM scm_primitive_eval (SCM exp);
  54. #define scm_primitive_eval_x(exp) scm_primitive_eval (exp)
  55. SCM_API SCM scm_eval (SCM exp, SCM module);
  56. #define scm_eval_x(exp, module) scm_eval (exp, module)
  57. SCM_INTERNAL void scm_init_eval (void);
  58. #endif /* SCM_EVAL_H */