From e93416cc05a38b34956e88b9516af5b910d5df19 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sun, 3 Feb 2008 09:46:55 +0100 Subject: Add a compiler macro for SELECTOR. darcs-hash:4e7f3cf6846d15869487905f52589ee8250bcf5d --- Lisp/method-invocation.lisp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Lisp/method-invocation.lisp') diff --git a/Lisp/method-invocation.lisp b/Lisp/method-invocation.lisp index 92a9c92..c0bad01 100644 --- a/Lisp/method-invocation.lisp +++ b/Lisp/method-invocation.lisp @@ -156,6 +156,18 @@ call to __invoke__, or an object of *type* __selector__, to *receiver*. ;=> # +## Note: + +__selector__ objects are funcallable. Therefore, the following calls +are all equivalent: + + (invoke-by-name instance \"stringWithCString:encoding:\" \"Mulk.\" 4) + (invoke instance :string-with-c-string \"Mulk.\" :encoding 4) + (funcall (selector \"stringWithCString:encoding:\") instance \"Mulk.\" 4) + +In fact, using __invoke-by-name__ is discouraged in favour of the latter +form. + ## Rationale: Whereas __invoke__ tries to make writing as well as reading method -- cgit v1.2.3