Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
# ============================================================================== # # RubyFORTH -- Copyright (C) 2007-8, Marc Simpson (GPL). # # Implementation of 'forget'. To use, 'ruby-include demos/forget.rb' # # ============================================================================== def forget_wordlist_headers(wordlist) wordlist.each { |k,v| wordlist.delete(k) if v > $here } end def forget_headers(vocab) forget_wordlist_headers(vocab[0]) forget_wordlist_headers(vocab[1]) end def forget(xt) if xt == 0 print "Error: word not found." return end $here = xt - 1 $vocabularies.each { |v| forget_headers(v) } end prim "forget" , "forget(xt(parse_word))"