Post

Replies

Boosts

Views

Activity

Comment on Need help on Array and API design
Actually I think it's waste of both performance and space. I am aware that when I get a 'copy' of an array in Swift as long as I do not modify it, I actually get a special reference of the array. But when I modify it, the copy-on-write mechanism kicks in and I now get a copy. Later on, I have to replace the original array with the modified array. That's totally against my experience on other languages and systems. But, I know I cannot change anything.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’23
Comment on Need help on Array and API design
Actually I think it's waste of both performance and space. I am aware that when I get a 'copy' of an array in Swift as long as I do not modify it, I actually get a special reference of the array. But when I modify it, the copy-on-write mechanism kicks in and I now get a copy. Later on, I have to replace the original array with the modified array. That's totally against my experience on other languages and systems. But, I know I cannot change anything.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’23
Comment on Any way to get array by reference?
This is just the situation where people feel helpless. We can't do anything to it. It's just by design. Another pain for me in Swift is that it does not explicitly support namespace. Apple is genius but sometimes they just fell asleep when making decisions.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23