root/trunk/examples/debug_hooks/SCRIPT.txt

Revision 4662, 1.1 KB (checked in by pmoura, 6 days ago)

Updated copyright notice.

  • Property svn:eol-style set to native
Line 
1================================================================
2Logtalk - Open source object-oriented logic programming language
3Release 2.35.0
4
5Copyright (c) 1998-2009 Paulo Moura.        All Rights Reserved.
6Logtalk is free software.  You can redistribute it and/or modify
7it under the terms of the "Artistic License 2.0" as published by
8The Perl Foundation. Consult the "LICENSE.txt" file for details.
9================================================================
10
11
12% start by loading the example with the debug statements activated:
13
14| ?- logtalk_load(debug_hooks(loader_debug)).
15...
16
17% debug the definition of the "object" predicate append/3:
18
19| ?- object::append([1,2,3], [4,5], List).
20
21Recursive case: append([2, 3], [4, 5], _G340)
22Recursive case: append([3], [4, 5], _G347)
23Recursive case: append([], [4, 5], _G354)
24Base case: append([], [4, 5], [4, 5])
25List = [1, 2, 3, 4, 5].
26yes
27
28
29% load the example with the debug statements discarded:
30
31| ?- logtalk_load(debug_hooks(loader_production)).
32...
33
34% call the "object" predicate append/3 without the debugging statements:
35
36| ?- object::append([1,2,3], [4,5], List).
37
38List = [1, 2, 3, 4, 5].
39yes
Note: See TracBrowser for help on using the browser.