Comments (6)
It should compile to the first case if we add it.
You prefer this style because the parenthesis doesn't need to wrap, right? It wouldn't be too hard to add to the grammar, but I think it could look a little funky on a single line, or for methods that don't take prior arguments. You're proposing:
list.each() x => x * x.
Versus the current compiler's:
list.each(x => x * x.)
Do you have any real examples where it helps make things clearer?
from coffeescript.
Partly i like it because it eliminates the need for specifying the end of a block twice. Typing ".)" is really awkward in my opinion, when I want to be able to define my own control structures.
Also, it drastically simplifies providing multi-line functions as parameters when you throw significant indentation into the mix.
from coffeescript.
It would be cool if CoffeeScript's lexer were smart enough to insert a period into the token stream for you, when you had an unclosed block within an outer parentheses. This may be do-able by counting parentheses. So:
list.each(x => x * x)
from coffeescript.
That would be nice, but significant indentation would also remove that problem.
from coffeescript.
My problem then is that I'm still specifying the end of the block twice - both with a paren and a dedent, or a paren and a period.. I'd rather get rid of the parens, but I guess it's just a pet peeve of mine.
from coffeescript.
Sorry, the block syntax is just too limited -- mentioned in the other issue. No multiple function arguments, and it has to be the last one. It wouldn't always be possible to call to with JS libraries with if they expected either. Closing as a "wontfix".
from coffeescript.
Related Issues (20)
- Bug: Re-ordered nested non-end BindingRestElement doesn't get transpiled HOT 1
- CoffeeScript is fantastic, please donβt give it up HOT 1
- How to imitate `let` behavior in loops? HOT 5
- Proposal: Alternative file extension HOT 1
- Bug: Excessive variable and shallow copy for leading or middle rest parameter
- Proposal: Introduce `let` statement. HOT 6
- Proposal: Document Existential Operator Assignment
- Site issue: code blocks twitch on hover HOT 2
- Proposal: cake command should support ES6 modules HOT 2
- Need help understanding class member meanings HOT 1
- CLI `npm` `scripts` and input `.coffee` file/s as last argument conflicting with `--watch` HOT 2
- Bug: wrong code is transpiled for function call without parentheses HOT 2
- Proposal: Add end word to close method or class HOT 2
- Bug: Invalid indentation allowed after `do`
- Bug: Remove checkShebangLine multi arguments check HOT 1
- feature_request(html): backend CoffeeScript compilation inside HTML files HOT 3
- Bug: yield cannot be used in do -> expressions reliably? HOT 5
- [not an issue] An embeddable playground for CoffeeScript HOT 1
- Please help HOT 2
- Feature request: Multiple imports
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 coffeescript.