Commit Graph

146 Commits

Author SHA1 Message Date
Ekaitz 721a06fc0b tests: Make tests/vector.test compatible with Guile.
* mes/module/mes/type-0.mes (unspecified?): New function.
* tests/vector.test (make-vector): Use it to test equality rather than
rely on string comparison.
2023-08-27 10:05:20 +02:00
Ekaitz 294d8a9737 mes: iota: Make compatible with Guile.
* mes/module/mes/scm.mes (iota): Throw exception when n < 0.
* tests/scm.test: Import (mes catch).
("iota -1"): Rewrite with exception handling.
2023-08-27 10:05:17 +02:00
Jan (janneke) Nieuwenhuizen 94643f8361
mes: Remove PEG.
PEG is not used and mostly broken.

* mes/module/mes/peg.mes,
mes/module/mes/peg/cache.scm,
mes/module/mes/peg/codegen.scm,
mes/module/mes/peg/simplify-tree.scm,
mes/module/mes/peg/string-peg.scm,
mes/module/mes/peg/using-parsers.scm,
tests/peg.test: Remove.
* AUTHORS: Remove mention.
2020-12-30 17:28:21 +01:00
Jan (janneke) Nieuwenhuizen a788fcfda7
core: Add gc-stats.
* include/mes/mes.h (gc_start_time, gc_end_time, gc_time): New
variables.
* src/mes.c (init): Initialize them.
* src/gc.c: Use them.
* src/gc.c (gc_stats): New function.
* include/mes/builtins.h: Declare it.
* src/builtins.c (mes_builtins): Register it.
* tests/gc.test: Use it.
2020-12-31 10:34:07 +01:00
Jan (janneke) Nieuwenhuizen b30af2ce9f
core: make-vector: Move to core.
* src/vector.c (make_vector_): Rename from make_vector__.  Add
parameter.  Fix double allocation.
(make_vector): Rename from make_vector_.  Use arity n.  Update users.
2020-08-16 16:54:18 +02:00
Jan (janneke) Nieuwenhuizen c308778ec7
tests: Add gc.test.
* tests/gc.test: New file.
* build-aux/check-mes.sh (TESTS): Add it.
* scaffold/gc-test.scm: Remove.
2020-04-25 16:39:43 +02:00
W. J. van der Laan ce80c24ae4
mes: Make logand work correctly.
* src/math.c (logand): Start from -1 instead of 0, so that the bitwise AND-ed
result is the intersection of bit sets instead of always 0.
* tests/math.test ("logand", "logand 3"): Test it.

Co-authored-by: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
2021-04-21 08:31:37 +02:00
Jan (janneke) Nieuwenhuizen 87c3dca401
tests: Update to bin/mes for standalone run.
* tests/base.test,
tests/boot.test,
tests/macro.test,
tests/perform.test,
tests/quasiquote.test,
tests/read.test,
tests/scm.test,
tests/srfi-0.test: Default to bin/mes.
2021-01-23 08:43:48 +01:00
Jan Nieuwenhuizen d55ca711f1
build: Cater for bootstrap build.
* build-aux/build.sh.in: Build bin/mes.  Update scripts and users.
* build-aux/bootstrap.sh.in: Update.
* build-aux/install.sh.in: Install all built bin/mes-* flavours.
* configure: Drop SEED, support --bootstrap.
* configure.sh: Likewise.
2019-12-13 21:52:18 +01:00
Jan Nieuwenhuizen dd34569751
mes: string->number: Support #x-prefixed hex numbers.
* mes/module/mes/scm.mes (string->number): Support "#x"-prefix.
* tests/math.test ("string->number #hex"): Test it.
2019-08-02 22:52:46 +02:00
Jan Nieuwenhuizen 81849edb86
mes: Remove broken copy of simple-format.
* mes/module/mes/simple-format.mes: New file.
* mes/module/mes/guile.mes: Use it.
(with-output-to-string, simple-format): Remove broken copies.
* mes/module/mes/display.mes (with-output-to-string, simple-format,
format): Remove.
2019-07-19 15:36:36 +02:00
Jan Nieuwenhuizen 27d771e6ab
test: Move srfi-1 for-each and map tests to tests/srfi-1.test.
This fixes: `make check MES=guile'.

* tests/srfi-1.test ("map 1,2", "map 2,1", "for-each 1,2",
for-each 2,1"): Move from scm.test.
* tests/scm.test ("map 1,2", "map 2,1", "for-each 1,2",
for-each 2,1"): Remove.
2019-05-29 16:30:25 +02:00
Jan Nieuwenhuizen 90b384def3
mes: Support map and for-each with lists of unequal length.
* mes/module/mes/base.mes (map): Support lists of unequal length.
* mes/module/mes/scm.mes (for-each): Likewise.
* module/mescc/compile.scm (expr->register): Fix compile warning.
* tests/scm.test ("map 1,2", "map 2,1", "for-each 1,2", "for-each
2,1": Test it.
2019-03-02 14:33:58 +01:00
Jan Nieuwenhuizen 819b32e61c
core: Add string-append.
* src/strings.c (string_append): New function.
* mes/module/mes/boot-0.scm.in (string-append): Remove.
* mes/module/mes/boot-03.scm (string-append): Remove.
* scaffold/boot/50-make-string.scm (string-append): Remove.
* scaffold/boot/50-string-append.scm (string-append): Remove.
* scaffold/boot/50-string-join.scm (string-append): Remove.
* scaffold/boot/51-module.scm (string-append): Remove.
* scaffold/boot/52-define-module.scm (string-append): Remove.
* tests/macro.test (string-append): Remove.
* scaffold/boot/17-string-append.scm: Move from 50-string-append.scm.
2018-11-15 23:09:56 +01:00
Jan Nieuwenhuizen 149f2a3e51
core: String as array of bytes.
* src/strings.c: New file.
* src/mes.c: Use it.  Update users.
2018-11-11 16:25:36 +01:00
Jan Nieuwenhuizen 6b5ac57602
build: Simplify: cater for one compiler at a time.
* build-aux/build-cc.sh: Remove.
* build-aux/build-cc32.sh: Remove.
* build-aux/build-cc64.sh: Remove.
* build-aux/build-x86_64-mes.sh: Remove.
* build-aux/cc-mes.sh: Remove.
* build-aux/cc-x86_64-mes.sh: Remove.
* build-aux/cc32-mes.sh: Remove.
* build-aux/cc64-mes.sh: Remove.
* build-aux/test64.sh: Remove.
* build-aux/bootstrap-mes.sh: New file.
* build-aux/config.make.in: New file.
* build-aux/config.status.in: New file.
* build-aux/test-cc.sh: New file.
* .gitignore: Update.
* build-aux/GNUmakefile.in: Update.
* build-aux/build-guile.sh: Update.
* build-aux/build-mes.sh: Update.
* build-aux/build.sh.in: Update.
* build-aux/cc.sh: Update.
* build-aux/check-boot.sh: Update.
* build-aux/check-mes.sh: Update.
* build-aux/check-mescc.sh: Update.
* build-aux/check-tcc.sh: Update.
* build-aux/check.sh.in: Update.
* build-aux/config.sh: Update.
* build-aux/export.make: Update.
* build-aux/install.sh.in: Update.
* build-aux/pre-inst-env.in: Update.
* build-aux/test.sh: Update.
* build-aux/uninstall.sh.in: Update.
* configure: Update.
* configure.sh: Update.
* module/mescc/i386/as.scm: Update.
* module/mescc/preprocess.scm: Update.
* module/mescc/x86_64/as.scm: Update.
* scripts/mescc.in: Update.
* tests/psyntax.test: Update.
2018-11-06 20:29:35 +01:00
Jan Nieuwenhuizen 5d8e44de2c
test: Add performance test.
* module/mes/test.scm (pass-if-timeout): New macro.
* tests/perform.test: New test.
* build-aux/check-mes.sh (tests): Run it.
2018-10-21 12:04:25 +02:00
Jan Nieuwenhuizen 00dc02757b
mes: Print backtrace upon exception.
* mes/module/mes/catch.mes (display-backtrace,
frame-function): New function.
(%eh): Use them.
2018-10-20 18:24:37 +02:00
Jan Nieuwenhuizen 7da67941e2
core: Add module-define!
* src/module.c (module_define_x, module_printer): New function.
(make_initial_module): Use them.
* tests/srfi-0.test: Test it.
* src/mes.c (display_m0): Remove.  Update callers.
* mes/module/mes/fluids.mes (make-fluid): Rewrite.
* tests/macro.test: Test it.
* mes/module/mes/boot-0.scm.in (module-define!): Remove.
* mes/module/mes/boot-02.scm: Likewise.
* module/mes/misc.scm (pk, warn): New function.
* build-aux/check-mes.sh (tests): Run tests.
2018-10-14 09:10:30 +02:00
Jan Nieuwenhuizen 3e5d775b3b
mes: with-fluids: Fix reset.
* mes/module/mes/fluids.mes (with-fluids): Fix reset.
* tests/fluids.test (report): Remove Mes failure expectation.
2018-10-15 10:39:02 +02:00
Jan Nieuwenhuizen a155a0a9a2
core: Support \xNN in reader. Fixes tcc-boot running on Mes.
* src/reader.c (reader_read_string): Support \xNN.  Fixes Guix
bootstrap chain; i.e., compilation of gcc-2.95.3 using tcc-boot.
* tests/base.test ("reader: \\x08"): Test it.
* scaffold/tests/17-compare-char.c: Likewise, for mescc.
* build-aux/check-mescc.sh (tests): Run it.
2018-12-13 18:19:43 +01:00
Jan Nieuwenhuizen a8a32a5280
tests: Expect srfi-13 failure, MesCC more resembles Gcc.
* tests/srfi-13.test (report): Expect INT-MIN failure for x86.
2018-10-07 14:14:50 +02:00
Jan Nieuwenhuizen b31d431b5d
mes: Support fold-right 3.
* mes/module/srfi/srfi-1.mes (fold-right): Support fold-right 3.
* tests/srfi-1.test ("fold-right-3"): Test it.
2018-10-06 21:05:43 +02:00
Jan Nieuwenhuizen f1778a7a0c
Add missing copyright headers.
* .dir-locals.el: Add copyright header.
* AUTHORS: Likewise.
* HACKING: Likewise.
* INSTALL: Likewise.
* README: Likewise.
* build-aux/export.make: Likewise.
* build-aux/setup-mes.sh: Likewise.
* configure.sh: Likewise.
* install.sh: Likewise.
* scaffold/tests/90-goto-var.c: Likewise.
* scaffold/tests/91-goto-array.c: Likewise.
* tests/read.test: Likewise.
* uninstall.sh: Likewise.
* doc/fosdem/beamercolorthemeX.sty:
* doc/fosdem/beamerthemeX.sty:
* doc/fosdem/html.sty: Remove.
* doc/fosdem/README: New file.
* doc/images/README: New file.
2018-07-23 19:10:34 +02:00
Jan Nieuwenhuizen 72cb975213
GNU Mes.
Throughout, make these changes

   Copyright headers: GNU Mes
   First mention of name: GNU Mes
   Website: https://www.gnu.org/software/mes
   Git:     git://git.savannah.gnu.org/mes.git
2018-07-22 14:24:36 +02:00
Jan Nieuwenhuizen 87269a16f6
core: Document number->string INT-MIN failure with gcc-x86.
* src/mes.c (scm_symbol_arch, scm_symbol_compiler): New symbol.
  (mes_symbols, bload_env): Add them.
  (scm_symbol_gnuc, scm_symbol_mesc): Remove.
* scaffold/mini-mes.c: Likewise.
* module/mes/mes-0.scm (%arch, %compiler): New public variable.
* tests/srfi-13.test: Expect number->string INT-MIN to fail for
  gcc-x86.
* HACKING (Bugs): Add it.
2018-07-21 15:20:01 +02:00
Jan Nieuwenhuizen 4f2c685753
build: Refactor mes tests.
* build-aux/check-mes.sh: New file.
* check.sh: Invoke it for Guile and Mes.
* .gitignore: Ignore new guile logs.
* mes/module/mes/boot-0.scm: Ignore some standard Guile options.
* module/mes/test.scm: Make a module.
* tests/base.test: Use it.  Make a module, support invoking with Guile
  or Mes alike.
* tests/boot.test: Likewise.
* tests/catch.test: Likewise.
* tests/closure.test: Likewise.
* tests/cwv.test: Likewise.
* tests/display.test: Likewise.
* tests/fluids.test: Likewise.
* tests/getopt-long.test: Likewise.
* tests/guile.test: Likewise.
* tests/let-syntax.test: Likewise.
* tests/let.test: Likewise.
* tests/match.test: Likewise.
* tests/math.test: Likewise.
* tests/module.test: Likewise.
* tests/optargs.test: Likewise.
* tests/peg.test: Likewise.
* tests/pmatch.test: Likewise.
* tests/psyntax.test: Likewise.
* tests/quasiquote.test: Likewise.
* tests/read.test: Likewise.
* tests/scm.test: Likewise.
* tests/srfi-13.test: Likewise.
* tests/srfi-14.test: Likewise.
* tests/srfi-16.test: Likewise.
* tests/srfi-1.test: Likewise.
* tests/srfi-43.test: Likewise.
* tests/srfi-9.test: Likewise.
* tests/syntax.test: Likewise.
* tests/vector.test: Likewise.
* tests/base.test-guile: Remove.
* tests/boot.test-guile: Remove.
* tests/catch.test-guile: Remove.
* tests/closure.test-guile: Remove.
* tests/cwv.test-guile: Remove.
* tests/display.test-guile: Remove.
* tests/fluids.test-guile: Remove.
* tests/getopt-long.test-guile: Remove.
* tests/guile.test-guile: Remove.
* tests/let-syntax.test-guile: Remove.
* tests/let.test-guile: Remove.
* tests/match.test-guile: Remove.
* tests/math.test-guile: Remove.
* tests/module.test-guile: Remove.
* tests/optargs.test-guile: Remove.
* tests/peg.test-guile: Remove.
* tests/pmatch.test-guile: Remove.
* tests/psyntax.test-guile: Remove.
* tests/quasiquote.test-guile: Remove.
* tests/read.test-guile: Remove.
* tests/scm.test-guile: Remove.
* tests/srfi-13.test-guile: Remove.
* tests/srfi-14.test-guile: Remove.
* tests/srfi-16.test-guile: Remove.
* tests/srfi-1.test-guile: Remove.
* tests/srfi-43.test-guile: Remove.
* tests/srfi-9.test-guile: Remove.
* tests/syntax.test-guile: Remove.
* tests/vector.test-guile: Remove.
2018-07-21 13:48:50 +02:00
Jan Nieuwenhuizen 542289a3c6
build: Separate Mes and Guile modules.
* scaffold/gc.scm: Move from guile/gc.scm.
* guile/: Remove.
* module/language/paren.mes: Remove.
* mes/module/mes/base.mes: Move from module/mes/.
* mes/module/mes/boot-0.scm: Likewise.
* mes/module/mes/boot-00.scm: Likewise.
* mes/module/mes/boot-01.scm: Likewise.
* mes/module/mes/boot-02.scm: Likewise.
* mes/module/mes/catch.mes: Likewise.
* mes/module/mes/display.mes: Likewise.
* mes/module/mes/fluids.mes: Likewise.
* mes/module/mes/getopt-long.mes: Likewise.
* mes/module/mes/guile.mes: Likewise.
* mes/module/mes/lalr.mes: Likewise.
* mes/module/mes/lalr.scm: Likewise.
* mes/module/mes/let.mes: Likewise.
* mes/module/mes/match.mes: Likewise.
* mes/module/mes/match.scm: Likewise.
* mes/module/mes/mescc.mes: Likewise.
* mes/module/mes/misc.mes: Likewise.
* mes/module/mes/module.mes: Likewise.
* mes/module/mes/optargs.mes: Likewise.
* mes/module/mes/optargs.scm: Likewise.
* mes/module/mes/peg.mes: Likewise.
* mes/module/mes/peg/cache.scm: Likewise.
* mes/module/mes/peg/codegen.scm: Likewise.
* mes/module/mes/peg/simplify-tree.scm: Likewise.
* mes/module/mes/peg/string-peg.scm: Likewise.
* mes/module/mes/peg/using-parsers.scm: Likewise.
* mes/module/mes/pmatch.mes: Likewise.
* mes/module/mes/pmatch.scm: Likewise.
* mes/module/mes/posix.mes: Likewise.
* mes/module/mes/pretty-print.mes: Likewise.
* mes/module/mes/pretty-print.scm: Likewise.
* mes/module/mes/psyntax-0.mes: Likewise.
* mes/module/mes/psyntax-1.mes: Likewise.
* mes/module/mes/psyntax.mes: Likewise.
* mes/module/mes/psyntax.pp: Likewise.
* mes/module/mes/psyntax.ss: Likewise.
* mes/module/mes/quasiquote.mes: Likewise.
* mes/module/mes/quasisyntax.mes: Likewise.
* mes/module/mes/quasisyntax.scm: Likewise.
* mes/module/mes/repl.mes: Likewise.
* mes/module/mes/scm.mes: Likewise.
* mes/module/mes/syntax.mes: Likewise.
* mes/module/mes/syntax.scm: Likewise.
* mes/module/mes/test.mes: Likewise.
* mes/module/mes/tiny-0.mes: Likewise.
* mes/module/mes/type-0.mes: Likewise.
* mes/module/mescc/M1.mes: Likewise.
* mes/module/mescc/as.mes: Likewise.
* mes/module/mescc/bytevectors.mes: Likewise.
* mes/module/mescc/compile.mes: Likewise.
* mes/module/mescc/i386/as.mes: Likewise.
* mes/module/mescc/info.mes: Likewise.
* mes/module/mescc/mescc.mes: Likewise.
* mes/module/mescc/preprocess.mes: Likewise.
* mes/module/nyacc/lalr.mes: Likewise.
* mes/module/nyacc/lang/c99/cpp.mes: Likewise.
* mes/module/nyacc/lang/c99/parser.mes: Likewise.
* mes/module/nyacc/lang/c99/pprint.mes: Likewise.
* mes/module/nyacc/lang/calc/parser.mes: Likewise.
* mes/module/nyacc/lang/util.mes: Likewise.
* mes/module/nyacc/lex.mes: Likewise.
* mes/module/nyacc/parse.mes: Likewise.
* mes/module/nyacc/util.mes: Likewise.
* mes/module/rnrs/arithmetic/bitwise.mes: Likewise.
* mes/module/srfi/srfi-0.mes: Likewise.
* mes/module/srfi/srfi-1.mes: Likewise.
* mes/module/srfi/srfi-1.scm: Likewise.
* mes/module/srfi/srfi-13.mes: Likewise.
* mes/module/srfi/srfi-14.mes: Likewise.
* mes/module/srfi/srfi-16.mes: Likewise.
* mes/module/srfi/srfi-16.scm: Likewise.
* mes/module/srfi/srfi-26.mes: Likewise.
* mes/module/srfi/srfi-26.scm: Likewise.
* mes/module/srfi/srfi-43.mes: Likewise.
* mes/module/srfi/srfi-8.mes: Likewise.
* mes/module/srfi/srfi-9.mes: Likewise.
* mes/module/srfi/srfi-9/gnu.mes: Likewise.
* mes/module/sxml/xpath.mes: Likewise.
* mes/module/sxml/xpath.scm: Likewise.
* module/mes/mes-0.scm: Likewise.
* build-aux/build-guile.sh: Update for new layout.
* build-aux/build-mes.sh: Likewise.
* build-aux/check-boot.sh: Likewise.
* build-aux/check-mescc.sh: Likewise.
* install.sh: Likewise.
* scaffold/boot/51-module.scm: Likewise.
* scaffold/boot/52-define-module.scm: Likewise.
* scripts/mescc: Likewise.
* src/mes.c: Likewise.
* tests/base.test-guile: Likewise.
* tests/boot.test: Likewise.
* tests/srfi-9.test: Likewise.
* mes/include: New symlink.
* mes/lib: New symlink.
* AUTHORS: Update file names.
2018-07-21 07:15:52 +02:00
Jan Nieuwenhuizen cfda148e1e
mescc: Tinycc support: Minimal float support.
* lib/libc+tcc.c (ldexp, strtod, strtof, strtold): New stub.
* include/math.h (ldexp): Declare.
* include/stdlib.h (strtod, strtof, strtold): Declare.
* module/mes/scm.mes (string->number): Minimal float support.
  (inexact->exact): New function.
* tests/math.test ("string->number"): Test it.
* module/language/c99/compiler.mes (ast->type): Handle float type.
  (type->info): Likewise.
  (cstring->int): Rename from cstring->number.  Update callers.
  (cstring->float): New function.
  (expr->accu): Use it.
2018-05-18 15:28:05 +02:00
Jan Nieuwenhuizen 1cd97f1172
mes: Add unfold.
* module/srfi/srfi-1.mes (unfold): New function.
2018-05-20 13:04:20 +02:00
Jan Nieuwenhuizen 479a5ef7f1
mes: Add const.
* module/mes/scm.mes (const): New function.
* tests/scm.test ("const"): Test it.
2018-05-20 13:18:36 +02:00
Jan Nieuwenhuizen c4abd50a53
core: Add logxor.
* src/math.c (logxor): New function.
* tests/math.test ("logxor"): Test it.
2018-05-16 22:30:08 +02:00
Jan Nieuwenhuizen 7f0af1b46a
mes: string-join: Support optional delimiter, support grammar.
* module/srfi/srfi-13.mes (string-join): Support optional infix and
  grammar.
* tests/srfi-13.test ("string-join"): Test it.
2018-05-16 23:31:39 +02:00
Jan Nieuwenhuizen 04860cca6b
core: reader: Support binary #b101.
* src/reader.c (reader_read_binary): New function.
  (reader_read_hash): Use it.
* tests/scm.test ("binary"): Test it.
2018-05-16 22:32:59 +02:00
Jan Nieuwenhuizen 10bd43d222
mes: Support srfi-9-gnu.
* module/srfi/srfi-9/gnu.mes: New file.  Support srfi-9-gnu.
* tests/srfi-9.test: Test it.
* tests/srfi-9.test-guile:
2018-05-04 12:44:05 +02:00
Jan Nieuwenhuizen 99718a8b7a
core: Fixes for int-max, int-min.
* src/math.c (greater_p): Fix INT_MAX > 0.
  (less_p): Fix INT_MIN < 0.
* tests/math.test ("< INT-MIN"): Test it.
  ("< INT-MAX"):
  ("> INT-MAX"):
  ("> INT-MAX 0"):
  ("> INT-MIN"):
* tests/srfi-13.test ("string->number INT-MAX"): Test it.
  ("string->number INT-MIN"):
  ("number->string INT-MAX"):
  ("number->string INT-MIN"):
* scaffold/tests/60-math.c (test): Test it.
2018-05-02 23:11:27 +02:00
Jan Nieuwenhuizen a937d18c38
build: Simplify, drop make.scm experiment.
* build.sh: Rewrite.
* build-aux/build-cc.sh: New file.
* build-aux/build-mes.sh: New file.
* build-aux/build-mlibc.sh: New file.
* build-aux/cc.sh: New file.
* build-aux/cc-mes.sh: New file.
* build-aux/cc-mlibc.sh: New file.
* install.sh: Update.
* make.scm: Remove.
* guile/guix/make.scm: Remove.
* guile/guix/records.scm: Remove.
* guile/guix/shell-utilsg.scm: Remove.
2018-04-29 18:38:57 +02:00
Jan Nieuwenhuizen 56ef2f3f2d
mes: Add string-replace.
* module/srfi/srfi-13.mes (string-replace): New function.
* tests/srfi-13.test ("string-replace"): Test it.
2018-04-29 18:27:29 +02:00
Jan Nieuwenhuizen 563d1d92f9
mes: Add string-map.
* module/srfi/srfi-13.mes (string-map): New function.
* tests/srfi-13.test ("string-map"): Test it.
2018-04-29 18:26:46 +02:00
Jan Nieuwenhuizen 59d4d90a90
mes: Add string-trim, string-trim-right, string-trim-both.
* module/srfi/srfi-13.mes (string-trim, string-trimn-right,
  string-trim-both): New function.
* tests/srfi-13.test ("string-trim"): Test it.
  ("string-trim-right"):
  ("string-trim-both"):
2018-04-29 18:24:29 +02:00
Jan Nieuwenhuizen 3c9b5f433d
mes: Add string-contains.
* module/srfi/srfi-13.mes (string-contains): New function.
* tests/srfi-13.test ("string-contains"): Test it.
  ("string-contains not"):
2018-04-29 18:21:52 +02:00
Jan Nieuwenhuizen 1f216444f6
mes: string-drop: Error on negative droppings.
* module/srfi/srfi-13.mes (string-drop, string-take,
  string-drop-right): Error on negative droppings.
* tests/srfi-13.test ("string-drop"): Test it.
2018-04-29 18:15:04 +02:00
Jan Nieuwenhuizen 41fe739463
core: reverse!: Handle empty list.
* src/mes.c (reverse_x_): Handle empty list.
* tests/scm.test ("reverse! ()"): Test it.
2018-04-29 18:14:01 +02:00
Jan Nieuwenhuizen c6fecdc353
mescc: Merge mescc.mes and mescc.scm.
* scripts/mescc: New file.
* scripts/mescc.mes: Remove.
* guile/mescc.scm: Remove.
* guile/guix/make.scm (CC.mescc): Update.
* install.sh (TINYCC_SEED): Update.
* make.scm (bootstrap?): Update.
* test.sh (MES): Update.
* check-boot.sh: Use $GUILE to allow running without Guile.
2018-04-27 23:47:31 +02:00
Jan Nieuwenhuizen 630718f134
mes: Guile-like command-line interface.
* module/mes/boot-0.scm (tty?): Guile-like command-line interface.
* scripts/repl.mes: Remove.
* scripts/mescc.mes: Update.
* tests/*.test: Update scripts.
* module/mes/repl.mes (repl): Add ,quit.
2018-04-22 11:51:28 +02:00
Jan Nieuwenhuizen 4b6d11e990
core: append2, append_reverse, reverse, reverse!: Create less garbage.
* src/mes.c (append_reverse): New function.
  (reverse_x_): New function.
  (append2): Use them to create less garbage.
* module/mes/scm.mes (reverse): Create less garbage.
* module/srfi/srfi-1.mes (reverse!): Rewrite, use core:reverse!.
  (append-reverse): Remove.
2018-04-20 14:38:24 +02:00
Jan Nieuwenhuizen 3330948a90
core: Optimize vector-map, vector-for-each.
* module/srfi/srfi-43.mes (vector-map): Optimize.
  (vector-for-each): Optimize.
* tests/srfi-43.test: New file.
* tests/srfi-43.test-guile: New file.
* check.sh (tests): Add it.
* make.scm (mes-tests): Add it.
2018-04-20 13:06:00 +02:00
Jan Nieuwenhuizen ac0baf84d4
core: Cleanup make_cell, remove tmp cells.
* src/mes.c (make_cell__): New function.
  (make_cell_): Use it.
  (length__): New function.
  (tmp, tmp_num, tmp_num2, tmp_num_, tmp_num2_, make_tmps): Remove.
  Update callers to use make_cell__ directly.
 * src/vector.c (make_vector__): New function.
  (make_vector_): Use it.
2018-04-14 08:15:49 +02:00
Jan Nieuwenhuizen 0d0c7a415b
mes: Move base-0.mes int boot-0.scm.
* module/mes/boot-02.scm: New file, rename from boot-0.scm.
* module/mes/boot-0.scm: Add base-0.mes.
* module/mes/base-0.mes: Remove.
2018-04-14 22:06:28 +02:00
Jan Nieuwenhuizen ad135d3752 doc: Release udpate.
* HACKING: Update.
* INSTALL: Update.
* NEWS: Update.
* README: Update.
* doc/ANNOUNCE-0.12: New file.
* throughout: (janneke) coming out.
2017-11-21 19:22:26 +01:00