Skip to content
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

Merged
merged 3 commits into from
Jan 5, 2017

Conversation

xzyfer
Copy link
Contributor

@xzyfer xzyfer commented Jan 2, 2017

Lists gained an is_bracketed attribute in #2284. The primary
semantic difference is that theis_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

Copy link
Contributor

@mgreter mgreter left a 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:

  1. 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 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.

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.

@xzyfer
Copy link
Contributor Author

xzyfer commented Jan 3, 2017 via email

@xzyfer xzyfer force-pushed the bracketed-list-c-api branch from bb3da21 to ab00600 Compare January 5, 2017 08:00
@xzyfer xzyfer changed the title Add list delimiter support to the C API Add list is_bracketed support to the C API Jan 5, 2017
@xzyfer xzyfer force-pushed the bracketed-list-c-api branch from ab00600 to 9450d37 Compare January 5, 2017 08:13
Lists gained an `is_bracketed` attribute in sass#2284. The primary
semantic difference is that the`is_bracketed` changes list equality
(sass#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.
@xzyfer xzyfer force-pushed the bracketed-list-c-api branch from 9450d37 to c2739e3 Compare January 5, 2017 08:15
@xzyfer
Copy link
Contributor Author

xzyfer commented Jan 5, 2017

I'm not too excited about the term "delimiter" here

This has been addressed in #2284. The delimiter attribute was dropped in favour of the more semantic is_bracketed property which is what the delimiter attribute was being used to infer.

There would be a way to make this a "non" breaking change.

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 guess bracketed lists will be a seldomly used feature?

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.

IMO there are a few other flags that are not exposed via the constructor directly.

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.

Alternatively there could also be an explicit constructor for bracketed lists. I.e. sass_make_array;

I don't think arrays are right here. These are lists. They share all the same semantics as lists.

@mgreter
Copy link
Contributor

mgreter commented Jan 5, 2017

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.

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?

xzyfer added 2 commits January 5, 2017 19:46
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
@xzyfer
Copy link
Contributor Author

xzyfer commented Jan 5, 2017

Update the documentation and bumped the ABI version to 1:0:0

@xzyfer xzyfer merged commit 6537833 into sass:master Jan 5, 2017
@xzyfer xzyfer deleted the bracketed-list-c-api branch January 5, 2017 09:57
@mgreter
Copy link
Contributor

mgreter commented Jan 5, 2017

You forgot to increment for windows:
https://github.com/sass/libsass/blob/master/res/resource.rc

@xzyfer
Copy link
Contributor Author

xzyfer commented Jan 5, 2017 via email

@am11
Copy link
Contributor

am11 commented Jan 6, 2017

@xzyfer responded with a PR #2288 😎

xzyfer added a commit that referenced this pull request Mar 5, 2017
This reverts commit 6537833, reversing
changes made to 01074d8.
mgreter pushed a commit that referenced this pull request Apr 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants