memoize.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* classes: h_files */
  2. #ifndef SCM_MEMOIZE_H
  3. #define SCM_MEMOIZE_H
  4. /* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2004,2008,2009,2010,2011,2013,2014
  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. SCM_API SCM scm_sym_and;
  24. SCM_API SCM scm_sym_begin;
  25. SCM_API SCM scm_sym_case;
  26. SCM_API SCM scm_sym_cond;
  27. SCM_API SCM scm_sym_define;
  28. SCM_API SCM scm_sym_do;
  29. SCM_API SCM scm_sym_if;
  30. SCM_API SCM scm_sym_lambda;
  31. SCM_API SCM scm_sym_let;
  32. SCM_API SCM scm_sym_letstar;
  33. SCM_API SCM scm_sym_letrec;
  34. SCM_API SCM scm_sym_quote;
  35. SCM_API SCM scm_sym_quasiquote;
  36. SCM_API SCM scm_sym_unquote;
  37. SCM_API SCM scm_sym_uq_splicing;
  38. SCM_API SCM scm_sym_at;
  39. SCM_API SCM scm_sym_atat;
  40. SCM_API SCM scm_sym_delay;
  41. SCM_API SCM scm_sym_eval_when;
  42. SCM_API SCM scm_sym_arrow;
  43. SCM_API SCM scm_sym_else;
  44. SCM_API SCM scm_sym_apply;
  45. SCM_API SCM scm_sym_set_x;
  46. SCM_API SCM scm_sym_args;
  47. /* {Memoized Source}
  48. */
  49. #define SCM_MEMOIZED_TAG(x) (scm_to_uint16 (scm_car (x)))
  50. #define SCM_MEMOIZED_ARGS(x) (scm_cdr (x))
  51. enum
  52. {
  53. SCM_M_SEQ,
  54. SCM_M_IF,
  55. SCM_M_LAMBDA,
  56. SCM_M_CAPTURE_ENV,
  57. SCM_M_LET,
  58. SCM_M_QUOTE,
  59. SCM_M_CAPTURE_MODULE,
  60. SCM_M_APPLY,
  61. SCM_M_CONT,
  62. SCM_M_CALL_WITH_VALUES,
  63. SCM_M_CALL,
  64. SCM_M_LEXICAL_REF,
  65. SCM_M_LEXICAL_SET,
  66. SCM_M_BOX_REF,
  67. SCM_M_BOX_SET,
  68. SCM_M_RESOLVE,
  69. SCM_M_CALL_WITH_PROMPT
  70. };
  71. SCM_INTERNAL SCM scm_memoize_expression (SCM exp);
  72. SCM_INTERNAL SCM scm_unmemoize_expression (SCM memoized);
  73. SCM_INTERNAL SCM scm_memoized_typecode (SCM sym);
  74. SCM_INTERNAL SCM scm_sys_resolve_variable (SCM loc, SCM module);
  75. SCM_INTERNAL void scm_init_memoize (void);
  76. #endif /* SCM_MEMOIZE_H */
  77. /*
  78. Local Variables:
  79. c-file-style: "gnu"
  80. End:
  81. */