Allow decorators for functions as well
Decorators for classes, methods, and object properties are a really nice extension to the language. The only extra one I would _like_ to see is the ability to add decorators to function declarations: ``` @RunOnce function expensiveOperation() { return 1 + 1; } ``` de-sugars to: ``` var expensiveOperation = RunOnce(function expensiveOperation() { return 1 + 1; }); ``` --- This _suggests_ allowing decorators for any assignment, but I think that might be a bit much so I'm leaving it out of this PR: ``` // For the curious, that would allow constructs like this @RunOnce let expensiveOp = () => 1 + 1 // De-sugars to let expensiveOp = RunOnce(() => 1 + 1); ```
Posted by svieira on Mar 18, 2015, 9:12 PM
Tags
Related issues
- struct's lifetime requirements can be bypassed via covariant field assignment
- Proposal to Reorganize the Moderation Team and Review Moderation Policies
- Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
- proposal: container/...: generic collection types
- Better Custom Endpoint BYOK
- A concrete policy for backward compatibility until Godot 5.0
Raise real-world problems, find people facing the same issue, and discuss solutions.7,500 issues0 comments
github (Other)
struct's lifetime requirements can be bypassed via covariant field assignment
Proposal to Reorganize the Moderation Team and Review Moderation Policies
Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
proposal: container/...: generic collection types
Better Custom Endpoint BYOK
A concrete policy for backward compatibility until Godot 5.0
New MTP models not supported
Tracking: 429 / Capacity Issues
Allow decorators for functions as well
Decorators for classes, methods, and object properties are a really nice extension to the language. The only extra one I would _like_ to see is the ability to add decorators to function declarations: ``` @RunOnce function expensiveOperation() { return 1 + 1; } ``` de-sugars to: ``` var expensiveOperation = RunOnce(function expensiveOperation() { return 1 + 1; }); ``` --- This _suggests_ allowing decorators for any assignment, but I think that might be a bit much so I'm leaving it out of this PR: ``` // For the curious, that would allow constructs like this @RunOnce let expensiveOp = () => 1 + 1 // De-sugars to let expensiveOp = RunOnce(() => 1 + 1); ```
Comments (0)
No comments yet. Start the discussion.