diff modules/object.tp @ 268:123e9468d55e

Add support for invoking methods that take no arguments other than self through the relfection API
author Michael Pavone <pavone@retrodev.com>
date Fri, 18 Jul 2014 09:55:19 -0700
parents 75dc7161c1ca
children b74956a2196f
line wrap: on
line diff
--- a/modules/object.tp	Fri Jul 18 00:14:22 2014 -0700
+++ b/modules/object.tp	Fri Jul 18 09:55:19 2014 -0700
@@ -61,6 +61,13 @@
 			}
 			arr
 		}
+
+		llMessage: sendMessage:to withVars: {
+			obj <- object ptr
+			methodId <- obj_int32 ptr
+		} andCode: :methodId :obj {
+			mcall: (methodId num) 1 obj
+		}
 	}
 	getMethodDict <- {
 		methodDict <- dict hash
@@ -90,5 +97,12 @@
 				rt methodName: id
 			}
 		}
+
+		sendMessage:to <- :message :obj {
+			d <- getMethodDict:
+			d ifget: message :messageId{
+				rt sendMessage: messageId to: obj
+			} else: { false }
+		}
 	}
 }