=================================================================== RCS file: /home/cvs/OpenXM/src/k097/object.kk,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -u -p -r1.1.1.1 -r1.5 --- OpenXM/src/k097/object.kk 1999/10/08 02:12:15 1.1.1.1 +++ OpenXM/src/k097/object.kk 2001/01/13 12:40:56 1.5 @@ -1,7 +1,9 @@ +/* $OpenXM: OpenXM/src/k097/object.kk,v 1.4 2001/01/08 05:26:49 takayama Exp $ */ /* object.kk , 1997, 4/11. */ Protect("showln",0); class Object extends PrimitiveObject { + local ; def new0() { return(Object); } @@ -21,7 +23,12 @@ def IsObject(a) { if (k00ecTag(a[0]) == k00ecTag(Object[0])) return(true); else return(false); } -HelpAdd(["IsObject",["IsObject(a) return true if a is an Object."]]); +HelpAdd(["IsObject", + ["IsObject(<>) return true if a is an Object."], + ["a"], + ["Tag"], + "check if a given object is primitive or not." +]); @@ -29,6 +36,7 @@ HelpAdd(["IsObject",["IsObject(a) return true if a is 1997, 4/17 */ class Gmp extends Object { + local ; def BitAnd(a,b) { sm1("[(and) ",a," ",b," ] mpzext /FunctionValue set "); } @@ -59,8 +67,44 @@ HelpAdd(["Gmp.", ["Gmp is a class which supports the following methods:", "BitAnd, BitOr, ModuloPower, ProbabilisticPrimeP, Sqrt,", "Gcd, Div, Mod.", - "Ex. r = Gmp.Gcd(5,8); ", - "These methods call functions of Gnu-MP package.", - "The Copyright notice is in kan96xx/gmp.", - "Note that there is no method to create an instance."]]); + "These methods call functions of GNU MP package.", + "Note that there is no method to create an instance.", + "Ex. r = Gmp.Gcd(5,8); " + ], + null, + null, + "class Gmp" +]); +class Stderr extends Object { + local ; + def Print(s) { + s = ToString(s); + if (!Boundp("Stderr_fd")) { + sm1(" [37 (string) dc (stderr)] cat (w) file /Stderr_fd set "); + } + sm1(" Stderr_fd s writestring "); + } + def Println(s) { + Print(s); Ln(); + } + def Ln() { + if (!Boundp("Stderr_fd")) { + sm1(" [37 (string) dc (stderr)] cat (w) file /Stderr_fd set "); + } + sm1(" Stderr_fd 10 (string) dc writestring "); + } + def Flush() { + sm1(" [(flush)] extension "); + } +} + +HelpAdd(["Stderr.", + ["Stderr is a class which supports printing to stderr.", + "Methods are Print, Println, Ln, Flush.", + "Stderr_fd is a global variable to save a file descriptor." + ], + null, + null, + "class Stderr" +]);