Hello!
The following code brings FriCAS into Lisp debugger.
)abbrev package BUG Bug
Bug(D: Type): Exports == Implementation where
Exports == with
dummy: D -> D
Implementation == add
iter: (D -> D, D, PositiveInteger) -> D
iter(f, p, 0) == p
iter(f, p, n) == f(iter(f, p, n-1))
The output follows:
BUG abbreviates package Bug
------------------------------------------------------------------------
initializing NRLIB BUG for Bug
compiling into NRLIB BUG
compiling local iter : (D -> D,D,PositiveInteger) -> D
BUG;iter is replaced by p
Break
Available restarts:
1. (CONTINUE) Return from BREAK.
Broken at SI:BYTECODES. [Evaluation of: (PROGN (DEFPARAMETER *YEARWEEK*
"Wednesday February 3, 2010 at 04:29:45 ") (DEFPARAMETER *BUILD-VERSION*
"FriCAS 2010-01-08") (DEFPARAMETER TIMESTAMP
"/tmp/wip/fricas/work/fricas/target/i486--netbsdelf/timestamp") (DEFPARAMETER
|$createLocalLibDb| T) (INTERPSYS-ECL-IMAGE-INIT
"/tmp/wip/fricas/work/fricas/target/i486--netbsdelf"))]
BOOT>> :r1
Time: 0.01 SEC.
compiling local iter : (D -> D,D,PositiveInteger) -> D
****** comp fails at level 3 with expression: ******
error in function iter
(|f| (|iter| |f| |p| | << | (- |n| 1) | >> |))
****** level 3 ******
$x:= (- n (One))
$m:= (PositiveInteger)
$f:=
((((|n| # #) (|p| # #) (|f| # #) (|n| #) ...)))
>> Apparent user error:
cannot compile (- n (One))
OpenAxiom's response is that this is "apparent user error":
BUG abbreviates package Bug
------------------------------------------------------------------------
initializing NRLIB BUG for Bug
compiling into NRLIB BUG
Adding $ modemaps
Adding D modemaps
Adding Integer modemaps
Adding NonNegativeInteger modemaps
Adding PositiveInteger modemaps
compiling local iter : (D -> D,D,PositiveInteger) -> D
BUG;iter is replaced by p
Time: 0.01 SEC.
Adding Integer modemaps
Adding NonNegativeInteger modemaps
Adding PositiveInteger modemaps
compiling local iter : (D -> D,D,PositiveInteger) -> D
****** comp fails at level 1 with expression: ******
((DEF (|iter| |f| |p| |n|)
(NIL NIL NIL NIL)
(NIL NIL NIL NIL)
(|f| (|iter| |f| |p| (- |n| 1)))))
****** level 1 ******
$x:= (DEF (iter f p n) (NIL NIL NIL NIL) (NIL NIL NIL NIL) (f (iter f p (- n
(One)))))
$m:= $EmptyMode
$f:=
((((|iter| #) (|$Information| #) (|$DomainsInScope| # # #) (|dummy| # #) ...)))
>> Apparent user error:
redefinition of iter : (D -> D,D,PositiveInteger) -> D
I don't understand what's apparent here given that the code works when
typed manually in, both in FriCAS and in OpenAxiom:
(1) -> iter(f, p, 0) == p
Type: Void
(2) -> iter(f, p, n) == f(iter(f, p, n-1))
Type: Void
(3) -> iter(x+->x*2, 1, 4)
OpenAxiom will attempt to step through and interpret the code.
(3) 16
Type: PositiveInteger
I seek for enlightement.
--
HE CE3OH...
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
open-axiom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel