Skip to content

proposed syntax change to make #39 easier: braces around top-level of definition.

I propose to alter the syntax for define_derive_deftly! to incorporate braces as follows:

define_derive_deftly!{
  pub Accessors for struct = { // new brace!
     impl $ttype {
        $(
        fn $fname(&self) -> &$ftype {
            &self.$fname
        }
        )
     }
  }; // new brace!
}

Motivation:

  • If we do this now, we can later implement some of the solutions in #35/#39 without having to add a new top-level define_derive_deftly_several!, since the syntax could accommodate multiple definitions.

What do you think?

This is only a 1.0 blocker if you decide to do it; if not, then feel free to close.