-
-
Notifications
You must be signed in to change notification settings - Fork 84
Add "subject"
scope type
#1172
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
Comments
- Partially addresses #1172 - Waiting to add Talon side until we're more confident in this scope type - Split from #831 ## Checklist - [x] Add Typescript - [x] Add C - [x] Add C# - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet Co-authored-by: Michael Doronin <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Andreas Arvidsson <[email protected]>
- Partially addresses #1172 - Waiting to add Talon side until we're more confident in this scope type - Split from #831 ## Checklist - [x] Add Typescript - [x] Add C - [x] Add C# - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet Co-authored-by: Michael Doronin <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Andreas Arvidsson <[email protected]>
As I mention in #2177, "subject" is a generalisation of "condition". |
huh that's kind of interesting. had never seen your if-else / switch equivalence before. repeated here for convenience def ifThenElse(cond, ifTrue, ifFalse):
match cond:
# ^^^^ <-- "condition"
case True:
# ^^^^ <-- "pattern"
return ifTrue()
case False:
# ^^^^^ <-- "pattern"
return ifFalse() I think I could be convinced that |
Inside the parens? Are you talking about the arguments to the function? Could you elaborate? |
It should be the argument to match, right? The name in the parens is the function argument. |
Letting "condition" refer to today's "subject". But not totally convinced |
I was never a fan of subject and would be fine with just using condition there as well. |
Wait, was subject actually implemented? |
Yes but as a private scope
|
For original discussion, see #579 (comment) for more
The text was updated successfully, but these errors were encountered: