Closed plexus closed 7 years ago
Diff ignoring whitespace: https://github.com/metabase/toucan/pull/14/files?w=1
I'll update VERSION-HISTORY once #13 is merged, or we'll be getting conflicts.
@plexus sorry for the delay. I'll take a look at this and your other PR
@plexus don't worry about updating the VERSION-HISTORY, I'll do it when I push out a new release
I cleaned things up that were pointed out in the review. My apologies for making seemingly arbitrary changes, I reverted them. I tend to use emacs' fill-paragraph functionality a lot when writing docs. However in this case it seems the docs are wrapped by hand, so their fill-column isn't consistent.
@plexus Sorry it took me so long to merge this things have been a little hectic around here. But it looks good. Thanks!
Pass implementations of protocols directly to
defmodel
, the same way you would do indefrecord
ordeftype
. (fixes #9)Also provides implementations for
empty
(fixes #1) andapply
(fixes #2).This updates the documentation, promoting this way of doing things as the preferred method (vs using extend...merge...IModelDefaults), but still leaves in an example of how to do things the old-fashioned way.
The defining-models doc has been expanded slightly to further clarify the relationship between
User
and(User 1
).The fill column in that document was irregular but seemed to hover around 120, so I went with breaking lines at 120 characters. It might be best to ignore whitespace changes when reviewing this.
Note that as it stands you can implement protocols in
defmodel
, but not interfaces, since the forms are inserted inextend
rather than indefrecord
itself. To fix this we'll have to separate extensions to IModel from other interface/protocol implementations.