Comments (2)
Some relevant Python references:
I'm a fan of the capability but I'd like to find a better way to name it. The Python for ... else
way seems to be confusing even for Python fans. It would also be nice to have a clause for the break
path as well, similar to how we have try ... catch ... else ...
.
from civet.
We discussed this at some length here: #1083 (and probably Discord before that)
Ha, there's even an ancient partial PR for it: #359
While I agree for..else
is intuitive if you come from Python, Daniel pointed out that it's ambiguous whether else
is the break
case or the non-break
case. Both are common, depending on the use-case. (Does break
mean "I succeeded" or "I failed"?) The idea was to allow both options, via if break
or unless break
(and else
clauses). I feel like things then got a little more complicated with assigning to break
and if break?
and I'm not sure we ended up in the best proposal... but perhaps we can refine it to find the best form.
from civet.
Related Issues (20)
- Cannot optional-chain prototype
- Top-level `comptime` block is always `undefined` in the REPL HOT 2
- Empty array matching still broken
- `--inline-map` suppresses comptime serialization errors
- `guard`-`else` HOT 4
- Stray semicolon in class body causes ParseError
- `&` is not compiled to `$ => $` in specific contexts HOT 1
- `<` is weirdly sensitive to being less-than or extends in SAFE HOT 4
- Matching nested property with same name generates invalid JS
- Ampersand bugs HOT 1
- `.#x` shorthand for private properties HOT 1
- Missing parens in `.-1` access in certain contexts
- Attempted pattern matching ternary HOT 1
- Finishing civetconfig
- `get #x` requires newline, not semicolon HOT 1
- coffeeDo bug
- Use `{}` instead of `;` for empty block
- Generator operators
- Cannot shadow operator with argument HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from civet.