You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm new to crystal and I was looking at the standard library and I realized that there's an inconsistency with a few of the functions and I'm not sure about others as I haven't checked, but you have two different functions that follow the same rules eg.: chomp and strip
The problem is with strip the main definition strips the beginning and end of a string whilist the chomp definition strips the end of a string . Now that's fine if they didn't attempt to follow the same rules. strip has a lstrip and a rstrip variation which only purpose is to strip only the left or right of a string while chomp only has a lchomp while if rchomp's expected functionality currently resides in chomp since rchomp doesn't actually exist.
Wouldn't it be appropriate for chomp to follow the same rules as strip and have an lchomp and rchomp while chomp strips the string | char from the beginning AND end of a string?
Just seems like a weird inconsistency with the standard library that I wanted to address while there's still breaking changes being made.
Kind regards.
The text was updated successfully, but these errors were encountered:
So I'm new to crystal and I was looking at the standard library and I realized that there's an inconsistency with a few of the functions and I'm not sure about others as I haven't checked, but you have two different functions that follow the same rules eg.:
chomp
andstrip
The problem is with
strip
the main definition strips the beginning and end of astring
whilist thechomp
definition strips the end of astring
. Now that's fine if they didn't attempt to follow the same rules.strip
has alstrip
and arstrip
variation which only purpose is to strip only the left or right of astring
whilechomp
only has alchomp
while ifrchomp
's expected functionality currently resides inchomp
sincerchomp
doesn't actually exist.Wouldn't it be appropriate for
chomp
to follow the same rules asstrip
and have anlchomp
andrchomp
whilechomp
strips thestring | char
from the beginning AND end of astring
?Just seems like a weird inconsistency with the standard library that I wanted to address while there's still breaking changes being made.
Kind regards.
The text was updated successfully, but these errors were encountered: