> On Mar 11, 2017, at 12:12 PM, Edward Connell via swift-users 
> <swift-users@swift.org> wrote:
> 
> It seems that an easy workaround would be an #include statement. 
> The boiler plate can be put in a separate file and included wherever it's 
> needed. 

IMHO this seems like a surefire ‘design smell’ — if you have a use case where 
you find yourself wanting a preprocessor to eliminate lots of redundant lines 
in your source code, then either your code or the language you’re using have 
serious problems.

(I see absolutely nothing wrong with inheritance, and it solves exactly this 
sort of problem. Yes, structs can’t inherit, but they can contain a common 
struct as a member, which is quite similar and addresses this issue.)

—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to