4 ms·
This is partially true, but a pretty large chunk of idiomatic Ruby is focused on Enumerable method chaining, transforming arrays and hashes, slicing and dicing
by djur 3y ago
This is partially true, but a pretty large chunk of idiomatic Ruby is focused on Enumerable method chaining, transforming arrays and hashes, slicing and dicing strings, etc. A language that was totally dedicated to message-passing nirvana wouldn't have regexes as a built-in data type with a literal syntax (or dictionaries, ranges, and so on)
- chris12321 3y agoThose things are all just Objects in Ruby, just with some syntactic sugar, not built in data types. `/a?/` is just syntactic sugar for `Regexp.new('a?')`, ['a','b','c'] is just `Array.[]( 'a', 'b', 'c')` everything is an object being sent messages.