nim-lang / RFCs

A repository for your Nim proposals.
135 stars 26 forks source link

Use setter `seq.len = 10` instead of `seq.setLen(10)` #424

Closed al6x closed 2 years ago

al6x commented 2 years ago

It's more consistent with getting the length echo seq.len and looks better.

It's probably not worth to deprecate setLen, too breaking change, but it may be worth to add len= setter and put a note in docs and manual that setLen is older version.

Araq commented 2 years ago

But then we have two ways to write the same and people would be "confused" about whether there is a difference between s.setLen 0 and s.len = 0. Not worth it.