--* From hemmecke@risc.uni-linz.ac.at  Fri May 12 16:37:51 2000
--* Received: from kernel.risc.uni-linz.ac.at (root@kernel.risc.uni-linz.ac.at [193.170.37.225])
--* 	by nagmx1.nag.co.uk (8.9.3/8.9.3) with ESMTP id QAA29811
--* 	for <ax-bugs@nag.co.uk>; Fri, 12 May 2000 16:37:48 +0100 (BST)
--* Received: from deneb.risc.uni-linz.ac.at (deneb.risc.uni-linz.ac.at [193.170.37.113])
--* 	by kernel.risc.uni-linz.ac.at (8.9.2/8.9.2/Debian/GNU) with ESMTP id RAA09796;
--* 	Fri, 12 May 2000 17:37:43 +0200 (CEST)
--* Message-ID: <XFMail.000512173743.hemmecke@risc.uni-linz.ac.at>
--* X-Mailer: XFMail 1.3 [p0] on Solaris
--* X-Priority: 3 (Normal)
--* Content-Type: text/plain; charset=us-ascii
--* Content-Transfer-Encoding: 8bit
--* MIME-Version: 1.0
--* Date: Fri, 12 May 2000 17:37:43 +0200 (MET DST)
--* Sender: hemmecke@risc.uni-linz.ac.at
--* From: Ralf.Hemmecke@risc.uni-linz.ac.at
--* To: ax-bugs@nag.co.uk
--* Subject: [1] default one? function

--@ Fixed  by: <Who> <Date>
--@ Tested by: <Name of new or existing file in test directory>
--@ Summary:   <Description of real problem and the fix>

-- Command line: axiomxl -V -grun -laxllib -DC1 -DC2 xxx.as
-- Version: Aldor version 1.1.12p5 for LINUX(glibc)
-- Original bug file name: xxx.as

-- Author: Ralf Hemmecke, Johannes Kepler Universit"at Linz
-- Date: 12-MAY-2000
-- Aldor version 1.1.12p5 for LINUX(glibc) 
-- Subject: default one? function

-- The following code does compile with
--   axiomxl -V -grun -laxllib -DC1 -DC2 xxx.as
-- with 1.1.12p2 and 1.1.12.5. For the latter, however, the execution
-- of the code will produce a runtime error which will not happen for
-- 1.1.12p2.

--: Looking in CalixPowerProducts(??) for 1 with code 87796999
--: Unhandled Exception: RuntimeError(??)
--: Export not found

-- Compilation with zero or one of the options alone works.

#include "axllib"

define CAT: Category == with {
        1: %;
    default {
        (p:TextWriter) << (x:%):TextWriter == p << "(SOMETHING)";
        (x: %) = (y: %): Boolean == true;
#if C1
        one?(x: %): Boolean == x = 1;
#endif
    }
}

CalixPowerProducts(vars: List String): CAT == {
    n: SingleInteger == #vars;
    add {
        Rep ==> PrimitiveArray SingleInteger;
        import from Rep;
#if C2
        someFunction(T: PrimitiveArray %): () == {
                m: % := T.1;
        }
#endif
        1: % == per new(n, 0);
    }
}

main(): () == {
        import from List String;
        import from CalixPowerProducts(["x","y"]);
        e := 1;
        print << "(" << e << ")" << newline;
}
main();
