if local statements and expressions - #238
Conversation
|
I would've scoped my RFC smaller if I were given actionable feedback and clearer communication to that end.
|
This is not true. local const = true
if const then
...
endIs legal code. This can probably be resolved with an additional lookahead as I don't think |
just recapping here from the discussion in OSS but we will (and always were going to!) list you as a co-author on this as well and really appreciate the discussions and ideas on this, and plan to keep working with you to extend this to more of the use cases that we've been discussing in other threads/rfcs 😊 |
|
@deviaze I would agree with |
Oh, I personally agree with that take too. I need
|
|
Intro should clarify that this feature only applies to |
|
While I personally agree with you and think that the consistent minimal feature set here should also include |
Ah that's a good callout, thanks! I'm happy to extend the scope to supporting local y = if local x = foo() then x else "a"should be supported. But I'd still want to keep |
Yeah I'd love |
After we evaluated compiler closer, it is more work, but does not look significantly harder to avoid if we like the feature (same for block expressions). |
|
just updated to add |
|
hey everyone! let us know if you have further design comments about this. since it's been about 2 weeks, we're going to move on and start implementing this, but will leave the RFC open to keep the discussion open if there are new things that come up |
status: implementing
Rendered
This RFC introduces the syntax
if local, and is a tighter scoped version of #110! We'd love to start the work towards what was discussed there and think that a single binding perifis the minimal useful case and would still be valuable on its own.