It looks like SYMBOL: can be used anywhere. Thus my example becomes:

M: rectangle area
    SYMBOL: temp
    temp [ temp get width>> temp get height>> * ] with-variable ;

And in fact "\ temp" has no meaning if temp is not defined somewhere.  
That's why "\ +" works but not "\ not_defined". The documentation for  
DEFER: states that "Due to the way the parser works, words cannot be  
referenced before they are defined".

That answers my second question. However I'm not sure this is the  
correct way to express access to multiple slots.

On 12 Jan 2009, at 15:55, Ludovic Kuty wrote:

> I thought of doing like this:
> SYMBOL: temp
> M: rectangle area
>    temp [ temp get width>> temp get height>> * ] with-variable ;
>
> But now I have an implementation detail (the fact that temp is a
> symbol) that is leaking out of the method body. It doesn't feel right.
> I should be able to avoid SYMBOL and use "\ temp" but Factor curiously
> complains: "Word not found in current vocabulary search path". The \
> parsing word should avoid trying to execute the word. Any idea are
> welcome.


------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to