eval.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. /* {Ilocs}
  22. *
  23. * Ilocs are relative pointers into local environment structures.
  24. *
  25. */
  26. #define SCM_ILOCP(n) (SCM_ITAG8(n)==scm_tc8_iloc)
  27. /* {Evaluator}
  28. */
  29. typedef SCM (*scm_t_trampoline_0) (SCM proc);
  30. typedef SCM (*scm_t_trampoline_1) (SCM proc, SCM arg1);
  31. typedef SCM (*scm_t_trampoline_2) (SCM proc, SCM arg1, SCM arg2);
  32. #define SCM_EXTEND_ENV scm_acons
  33. SCM_API SCM scm_call_0 (SCM proc);
  34. SCM_API SCM scm_call_1 (SCM proc, SCM arg1);
  35. SCM_API SCM scm_call_2 (SCM proc, SCM arg1, SCM arg2);
  36. SCM_API SCM scm_call_3 (SCM proc, SCM arg1, SCM arg2, SCM arg3);
  37. SCM_API SCM scm_call_4 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4);
  38. SCM_API SCM scm_call_5 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  39. SCM arg5);
  40. SCM_API SCM scm_call_6 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  41. SCM arg5, SCM arg6);
  42. SCM_API SCM scm_call_7 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  43. SCM arg5, SCM arg6, SCM arg7);
  44. SCM_API SCM scm_call_8 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  45. SCM arg5, SCM arg6, SCM arg7, SCM arg8);
  46. SCM_API SCM scm_call_9 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4,
  47. SCM arg5, SCM arg6, SCM arg7, SCM arg8, SCM arg9);
  48. SCM_API SCM scm_call_n (SCM proc, SCM *argv, size_t nargs);
  49. SCM_API SCM scm_call (SCM proc, ...);
  50. SCM_API SCM scm_apply_0 (SCM proc, SCM args);
  51. SCM_API SCM scm_apply_1 (SCM proc, SCM arg1, SCM args);
  52. SCM_API SCM scm_apply_2 (SCM proc, SCM arg1, SCM arg2, SCM args);
  53. SCM_API SCM scm_apply_3 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM args);
  54. SCM_API SCM scm_nconc2last (SCM lst);
  55. SCM_API SCM scm_apply (SCM proc, SCM arg1, SCM args);
  56. #define scm_dapply(proc,arg1,args) scm_apply (proc, arg1, args)
  57. SCM_API SCM scm_map (SCM proc, SCM arg1, SCM args);
  58. SCM_API SCM scm_for_each (SCM proc, SCM arg1, SCM args);
  59. SCM_API SCM scm_primitive_eval (SCM exp);
  60. #define scm_primitive_eval_x(exp) scm_primitive_eval (exp)
  61. SCM_API SCM scm_eval (SCM exp, SCM module);
  62. #define scm_eval_x(exp, module) scm_eval (exp, module)
  63. SCM_INTERNAL void scm_init_eval (void);
  64. #endif /* SCM_EVAL_H */