When run like that, Factor expects the "script" to not leave anything on the
stack.  In your case, your script has stack effect of ( -- x ), where x is
"4".

Try making it print the number out:

$ cat x
USING: kernel math prettyprint ;

2 2 + .
$ factor x
4

On Tue, May 10, 2011 at 10:33 AM, Kartik Agaram <[email protected]> wrote:

> > This reads the file and runs that. This never has vocabs automatically
> > USE:'d. You'll need to add USE: or USING: definitions for the vocabs
> > that words in the file use. In this case, USE: math for the '+' word.
>
> Ah, thanks.
>
> I tried the following:
>
> $ cat x
> USING: kernel math ;
>
> 2 2 +
> $ ./factor x
> Quotation's stack effect does not match call site
> quot      [ 2 2 + ]
> call-site (( -- ))
>
> Am I missing more vocabularies? How can I see what the listener loads
> by default?
>
> I can add a page to the wiki when I figure this out - if there isn't
> one already.
>
>
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to