summaryrefslogtreecommitdiff
path: root/MLKRatio.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 /MLKRatio.m
parent10e9a6f9e07aee31eb739187fbc7e065ac369bf4 (diff)
Add a -descriptionForLisp method to all number classes.
Diffstat (limited to 'MLKRatio.m')
-rw-r--r--MLKRatio.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/MLKRatio.m b/MLKRatio.m
index 4c434c9..d11ff49 100644
--- a/MLKRatio.m
+++ b/MLKRatio.m
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#import "MLKDynamicContext.h"
+#import "MLKPackage.h"
#import "MLKRatio.h"
#import "runtime-compatibility.h"
#import "util.h"
@@ -104,6 +106,15 @@ DEFINE_MPQ_TWOARG_OPERATION (divideBy:, mpq_div)
return str;
}
+-(NSString *) descriptionForLisp
+{
+ MLKInteger *base = [[MLKDynamicContext currentContext]
+ valueForBinding:[[MLKPackage
+ findPackage:@"COMMON-LISP"]
+ intern:@"*PRINT-BASE*"]];
+ return [self descriptionWithBase:[base intValue]];
+}
+
-(void) dealloc
{
mpq_clear (value);