Is it possible to change the semantics for multiline macros, such that:
@some_macro begin
...
end
can be formulated to
@some_macro
begin
...
end
where some_macro is some multiline macro. The latter syntax is better for code formatting and is more natural in my eyes.
Maybe this is not possible, an alternative would be:
@@some_macro
begin
...
end
to state that some_macro should be used in multiline mode with @@.
What’s the problem with having the macro and begin on the same line? Your editor should take care of code formatting, and perhaps highlighting will help your eyes get used to it.
I must say I have often wished that multiline macro can be supported more directly, i.e. without the begin, to be able to make new syntax constructs which feel a bit less second class. I also thought about the @@some_macro syntax:
I like this idea, it somehow feels wrong to put a macro in front of a type declaration to me. It feels like I’m messing up the more official syntax with a less official syntax. Or maybe its just that it pushes something I expect to see at the start of a line into the middle of a line, so it’s harder to scan the code. Consider
It doesn’t seem to improve much upon the status quo @C for i=... end, besides allowing to put for on a separate line. My wish would be to have @@macroname ...end without having to introduce a begin end block (with @@C_for this can be split into @@C for as you did because for is a julia block introducer, but this doesn’t work in the general case).