JuliaGizmos / Escher.jl

Composable Web UIs in Julia
https://juliagizmos.github.io/Escher.jl
Other
337 stars 63 forks source link

Naming clashes #41

Open njc46 opened 9 years ago

njc46 commented 9 years ago

Trying rule 2 example 1 from https://shashi.github.io/Escher.jl/ gives error in padding. Seems to apply to all calls of pad. Escher 0.1.0

Error: 'pad_outer' has no method matching pad_outer(::Measure{MeasureNil,MeasureNil}, ::FontColor)

shashi commented 9 years ago

This is a name shadowing issue that pops up from time to time. using Compose exports its own pad function which that piece of code tries to call.

shashi commented 9 years ago

cc @dcjones another name collision between compose and Escher: pad

njc46 commented 9 years ago

Yep Escher.pad fixed the problem. Same thing happens with title

shashi commented 9 years ago

Ouch. I'm wondering if I should put Escher functions in submodules that are not imported by default.

So you would have to do something like using Escher.Layout or using Escher.Typography to get these functions. Then you can chose which pad or title you want to use by either including Compose first or Escher.Layout first. But may not be worth the hassle and there will have to be many many submodules.

dcjones commented 9 years ago

This kind of thing is more awkward than the conflicting unit names because at least there it was obvious that there was some common notion that needed to be factored out. Here, if we factored out pad into a separate package, it would be pretty contrived. I'm not sure what we can do besides qualify these things.

Same thing happens with title

What does title conflict with? There's a title in Gadfly, but that's typically qualified as Guide.title anyway.

njc46 commented 9 years ago

I quickly tried to recreate the problem with title, but was unable to do so. Previously, it would error with something like "expected function, but got class". And I before, I thought qualifying it as Escher.title fixed it.

Will post back if I see it again.

shashi commented 9 years ago

One more offender is fontsize

randyzwitch commented 8 years ago

Is this still an issue or can it be closed?

shashi commented 8 years ago

Still an issue. No clear solution is available though