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

List of ASCII symbols in cheatsheet #1653

Merged
merged 2 commits into from
Dec 21, 2024
Merged

List of ASCII symbols in cheatsheet #1653

merged 2 commits into from
Dec 21, 2024

Conversation

edemaine
Copy link
Collaborator

This started as an exercise to see which symbols we use the least (e.g. ~). But I think it could be helpful also as:

  • a list of operator-based features
  • reading code (what does # mean here?)

I'm open to better ideas of where to put it, though. Also let me know if I missed some!

@edemaine edemaine marked this pull request as ready for review December 20, 2024 21:33
| Symbol | Meanings |
|--------|----------|
| space | Function call |
| `?` | Non-null test `x?`; non-null access `x?.y`, `x?y`, `x?(...)`, `x?[...]`; null coalescing `x ?? y` (`x ? y` with `coffeeBinaryExistential`); TypeScript optionals `(x?: number) => x`; if/then/else ternary `x ? y : z` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional types number?, number??, optional declarations let x?: number, optional check if x? := foo()

As an aside, let x? with no type annotation is currently left alone during compilation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what let x? should mean. I think most intuitively it would say "allow x to be unassigned on first access" but I'm not sure this is possible in TypeScript. Perhaps a helpful error message for now.

civet.dev/cheatsheet.md Outdated Show resolved Hide resolved
civet.dev/cheatsheet.md Outdated Show resolved Hide resolved
civet.dev/cheatsheet.md Outdated Show resolved Hide resolved
civet.dev/cheatsheet.md Outdated Show resolved Hide resolved
civet.dev/cheatsheet.md Outdated Show resolved Hide resolved
civet.dev/cheatsheet.md Outdated Show resolved Hide resolved
Copy link
Contributor

@STRd6 STRd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I’ve always wanted something like this! Eventually we can also add a search/filter box so we can type in a symbol and see what it could be.

@edemaine edemaine merged commit 8967369 into main Dec 21, 2024
4 checks passed
@edemaine edemaine deleted the ascii branch December 21, 2024 16:13
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.

3 participants