core: Remove pmatch-car, pmatch-cdr hack.

* src/mes.c (scm_vm_eval_pmatch_car, scm_vm_eval_pmatch_cdr): Remove
  (eval_apply): Remove cell_vm_eval_pmatch_car,
  cell_vm_eval_pmatch_cdr hack.
  (mes_symbols): Remove cell_symbol_pmatch_car, cell_symbol_pmatch_cdr.
* scaffold/mini-mes.c: Likewise.
* module/mes/guile.scm (mes): Remove pmatch-car, pmatch-cdr.
* module/mes/pmatch.scm (ppat): Use plain car, cdr.
This commit is contained in:
Jan Nieuwenhuizen 2018-04-28 12:19:40 +02:00
parent 7603ee1f31
commit c03449ac5a
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
4 changed files with 4 additions and 53 deletions

View file

@ -42,15 +42,12 @@
core:write
core:write-error
core:write-port
core:type
pmatch-car
pmatch-cdr
))
core:type)
;;#:re-export (open-input-file open-input-string with-input-from-string)
)
(cond-expand
(guile
(define pmatch-car car)
(define pmatch-cdr cdr)
(define core:exit exit)
(define core:display display)
(define core:display-port display)

View file

@ -74,6 +74,6 @@
((_ v (unquote var) kt kf) (let ((var v)) kt))
((_ v (x . y) kt kf)
(if (pair? v)
(ppat (pmatch-car v) x (ppat (pmatch-cdr v) y kt kf) kf)
(ppat (car v) x (ppat (cdr v) y kt kf) kf)
kf))
((_ v lit kt kf) (if (eq? v (quote lit)) kt kf))))

View file

@ -135,8 +135,6 @@ struct scm scm_symbol_mes_version = {TSYMBOL, "%version",0};
struct scm scm_symbol_car = {TSYMBOL, "car",0};
struct scm scm_symbol_cdr = {TSYMBOL, "cdr",0};
struct scm scm_symbol_pmatch_car = {TSYMBOL, "pmatch-car",0};
struct scm scm_symbol_pmatch_cdr = {TSYMBOL, "pmatch-cdr",0};
struct scm scm_vm_evlis = {TSPECIAL, "*vm-evlis*",0};
struct scm scm_vm_evlis2 = {TSPECIAL, "*vm-evlis2*",0};
@ -145,8 +143,6 @@ struct scm scm_vm_apply = {TSPECIAL, "core:apply",0};
struct scm scm_vm_apply2 = {TSPECIAL, "*vm-apply2*",0};
struct scm scm_vm_eval = {TSPECIAL, "core:eval",0};
struct scm scm_vm_eval_pmatch_car = {TSPECIAL, "*vm-eval-pmatch-car*",0};
struct scm scm_vm_eval_pmatch_cdr = {TSPECIAL, "*vm-eval-pmatch-cdr*",0};
struct scm scm_vm_eval_define = {TSPECIAL, "*vm-eval-define*",0};
struct scm scm_vm_eval_set_x = {TSPECIAL, "*vm-eval-set!*",0};

View file

@ -177,8 +177,6 @@ struct scm scm_symbol_mes_version = {TSYMBOL, "%version",0};
struct scm scm_symbol_car = {TSYMBOL, "car",0};
struct scm scm_symbol_cdr = {TSYMBOL, "cdr",0};
struct scm scm_symbol_pmatch_car = {TSYMBOL, "pmatch-car",0};
struct scm scm_symbol_pmatch_cdr = {TSYMBOL, "pmatch-cdr",0};
struct scm scm_vm_evlis = {TSPECIAL, "*vm-evlis*",0};
struct scm scm_vm_evlis2 = {TSPECIAL, "*vm-evlis2*",0};
@ -187,8 +185,6 @@ struct scm scm_vm_apply = {TSPECIAL, "core:apply",0};
struct scm scm_vm_apply2 = {TSPECIAL, "*vm-apply2*",0};
struct scm scm_vm_eval = {TSPECIAL, "core:eval",0};
struct scm scm_vm_eval_pmatch_car = {TSPECIAL, "*vm-eval-pmatch-car*",0};
struct scm scm_vm_eval_pmatch_cdr = {TSPECIAL, "*vm-eval-pmatch-cdr*",0};
struct scm scm_vm_eval_define = {TSPECIAL, "*vm-eval-define*",0};
struct scm scm_vm_eval_set_x = {TSPECIAL, "*vm-eval-set!*",0};
@ -975,8 +971,6 @@ eval_apply ()
case cell_vm_apply: goto apply;
case cell_vm_apply2: goto apply2;
case cell_vm_eval: goto eval;
case cell_vm_eval_pmatch_car: goto eval_pmatch_car;
case cell_vm_eval_pmatch_cdr: goto eval_pmatch_cdr;
case cell_vm_eval_define: goto eval_define;
case cell_vm_eval_set_x: goto eval_set_x;
case cell_vm_eval_macro_expand_eval: goto eval_macro_expand_eval;
@ -1123,26 +1117,6 @@ eval_apply ()
{
switch (CAR (r1))
{
case cell_symbol_pmatch_car:
{
push_cc (CADR (r1), r1, r0, cell_vm_eval_pmatch_car);
goto eval;
eval_pmatch_car:
x = r1;
gc_pop_frame ();
r1 = CAR (x);
goto eval_apply;
}
case cell_symbol_pmatch_cdr:
{
push_cc (CADR (r1), r1, r0, cell_vm_eval_pmatch_cdr);
goto eval;
eval_pmatch_cdr:
x = r1;
gc_pop_frame ();
r1 = CDR (x);
goto eval_apply;
}
case cell_symbol_quote:
{
x = r1;
@ -1721,12 +1695,6 @@ g_cells[cell_symbol_car] = scm_symbol_car;
g_free++;
g_cells[cell_symbol_cdr] = scm_symbol_cdr;
g_free++;
g_cells[cell_symbol_pmatch_car] = scm_symbol_pmatch_car;
g_free++;
g_cells[cell_symbol_pmatch_cdr] = scm_symbol_pmatch_cdr;
g_free++;
g_cells[cell_vm_evlis] = scm_vm_evlis;
@ -1745,12 +1713,6 @@ g_cells[cell_vm_apply2] = scm_vm_apply2;
g_free++;
g_cells[cell_vm_eval] = scm_vm_eval;
g_free++;
g_cells[cell_vm_eval_pmatch_car] = scm_vm_eval_pmatch_car;
g_free++;
g_cells[cell_vm_eval_pmatch_cdr] = scm_vm_eval_pmatch_cdr;
g_free++;
g_cells[cell_vm_eval_define] = scm_vm_eval_define;
@ -1910,8 +1872,6 @@ g_cells[cell_symbol_mes_prefix].car = cstring_to_list (scm_symbol_mes_prefix.nam
g_cells[cell_symbol_mes_version].car = cstring_to_list (scm_symbol_mes_version.name);
g_cells[cell_symbol_car].car = cstring_to_list (scm_symbol_car.name);
g_cells[cell_symbol_cdr].car = cstring_to_list (scm_symbol_cdr.name);
g_cells[cell_symbol_pmatch_car].car = cstring_to_list (scm_symbol_pmatch_car.name);
g_cells[cell_symbol_pmatch_cdr].car = cstring_to_list (scm_symbol_pmatch_cdr.name);
g_cells[cell_vm_evlis].car = cstring_to_list ("*vm*");
g_cells[cell_vm_evlis2].car = g_cells[cell_vm_evlis].car;
@ -1919,8 +1879,6 @@ g_cells[cell_vm_evlis3].car = g_cells[cell_vm_evlis].car;
g_cells[cell_vm_apply].car = g_cells[cell_vm_evlis].car;
g_cells[cell_vm_apply2].car = g_cells[cell_vm_evlis].car;
g_cells[cell_vm_eval].car = g_cells[cell_vm_evlis].car;
g_cells[cell_vm_eval_pmatch_car].car = g_cells[cell_vm_evlis].car;
g_cells[cell_vm_eval_pmatch_cdr].car = g_cells[cell_vm_evlis].car;
g_cells[cell_vm_eval_define].car = g_cells[cell_vm_evlis].car;
g_cells[cell_vm_eval_set_x].car = g_cells[cell_vm_evlis].car;
g_cells[cell_vm_eval_macro_expand_eval].car = g_cells[cell_vm_evlis].car;