-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add list is_bracketed support to the C API #2282
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this looks ok, but I have two points:
-
I'm not too excited about the term "delimiter" here. Maybe that is just me, but I only use "delimiter" for stuff the goes between things, not around? I know that a lot of list/array implementation call their
separator
delimiter
. So having bothdelimiter
andseparator
for lists seems confusing too me. I would rather have called itSass_List_Type
... -
There would be a way to make this a "non" breaking change. I guess bracketed lists will be a seldomly used feature? So is it really needed in the constructor? This way we would not need to alter the constructor for lists. Implementors could then use "sass_list_set_type/delimiter" to change it when needed. IMO there are a few other flags that are not exposed via the constructor directly. Alternatively there could also be an explicit constructor for bracketed lists. I.e.
sass_make_array
; calling it array vs list would sound ok for me; but would need some more thought in regard of the "sass_is_list" tests etc.
Edit: I see that "delimiter" can be used in both ways, but I still think it is confusing when we already have a separator and naming it type seems at least a bit more obvious to me.
I've thought about bracketed lists a bit more. I'm going to drop to
delimiter all together and just tagged the list as bracketed or not. In
which case maybe having a different make function for bracketed lists make
sense. It'll still return a Sass_List just with the bracketed bool set.
I have Wip passing tests for dropping the delimiter I'll push this week.
…On 3 Jan. 2017 2:21 am, "Marcel Greter" ***@***.***> wrote:
***@***.**** commented on this pull request.
Technically this looks ok, but I have two points:
1.
I'm not too excited about the term "delimiter" here. Maybe that is
just me, but I only only use "delimiter" for stuff the goes between things,
not around? I know that a lot of lists call their separator delimiter.
So having both delimiter and separator for lists seems confusing too
me. I would rather have called it Sass_List_Type ...
2.
There would be a way to make this a "non" breaking change. I guess
bracketed lists will be a seldomly used feature? So is it really needed in
the constructor? This way we would not need to alter the constructor for
lists. Implementors could then use "sass_list_set_type/delimiter" to change
it when needed. IMO there are a few other flags that are not exposed via
the constructor directly. Alternatively there could also be an explicit
constructor for bracketed lists. I.e. sass_make_array; calling it
array vs list would sound ok for me; but would need some more thought in
regard of the "sass_is_list" tests etc.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#2282 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWEtHvqcobZKGbf5yfhjV99r3i7pfks5rORYVgaJpZM4LYzuH>
.
|
bb3da21
to
ab00600
Compare
ab00600
to
9450d37
Compare
9450d37
to
c2739e3
Compare
This has been addressed in #2284. The delimiter
I'm fine with making this a breaking a change as long it's document the change accordingly, which they will be. API breakages were expected in 3.5 and 4.0.
I disagree. Given the sheer amount of grid "frameworks" that exist, and the number of new ones that came out for flexbox, I expect this feature to get a decent workout. We shouldn't get in the way of experimentation.
Separator, and bracket are core semantics of a list. The same isn't true for most other list attributes which are largely implementation details of LibSass.
I don't think arrays are right here. These are lists. They share all the same semantics as lists. |
Then you should also increase ABI version number as AFAIK this is the first time we break ABI. I guess you'll add the documentation also to this PR? |
As per the [libtool versioning guidelines][1]. >If any interfaces have been added, removed, or changed since the >last update, increment current, and set revision to 0. [1]: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
Update the documentation and bumped the ABI version to 1:0:0 |
You forgot to increment for windows: |
Thanks I'll update it. I'm not able to find any documentation on the
semantics of bumping those version numbers. Sounds like everyone just does
their own thing. Do you know of any good recommendations? /cc @am11
Regards,
Michael
…On Fri, Jan 6, 2017 at 12:31 AM, Marcel Greter ***@***.***> wrote:
You forgot to increment for windows:
https://github.com/sass/libsass/blob/master/res/resource.rc
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#2282 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWAMXBI5q-_mBgvv21lz3M-0znK-jks5rPPCygaJpZM4LYzuH>
.
|
Lists gained an
is_bracketed
attribute in #2284. The primarysemantic difference is that the
is_bracketed
changes list equality(#2281) which can matter in custom functions.
This is a breaking change so I'd like to get it into the first 3.5
beta.
/cc
@nex3 to sanity check this actually matters for custom functions
@mgreter because you most about the C API
@chriseppstein because of the implication for eyeglass