Jan Nieuwenhuizen
52ead09bc4
core: Refactor lookup_variable.
...
* src/variable.c (lookup_variable, lookup_variable_, lookup_ref): Drop
lookup/env parameter. Update users.
* mes/module/mes/boot-0.scm (defined?): Update users.
* mes/module/mes/boot-00.scm (defined?): Likewise.
* mes/module/mes/boot-01.scm (defined?): Likewise.
* mes/module/mes/boot-02.scm (defined?): Likewise.
* mes/module/mes/boot-03.scm (defined?): Likewise.
* scaffold/boot/53-closure-display.scm (guile): Likewise.
* scaffold/boot/60-let-syntax-expanded.scm (defined?): Likewise.
* src/builtins.c (mes_builtins): Update registration.
* include/mes/builtins.h: Update declarations.
* include/mes/mes.h: Likewise.
* mes/module/mes/display.mes (display): Update variable display.
2020-12-30 16:00:41 +01:00
Jan (janneke) Nieuwenhuizen
189b381d99
core: Use casting functions.
...
Silence all casting errors by using casting functions.
* src/cc.c (cast_charp_to_scmp, cast_charp_to_scmpp,
cast_voidp_to_charp, cast_scmp_to_long, cast_scmp_to_charp): New function.
* src/m2.c (cast_charp_to_scmp, cast_charp_to_scmpp,
cast_voidp_to_charp, cast_scmp_to_long, cast_scmp_to_charp): New function.
* include/mes/mes.h: Declare them.
(struct scm): Add car_value, cdr_value, function.
(g_continuations): Change to long.
* src/mes.c: Silence all casting errors by using casting functions.
2020-12-29 18:25:56 +01:00
Jan (janneke) Nieuwenhuizen
b56c5fd3d5
core: Switch to pointer cells.
...
Run
build-aux/pointer.sh
* include/mes/macros.h: Remove.
* src/*.c: Update.
* include/mes/*.h: Update.
* simple.make: Update.
* kaem.run: Update.
2020-12-29 18:11:12 +01:00
Jan (janneke) Nieuwenhuizen
762cf51a6a
core: display: Prepare for pointer cells, M2-Planet.
...
Rewrite C-constructs not supported by M2-Planet
if (foo) -> if (foo != 0)
if (!foo) -> if (foo == 0)
; -> 0;
// ... -> /* ... */
* src/display.c (display_helper): Use cell_ref.
2020-12-29 18:11:09 +01:00
Jan (janneke) Nieuwenhuizen
e21ee56574
core: Prepare for M2-Planet: if (foo).
...
Rewrite C-constructs not supported by M2-Planet
if (foo) -> if (foo != 0)
* src/posix.c: Rewrite C-constructs not supported by M2-Planet.
(current_input_port): Likewise.
* src/display.c (display_helper): : Likewise.
* src/eval-apply.c (expand_variable_): : Likewise.
(eval_apply): : Likewise.
* src/mes.c (open_boot): : Likewise.
* src/reader.c (reader_read_identifier_or_number): : Likewise.
* src/symbols.c (init_symbol): : Likewise.
2020-12-29 18:11:03 +01:00
Jan (janneke) Nieuwenhuizen
bd6d933099
core: Remove CBYTES, CSTRING, NCBYTES macros.
...
* src/gc.c (cell_bytes, news_bytes): New function.
* include/mes/macros.h (CBYTES, CSTRING, NCBYTES): Remove. Update
users.
* include/mes/m2.h: Likewise.
2020-12-29 18:10:58 +01:00
Jan (janneke) Nieuwenhuizen
5df5c1987f
core: Refactor display.
2020-12-29 18:10:57 +01:00
Jan (janneke) Nieuwenhuizen
b00d100910
core: Upcase register names.
...
* include/mes/mes.h (R0, R1, R2, R3, M0): Rename from lower case.
Update users.
2020-12-29 18:10:56 +01:00
Jan (janneke) Nieuwenhuizen
460ff0ebf5
core: Split-out display.c.
...
* src/lib.c (display_helper, display_, display_error_, display_port_,
write_, write_error_, write_port_, fdisplay_): Move to ..
* src/display.c: New file.
* build-aux/configure-lib.sh (mes_SOURCES): Add it.
* simple.make: Likewise.
2020-12-29 18:10:56 +01:00