Paste: group*

Author: tylerg
Mode: factor
Date: Wed, 9 Sep 2009 21:10:30
Plain Text |
! I am now hoping this makes it into the grouping vocabulary

: group* ( seq n -- array ) group unclip-last append ;

! An application:

SYNTAX: 2{ \ } [ >array 2 group* ] parse-literal ; 

2{ [ dup 0 > ] [ "positive" ] 
   [ dup 0 < ] [ "negative" ] 
   [ "zero" ] } cond

! See http://treewalker.wordpress.com/ for my arguments on why this is desireable

New Annotation

Summary:
Author:
Mode:
Body: