| 
						 
						
						
						
						 
					 | 
					 | 
					@ -1,13 +1,13 @@
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					! Copyright (C) 2009 Doug Coleman.
 | 
					 | 
					 | 
					 | 
					! Copyright (C) 2009 Doug Coleman.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					! See http://factorcode.org/license.txt for BSD license.
 | 
					 | 
					 | 
					 | 
					! See http://factorcode.org/license.txt for BSD license.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					USING: classes.tuple help.markup help.syntax kernel math
 | 
					 | 
					 | 
					 | 
					USING: classes.tuple help.markup help.syntax kernel math
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					quotations sequences stack-checker ;
 | 
					 | 
					 | 
					 | 
					quotations sequences stack-checker arrays ;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					IN: combinators.smart
 | 
					 | 
					 | 
					 | 
					IN: combinators.smart
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: input<sequence
 | 
					 | 
					 | 
					 | 
					HELP: input<sequence
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    { "seq" sequence }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     { "newquot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Infers the number of inputs, " { $snippet "n" } ", to " { $snippet "quot" } " and calls the " { $snippet "quot" } " with the first " { $snippet "n" } " values from a sequence." }
 | 
					 | 
					 | 
					 | 
					{ $description "Infers the number of inputs, " { $snippet "n" } ", to " { $snippet "quot" } " and calls the " { $snippet "quot" } " with the first " { $snippet "n" } " values from a sequence." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -21,7 +21,7 @@ HELP: input<sequence
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: output>array
 | 
					 | 
					 | 
					 | 
					HELP: output>array
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     { "newquot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "array" array }
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Infers the number of outputs from the quotation and constructs an array from those outputs." }
 | 
					 | 
					 | 
					 | 
					{ $description "Infers the number of outputs from the quotation and constructs an array from those outputs." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -37,7 +37,7 @@ HELP: output>array
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: output>sequence
 | 
					 | 
					 | 
					 | 
					HELP: output>sequence
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation } { "exemplar" "an exemplar" }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation } { "exemplar" "an exemplar" }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     { "newquot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "seq" sequence }
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Infers the number of outputs from the quotation and constructs a new sequence from those objects of the same type as the exemplar." }
 | 
					 | 
					 | 
					 | 
					{ $description "Infers the number of outputs from the quotation and constructs a new sequence from those objects of the same type as the exemplar." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -51,7 +51,6 @@ HELP: output>sequence
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: reduce-outputs
 | 
					 | 
					 | 
					 | 
					HELP: reduce-outputs
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation } { "operation" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation } { "operation" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     { "newquot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Infers the number of outputs from " { $snippet "quot" } " and reduces them using " { $snippet "operation" } ". The identity for the " { $link reduce } " operation is the first output." }
 | 
					 | 
					 | 
					 | 
					{ $description "Infers the number of outputs from " { $snippet "quot" } " and reduces them using " { $snippet "operation" } ". The identity for the " { $link reduce } " operation is the first output." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -119,7 +118,7 @@ HELP: keep-inputs
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: dropping
 | 
					 | 
					 | 
					 | 
					HELP: dropping
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot'" quotation }
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Outputs a quotation that, when called, will have the effect of dropping the number of inputs to the original quotation." }
 | 
					 | 
					 | 
					 | 
					{ $description "Outputs a quotation that, when called, will have the effect of dropping the number of inputs to the original quotation." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -132,7 +131,7 @@ HELP: dropping
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: input<sequence-unsafe
 | 
					 | 
					 | 
					 | 
					HELP: input<sequence-unsafe
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "seq" sequence }
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "An unsafe version of " { $link input<sequence-unsafe } "." } ;
 | 
					 | 
					 | 
					 | 
					{ $description "An unsafe version of " { $link input<sequence-unsafe } "." } ;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -140,7 +139,6 @@ HELP: input<sequence-unsafe
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: map-reduce-outputs
 | 
					 | 
					 | 
					 | 
					HELP: map-reduce-outputs
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation } { "mapper" quotation } { "reducer" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation } { "mapper" quotation } { "reducer" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Infers the number of outputs from " { $snippet "quot" } " and, treating those outputs as a sequence, calls " { $link map-reduce } " on them." }
 | 
					 | 
					 | 
					 | 
					{ $description "Infers the number of outputs from " { $snippet "quot" } " and, treating those outputs as a sequence, calls " { $link map-reduce } " on them." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -154,7 +152,6 @@ HELP: map-reduce-outputs
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: nullary
 | 
					 | 
					 | 
					 | 
					HELP: nullary
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Infers the number of inputs to a quotation and drops them from the stack." }
 | 
					 | 
					 | 
					 | 
					{ $description "Infers the number of inputs to a quotation and drops them from the stack." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -167,7 +164,6 @@ HELP: nullary
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: preserving
 | 
					 | 
					 | 
					 | 
					HELP: preserving
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Calls a quotation and leaves any consumed inputs on the stack beneath the quotation's outputs." }
 | 
					 | 
					 | 
					 | 
					{ $description "Calls a quotation and leaves any consumed inputs on the stack beneath the quotation's outputs." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -183,7 +179,6 @@ HELP: preserving
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: smart-apply
 | 
					 | 
					 | 
					 | 
					HELP: smart-apply
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation } { "n" integer }
 | 
					 | 
					 | 
					 | 
					    { "quot" quotation } { "n" integer }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "Applies a quotation to the datastack " { $snippet "n" } " times, starting lower on the stack and working up in increments of the number of inferred inputs to the quotation." }
 | 
					 | 
					 | 
					 | 
					{ $description "Applies a quotation to the datastack " { $snippet "n" } " times, starting lower on the stack and working up in increments of the number of inferred inputs to the quotation." }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $examples
 | 
					 | 
					 | 
					 | 
					{ $examples
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					@ -198,42 +193,36 @@ HELP: smart-apply
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: smart-if
 | 
					 | 
					 | 
					 | 
					HELP: smart-if
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "pred" quotation } { "true" quotation } { "false" quotation }
 | 
					 | 
					 | 
					 | 
					    { "pred" quotation } { "true" quotation } { "false" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "A version of " { $link if } " that takes three quotations, where the first quotation is a predicate that preserves any inputs it consumes." } ;
 | 
					 | 
					 | 
					 | 
					{ $description "A version of " { $link if } " that takes three quotations, where the first quotation is a predicate that preserves any inputs it consumes." } ;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: smart-if*
 | 
					 | 
					 | 
					 | 
					HELP: smart-if*
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "pred" quotation } { "true" quotation } { "false" quotation }
 | 
					 | 
					 | 
					 | 
					    { "pred" quotation } { "true" quotation } { "false" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "A version of " { $link if } " that takes three quotations, where the first quotation is a predicate that preserves any inputs it consumes, the second is the " { $snippet "true" } " branch, and the third is the " { $snippet "false" } " branch. If the " { $snippet "true" }  " branch is taken, the values are left on the stack and the quotation is called. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped and the quotation is called." } ;
 | 
					 | 
					 | 
					 | 
					{ $description "A version of " { $link if } " that takes three quotations, where the first quotation is a predicate that preserves any inputs it consumes, the second is the " { $snippet "true" } " branch, and the third is the " { $snippet "false" } " branch. If the " { $snippet "true" }  " branch is taken, the values are left on the stack and the quotation is called. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped and the quotation is called." } ;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: smart-unless
 | 
					 | 
					 | 
					 | 
					HELP: smart-unless
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "pred" quotation } { "false" quotation }
 | 
					 | 
					 | 
					 | 
					    { "pred" quotation } { "false" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "A version of " { $link unless } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "false" } " branch." } ;
 | 
					 | 
					 | 
					 | 
					{ $description "A version of " { $link unless } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "false" } " branch." } ;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: smart-unless*
 | 
					 | 
					 | 
					 | 
					HELP: smart-unless*
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "pred" quotation } { "false" quotation }
 | 
					 | 
					 | 
					 | 
					    { "pred" quotation } { "false" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "A version of " { $link unless } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "false" } " branch. If the " { $snippet "true" }  " branch is taken, the values are left on the stack. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped and the quotation is called." } ;
 | 
					 | 
					 | 
					 | 
					{ $description "A version of " { $link unless } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "false" } " branch. If the " { $snippet "true" }  " branch is taken, the values are left on the stack. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped and the quotation is called." } ;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: smart-when
 | 
					 | 
					 | 
					 | 
					HELP: smart-when
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "pred" quotation } { "true" quotation }
 | 
					 | 
					 | 
					 | 
					    { "pred" quotation } { "true" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "A version of " { $link when } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "true" } " branch." } ;
 | 
					 | 
					 | 
					 | 
					{ $description "A version of " { $link when } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "true" } " branch." } ;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					HELP: smart-when*
 | 
					 | 
					 | 
					 | 
					HELP: smart-when*
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $values
 | 
					 | 
					 | 
					 | 
					{ $values
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "pred" quotation } { "true" quotation }
 | 
					 | 
					 | 
					 | 
					    { "pred" quotation } { "true" quotation }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { "quot" quotation }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ $description "A version of " { $link when } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "true" } " branch. If the " { $snippet "true" }  " branch is taken, the values are left on the stack and the quotation is called. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped." } ;
 | 
					 | 
					 | 
					 | 
					{ $description "A version of " { $link when } " that takes two quotations, where the first quotation is a predicate that preserves any inputs it consumes and the second is the " { $snippet "true" } " branch. If the " { $snippet "true" }  " branch is taken, the values are left on the stack and the quotation is called. If the " { $snippet "false" } " branch is taken, the number of inputs inferred from predicate quotation is dropped." } ;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
					 | 
					 | 
					
 
 |