[Aimmath-commit] AIM/WEB-INF/maple Util.mpl,1.1.1.1.2.2,1.1.1.1.2.3
Brought to you by:
gustav_delius,
npstrick
From: <gr...@us...> - 2003-07-18 06:52:40
|
Update of /cvsroot/aimmath/AIM/WEB-INF/maple In directory sc8-pr-cvs1:/tmp/cvs-serv16976 Modified Files: Tag: develop_2_1 Util.mpl Log Message: Added `Util/CommaAndJoin` (like `Util/CommaJoin` but adds an extra space after each comma and an `and' between the last two arguments). - GG Index: Util.mpl =================================================================== RCS file: /cvsroot/aimmath/AIM/WEB-INF/maple/Util.mpl,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -C2 -d -r1.1.1.1.2.2 -r1.1.1.1.2.3 *** Util.mpl 10 Jul 2003 20:10:03 -0000 1.1.1.1.2.2 --- Util.mpl 18 Jul 2003 06:52:37 -0000 1.1.1.1.2.3 *************** *** 157,160 **** --- 157,180 ---- `Package/Assign`( + `Util/CommaAndJoin`::string, + "Join strings together, inserting a \", \" between them, + except for the second last and last strings, where \" and \" is + inserted instead. + If arguments are not strings, convert them using + @sprintf(\"%A\",..)@ first. + ", + proc() + if nargs = 0 then + ""; + elif nargs = 1 then + `Util/JoinString`("", args[1]); + else + `Util/JoinString`(" and ", + `Util/JoinString`(", ", args[1 .. -2]), args[-1]); + fi; + end + ): + + `Package/Assign`( `Util/ColonJoin`::string, "Join strings together, inserting colons between them. |