rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Make Seq type less restrictive, based on audit.

Open jemc opened this issue 8 years ago • 3 comments

As discussed on the sync call, we want to audit the Seq interface, as it currently contains a lot of methods that make extra assumptions about what kind of sequence is being dealt with, whether it has a fixed size, whether the underlying pointer can be resized, etc.

In the upcoming value-dependent type changes, we will have a Vector type with a fixed size that won't be compatible with Seq as it currently stands.

I would suggest reducing the number of methods in Seq and possibly adding other interfaces to cover Seqs that have a size that isn't fixed, and the ability to reserve more space in the pointed-to-buffer.

There was already an audit performed in https://github.com/ponylang/ponyc/issues/1131, so this just needs an RFC.

jemc avatar Oct 22 '16 15:10 jemc

I'm going to assign myself to this one.

Praetonus avatar Mar 07 '17 21:03 Praetonus

I've experimented with a few ideas and I think I'm going to split them into two actual RFCs: the first about tidying up the Seq interface and resolving some inconsistencies between different sequences (e.g. Array.remove vs. String.remove), and the second about sequence views. Since I expect the changes I'll propose to be much more comfortable to use with subtype checking and generic type inference implemented, I'll implement these before jumping back into sequence stuff.

Praetonus avatar Mar 22 '17 18:03 Praetonus

@Praetonus before implementing subtype checking and generic type inference, you may want to rebase and work from on top of my refer pass branch (https://github.com/ponylang/ponyc/pull/1715) to avoid a lot of merge conflicts later.

jemc avatar Mar 22 '17 19:03 jemc