Question 1 is really simple:
foo is wrong, thus cannot compile :-(
In one case foo expects a number, in the other recurse with empty stack
(with no input parameter).
Even fixing this, if you don't change some other thing, you would have
infinite loop.
This is what you wrote in C(++):

void f(int n) {
    if (n != 5)
        f();
}

what is f prototype ? :-)

Michele Pes


On 03/11/2011 16.46, Arkady Rost wrote:
> Hi! I have two questions.
>
> 1) How to declare a stack effect for such function?
> : foo ( ?? -- ??? ) dup 5 = [ ] [ drop foo ] if ; inline recursive
>
> 2) How the word with-compilation-unit applies changed words?
> It's invoked with with-scope word witch discards any variable set by
> the quotation.
>
> Cheers,
>     Arkady Rost
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
>
>
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to