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

Revisit use of the name pass #144

Open
countvajhula opened this issue Jan 5, 2024 · 2 comments
Open

Revisit use of the name pass #144

countvajhula opened this issue Jan 5, 2024 · 2 comments
Labels
RFC Comments from the community are solicited

Comments

@countvajhula
Copy link
Collaborator

pass is Qi's values equivalent of filter for lists. It was originally named for "low pass" "high pass" and "band pass" filters that are found in analog electronics, and so as to avoid colliding with the filter function which is frequently used within flows to operate on lists.

But for some time, the potential utility of the name pass to mean _ (the "pass through" flow) has been apparent. There is no English word that quite achieves the meaning of "pass" as simply as "pass" does. And python uses pass in a similar way, to indicate an expression that does nothing.

Almost all of Qi's core forms have a plain-English name even if they sometimes have a symbolic name. For instance, is sep, and is collect, -< is tee and >< is amp. But _ has no plain English name, and it feels as though it ought to be "pass." Having such a name would make it easy to talk about in documentation, where otherwise it is sometimes awkward to refer to the form simply as _ as it does not afford much versatility in phrasing. We'd like to refer to _ as the "pass-through flow," and have that correctly call to mind the pass form, rather than reinforce an invalid association with today's filter-like pass.

Although there don't seem to be many words other than pass that are appropriate here, on the other hand, for the existing use of "pass" as the filter form, there are some options, in particular allow. E.g. (allow positive?). In fact, this arguably reads better than (pass positive?), and also suggests the opposite, (exclude positive?).

Of course, if we did make this change, it would be backwards incompatible, and could be an annoying change to make. It's unusual to rename linguistic forms in this way. But it may be an investment in clarity worth making, and it could be a good proving ground for an automated migration scheme that we hope to offer to users for backwards incompatible changes in the future (see Designing for backwards incompatibility).

To follow a scheme suggested by @jackfirth, we could:

  1. Release a version of Qi in which we introduce the new allow form as an alias for pass.
  2. Encourage (e.g. via Resyntax suggestions) users to migrate uses of pass to allow.
  3. Release the next version of Qi in which pass becomes identified with _.
@countvajhula countvajhula added the RFC Comments from the community are solicited label Jan 5, 2024
@benknoble
Copy link
Collaborator

benknoble commented Jan 5, 2024

While I like allow/deny, have we considered calling _ the "identity" or "do-nothing" flow?

FWIW I think Python's pass is more like ground or void since it returns None.

@countvajhula
Copy link
Collaborator Author

Identity doesn't feel too bad on its own (and I think we do refer to it that way in our heads), but as a specialized term it feels unwieldy, esp. for non-math folks. For example:

(~> (1 2 3 4 5) (== identity
                    sqr
                    identity
                    identity
                    add1) +)

It also collides with Racket's identity but has slightly different behavior (i.e. values), and that could be confusing.

That's true re: pass in python, it's not quite the same.

"do-nothing" flow, usable but also unwieldy and doesn't suggest a simple form name. Would be ideal for it to be a verb.

Another possibility is to use uppercase PASS, the same way and (predicate) and AND (boolean gate) are different in Qi.

One useful thing about changing pass itself is that it would be a convenient and relatively challenging proving ground for our backwards compatibility model, including providing parsers to automatically migrate code, etc. -- not that that's a good reason on its own of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Comments from the community are solicited
Projects
None yet
Development

No branches or pull requests

2 participants