On Tue, Feb 23, 2010 at 3:18 AM, William Schlieper <schlie...@unc.edu> wrote:
> But if you want to make wordlist a function of the form ( text --
> array ) then you would want to use MEMO:.

FWIW, MEMO: works with any number of inputs or outputs, including
zero. This enables some silly examples.

Here is a word that prints each string it is given only once:

MEMO: print-once ( string -- ) print ;

Here's a word that returns the sum of integers 0 to 1000 which is only
computed once:

MEMO: sum-up-to-1000 ( -- n ) 0 1000 [a,b] sum ;

Slava

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to