Hello,
On Sat, 19 Dec 2020 21:24:40 +0300
Paul Sokolovsky
Hello,
On Sat, 19 Dec 2020 03:52:46 +0100 Marco Sulla
wrote: Maybe it's a crazy idea, but what if we could decorate a single line of code?
For example:
@Timer a = time_consuming_function()
Syntax-wise, I don't see any problems. As I mentioned in a recent mail, "@" here is effectively a prefix operator (unary in first approximation).
But is that really compelling usecase? What if you want to time 2 statements?
Thinking about it more, that would require introducing some kind of "brackets" to delimit "decorated" statements, e.g.: @Timer{ foo bar @} And then it's just one step more to switch to brace-based alternative syntax altogether. Recent (of gazillion older) motion on that front: https://github.com/umlet/pwk [] -- Best regards, Paul mailto:pmiscml@gmail.com