• R/O
  • SSH

quipu: Commit

quipu mercurial repository


Commit MetaInfo

Revisión6875227bcd00b467806f2c645e96600a04c5f5df (tree)
Tiempo2020-04-09 08:43:05
AutorAgustina Arzille <avarzille@rise...>
CommiterAgustina Arzille

Log Message

Better reporting of generic function names

Cambiar Resumen

Diferencia incremental

diff -r b83d33a615ec -r 6875227bcd00 function.cpp
--- a/function.cpp Wed Apr 08 19:00:02 2020 -0300
+++ b/function.cpp Wed Apr 08 20:43:05 2020 -0300
@@ -456,14 +456,16 @@
456456 return (meth_call (interp, argv, argc));
457457
458458 case 3:
459- // Flag method.
460- if (argc != 3 || !fct_p (argv[1]) || !fct_p (argv[2]))
459+ // Flag generic function.
460+ if (argc != 4 || !fct_p (argv[2]) || !fct_p (argv[3]))
461461 qp_return (NIL);
462+ else if (symbol_p (argv[1]))
463+ as_fct(argv[3])->name = argv[1];
462464
463- as_fct(argv[2])->set_flag (function::genericfn_flag |
464- (as_fct(argv[1])->vo_full & function::kwargs_flag));
465- as_fct(argv[2])->max_argc = as_fct(argv[1])->max_argc;
466- qp_return (argv[2]);
465+ as_fct(argv[3])->set_flag (function::genericfn_flag |
466+ (as_fct(argv[2])->vo_full & function::kwargs_flag));
467+ as_fct(argv[3])->max_argc = as_fct(argv[2])->max_argc;
468+ qp_return (argv[3]);
467469
468470 case 4:
469471 return (meth_next (interp, argv + 1, argc - 1));
@@ -475,7 +477,7 @@
475477 return (meth_query (interp, argv + 1, argc - 1));
476478
477479 case 7:
478- {
480+ { // Add method to generic function.
479481 if (!genericfn_p (argv[1]))
480482 interp->raise ("arg-error", "first argument "
481483 "is not a generic function");
diff -r b83d33a615ec -r 6875227bcd00 sys.qp
--- a/sys.qp Wed Apr 08 19:00:02 2020 -0300
+++ b/sys.qp Wed Apr 08 20:43:05 2020 -0300
@@ -532,8 +532,8 @@
532532 (defct %meth-cmptypes (x y)
533533 (%meth-ctl 1 x y))
534534
535-(defct %meth-flag (nargs fn)
536- (%meth-ctl 3 nargs fn))
535+(defct %meth-flag (name meth gfn)
536+ (%meth-ctl 3 name meth gfn))
537537
538538 (defct %meth-get-argname (arg opt)
539539 (if (array-p arg)
@@ -620,7 +620,7 @@
620620 (fct (,gval ,gmeth)
621621 (if (%meth-test ,gval ,gmeth)
622622 ,gval
623- (%meth-flag ,gmeth
623+ (%meth-flag ,qn ,gmeth
624624 (let ,gval (tuple %meth-cmptypes)
625625 (fct ,fct-args
626626 ,call-expr)))))
Show on old repository browser