login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #387 overloading functions in the interpreter does not work revision 1 of 1

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' 


Submitted by : (unknown) at: 2007-11-17T22:56:20-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

axiom
*(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.
Type: Void
axiom
2*3
axiom
Compiling function * with type (Set(Integer),Set(Integer)) -> Set(
      Integer) 
   Conversion failed in the compiled user function * .
Cannot convert from type Integer to Set(Integer) for value 2

This problem is not related to *.

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]
Function declaration mulset : (Set(Integer),Set(Integer)) -> Set( Integer) has been added to workspace.
Type: Void
axiom
mulset(2,3)
axiom
Compiling function mulset with type (Set(Integer),Set(Integer)) -> 
      Set(Integer) 
   Conversion failed in the compiled user function mulset .
Cannot convert from type Integer to Set(Integer) for value 2

It works if conversion from Integer to set is explicit.

axiom
set [2] * set [3]

\label{eq1}\left\{ 6 \right\}(1)
Type: Set(Integer)

overloading an operation in the interpreter is a problem --kratt6, Mon, 29 Oct 2007 08:53:07 -0600 reply
Why doesn't axiom find *: (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:

axiom
(2*3)$Integer

\label{eq2}6(2)
Type: Integer

So I think probably the current behavior is sensible.

better title --kratt6, Mon, 29 Oct 2007 09:19:05 -0600 reply
Name: #387 redefining * => #387 overloading functions in the interpreter does not work