Bill Page <bill.p...@newsynthesis.org> writes: | 0 and 1, that is 'Zero()' and 'One()' are special in Axiom but in | principle it would make sense to extend this scheme to all | non-negative Integer literals though I am currently at a loss as to | how to extend the naming scheme since Two(), Three(), etc. seem | increasingly arbitrary. Maybe symbols like '0, '1, '2, etc. would be | better. Need I mention again that an extension of this sort is in | fact a recent addition to OpenAxiom ...
Signatures for constants with general types of the form 0: T or 1:T in any constructor definition have been present in OpenAxiom since release 1.2.0 (officially August 22, 2008). See the description of the changes in section "2.1.2 Compiler" at http://www.open-axiom.org/1.2/ Previously, one had to write 0: constant -> % in all flavours of AXIOM. Since then, OpenAxiom has accepted constant definitions not just for the current domain (i.e. %) but for any type and in any constructor (not just in domains, but also in packages.) In OpenAxiom-1.2.2 (current active release branch) you can also define constants with name 3, 4, 5, etc. with your own type. (There might remain some infelicities in the interpreter.) OpenAxiom allows you to define a constant with any "atomic" name (including non-negative integer literal names.) Finally, the runtime systems of all flavours of AXIOM make a distinction between a constant and a nullary function. That is, the runtime system makes a distinction between something declared as f: constant -> T versus f: () -> T even though sometimes, the compiler (and under certain circumstances, the interpreter) will happily confuse a constant with a nullary function. OpenAxiom has propagated the distinction to the compiler level in OpenAxiom-1.2.2. There is one last change that needs to be committed and the distinction will be complete. -- Gaby ------------------------------------------------------------------------------ RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register now! http://p.sf.net/sfu/rsa-sfdev2dev2 _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel