The Crystal Programming Language Forum

Comments inside macros

I think it’ll be nice if comments were permitted (no evaluation at all) inside macros, perhaps using a double sharp? Having to move the code around when experimenting is tiring.

Seems to be kinda related. It would need to be something like @bew suggested in order to still allow creating comments with macro variables.

Thanks for the link @Blacksmoke16. Yup, same thing. But I think a {# #} while consistent with the rest of the syntax is a lot more to type (to toggle I mean) than just invoking a cmd+/ to toggle out a line, but then again is consistent with ERB I suppose. Just my two cents.

Some previous discussion on this here: https://github.com/crystal-lang/crystal/issues/8408

2 Likes