2016-08-04 10:43:50 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								USING:  compiler.tree  effects  help.markup  help.syntax  kernel  math 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								quotations sequences stack-checker.state stack-checker.values
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								stack-checker.visitor words ;
 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-16 12:15:14 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								IN:  stack-checker.backend 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-02-05 04:58:36 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  consume-d 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "n"  integer  } { "seq"  sequence  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Consumes 'n' items from the compile time data stack."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
									
										
										
										
											2015-02-05 10:22:15 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  { $unchecked-example
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "USING: kernel namespaces prettyprint stack-checker.backend stack-checker.values ;" 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-05 04:58:36 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    "0 \ <value> set-global [ 3 consume-d ] with-infer 2drop ." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "V{ 1 2 3 }" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  end-infer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Called to end the infer context. It outputs a "  { $link #return } " node to the "  { $link stack-visitor } " containing the remaining items on the data stack."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  ensure-d 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "n"  integer  } { "values"  sequence  } }
							 
						 
					
						
							
								
									
										
										
										
											2017-08-27 06:03:35 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Makes sure there is room for at least "  { $snippet "n"  } " items in "  { $link meta-d } " starting from "  { $link inner-d-index } ". Modifies "  { $link meta-d } " and "  { $link inner-d-index } ". Returns the last "  { $snippet "n"  } " items of "  { $link meta-d } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-05 04:58:36 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  infer-literal-quot 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "literal"  literal-tuple } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Performs inferencing for a literal quotation."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $examples
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  { $unchecked-example
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    "[ 3 + * ] <literal> infer-literal-quot" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-05-16 12:15:14 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  infer-quot-here 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "quot"  quotation } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Performs inferencing on the given quotation. This word should only be called in a "  { $link with-infer } " context."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  introduce-values 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "values"  sequence  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Emits an "  { $link #introduce } " node to the current "  { $link stack-visitor } " which pushes the given values onto the data stack."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-02-05 04:58:36 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  pop-d 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "obj"  "object"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Pops an item from the compile time datastack. If the datastack is empty, a new value is instead introduced."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $see-also introduce-values } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-04 10:43:50 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  pop-literal 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "obj"  object  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Used for popping a value off the datastack which is expected to be a literal."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-02-05 04:58:36 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  push-d 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "obj"  "object"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Pushes an item onto the compile time data stack."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  push-literal 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "obj"  "object"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Pushes a literal onto the "  { $link literals } " sequence."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $see-also commit-literals } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-09-21 06:32:32 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  required-stack-effect 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "word"  word } { "effect"  effect } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Gets the stack effect of the word, or throws an error if it doesn't have one."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-05-16 12:15:14 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								HELP:  with-infer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $values { "quot"  quotation } { "effect"  effect } { "visitor"  "a visitor, if any"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $description "Initializes the inference engine and then runs the given quotation which is supposed to perform the inferencing."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-31 20:24:54 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ARTICLE: "stack-checker.backend"  "Stack effect inference implementation" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Contains words for manipulating the compile-time data and retainstacks:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  peek-d
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  pop-d
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  pop-literal
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  pop-r
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  push-d
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  push-literal
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  push-r
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ABOUT: "stack-checker.backend"