Is there a language where collections can be used as objects without altering the behavior?
- by Dokkat
Is there a language where collections can be used as objects without altering the behavior?
As an example, first, imagine those functions work:
function capitalize(str)
//suppose this *modifies* a string object capitalizing it
function greet(person):
print("Hello, " + person)
capitalize("pedro")
>> "Pedro"
greet("Pedro")
>>…