The stack effect for send is the following:

send ( args... receiver selector -- return... )

I've been staring at this piece of code from cocoa-tests.factor for a  
while and I can't reconcile it with the send stack effect:

: test-foo
     Foo -> alloc -> init
     dup 1.0 2.0 101.0 102.0 <NSRect> -> foo:
     -> release ;

I used the walker to inspect the stack, just in case I was missing  
something and the stack seems to contain <alien> <alien> <ns-rect>  
"foo:" just before invocation.

The signature of foo: is { "id" "SEL" "NSRect" }

"foo:", the selector, is at the top of the stack before invocation but  
it's followed by an instance of NSRect (<ns-rect>) whereas the  
receiver is <alien>.

Is the stack effect declaration wrong or am I missing something?

        Thanks, Joel

--
http://wagerlabs.com






-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to