From ee5e38b46ce247e9e1c12147ea5351875f391909 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 9 Sep 2022 14:03:30 +0900 Subject: [PATCH] [ruamoko] Implement default -describe method on Object It returns [classname@address], which is probably a reasonable default. --- ruamoko/lib/Object.r | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruamoko/lib/Object.r b/ruamoko/lib/Object.r index 711721d1d..83ed07755 100644 --- a/ruamoko/lib/Object.r +++ b/ruamoko/lib/Object.r @@ -1,5 +1,6 @@ #include #include +#include static void link__obj_forward (void) { @@ -367,4 +368,9 @@ typedef void arIMP(id, SEL, id); return self; } +- (string) describe +{ + return sprintf ("[%s@%p]", object_get_class_name (self), self); +} + @end