| 1 | ================================================================ |
|---|
| 2 | Logtalk - Open source object-oriented logic programming language |
|---|
| 3 | Release 2.35.0 |
|---|
| 4 | |
|---|
| 5 | Copyright (c) 1998-2009 Paulo Moura. All Rights Reserved. |
|---|
| 6 | Logtalk is free software. You can redistribute it and/or modify |
|---|
| 7 | it under the terms of the "Artistic License 2.0" as published by |
|---|
| 8 | The 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 | |
|---|
| 21 | Recursive case: append([2, 3], [4, 5], _G340) |
|---|
| 22 | Recursive case: append([3], [4, 5], _G347) |
|---|
| 23 | Recursive case: append([], [4, 5], _G354) |
|---|
| 24 | Base case: append([], [4, 5], [4, 5]) |
|---|
| 25 | List = [1, 2, 3, 4, 5]. |
|---|
| 26 | yes |
|---|
| 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 | |
|---|
| 38 | List = [1, 2, 3, 4, 5]. |
|---|
| 39 | yes |
|---|