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

Create a loopy-env or loopy-block (WIP) #133

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Create a loopy-env or loopy-block (WIP) #133

wants to merge 13 commits into from

Conversation

okamsn
Copy link
Owner

@okamsn okamsn commented Aug 23, 2022

Things to do:

  • Add variable to say when to block commands.
  • Prevent all iteration commands
  • Prevent commands like skip

Things to consider:

  • What should return value be?
    • Would be nice to just have the final expression be the return value.
    • Should probably still support finally-return for consistency.
  • What about optimized accumulations?
    • In loopy, happens before after-do
    • What if triggered manually, such as with a (loopy-finalize)?
      • Pros: Explicit. Easy to implement after Try to use macro expansion better, such as in loopy-iter and optimized accums. #119 (commands as macros in
        loopy-iter).
      • Cons: Have to remember what to do if we don't want to use after-do,
        finally-do, or finally-return.
      • Should it be allowed only at the top level?
        • If no, how to deal with scoping issues when used inside another expand
          loopy-* macro?
          • Just expand in another step after processing the body? What if in
            multiple loopy-env? Include a loop name?
  • What should commands like leave do?
;; Hypothetical example
(defmacro loopy-env (&rest args) `(ignore ,@args))
(defmacro loopy-finalize () '(progn stuff))
(loopy-env (dolist (i some-list)
             (collecting i))
           (loopy-finalize)
           loopy-result)

@okamsn okamsn marked this pull request as draft August 23, 2022 01:42
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.

1 participant