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
Right now substr takes an optional third argument. Which means that both 2 and 3 arguments work with calling that function. It's not a big thing, but it's slightly annoying, because nothing else in 007 works that way.
We could go any of the following ways in resolving that:
Make the third parameter non-optional. Live with the consequences: having to write out the third argument always, even when we want the rest of the string.
Split up substr into two functions. Maybe call them substr(s, pos, chars) and suffix(s, pos). For consistency, maybe also add a prefix(s, pos).
I'm kind of leaning towards the second option right now because it's easier. (Maybe there is prior art somewhere containing better names than prefix and suffix? It has to be two words that mean "start" and "end"; using "left" and "right" is unfair to RTL writing systems.) But really, any solution on the list is acceptable.
The text was updated successfully, but these errors were encountered:
Right now
substr
takes an optional third argument. Which means that both 2 and 3 arguments work with calling that function. It's not a big thing, but it's slightly annoying, because nothing else in 007 works that way.We could go any of the following ways in resolving that:
substr
into two functions. Maybe call themsubstr(s, pos, chars)
andsuffix(s, pos)
. For consistency, maybe also add aprefix(s, pos)
.optional_parameters
pragma.I'm kind of leaning towards the second option right now because it's easier. (Maybe there is prior art somewhere containing better names than
prefix
andsuffix
? It has to be two words that mean "start" and "end"; using "left" and "right" is unfair to RTL writing systems.) But really, any solution on the list is acceptable.The text was updated successfully, but these errors were encountered: