Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document Rust-based builtins in lib/builtins.rs (#2030) #2265

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mthom
Copy link
Owner

@mthom mthom commented Jan 2, 2024

Document the remaining ISO built-ins implemented completely in Rust.

@bakaq
Copy link
Contributor

bakaq commented Jan 2, 2024

Unfortunately, it seems that Doclog doesn't render the documentation if it's not immediately followed by a clause that is exported in the module, but I think Doclog itself could be altered to accept things like this (maybe with a different syntax) and I think it would be easier to implement than the extra files idea.

@mthom
Copy link
Owner Author

mthom commented Jan 2, 2024

good thing I wanted to await @aarroyoc's feedback before merging this.

@aarroyoc
Copy link
Contributor

aarroyoc commented Jan 3, 2024

Yes, @bakaq is right. DocLog only looks at publicly exported predicates. We could add some kind of meta-data inside comments to add predicates to the current file. It shouldn't be too hard, I'll try it soon.

Another option could be just analyze all the comments and join that result with the public exported list. It might be slower though

@aarroyoc
Copy link
Contributor

aarroyoc commented Jan 3, 2024

I've updated DocLog (aarroyoc/doclog@b6c2f8c) and now it renders this kind of comments! (and should render the rest as before). Only problem is that they're not indexed in the search box yet.

% X precedes Y if its atom precedes Y's atom according to 4. If the functor names
% and arities are equal, the subterms of X and Y are compared recursively.

%% (@<)(?X,Y), (@>=)(?X,?Y), (@=<)(?X,?Y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put just one predicate per comment. Right now it works because it's very lax in what it accepts but if in the future we want to derive more information it could be problematic. For example, this is going to be problematic for the search box if we want to index these fields too.

@@ -33,6 +33,137 @@
internal settings and basic I/O are all here.
*/

%% (@>)(?X, ?Y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not valid syntax, I have filed #2270 for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is valid to write it as @>(?X, ?Y) (with suitable prefix operator ?).

%
% Numeric comparison operators respectively true if X is greater, less
% than, greater than or equal, less than or equal, equal or not equal
% to Y. X and Y must be instantiated to numbers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small correction: "X and Y can be any ground arithmetical expression" or another wording "must be evaluable to numbers"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants