Closed zdne closed 9 years ago
lgtm.
Reviewed. Please, search and replace occurrences of "member type" or "member type(s)" or "member types". Otherwise good.
Reviewed. Please, search and replace occurrences of "member type" or "member type(s)" or "member types". Otherwise good.
sigh
It was for sake of consistency. If there are two different definitions for terms "member" and "member type" (even non-formal) let's keep both. Otherwise let's use just one term everywhere.
Or... Maybe I'm just overwhelmed by terms so I can't easily see their original English meanings anymore :-) "member type" is probably just "type of member", no big deal. On Dec 16, 2014 1:55 AM, "Z" notifications@github.com wrote:
Reviewed. Please, search and replace occurrences of "member type" or "member type(s)" or "member types". Otherwise good.
sigh
— Reply to this email directly or view it on GitHub https://github.com/apiaryio/mson-ast/pull/9#issuecomment-67135469.
Guys this wasn't a change "we won't call member type a type anymore", actually I think we are loosing something fundamental here. Let me rework this PR.
Sorry about my comment. Yup, this change is only about renaming the data structure. Not the concept.
@pksunkara @honzajavorek nps let me rework it, I will post an update soon
OK, so I have made the changes I am finally happy with, I believe it adds more clarity and a bit simplifies the AST as well. Here is what I have done and why:
Per MSON AST spec member types are:
We were sort of forcefully pushing under this term Mixin and One Of types as well as Groups of any of these and tried to call them Member Types and later Members.
I feel this is washing away the original idea in MSON where Member Types are in fact inline anonymous types on their own (unlike mixin or one of). To correct this wrong doing I suggest we use the term "element" (as in Type Section content element, or Type Section's element) for any of the member type, mixin type, one of type or group of thereof.
Note: MSON AST Element
has no equivalent in MSON spec because there isn't any! This is important idea behind its name.
Furthermore since we are talking about Type Definitions, Named Types and Data Structure Types introducing a type
property of a heterogenous data structures (Type Section
and Member
now Element
) only adds to the confusion. Hence I have renamed them to class
I have flattened the Mixin type from object
directly to Type Definition
.
In addition to these changes I have added explicit types to every Named Type definition for added clarity (consider Member is an actual keyword and Element is a reserved keyword).
Hope you will like these changes and the AST will be now a bit more clearer.
Nitpick: In the pic, the four arrows starting from sample
and default
can be merged into two arrows. The crossings there look a bit confusing, so merging would look better IMHO.
I went over the AST trying to simplify as we talked yesterday, but couldn't any more. So, I am pretty happy with the final result now.
inline anonymous types on their own
:+1:
"element"
The new Element
thing is really smart :clap:
Overload of "types"
Class is probably a good choice. The only other word, which came to my mind and would be suitable for these attributes, is kind
. It isn't used very often, but it might avoid conotations people already have with classes in programming.
I finished my review. Please, look at the comments and polish nitpicks.
@pksunkara
Nitpick: In the pic, the four arrows starting from sample and default can be merged into two arrows. The crossings there look a bit confusing, so merging would look better IMHO.
I do not see how this can be done.
@honzajavorek @pksunkara comments addressed
fixed, cheers!
This PR addresses all of the points in the feedback as discussed in #8, for @honzajavorek to review & merge