| Did you know ... | Search Documentation: |
| Pack starlog -- FEATURE_COMPLETE.md |
"Make the default not to outputeval()andno_eval()but not necessarily the contents of (), and have options to outputeval(),no_eval()or both."
โ
By default, both eval() and no_eval() wrappers are stripped from output
โ
The contents of the wrappers are preserved
โ
This makes output cleaner and more concise
Four new options provide complete control:
| Option | Default | Description |
|---|---|---|
output_eval(false) | โ | Strip eval() wrappers |
output_eval(true) | Keep eval() wrappers | |
output_no_eval(false) | โ | Strip no_eval() wrappers |
output_no_eval(true) | Keep no_eval() wrappers |
?- starlog_output_code(A is no_eval(1+1)).
A is 1+1 % โ no_eval() wrapper removed
?- starlog_output_code(B is eval("x":"y")).
B is "xy" % โ eval() wrapper removed and evaluated
no_eval() only
?- starlog_output_code(A is no_eval(1+1), _, [output_no_eval(true)]).
A is no_eval(1+1) % โ no_eval() wrapper kept
?- starlog_output_code(B is eval("x":"y"), _, [output_no_eval(true)]).
B is "xy" % โ eval() wrapper still stripped and evaluated
eval() only
?- starlog_output_code(A is eval("x":"y"), _, [output_eval(true)]).
A is eval("x":"y") % โ eval() wrapper kept
?- starlog_output_code(B is no_eval(1+1), _, [output_eval(true)]).
B is 1+1 % โ no_eval() wrapper still stripped
?- starlog_output_code(C is no_eval(eval(1+1)), _, [output_eval(true), output_no_eval(true)]). C is no_eval(eval(1+1)) % โ both wrappers kept
% Input: no_eval with eval inside
?- starlog_output_code(A is no_eval("x" : eval("y":"z"))).
A is "x":"yz" % โ Default: both stripped, eval was evaluated
?- starlog_output_code(B is no_eval("x" : eval("y":"z")), _, [output_eval(true), output_no_eval(true)]).
B is no_eval("x":eval("y":"z")) % โ Both kept
starlog.pl (+105 lines)
README.md (+49 lines)
tests/test_output_eval_options.pl (108 lines)
demo_output_eval_options.pl (83 lines)
IMPLEMENTATION_SUMMARY_EVAL_OUTPUT.md (139 lines)
CHANGES_SUMMARY.md (133 lines)
โ
tests/test_output_eval_options.pl - Comprehensive test suite
โ
demo_output_eval_options.pl - Interactive demonstration
# Run the test suite swipl -s tests/test_output_eval_options.pl # Run the interactive demo swipl -s demo_output_eval_options.pl # Test should show: # - All 8 tests passing # - Clear output showing stripped/kept wrappers # - Verification of return values
โ Fully backward compatible
compress(true)Total Lines Added: 484 lines Files Modified: 2 Files Created: 4 Test Cases: 8 Options Added: 4
The implementation is complete and ready for testing. All code has been:
git diff HEAD~5 starlog.pl git diff HEAD~5 README.md
swipl -s tests/test_output_eval_options.pl
swipl -s demo_output_eval_options.pl
cd tests swipl -s test_output_code.pl swipl -s test_eval.pl swipl -s test_no_eval.pl
git merge copilot/update-eval-output-options
All documentation is complete:
Implementation by: GitHub Copilot Date: 2025-12-26 Status: โ COMPLETE - Ready for Testing