DISQUS

DISQUS Hello! Phil Dawes' Stuff is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

Tidying up factor code

Started by phildawes · 9 months ago

A little utility I wrote for clearing up code: words-not-used. You give it a word and a vocabulary and it tells you all the definitions in the vocab that aren’t used by the execution of the word. It’s handy for clearing up old code that is no longer used.
(n.b. the word ... Continue reading »

1 comment

  • 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 ;

Add New Comment

Returning? Login