2008-01-09 04:52:08 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								USING:  help.markup  help.syntax  strings  words  compiler.units  ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								IN:  vocabs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "vocabularies"  "Vocabularies" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-28 23:48:25 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								"A "  { $emphasis "vocabulary"  } " is a named collection of "  { $link "words"  } ". Vocabularies are defined in the "  { $vocab-link "vocabs"  } " vocabulary." 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								$nl
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Vocabularies are stored in a global hashtable:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections dictionary }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Vocabularies form a class." 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    vocab
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    vocab?
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Various vocabulary words are overloaded to accept a "  { $emphasis "vocabulary specifier"  } ", which is a string naming the vocabulary, the "  { $link vocab } " instance itself, or a "  { $link vocab-link } ":" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    vocab-link
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    >vocab-link
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Looking up vocabularies by name:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections vocab }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Accessors for various vocabulary attributes:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    vocab-name
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    vocab-main
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    vocab-help
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Looking up existing vocabularies and creating new vocabularies:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
									
										
										
										
											2011-10-24 06:37:47 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    lookup-vocab
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    child-vocabs
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    create-vocab
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Getting words from a vocabulary:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    vocab-words
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    words
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    all-words
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    words-named
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								"Removing a vocabulary:" 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections forget-vocab }
							 
						 
					
						
							
								
									
										
										
										
											2010-04-28 05:04:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $see-also "words"  "vocabs.loader"  "word-search"  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ABOUT: "vocabularies" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  dictionary 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $var-description "Holds a hashtable mapping vocabulary names to vocabularies."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  vocabs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "seq"  "a sequence of strings"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs a sequence of all defined vocabulary names."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-10-24 06:37:47 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  lookup-vocab 
							 
						 
					
						
							
								
									
										
										
										
											2008-01-09 01:35:28 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "vocab-spec"  "a vocabulary specifier"  } { "vocab"  vocab } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs a named vocabulary, or "  { $link f  } " if no vocabulary with this name exists."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $class-description "Instances represent vocabularies."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  vocab-name 
							 
						 
					
						
							
								
									
										
										
										
											2008-09-02 16:22:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "vocab-spec"  "a vocabulary specifier"  } { "name"  string  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the name of a vocabulary."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  vocab-words 
							 
						 
					
						
							
								
									
										
										
										
											2008-09-02 16:22:56 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "vocab-spec"  "a vocabulary specifier"  } { "words"  "an assoc mapping strings to words"  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs the words defined in a vocabulary."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  words 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "vocab"  string  } { "seq"  "a sequence of words"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs a sequence of words defined in the vocabulary, or "  { $link f  } " if no vocabulary with this name exists."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  all-words 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "seq"  "a sequence of words"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs a sequence of all words in the dictionary."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  forget-vocab 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "vocab"  string  } }
							 
						 
					
						
							
								
									
										
										
										
											2008-02-06 13:47:15 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Removes a vocabulary. All words in the vocabulary are forgotten."  }
							 
						 
					
						
							
								
									
										
										
										
											2008-01-09 04:52:08 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $notes "This word must be called from inside "  { $link with-compilation-unit } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  load-vocab-hook 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-14 03:14:40 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $var-description { $quotation "( name -- vocab )"  } " which loads a vocabulary. This quotation is called by "  { $link load-vocab } ". The default value should not need to be changed; this functionality is implemented via a hook stored in a variable to break a circular dependency which would otherwise exist from "  { $vocab-link "vocabs"  } " to "  { $vocab-link "vocabs.loader"  } " to "  { $vocab-link "parser"  } " back to "  { $vocab-link "vocabs"  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  words-named 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "str"  string  } { "seq"  "a sequence of words"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs a sequence of all words named "  { $snippet "str"  } " from the set of currently-loaded vocabularies."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  create-vocab 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "name"  string  } { "vocab"  vocab } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Creates a new vocabulary if one does not exist with the given name, otherwise outputs an existing vocabulary."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  child-vocabs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "vocab"  "a vocabulary specifier"  } { "seq"  "a sequence of strings"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Outputs all vocabularies which are conceptually under "  { $snippet "vocab"  } " in the hierarchy."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    { $unchecked-example
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        "\"io.streams\" child-vocabs ." 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-25 21:36:20 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        "{ \"io.streams.c\" \"io.streams.duplex\" \"io.streams.lines\" \"io.streams.nested\" \"io.streams.plain\" \"io.streams.string\" }" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  vocab-link 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-19 15:39:08 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $class-description "Instances of this class identify vocabularies which are potentially not loaded. The "  { $link vocab-name } " slot is the vocabulary name." 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								$nl
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Vocabulary links are created by calling "  { $link >vocab-link } "." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  >vocab-link 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-19 15:39:08 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "name"  string  } { "vocab"  "a vocabulary specifier"  } }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $description "If the vocabulary is loaded, outputs the corresponding "  { $link vocab } " instance, otherwise creates a new "  { $link vocab-link } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-24 10:11:45 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  runnable-vocab 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-28 23:48:25 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $class-description "The class of vocabularies with a "  { $slot "main"  } " word."  } ;