> Notably in Ruby e.g. /(.)(.)(.)/.match("foo") returns a MatchData object: > > # > > Shouldn't a function like string-match (or rather some new function) > return a # object too? Or the current list returned > by the function 'match-data' is sufficient? Personally I find the pattern of mixing a check for a match object, then access to the global match variables a lot more convenient in Ruby than extracting the data from the match object: 'foo123bar'[/[a-z]+([0-9]+)[a-z]+/] && $1 #=> "123" The alternative: m = /[a-z]+([0-9]+)[a-z]+/.match('foo123bar') m && m[1] #=> "123" The above is more attractive if there was an if-let/when-let equivalent. So that's what I'd design against.