On Tue, Feb 12, 2013 at 6:45 AM, Staffan Tylen <staffan.tylen@gmail.com> wrote:
I'm reading and reading but I can't see in what way the following code contradicts what is documented for the send method in the ooxref manual. When executed I get message 

Error 97.1:  Object "an A" does not understand message "METHOD1"

Staffan

a=.a~new

::class a
::method init
self~send(.array~of("method1",.b~new))


The doc says:  Returns a result of invoking a method on the target object using the specified message name and arguments.

The target object does not have a method1 so the error is to be expected I think.  In addition, .b~new is not a class object, so that would cause another error I think.

Not sure exactly what you ultimately want to do, but this is an example of using an array for the first arg of send()

a=.a~new

::class a subclass b
::method init

self~send(.array~of("method1",.b))

::method method1
  say 'hi from method1 in a'

::class b
::method method1
say "hi from method1 in b"

produces:

hi from method1 in b

You could also do this:

a=.a~new

::class a subclass b
::method init

self~send(.array~of("method1",.b))

::class b
::method method1
say "hi from method1 in b"

which produces the same thing.

Or, perhaps you wanted something like this:

a=.a~new

::class a
::method init

bObj = .b~new
bObj~send("method1")


::class b
::method method1
say "hi from method1 in b"



--
Mark Miesfeld