Commit Graph

11 Commits

Author SHA1 Message Date
Jan Nieuwenhuizen 76f1a89cef core+mini-mes: Replace manual snippets by snarfed includes.
* build-aux/mes-snarf.scm (symbol->source, function->header,
  function->source, function->environment): Add workarounds to
  avoid struct-copy initializers.
* GNUmakefile (mini-mes): Snarf symbols and functions.
* scaffold/mini-mes.c: Include mini-mes.h, mini-mes.symbols.h,
  mini-mes.symbols.i, mini-mes.i, mini-mes.environment.i.
  Add snarfable symbol/special definitions.
  (type_t): Prefix all types with `T', update users.
  (assert_defined, gc_push_frame, gc_peek_frame, gc_init_cells): Mark
  as internal.
* mes.c (type_t): Prefix all types with `T', update users.
* scaffold/mini-mes.c (eq_p, type_, car_, cdr_,
  list_of_char_equal_p, lookup_macro, write_byte): New functions (from
  mes.c).
  (assq): Add debugging, workaround.
2017-03-10 20:56:18 +01:00
Jan Nieuwenhuizen 471bdb0af4 core: One big eval_apply.
* mes.c (eval_apply): New function.
  (eval_apply_t): New type.
  (g_target): New global.
  (vm_evlis, vm_apply_env, vm_eval_env, vm_expand_macro_env,
  vm_begin_env, vm_if_env, vm_call_with_values_env): Remove.  Update callers.
  (macro_expand_env): Rename from expand_macro_env.
* guile/mes.mes: Update callers.
* module/mes/base-0.mes: Likewise.
* module/mes/mes-0.mes: Likewise.
* module/mes/psyntax-1.mes: Likewise.
* module/mes/repl.mes: Likewise.
2016-12-22 16:34:28 +01:00
Jan Nieuwenhuizen 661954a352 Update Mes in Guile.
* guile/mes.scm: Update for guile-2.2.
* guile/mes.mes: Update from module/mes/mes-0.mes.
* guile/reader.mes: Update from module/mes/read-0.mes.
2016-12-12 20:35:19 +01:00
Jan Nieuwenhuizen 2b577eaee0 Add loadable modules.
* module/mes/base-0.mes (mes-use-module): Implement.
* module/mes: Update users.
* HACKING: Update.
* NEWS: Update.
* configure (main): Use shell expansion for prefix.
* make/install.make (install): Substitute prefix.
2016-12-12 20:35:19 +01:00
Jan Nieuwenhuizen a0709313ca core: Refactor eval.
* mes.c (eval_env): Rename from builtin_eval, Update callers.  Use switch.
2016-12-12 20:33:50 +01:00
Jan Nieuwenhuizen 97212b5765 boot: fix ignored.
* module/mes/loop-0.mes: Wrap read-file in begin.
* module/mes/mes-0.mes: Remove ignored.
2016-12-12 20:33:49 +01:00
Jan Nieuwenhuizen 1f511481a3 Fix values.
* mes.c (call): Respect any other non-value arguments.
* tests/scm.test (values, values 2, values 3, call-with-values): New test.
2016-12-12 20:33:49 +01:00
Jan Nieuwenhuizen a00e69863e Revert "Speedup boot eval/apply."
This reverts commit 6326b3103156fd79cd7bebbb351194626cc8a64b.
2016-12-12 20:33:48 +01:00
Jan Nieuwenhuizen 0bd0cb2e3e Speedup boot eval/apply.
* module/mes/mes-0.scm (apply-env, evlis, eval-expand,
  eval-quasiquote): use IF iso COND: factor 3.
  (apply-env): Use lambda iso let: another 30%.
2016-12-12 20:33:48 +01:00
Jan Nieuwenhuizen 2823fca025 Avoid gratuitous consing with begin and quasiquote.
* mes.c (apply_env, main): Call begin rather than eval with cons'ed
  symbol begin.
* module/mes/mes-0.mes (apply-env): Likewise.
* quasiquote.c (add_unquoters): cons global unquoters rather than
  creating it fresh.
* module/mes/mes-0.mes (add-unquoters): Likewise.
2016-10-23 10:08:04 +02:00
Jan Nieuwenhuizen 2586f0bb2c Move optional type predicates to type.c.
* mes.c (char_p, macro_p, number_p, pair_p, string_p, symbol_p,
  vector_p, builtin_p, boolean_p): Move to type.c
* type.c: New file.
* GNUmakefile (mes.o): Depend on type snarf output.
* module/mes/loop-0.mes (cond, map, let, or, and not, evlis-env,
  apply-env, eval-expand, uquote, add-unquoters, eval,
  expand-macro-env, eval-begin-env, eval-if-env, sexp:define,
  env:define, env:macro): Move to mes-0.mes.
* module/mes/mes-0.mes: New file.
* module/mes/type-0.mes: New file.
* scripts/include.mes: If BOOT, also include mes-0.mes.  If TYPE0,
  also include type-0.mes.
2016-10-22 12:16:19 +02:00