macroid icon indicating copy to clipboard operation
macroid copied to clipboard

enhancement: use package object instead of FullDsl

Open pfn opened this issue 11 years ago • 3 comments

I don't think there's a reason to manually import FullDsl._

instead, should a package object be used to just have a single import of macroid._ ?

pfn avatar Jul 29 '14 15:07 pfn

Rather, I don't think there's much of a reason to import macroid._ and not FullDsl._ ; sure there's a bit of namespace pollution when doing both, but I don't see when I would want just macroid._ and not the FullDsl as well.

pfn avatar Jul 29 '14 15:07 pfn

The way Macroid is structured now is as follows:

  • features are grouped in small private[macroid] traits
  • these traits are mixed into various bigger objects.

Here is an approximate list of objects available: http://macroid.github.io/guide/Imports.html The idea was to provide granular modularity. For example, it can be desirable not to import Tweaks._, then it’s a simple matter of doing import LayoutDsl._; import Tweaks and using tweaks with a qualifier.

That said, I’m not completely sold on the single import, besides macroid._ is often not needed. What I was considering instead was to reintroduce the cakes as package objects, or lowercase objects, so that:

import macroid._
import macroid.fulldsl._

Anyway, I think this could be easily decided by conducting a poll in the mailing list — thanks for the suggestion!

stanch avatar Jul 29 '14 15:07 stanch

See https://groups.google.com/forum/#!topic/macroid/P-cn8l4kzls.

stanch avatar Jul 29 '14 15:07 stanch