I upgraded as you requested and tried to also upgrade my software. 
Previously, I had been allowed to pass quotations around on the stack, store 
them in symbols and get them out again, and generally treat them as 
first-class datums. Now I'm getting an error message that says: "Got a 
computed value where a literal quotation was expected." This is a serious 
problem for me because my Forth programming relies heavily upon passing cfa 
values (the Forth equivalent of quotations) as parameters, and I'm largely 
trying to port Forth to Factor. I think modern terminology refers to these 
as "closures," although I'm not very familiar with the computer-sciency 
terms that people use nowadays.

Specifically, the problem arises on the definition of traverse is shown 
below (see www.rosycrew.org/list.factor for the entire program):

<PRIVATE

SYMBOLS: first-node toucher ;                          ! these parameters 
are unchanging throughout recursion

: <traverse> ( node -- )
    dup fore>>  swap                                           ! --  
next-node node
    toucher get call                                                ! --  
next-node
    dup  first-node get  eq? [ drop ] [ <traverse> ] if ;
inline recursive

! <traverse> gets next-node before calling toucher on node, in case toucher 
clobbers the node

PRIVATE>

: traverse ( node toucher -- )
    over first-node set  toucher set                        ! -- node
    <traverse> ;


> Message: 5
> Date: Thu, 10 Sep 2009 21:44:26 -0500
> From: Slava Pestov <[email protected]>
> Subject: Re: [Factor-talk] confusion
> To: [email protected]
> Message-ID:
> <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hugh,
>
> Please update to the latest Factor release from the download grid at
> http://factorcode.org. Stack effect declarations are now mandatory,
> and have been since January or so. Your code below won't work with the
> latest Factor. 


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to