[Aimmath-commit] AIM/WEB-INF/maple/aim Inert.mpl,1.10,1.11
Brought to you by:
gustav_delius,
npstrick
From: <mo...@us...> - 2004-01-12 06:02:21
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple/aim In directory sc8-pr-cvs1:/tmp/cvs-serv32142/WEB-INF/maple/aim Modified Files: Inert.mpl Log Message: Added Inert/Pair and Inert/PairSequence to represent ordered pairs and finte sequences of ordered pairs. Index: Inert.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/aim/Inert.mpl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Inert.mpl 20 Dec 2003 21:42:22 -0000 1.10 --- Inert.mpl 12 Jan 2004 06:02:18 -0000 1.11 *************** *** 1332,1335 **** --- 1332,1390 ---- ): + ################################################################### + # tuples + ################################################################### + + ################################################################### + `Package/Assign`( + `Inert/Pair`::Inert, + "The Inert ordered pair.", + `new/Inert`( (x,y)->[x,y], # Map + "\\left(%1,%2\\right)", # TeX + 2, # Nargs + 'anything', # Domain + "Pair", # Name + false, # Needs parentheses + true, # Provides parentheses + false, # Associative + 0) # Precedence + ): + + `Package/Assign`( + Pair::procedure, + "", + proc() Apply(`Inert/Pair`,args) end + ): + + ################################################################### + `Package/Assign`( + `Inert/PairSequence`::Inert, + "A sequence of ordered pairs.", + `new/Inert`( proc() [args] end, # Map + proc() # TeX + local i,s; + s:=`if`(nargs>0, + cat("\\left(",TeX(args[1][1]),",",TeX(args[1][2]),"\\right)"), + ""); + for i from 2 to nargs do + s:=cat(s,",\\left(",TeX(args[i][1]),",",TeX(args[i][2]),"\\right)"); + od: + return s + end, + -1, # Nargs + [anything,anything], # Domain + "PairSequence", # Name + true, # Needs parentheses + false, # Provides parentheses + true, # Associative + 0) # Precedence + ): + + `Package/Assign`( + PairSequence::procedure, + "", + proc() Apply(`Inert/PairSequence`,args) end + ): + ################################################################### # END Inert |