Commit graph

1231 commits

Author SHA1 Message Date
Jan Nieuwenhuizen 28b3ec954b build: Remove scripts/mes symlink. 2018-04-07 18:27:26 +02:00
Jan Nieuwenhuizen 4958921abc mes: Add string-fold, string-fold-right.
* module/srfi/srfi-13.mes (string-fold, string-fold-right): New
  function.
* tests/srfi-13.test ("string-fold"): Test it.
  ("string-fold-right"): Test it.
2018-04-07 13:37:07 +02:00
Jan Nieuwenhuizen c4b0879bc9 mes: Allow tick as part of identifier.
* src/reader.c (reader_read_sexp_): Do not treat tick as special.
2018-04-07 13:36:23 +02:00
Jan Nieuwenhuizen cd0e3f8ba5 mescc: Remove debugging.
* module/language/c99/compiler.mes: Remove debugging.
2018-04-07 13:14:58 +02:00
Jan Nieuwenhuizen 83549786ed mescc: No comments in M1 when running on Mes.
* module/language/c99/compiler.mes (ast-comment): If mes?, return nil.
2018-04-07 13:13:26 +02:00
Jan Nieuwenhuizen 5867ac4afe mescc: Trace globals.
* module/language/c99/compiler.mes (mescc:trace): New function.  Use
  throughout.
2018-04-07 12:56:17 +02:00
Jan Nieuwenhuizen da724cdaa1 Revert "core: Add member."
This reverts commit 921686a0a3b06281f1804d04e6d4a0344dda507a.
2018-04-07 13:15:26 +02:00
Jan Nieuwenhuizen f33d23bca1 core: Add member.
* src/lib.c (member): New function.
* module/mes/scm.mes (member): Remove.
2018-04-07 12:18:50 +02:00
Jan Nieuwenhuizen 5e9c539f57 mescc: trace M1 dumping.
* module/language/c99/compiler.mes (info->object): Add tracing.
* module/mes/M1.mes (object->M1): Add tracing.
2018-04-07 10:24:57 +02:00
Jan Nieuwenhuizen f199694a66 Revert "guix: Update nyacc to 0.83.31."
This reverts commit 624b85d6b1dd876542f7ad342d6beb8a92408397.
2018-04-07 13:41:32 +02:00
Jan Nieuwenhuizen a6454e9e72 guix: Update nyacc to 0.83.31.
* guix.scm (nyacc): Update to 0.83.31.
2018-04-07 09:48:47 +02:00
Jan Nieuwenhuizen 8481b54097 mescc: Have Nyacc trace functions while parsing.
* guile/mescc.scm (main): Set NYACC_TRACE.
* scripts/mescc.mes (main): Set NYACC_TRACE.
2018-04-07 09:35:08 +02:00
Jan Nieuwenhuizen 6932d83d82 mes: Add setenv.
* src/posix.c (setenv_): New function.
* tests/base.test ("setenv, getenv"): Test it.
2018-04-07 09:34:02 +02:00
Jan Nieuwenhuizen bd82d5988d core: Add setenv.
* lib/libc.c (setenv): New function.
* include/stdlib.h (setenv): Declare it.
* scaffold/tests/61-array.c (test): Test it.
2018-04-07 09:21:51 +02:00
Jan Nieuwenhuizen 0fe6dc1f66 guix: Add manifest.
* build-aux/manifest.scm: New file.
2018-04-05 23:13:23 +02:00
Jan Nieuwenhuizen 70b98a8c15 guix: Update Nyacc to 0.80.42.
* guix.scm (nyacc): Update to 0.80.42.
2018-04-05 21:24:11 +02:00
Jan Nieuwenhuizen 30262dcdc1 mescc: Also print `parsing: input' when using -E.
* module/language/c99/compiler.mes (c99-input->ast): Print `parsing:
  input'.
  (c99-input->info): Remove that.
2018-04-06 07:18:19 +02:00
Jan Nieuwenhuizen b5c2bdec00 core: Cleanup reader.
* src/reader.c (reader_read_sexp_): Rename from reader_read_word_.  Cleanup.
  (read_hash): Cleanup.
2018-04-05 22:41:53 +02:00
Jan Nieuwenhuizen 35bb5869f9 mes: Cleanup formatting. 2018-04-05 21:35:31 +02:00
Jan Nieuwenhuizen 0a4030838c core: Add equal2?.
* src/lib.c (equal2_p): New function.
* module/mes/base.mes (equal2?): Remove.
2018-04-05 20:01:04 +02:00
Jan Nieuwenhuizen 6a9621ebf3 core: Add memq.
* lib/mes.c (memq): New function.
* module/mes/scm.mes (memq): Remove.
2018-04-05 11:03:09 +02:00
Jan Nieuwenhuizen 76e1b0582f mes: Remove duplicate memq.
* module/mes/base-0.mes (memq): Remove.
2018-04-05 11:02:06 +02:00
Jan Nieuwenhuizen 9fc27ee25a mes: Single environment lookup for variables, SICP chapter 3.
* src/mes.c (t): Add TVARIABLE.
  (scm_vm_eval_deref): New vm special.
  (make_vref_): New internal function.
  (eval_apply): WIP: replace symbols with their variable reference.
* src/gc.c (gc_loop): Handle TVARIABLE.
* src/lib.c (display_helper): Handle TVARIABLE.
* module/mes/type-0.mes (<cell:variable>): New variable.
  (cell:type-alist): Add it.
  (variable?): New function.
* module/mes/display.mes (display): Handle <variable>.
2017-12-09 08:33:50 +01:00
Jan Nieuwenhuizen d1444ead65 core: Remove override hook for read-input-file.
* src/reader.c (read_input_file_env): Remove override hook for
read-input-file.
2018-04-03 07:45:12 +02:00
Jan Nieuwenhuizen 4c9690996c mes: Iterative recursive macro expand.
* src/mes.c (eval_apply): Iterative recursive macro expand.
* src/posix.c (set_current_input_port): Return previous port.
* module/mes/catch.mes (%eh): Use core:display.
* module/mes/display.mes (display-cut, display-cut2): Move macro
  definitions to toplevel.
2018-03-04 10:05:55 +01:00
Jan Nieuwenhuizen 4986549f34 guix: records.scm: update from upstream.
* guile/guix/records.scm: Update from upstream.
2018-04-04 23:32:40 +02:00
Jan Nieuwenhuizen 9c8e2dbd9f mes: Add incremental test suite.
* check-boot.sh: New file.
* check.sh: Invoke it.
* module/srfi/srfi-16.mes: New file.
* scaffold/boot/00-zero.scm: New file.
* scaffold/boot/01-true.scm: New file.
* scaffold/boot/02-symbol.scm: New file.
* scaffold/boot/03-string.scm: New file.
* scaffold/boot/04-cons.scm: New file.
* scaffold/boot/04-quote.scm: New file.
* scaffold/boot/05-list.scm: New file.
* scaffold/boot/06-tick.scm: New file.
* scaffold/boot/07-if.scm: New file.
* scaffold/boot/08-if-if.scm: New file.
* scaffold/boot/10-cons.scm: New file.
* scaffold/boot/11-list.scm: New file.
* scaffold/boot/12-car.scm: New file.
* scaffold/boot/13-cdr.scm: New file.
* scaffold/boot/14-exit.scm: New file.
* scaffold/boot/15-display.scm: New file.
* scaffold/boot/16-if-eq-quote.scm: New file.
* scaffold/boot/20-define-quote.scm: New file.
* scaffold/boot/20-define-quoted.scm: New file.
* scaffold/boot/20-define.scm: New file.
* scaffold/boot/21-define-procedure.scm: New file.
* scaffold/boot/22-define-procedure-2.scm: New file.
* scaffold/boot/23-begin.scm: New file.
* scaffold/boot/24-begin-define.scm: New file.
* scaffold/boot/25-begin-define-2.scm: New file.
* scaffold/boot/26-begin-define-later.scm: New file.
* scaffold/boot/26-define-define.scm: New file.
* scaffold/boot/27-lambda-define.scm: New file.
* scaffold/boot/28-define-define.scm: New file.
* scaffold/boot/29-lambda-define.scm: New file.
* scaffold/boot/2a-lambda-lambda.scm: New file.
* scaffold/boot/2b-define-lambda.scm: New file.
* scaffold/boot/2c-define-lambda-recurse.scm: New file.
* scaffold/boot/2d-define-lambda-set.scm: New file.
* scaffold/boot/2e-define-second.scm: New file.
* scaffold/boot/30-capture.scm: New file.
* scaffold/boot/31-capture-define.scm: New file.
* scaffold/boot/32-capture-modify-close.scm: New file.
* scaffold/boot/33-procedure-override-close.scm: New file.
* scaffold/boot/34-cdr-override-close.scm: New file.
* scaffold/boot/35-closure-modify.scm: New file.
* scaffold/boot/36-closure-override.scm: New file.
* scaffold/boot/37-closure-lambda.scm: New file.
* scaffold/boot/38-simple-format.scm: New file.
* scaffold/boot/40-define-macro.scm: New file.
* scaffold/boot/41-when.scm: New file.
* scaffold/boot/42-if-when.scm: New file.
* scaffold/boot/43-or.scm: New file.
* scaffold/boot/44-or-if.scm: New file.
* scaffold/boot/45-pass-if.scm: New file.
* scaffold/boot/46-report.scm: New file.
* scaffold/boot/47-pass-if-eq.scm: New file.
* scaffold/boot/48-let.scm: New file.
* scaffold/boot/49-macro-override.scm: New file.
* scaffold/boot/4a-define-macro-define-macro.scm: New file.
* scaffold/boot/4b-define-macro-define.scm: New file.
* scaffold/boot/4c-quasiquote.scm: New file.
* scaffold/boot/50-primitive-load.scm: New file.
* scaffold/boot/51-module.scm: New file.
* scaffold/boot/52-define-module.scm: New file.
* scaffold/boot/53-closure-display.scm: New file.
* scaffold/boot/60-let-syntax.scm: New file.
* scaffold/boot/closure.scm: New file.
* scaffold/boot/compose.scm: New file.
* scaffold/boot/data/bar.mes: New file.
* scaffold/boot/data/i.scm: New file.
* scaffold/boot/data/module.mes: New file.
* scaffold/boot/foo.scm: New file.
* scaffold/boot/lambda-star.scm: New file.
* scaffold/boot/vector.scm: New file.
* tests/boot.test: New file.
* tests/boot.test-guile: New file.
* tests/srfi-16.test: New file.
* tests/srfi-16.test-guile: New file.
2018-01-25 06:58:44 +01:00
Jan Nieuwenhuizen 459e4f6a57 mes: Boot from MES_BOOT, boot-0.scm.
* src/mes.c (load_env): Softcode loading of boot-0.scm from
  environment variabl MES_BOOT.
* module/mes/boot-00.scm: New file.
* module/mes/boot-01.scm: New file.
* module/mes/boot-0.scm: Rename from read-0.mes.
* module/mes/module.mes: New file.
2018-02-03 21:43:52 +01:00
Jan Nieuwenhuizen e54c70bc00 build: Add -fno-stack-protector for debian.
* guile/guix/make.scm (%C32-FLAGS): Add -fno-stack-protector.
2018-03-04 15:53:05 +01:00
Jan Nieuwenhuizen f077364bce mes: reader: reader_ prefix; read/write char/string in core.
* src/posix.c (peek_char, read_char, read_string, unread_char, write_char): New function.
* src/reader.c: Use reader_ prefix.

r#	bootstrappable.org
2018-01-06 07:58:23 +01:00
Jan Nieuwenhuizen 91070593e9 mes: More informative error reporting for number asserts.
* src/math.c (assert_number): New function.  Update assert () users.
2018-01-25 07:00:48 +01:00
Jan Nieuwenhuizen da9d2247e0 guile: Resurrect eval/apply in scheme.
* guile/mes.mes (eval-expand): Short-circuit make-closure.
* guile/mes.scm (environment): Update.
2018-01-27 16:43:09 +01:00
Jan Nieuwenhuizen 3d93eea456 mes: simple-format: support ~A, ~S.
* module/mes/display.scm (simple-format): support ~A, ~S.
2018-02-03 20:06:38 +01:00
Jan Nieuwenhuizen d176d1bf6c core: Display and write string and char compliance.
* src/lib.c (display_helper): Display and write char and string compliance.
2018-01-22 23:45:46 +01:00
Jan Nieuwenhuizen 5a7db9749d mes: display: Support keyword.
* src/lib.c (display_helper): Support keyword.
2018-02-03 21:57:30 +01:00
Jan Nieuwenhuizen 3161f039b2 mes: display: vector.
* src/lib.c (display_helper): Display vector.
2018-01-12 18:24:42 +01:00
Jan Nieuwenhuizen 63e8b49d9e mes: display: closure names.
* src/lib.c (display_helper): Display closure names.
2018-01-14 09:11:19 +01:00
Jan Nieuwenhuizen 7b8f69972e mes: Rename make-vector to core:make-vector.
* src/vector.c (make_vector_): Rename from make_vector.  Update callers.
2018-01-07 16:26:36 +01:00
Jan Nieuwenhuizen a5ede4d4d6 mes: Better error reporting.
* src/lib.c (write_error_): New function.
* src/mes.c (error, check_apply): Use it.
  (append2, set_car_x): Upon error, call error (WAS: assert).
2018-01-07 16:08:11 +01:00
Jan Nieuwenhuizen 0fab33da36 Revert "mes: un-defmacro optargs. WIP"
This reverts commit 5da527c540dc0e1481a010899233b4e806fe37da.
2018-01-07 14:52:09 +01:00
Jan Nieuwenhuizen a8e8f0a1e3 mes: un-defmacro optargs. WIP 2018-01-06 09:29:11 +01:00
Jan Nieuwenhuizen d4f311c1df mes: Test optargs without pmatch.
* tests/optargs.test: Remove pmatch.
2018-01-06 11:18:38 +01:00
Jan Nieuwenhuizen 6f81fe41b0 mes: Add define-macro*.
* module/mes/optargs.mes (define-macro*): New macro.
2018-01-06 11:09:10 +01:00
Jan Nieuwenhuizen 5d68fc44ba mes: Evaluate test of COND only once.
* module/mes/base-0.mes (cond): Evaluate test of COND only once.
  Fixes cond tests with side effects (Nyacc).
* tests/base.test ("cond side effect"): Test it.
2018-01-05 10:01:50 +01:00
Jan Nieuwenhuizen c60e79ae11 mes: #\page is whitespace.
* module/srfi/srfi-14.mes (char-set:whitespace): Add #\page.
2018-01-04 22:26:29 +01:00
Jan Nieuwenhuizen cab272a101 mes: #<eof> is not a character.
* module/mes/display.mes (display):
* module/mes/type-0.mes (char?): -1 is not a character.
  (eof-object?): New function.
* tests/base.test ("#<eof>"): Test it.
* module/mes/scm.mes (eof-object?): Remove.
  (unread-char): Return character (WAS: integer).
2018-01-04 21:36:46 +01:00
Jan Nieuwenhuizen 0e06928320 mes: open-input-string: peek fix.
* module/mes/guile.mes (open-input-string): Return actual tell.
* tests/guile.test ("open-input-string peek"): Test it.
2018-01-04 19:32:35 +01:00
Jan Nieuwenhuizen 28d0c259ed mes: with-input-from-string: peek fix.
* module/mes/guile.mes (with-input-from-string): Return actual tell.
* tests/guile.test ("with-input-from-string peek"): Test it.
2018-01-04 18:35:26 +01:00
Jan Nieuwenhuizen fd13741eb3 mescc: Resurrect guile-1.8.
* guile/mescc.scm: Use GUILE_LOAD_COMPILED_PATH instead of -C.
  [guile]: Include syncase.
* module/language/c99/compiler.scm [guile]: Stub pretty-print-c99.
  Set stack to unlimited.
* module/language/c99/info.scm [guile]: Include (ice-9 syncase).
* module/mes/as-i386.scm [guile]: Likewise.
* module/mes/guile.scm [guile]: Add compose, export it.
2018-01-03 08:33:55 +01:00
Jan Nieuwenhuizen c5f9623c55 mes: Add string-drop-right.
* module/srfi/srfi-13.mes (string-drop-right): New function.
2018-01-03 06:53:02 +01:00