public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* n arity with method
@ 2023-11-16 22:53 Damien Mattei
  2023-11-18 11:14 ` Damien Mattei
  0 siblings, 1 reply; 7+ messages in thread
From: Damien Mattei @ 2023-11-16 22:53 UTC (permalink / raw)
  To: kawa mailing list

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

(import (rename (scheme base) (* orig*)))

(define * (make-procedure method: (lambda (x ::number y ::number) (orig* x
y))
 method: (lambda (x ::matrix y ::matrix) (multiply-matrix-matrix  x y))
 method: (lambda (x ::matrix y ::vector) (multiply-matrix-vector  x y))))

is there a way to still have * a n-arity operator with typed methods ?
because now i have this error:
(* 2 3 4)
Argument  (null) has wrong type
at gnu.mapping.CallContext.matchError(CallContext.java:185)
at gnu.expr.GenericProc.applyToConsumerGP(GenericProc.java:132)
at gnu.kawa.functions.ApplyToArgs.applyToConsumerA2A(ApplyToArgs.java:132)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:586)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:724)
at kawa.repl.main(repl.java:830)
the problem is that * is no more n-arity operator now

Damien

anyway there is perheaps a possibility of using a variable number of args
but i did not think it this evening.... perheaps tomorrow...

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-11-22 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 22:53 n arity with method Damien Mattei
2023-11-18 11:14 ` Damien Mattei
2023-11-19  7:23   ` Damien Mattei
2023-11-19 17:50     ` Per Bothner
2023-11-20 13:51       ` Damien Mattei
2023-11-21  8:48         ` Damien Mattei
2023-11-22 10:03           ` Damien Mattei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).