Search found 7 matches

by Hibeus
Tue Feb 01, 2011 5:51 am
Forum: Help
Topic: Out of global stack expanding a DCG rule
Replies: 4
Views: 6494

Re: Out of global stack expanding a DCG rule

Calling both predicates with a cut as argument results in one solution for a/1 but two solutions for b/1 (as the call/1 control construct is opaque to cuts). Regarding portability issues, not all Prolog compilers behave as illustrated for GNU Prolog or SWI-Prolog above. This example is enlightening...
by Hibeus
Tue Feb 01, 2011 12:04 am
Forum: Help
Topic: Out of global stack expanding a DCG rule
Replies: 4
Views: 6494

Re: Out of global stack expanding a DCG rule

Using call/1 in my code as you suggest produces the intended results. Thank you. I was a little surprised SWI Prolog did not report an error, but then, neither does GNU Prolog (1.3.0) for example, so it is unlikely to be a problem in either Prolog compiler. Reporting an error is, from a user's persp...
by Hibeus
Mon Jan 31, 2011 7:46 am
Forum: Help
Topic: Out of global stack expanding a DCG rule
Replies: 4
Views: 6494

Out of global stack expanding a DCG rule

Hello, While debugging some code today I found this: ?- expand_term((rule_1-->{if_name(X), X}), T). T = (rule_1(_G355, _G356):- (if_name(X), X), _G356=_G355). ?- logtalk << expand_term((rule_1-->{if_name(X), X}), T). ERROR: Unknown error term: error(resource_error(stack),global) I am using SWI Prolo...
by Hibeus
Fri Jan 28, 2011 3:45 am
Forum: Help
Topic: Operator priority: >>/2 vs. =/2
Replies: 2
Views: 3572

Re: Operator priority: >>/2 vs. =/2

Ah, I understand now why you made this choice, and agree that trading a pair of parentheses for such portability is good. And thank you for the examples, also !
by Hibeus
Fri Jan 28, 2011 1:41 am
Forum: Help
Topic: Operator priority: >>/2 vs. =/2
Replies: 2
Views: 3572

Operator priority: >>/2 vs. =/2

Hello, I am writing some anonymous predicates and ran into the following case: ?- logtalk << call([X, Y, Z]>>Z = X, 1, 1, T). ERROR: Undefined procedure: (=)/5 ERROR: However, there are definitions for: ERROR: (=)/2 ERROR: (=)/2 ?- callable(Z = X). true. ?- logtalk << call([X, Y, Z]>>(Z = X), 1, 1, ...
by Hibeus
Wed Jan 26, 2011 3:38 am
Forum: Help
Topic: Compiler flags list
Replies: 2
Views: 3499

Re: Compiler flags list

Thank you very much ! :D
by Hibeus
Wed Jan 26, 2011 2:46 am
Forum: Help
Topic: Compiler flags list
Replies: 2
Views: 3499

Compiler flags list

Hello, Is there a place listing the various compiler flags ans their possible values? Up to now, I am relying on the explanations in the default settings.lgt as well as the documentation for the built-in predicates, and may have missed the place where this information is stored. I am just asking out...