On Tue, Oct 6, 2009 at 2:50 PM, Hugh Aguilar <hugoagui...@rosycrew.com> wrote:
> Well, I've taken a stab at writing some documentation comparing Factor to
> Forth. Take a look at this (www.rosycrew.org/FactorVsForth.dvi) and let me
> know if this is going in a direction that you think will be useful.

It's an interesting read - I like seeing what a Forth programmers
perspective is on Factor. Personally I find your use of the term 'real
world' odd since the meaning is obviously different depending on the
type of development you do. To me, 'real world' is any application
that gets used. Including web applications (What I tend to use and
develop in Factor) and desktop applications.

Some of the Factor examples could do with tweaking. One quick example
is your first definition of 'pars':

 : pars ( seq -- val )
    dup length 1 = [ first ] [
        dup first swap rest pars
    ] if ;
recursive

Much shorter is:

: parse ( seq -- val )
    unclip [ par ] reduce ;

You should definitely investigate the use of combinators rather than
writing recursive functions. This is a strength of Factor (and similar
languages).

There have been Forth's that have quotations by the way. 4p provides
the syntax: C{ 1 2 + } to create an anonymous word, leaving the
execution pointer on the stack. You can get it here:

http://maschenwerk.de/

Chris.
-- 
http://www.bluishcoder.co.nz

------------------------------------------------------------------------------
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
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to