Paste: free-vars (rewritten, all tests pass)

Author: dharmatech
Mode: factor
Date: Thu, 20 Nov 2008 08:40:48
Plain Text |
: free-vars ( form -- vars )
  {
    { [ lambda?       ] [ [ body>> free-vars ] [ vars>> ] bi diff ] }
    { [ quotation?    ] [ [ free-vars ] map flatten               ] }
    { [ local-writer? ] [ "local-reader" word-prop 1array         ] }
    { [ lexical?      ] [                          1array         ] }
    { [ quote?        ] [ local>>                  1array         ] }
    { [ drop t        ] [ drop { }                                ] }
  }
  1cond
  prune ;

New Annotation

Summary:
Author:
Mode:
Body: