DISQUS

Phil Dawes' Stuff: Tidying up factor code

  • Slava Pestov · 1 year ago
    Hi Phil,

    To get all words used by a word, recursively, use

    [ word-def quot-uses ] closure

    Also words list>hashtable is just vocab-words

    And list>hashtable can be written as

    : list>hashtable [ "" ] H{ } map>assoc ;

    Assuming you want "" as the values, but usually we use equal keys/values when representing a set as a hashtable:

    : list>hashtable [ dup ] H{ } map>assoc ;