Hi Rowan, On Sun, Mar 29, 2020 at 10:00 AM Rowan Tommins <rowan.coll...@gmail.com> wrote:
> > myObj.with { > foo = 10 > bar = foo + 20 > } > I really like the suggested "with" syntax, - in fact I had contemplated something like that along the way. The slight "problem", I think, is that, as you mention, adding a fully fledged "with" syntax would imply that you could do a lot more than simply assigning values to properties. And while I agree that that would be cool, it feels like overkill for the actual problem COPA is trying to solve. Do you think a narrow version of "with" syntax could be incorporated into COPA without causing frustration? Or would it be wise to give it its own RFC? I haven't researched if there have already been RFCs proposing something along the lines of "with", and as such I have no idea if it has already been discussed and found problematic. > I'm not sure whether I like this idea or not, but I thought I'd share > it, because I think COPA as currently proposed is too narrow a use case > to deserve a special syntax. > I understand and fully agree that COPA is narrow, but I don't really understand why that's a problem - I proposed it exactly because I felt that its simplicity is its force. Low hanging fruit is usually something I would encourage to go after. I believe it's a trivial implementation that can help in uncountable situations where you just need to assign values to a predefined data structure in a single expression. I'd really like to hear the arguments against such a cost-benefit calculation. Cheers, Jakob