question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing de facto standard format/2-3 predicates

See original GitHub issue

Would be possible to add the de facto standard format/2-3 predicates? Any (relatively) easy way for lifting the required functionality from an existing JS library?

For sample calls and tests, please see: https://github.com/LogtalkDotOrg/logtalk3/blob/master/tests/prolog/predicates/format_2/tests.lgt https://github.com/LogtalkDotOrg/logtalk3/blob/master/tests/prolog/predicates/format_3/tests.lgt

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:26 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
jariazavalverdecommented, May 16, 2020

The default value for double_quotes in Tau Prolog is codes. The ISO/IEC 13211-1 leaves the default value to the implementation, so I relied on the default value of SWI (that now is string) and GNU Prolog. But the decision was totally arbitrary, I would have no problem changing it.

3reactions
triskacommented, Jan 8, 2021

Thank you very much for your interest! format.pl is available from:

https://github.com/mthom/scryer-prolog/blob/master/src/lib/format.pl

It would be awesome if you could integrate it in Tau Prolog too, this is a great opportunity for collaboration between two Prolog systems that are very conforming to the ISO standard and hence allow easy porting of applications and libraries. It is especially fortunate that both systems have taken the bold step to set double_quotes to chars by default, a setting which I strongly encourage and which format.pl also assumes.

If possible, please make the non-terminal format_//2 from this library also available in Tau Prolog: I have found format_//2 to be a really useful building block to format lists of characters, and to declaratively describe output so that it can actually be reasoned about in test cases instead of appearing only on the screen.

The library also provides listing/1 and portray_clause/1, which I hope you also find useful for Tau Prolog. I often use portray_clause/1 when emitting solutions to generate output that can later be read with read/1 for convenient testing and reasoning.

Please let me know if you need anything specific to use the library: Ideally, porting it should amount to maybe changing a few directives, and changing the two occurrences of “Scryer” to “Tau”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The ACS Style Guide - Clarkson University
Most manuscripts are now written with de facto standard word-processing software and adhere to formats developed for ... scientific paper format, 23.
Read more >
Untitled
My awakening tv, 4th step inventory format, 23 de noviembre cristo rey, ... Turin brakes lost property review, Identificaron el cuerpo de paul...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found