22 lines
		
	
	
		
			629 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
		
		
			
		
	
	
			22 lines
		
	
	
		
			629 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| 
								 | 
							
								## template = dynamic predicate
							 | 
						||
| 
								 | 
							
								#prompt ( "Scope:" $scope "private" )
							 | 
						||
| 
								 | 
							
								#prompt ( "Functor:" $functor )
							 | 
						||
| 
								 | 
							
								#prompt ( "Arity:" $arity )
							 | 
						||
| 
								 | 
							
								#prompt ( "Comment:" $comment )
							 | 
						||
| 
								 | 
							
									:- $scope($functor/$arity).
							 | 
						||
| 
								 | 
							
									:- dynamic($functor/$arity).
							 | 
						||
| 
								 | 
							
								#prompt ( "Number of solutions:" $solutions "zero_or_one" )
							 | 
						||
| 
								 | 
							
								#if ( $arity == "0" )
							 | 
						||
| 
								 | 
							
									:- mode($functor, $solutions).
							 | 
						||
| 
								 | 
							
									:- info($functor/$arity,
							 | 
						||
| 
								 | 
							
										[comment is '$comment']).
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#prompt ( "Arguments (comma separated):" $args )
							 | 
						||
| 
								 | 
							
								#prompt ( "Argument names (comma separated):" $argnames )
							 | 
						||
| 
								 | 
							
									:- mode($functor($args), $solutions).
							 | 
						||
| 
								 | 
							
									:- info($functor/$arity, [
							 | 
						||
| 
								 | 
							
										comment is '$comment',
							 | 
						||
| 
								 | 
							
										argnames is [$argnames]]).
							 | 
						||
| 
								 | 
							
								#end
							 | 
						||
| 
								 | 
							
								
							 |