summaryrefslogtreecommitdiff
path: root/MLKInteger.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-06-22 19:16:25 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-06-22 19:16:25 +0200
commit29b9ca1a3a9d1f6291af51ab2f6150039b2d5619 (patch)
treeb5ac2d792a8c5ec420f1b7a12d2f5f858c655e27 /MLKInteger.m
parent10e9a6f9e07aee31eb739187fbc7e065ac369bf4 (diff)
Add a -descriptionForLisp method to all number classes.
Diffstat (limited to 'MLKInteger.m')
-rw-r--r--MLKInteger.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/MLKInteger.m b/MLKInteger.m
index c7ecc48..03e56b3 100644
--- a/MLKInteger.m
+++ b/MLKInteger.m
@@ -16,7 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#import "MLKDynamicContext.h"
#import "MLKInteger.h"
+#import "MLKPackage.h"
#import "runtime-compatibility.h"
#import "util.h"
@@ -101,6 +103,15 @@ DEFINE_MPZ_TWOARG_OPERATION (divideBy:, mpz_div)
return str;
}
+-(NSString *) descriptionForLisp
+{
+ MLKInteger *base = [[MLKDynamicContext currentContext]
+ valueForBinding:[[MLKPackage
+ findPackage:@"COMMON-LISP"]
+ intern:@"*PRINT-BASE*"]];
+ return [self descriptionWithBase:[base intValue]];
+}
+
-(void) dealloc
{
mpz_clear (value);