Aleksej Saushev <a...@inbox.ru> writes:

> I seek for enlightement.

Even with all your corrections it still doesn't work,
both this:

)abbrev package BUG Bug
Bug(D: Type): Exports == Implementation where
  Exports == with
    dummy: D -> D
  Implementation == add
    iterte: (D -> D, D, NonNegativeInteger) -> D
    iterte(f, p, n) ==
      n = 0 => p
      f(iterte(f, p, subtractIfCan(n, 1)))

and this:

)abbrev package BUG Bug
Bug(D: Type): Exports == Implementation where
  Exports == with
    dummy: D -> D
  Implementation == add
    iterte: (D -> D, D, NonNegativeInteger) -> D
    iterte(f, p, n) == if n = 0 then p else f(iterte(f, p, subtractIfCan(n, 1)))

result in

   BUG abbreviates package Bug 
------------------------------------------------------------------------
   initializing NRLIB BUG for Bug 
   compiling into NRLIB BUG 
   Adding $ modemaps
   Adding D modemaps
   Adding Integer modemaps
   Adding NonNegativeInteger modemaps
   compiling local iterte : (D -> D,D,NonNegativeInteger) -> D
   Adding Boolean modemaps
****** comp fails at level 4 with expression: ******
error in function iterte 

(IF (= |n| 0)
    |p|
    (|f| (|iterte| |f| |p| | << | (|subtractIfCan| |n| 1) | >> |)))
****** level 4  ******
$x:= (subtractIfCan n (One))
$m:= (NonNegativeInteger)
$f:=
((((|n| # #) (|p| # #) (|f| # #) (|n| #) ...)))
 
   >> Apparent user error:
   cannot compile (subtractIfCan n (One)) 


Neither replacing "pattern matching" with explicit conditional,
nor renaming to avoid possible clash with unexposed function,
nor converting to NonNegativeInteger helps.

I still seek for enlightement.

Is there any comprehensible documentation on the syntax and semantics of
the language?


-- 
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
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to