On 2/26/08, Ralf Hemmecke wrote: > ... > I am not so sure about Axiom, but in Aldor each type can > provide a function "bracket". The compiler then translates > > [x,y,z,t] > > into > > bracket(x,y,z,t). >
Axiom has an operator called 'construct' that is called by the interpreter in the case of the '[ ... ]' syntax. > In particular List and Record provide such bracket function of type > > (in List(T)) > bracket: Tuple T -> % > which allows the usual list construction. > > (in Record(a: Integer, b: String, c: Float)) > bracket: (Integer, String, Float) -> % > which allows > > Arec: Record(a:Integer, b:String, c:Float) := [123,"azerty",1.2e-3] > > What else would you want? > I think it is very useful to also have a similar operator called 'brace' in the case of the '{ ... }' syntax. This notation is very common in mathematics, e.g. in 'choose' and in the Christofel (tensor) symbols in geometry, etc. Regards, Bill Page. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel