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 recipe for Loopy. #7253

Closed
wants to merge 1 commit into from
Closed

Add recipe for Loopy. #7253

wants to merge 1 commit into from

Conversation

okamsn
Copy link
Contributor

@okamsn okamsn commented Nov 26, 2020

Add recipe for loopy macro.

Brief summary of what the package does

Loopy provides a looping macro, similar in usage to cl-loop. Unlike cl-loop, it uses expressions instead of clauses, and has conditional structures that work closer to normal Emacs Lisp.

Direct link to the package repository

https://github.com/okamsn/loopy

Your association with the package

I am the maintainer.

Relevant communications with the upstream package maintainer

None needed

Checklist

Please confirm with x:

  • The package is released under a GPL-Compatible Free Software License.
  • I've read CONTRIBUTING.org
  • I've used the latest version of package-lint to check for packaging issues, and addressed its feedback
  • My elisp byte-compiles cleanly
    • It complains when the examples are byte-compiled, as the macro currently sometimes creates an unused variable.
  • M-x checkdoc is happy with my docstrings
  • I've built and installed the package using the instructions in CONTRIBUTING.org
  • I have confirmed some of these without doing them

Loopy provides a looping macro, similar in usage to ‘cl-loop’.  Unlike cl-loop,
it uses expressions instead of clauses, and had conditional structures that work
closer to normal Emacs Lisp.
@alphapapa
Copy link
Contributor

This looks very interesting. Were you inspired by the CL iterate macro? (I didn't see it mentioned in the readme.)

@okamsn
Copy link
Contributor Author

okamsn commented Nov 27, 2020

I have looked through the looping packages on https://lispcookbook.github.io/cl-cookbook/iteration.html.

I think that Loopy is similar to the iterate and for packages in that it uses sexps instead of clauses like in cl-loop. However, it is also much simpler, as it is more restrictive in where normal Lisp code can occur, similar to cl-loops's do clause.

EDIT:

I think that the use of normal Lisp expressions outside of specific location could be added straight-forwardly (if they and the Loopy commands aren't interwoven), but I think that should be added after things are more certain, since it would probably complicate debugging.

@okamsn
Copy link
Contributor Author

okamsn commented Nov 28, 2020

@alphapapa Do you see places where the package could be improved?

@riscy
Copy link
Member

riscy commented Dec 5, 2020

Quick first pass from me. Maybe you don't intend to distribute loopy-examples.el with this; one option would be to add an examples directory that will automatically be excluded by the default MELPA recipe.

Have you tried posting a RFC to the community somewhere to see if you can get some feedback on this? The package seems relatively new (based on the git timestamps) and I wonder if the ideas/api couldn't benefit from some exposure to the community before it's indexed. You'd probably also want to quantify exactly how much slower this is than cl-loop (I suspect a lot of authors are trying to squeeze as much performance as they can out of elisp, and might be interested.)

loopy-examples.el

byte-compile (using Emacs 27.1):

loopy-examples.el:33:1:Error: Cannot open load file: No such file or directory, selectrum

checkdoc (using version 0.6.2):

  • No issues!

package-lint (using version 20200906.512):

2 issues found:
44:0: error: "selectrum-swiper-loopy" doesn't start with package's prefix "loopy".
95:0: error: "selectrum-outline-loopy" doesn't start with package's prefix "loopy".

Other possible lints:

  • loopy-examples.el#L72: Optionally use unless ... instead of when (null ...)
  • loopy-examples.el#L41: It may be simpler to just require this dependency
  • loopy-examples.el#L23: Prefer https over http if possible (why?)

loopy.el

byte-compile (using Emacs 27.1):

  • No issues!

checkdoc (using version 0.6.2):

  • No issues!

package-lint (using version 20200906.512):

  • No issues!

Other possible lints:

  • loopy.el#L27: Prefer https over http if possible (why?)

@okamsn
Copy link
Contributor Author

okamsn commented Dec 6, 2020

Quick first pass from me. Maybe you don't intend to distribute loopy-examples.el with this; one option would be to add an examples directory that will automatically be excluded by the default MELPA recipe.

I wanted to distribute a copy of the file, but not have it be treated as a library. Is there a way to do that?

I wanted to reference it from the Info and README files, but there's no reason for a user to load. It is just real-world examples of using the actual library.

Have you tried posting a RFC to the community somewhere to see if you can get some feedback on this?

Yes, I tried to request feedback on Reddit. They recommended that I look at Common Lisp's Iterate package.

The package seems relatively new (based on the git timestamps) and I wonder if the ideas/api couldn't benefit from some exposure to the community before it's indexed.

I will ask on the mailing lists, next.

You'd probably also want to quantify exactly how much slower this is than cl-loop (I suspect a lot of authors are trying to squeeze as much performance as they can out of elisp, and might be interested.)

I will do so. I am trying to make Loopy expand to the same code as cl-loop.

Thank you for you feedback. I will close this pull request for now, and see what the mailing lists say.

@okamsn okamsn closed this Dec 6, 2020
@riscy
Copy link
Member

riscy commented Dec 6, 2020

Thanks for being understanding. It does look like an interesting package, so keep us posted!

I wanted to distribute a copy of the file, but not have it be treated as a library. Is there a way to do that?

It's a convention that MELPA tries to keep the packages on the lean side, which usually means no example files (although, admittedly, certain documentation files are included by default). In the future we may want to automatically walk through packages to check them for common issues, and excluding examples would limit the number of false positives.

If simply linking the example doesn't work, you could possibly package the example up in an org file with +begin_src blocks?

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.

None yet

3 participants