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

Add example for using a custom predicate #117

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

Conversation

kevinjfoley
Copy link

I had some trouble when first using a custom predicate and so wanted to suggest/offer a section with an example on how they can be used.

@alphapapa
Copy link
Owner

Thanks for your patience. I'll take a look at this when I work on this package again.

@alphapapa alphapapa self-assigned this May 29, 2020
@alphapapa alphapapa added the docs label May 29, 2020
@alphapapa alphapapa added this to the 0.5 milestone May 29, 2020
@alphapapa alphapapa force-pushed the master branch 2 times, most recently from e441d88 to 4194456 Compare November 9, 2020 02:07
@alphapapa alphapapa modified the milestones: 0.5, 0.6 Nov 20, 2020
@alphapapa
Copy link
Owner

Hi Kevin,

Thanks for your patience on this.

The specific example you gave, searching for a property value with inheritance, is one that I think needs to be covered by built-in predicates, if it isn't already. So rather than add an example which would direct users to use a custom expression for something which is, or will be, built-in, I'd rather enhance the property predicate (or add one that searches with inheritance).

It would be good to add an example of using an arbitrary expression, though. Could we find a different one that would seem realistic to use? What do you think?

@alphapapa
Copy link
Owner

Well, I made a new way to make "custom predicates". See https://github.com/alphapapa/org-ql/blob/master/examples/defpred.org :)

It would still be good to have an example like yours in the documentation though, to show how arbitrary expressions can be used as the ACTION form when searching.

@kevinjfoley
Copy link
Author

I'm starting to think you're just determined to not merge any of my PR's 😝

Could we find a different one that would seem realistic to use? What do you think?

I agree a non built-in example would be best, however I think the difficulty is finding one that is "realistic to use" that also shouldn't be "be covered by built-in predicates". Maybe a property regexp check?

Well, I made a new way to make "custom predicates". See https://github.com/alphapapa/org-ql/blob/master/examples/defpred.org :)

This looks awesome, excited to use it!

It would still be good to have an example like yours in the documentation though, to show how arbitrary expressions can be used as the ACTION form when searching.

Would it make sense to refer to the section in my PR as "arbitrary expressions" then as opposed to "custom predicates"?

@alphapapa
Copy link
Owner

I'm starting to think you're just determined to not merge any of my PR's

D:

Could we find a different one that would seem realistic to use? What do you think?

I agree a non built-in example would be best, however I think the difficulty is finding one that is "realistic to use" that also shouldn't be "be covered by built-in predicates". Maybe a property regexp check?

Yeah, that would probably be good for a demo.

It would still be good to have an example like yours in the documentation though, to show how arbitrary expressions can be used as the ACTION form when searching.

Would it make sense to refer to the section in my PR as "arbitrary expressions" then as opposed to "custom predicates"?

Yes, I think that'd be great.

Thanks.

@alphapapa
Copy link
Owner

Revisiting this, I think the idea to show the use of custom or arbitrary predicate expressions in the docs is a good one, and I still think that whatever example we use should be one that's obviously not covered, or shouldn't be covered, by built-in predicates. Please let me know if you have any more thoughts on it.

In the interest of pushing out a stable release sooner, I'm deferring this to 0.7 (though being a simple documentation change, it can be done anytime).

@alphapapa alphapapa modified the milestones: 0.6, 0.7 Jun 18, 2021
@yantar92
Copy link
Contributor

yantar92 commented Jul 2, 2021 via email

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

Successfully merging this pull request may close these issues.

3 participants