Hi Joel,
You're looking at the stack effect of 'send', and you're looking at code
which calls '->'. -> is not the same as send :-)
In fact,
-> foo
is syntax sugar for
"foo" send
I hope this clarifies things.
Slava
Joel Reymont wrote:
> 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?
-------------------------------------------------------------------------
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