-
Notifications
You must be signed in to change notification settings - Fork 123
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
base: master
Are you sure you want to change the base?
Conversation
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. |
good thing I wanted to await @aarroyoc's feedback before merging this. |
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 |
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. |
src/lib/builtins.pl
Outdated
% 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) |
There was a problem hiding this comment.
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.
90fa12d
to
8bf212a
Compare
src/lib/builtins.pl
Outdated
@@ -33,6 +33,137 @@ | |||
internal settings and basic I/O are all here. | |||
*/ | |||
|
|||
%% (@>)(?X, ?Y) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
).
8bf212a
to
ea84ed1
Compare
ea84ed1
to
16c219a
Compare
% | ||
% 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. |
There was a problem hiding this comment.
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"
Document the remaining ISO built-ins implemented completely in Rust.