Commit Graph

17 Commits

Author SHA1 Message Date
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 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 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 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 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 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 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 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 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
Jan Nieuwenhuizen 28b3ec954b build: Remove scripts/mes symlink. 2018-04-07 18:27:26 +02:00
Jan Nieuwenhuizen 22880ac831 scm: Support reading negative hex numbers.
* module/mes/read-0.mes (read-hex): Support negative hex numbers.
* tests/math.test ("#x-10"): New test.
* tests/read.test: Add test.
2017-03-27 00:11:05 +02:00
Jan Nieuwenhuizen e460771988 test: Allow running with any mes.
* test/base.test: Run $MES if set, default to ../scripts/mes.
* tests/base.test: Likewise.
* tests/catch.test: Likewise.
* tests/closure.test: Likewise.
* tests/cwv.test: Likewise.
* tests/display.test: Likewise.
* tests/fluids.test: Likewise.
* tests/gc-0.test: Likewise.
* tests/gc-1.test: Likewise.
* tests/gc-2.test: Likewise.
* tests/gc-2a.test: Likewise.
* tests/gc-3.test: Likewise.
* tests/gc-4.test: Likewise.
* tests/gc-5.test: Likewise.
* tests/gc-6.test: Likewise.
* tests/gc.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/psyntax.test: Likewise.
* tests/quasiquote.test: Likewise.
* tests/read.test: Likewise.
* tests/record.test: Likewise.
* tests/scm.test: Likewise.
* tests/srfi-1.test: Likewise.
* tests/srfi-13.test: Likewise.
* tests/srfi-14.test: Likewise.
* tests/vector.test: Likewise.
2017-03-26 21:06:19 +02:00
Jan Nieuwenhuizen 9896f9eb92 scm+test: Factor-out math and vector.
* module/mes/base-0.mes (quotient): Remove.
* module/mes/scm.mes (quotient): Add.
* tests/scm.test: Remove arithmetic/math tests.
* tests/math.test: New file.
* GNUmakefile (TESTS): Add it
2017-04-02 11:34:40 +02:00