Paste: how to write narrow conds?

Author: klazuka
Mode: factor
Date: Thu, 10 Sep 2009 13:34:45
Plain Text |
: dimly-lit-word? ( word -- ? )
    { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: } memq? ;

: parsing-or-delim-word? ( word -- ? )
    [ parsing-word? ] [ delimiter? ] bi or ;

: word-color ( word -- color )
    {
        { [ dup dimly-lit-word? ] [ drop dim-color ] }
        { [ dup parsing-or-delim-word? ] [ drop alt-color ] }
        [ drop COLOR: black ]
    } cond ;

New Annotation

Summary:
Author:
Mode:
Body: