zambal / eml

Library for writing and manipulating (html) markup in Elixir.
Other
116 stars 14 forks source link

Make Markup module a public record and move all type conversions in Markup module into markup macros #4

Closed zambal closed 10 years ago

zambal commented 10 years ago

Currently the Markup module implements a private record and performs all kinds of type conversions before fields are set or updated. After some discussions on the elixir mailing list, I came to the conclusion that a public record would be better for two reasons:

  1. It's easier to use and more idiomatic when one want's to pattern match on the records fields in comparison to the current match! macro provided by Eml.
  2. All type conversions can be moved out of the Markup module and will be moved to the markup macros that are being used inside an eml block.
zambal commented 10 years ago

Since the new proposal for Maps in Elixir deprecates records in favour of structs, I'll put this on hold until the dust has settled down a bit regarding records/maps/structs.