|
|
last edited 17 years ago |
1 | ||
Editor:
Time: 2007/11/17 22:56:20 GMT-8 |
||
Note: overriding the interpreter |
changed: - \begin{axiom} *(A: Set INT, B: Set INT): Set INT == set concat [[(a*b)$Integer for a in members A] for b in members B] 2*3 \end{axiom} This problem is not related to '*'. \begin{axiom} mulset(A: Set INT, B: Set INT): Set INT == set concat [[(a*b)$Integer for a in members A] for b in members B] mulset(2,3) \end{axiom} It works if conversion from 'Integer' to 'set' is explicit. \begin{axiom} set [2] * set [3] \end{axiom} From kratt6 Mon Oct 29 08:53:07 -0600 2007 From: kratt6 Date: Mon, 29 Oct 2007 08:53:07 -0600 Subject: overloading an operation in the interpreter is a problem Message-ID: <20071029085307-0600@wiki.axiom-developer.org> Why doesn't axiom find '*: (INT, INT) -> INT' anymore? From BillPage Mon Oct 29 09:08:51 -0600 2007 From: Bill Page Date: Mon, 29 Oct 2007 09:08:51 -0600 Subject: Agreed Message-ID: <20071029090851-0600@wiki.axiom-developer.org> that is a problem. :-) But you have overridden the default behaviour in the interpreter. It is ok if you are explicit: \begin{axiom} (2*3)$Integer \end{axiom} So I think probably the current behavior is sensible. From kratt6 Mon Oct 29 09:19:05 -0600 2007 From: kratt6 Date: Mon, 29 Oct 2007 09:19:05 -0600 Subject: better title Message-ID: <20071029091905-0600@wiki.axiom-developer.org> Name: '#387 redefining *' => '#387 overloading functions in the interpreter does not work'
(1) -> *(A: Set INT,B: Set INT): Set INT == set concat [[(a*b)$Integer for a in members A] for b in members B]
Function declaration ?*? : (Set(Integer),Set(Integer)) -> Set( Integer) has been added to workspace.
2*3
Compiling function * with type (Set(Integer),Set(Integer)) -> Set( Integer) Conversion failed in the compiled user function * .
Cannot convert the value from type Integer to Set(Integer) .
This problem is not related to *
.
mulset(A: Set INT,B: Set INT): Set INT == set concat [[(a*b)$Integer for a in members A] for b in members B]
Function declaration mulset : (Set(Integer),Set(Integer)) -> Set( Integer) has been added to workspace.
mulset(2,3)
Compiling function mulset with type (Set(Integer),Set(Integer)) -> Set(Integer) Conversion failed in the compiled user function mulset .
Cannot convert the value from type Integer to Set(Integer) .
It works if conversion from Integer
to set
is explicit.
set [2] * set [3]
(1) |
*: (INT, INT) -> INT
anymore?
that is a problem. :-)
But you have overridden the default behaviour in the interpreter. It is ok if you are explicit:
(2*3)$Integer
(2) |
So I think probably the current behavior is sensible.
Name:#387 redefining *
=> #387 overloading functions in the interpreter does not work