Open natask opened 3 years ago
Hi,
I'm glad it's been useful to you. I don't think it's actually a complete 1:1 mapping with sexps, e.g. it doesn't support parenthetical sub expressions, alists, etc. It only supports what's been needed in org-ql so far.
I don't think splitting it out would be good. It would be another dependency for this package, and another thing to have to keep in sync if meaningful changes were made. It's only a few functions, so I think anyone who wants to use it should copy the code into their project and modify it according to their needs.
Yes, only after #251 would It would be 1:1.
I see. I plan on loosely maintaining a separate repo because It would be convenient for me to utilize and manage within multiple projects. I will post a link on here when I get around to it.
It still wouldn't always be 1:1, because a sexp query can contain arbitrary expressions, such as calls to any Lisp function or macro. But for a limited "vocabulary," yes, it could be 1:1, I think.
That's cool, please do link it when you're done. I'm happy to see your doing that, it's just that maintaining a kind of "non-sexp sexp syntax converter" library isn't something I want to take on. There are already enough of those kind of alternative-Lisp-syntax projects out there. :)
There are already enough of those kind of alternative-Lisp-syntax projects out there. :)
haha, I don't have the ambition to take on S-expressions (and lose like the countless and forgotten alternative lisp syntax projects). I assure you it will remain limited in scope. I only need it to describe boolean expressions.
I have the package here. it is rudimentary. I have only modified and tested sexp-string--define-query-string-to-sexp-fn and sexp-string--define-transform-query-fn. I am using it in org-roam-search and it works nicely.
As a side note, this is the function to simplify expressions you were looking for in #251.
@natask Thanks.
Since you copied a significant amount of code and comments directly from this package, you should probably list my name in the copyright statement in the headers. And you should make comments of your own pointing out what was copied and from where.
Also, FYI, there's a thread on emacs-devel with Stefan Monnier and Helmut Eller where we've been discussing some improvements to the peg.el API (the discussion continued in private email), e.g. for returning an optimized parsing function that can be called later to parse a string.
@natask Looking more carefully at this recent commit: https://github.com/natask/sexp-string/commit/dd73bcdd4ff4a36ba9bb5e996793da48a73f865f There are a few issues:
Having contributed a few small patches to Emacs, and now a package in GNU ELPA that has copyright assigned to the FSF, I am trying to be more careful about copyright and licensing in my projects. Please do be careful with how you use others' code in your projects as well.
@alphapapa My apologies, I didn't intend to misappropriate your license. My intention was to release my portion such that others can do what ever they please with it. I don't know much about copyright licenses. I wasn't aware that a project that uses GPLv3 licensed code needs to be licensed under GPLv3 as well.
I will license the project under GPLv3. Thank you for taking the time to put these issues in my radar. I will incorporate your suggestions.
Although I don't think that the project, given its limited applicability and fixed scope, warrants delving into copyright, it is nevertheless worth the experience. Better to learn on the small things.
@alphapapa My apologies, I didn't intend to misappropriate your license.
Of course, I didn't think you did so on purpose.
My intention was to release my portion such that others can do what ever they please with it.
This might be an opportunity for you to review why people choose the GPL over "permissive" licenses like MIT/BSD. Those licenses permit others to take the code, modify it, and release the modified software without the source code, so that users of the software can no longer modify or redistribute it. In other words, MIT/BSD give developers (or big companies) more freedom, but they give the users of the software less freedom. From another perspective, those licenses don't respect users of software as developers, or potential developers, of it; those users may be left beholden to the whims of others.
I don't know much about copyright licenses. I wasn't aware that a project that uses GPLv3 licensed code needs to be licensed under GPLv3 as well.
Yes, MIT or BSD code can be relicensed under the GPL, but GPL code cannot be relicensed under MIT or BSD. (Some people refer to the GPL as "viral" for this reason, implying that it spreads to other code; but, of course, that's always a conscious decision by those who apply the license or use GPL-licensed code.)
I will license the project under GPLv3. Thank you for taking the time to put these issues in my radar. I will incorporate your suggestions.
Thanks.
Although I don't think that the project, given its limited applicability and fixed scope, warrants delving into copyright, it is nevertheless worth the experience. Better to learn on the small things.
If it were all your own code, sure, you might even want to place it in the public domain, "unlicense," CC0, etc. Again, just be aware that would mean that the code could be taken "hostage" and users of the software could have their rights taken away.
I found utility in using your alternate query syntax in my projects. It is a convenient to use, specially in consult or helm. It has a one to one mapping with s-expression. Therefore, It can be tossed around internally and operated on natively. Are you interested in splitting it off into a different package. I am sure others would find it useful. For example searching in org-roam.