git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1973 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
		
			
				
	
	
		
			43 lines
		
	
	
		
			965 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			965 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| ================================================================
 | |
| Logtalk - Open source object-oriented logic programming language
 | |
| Release 2.30.7
 | |
| 
 | |
| Copyright (c) 1998-2007 Paulo Moura.  All Rights Reserved.
 | |
| ================================================================
 | |
| 
 | |
| 
 | |
| % start by loading the example:
 | |
| 
 | |
| | ?- logtalk_load(instmethods(loader)).
 | |
| ...
 | |
| 
 | |
| 
 | |
| % instance1 definition for method "method" is found in its class:
 | |
| 
 | |
| | ?- instance1::method.
 | |
| 
 | |
| This is the default definition for the method, stored in class root.
 | |
| 
 | |
| yes
 | |
| 
 | |
| 
 | |
| % instance2 overrides definition of method "method"
 | |
| 
 | |
| | ?- instance2::method.
 | |
| 
 | |
| This is an overriding definition stored in the instance2 instance itself.
 | |
| 
 | |
| yes
 | |
| 
 | |
| 
 | |
| % instance3 specializes definition of method "method"
 | |
| 
 | |
| | ?- instance3::method.
 | |
| 
 | |
| This is a specializing definition stored in the instance3 instance itself.
 | |
| It makes a super call to execute the default definition:
 | |
| 
 | |
| This is the default definition for the method, stored in class root.
 | |
| 
 | |
| yes
 |