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

"this" as optional second argument in functions #5205

Open
philrz opened this issue Aug 7, 2024 · 0 comments
Open

"this" as optional second argument in functions #5205

philrz opened this issue Aug 7, 2024 · 0 comments

Comments

@philrz
Copy link
Contributor

philrz commented Aug 7, 2024

tl;dr

A user asked in a community Slack thread:

I noticed that the grep function takes this as the 2nd argument by default, and [...] most(?) / "all other"(?) functions don't. But now that I see they could, why don't they?

Details

At the time this issue is being opened, Zed is at commit 343ac63.

In chatting with @mccanne about why the grep function currently behaves this way, he pointed out "that's how grep works" (i.e., at the Unix command line, grep just works off unnamed incoming lines of input). That said, the user's observation seems valid since we've already had some reports of user confusion between functions and operators, and seen through the eyes of a new user, I can see how this behavior of grep feels operator-like and could add to that confusion.

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

No branches or pull requests

1 participant