Curious: why do you use classes instead of structs for implementations in swiftz?
Conversation
no reason. I'm probably going to end up switching them to structs where I can.
1
2
developer.apple.com/library/prerel seems to mostly favor classes. Comments? Trying to grok perf of call-by-value.
4
Some fancier specifics: the compiler has enough info that it could pass stack structs byref in simple cases.
1
1
3
Right, if no mutating in callee. So what are non-simple cases / why does array need to be special?
1
Replying to
Basically array is special because it allows broader sharing of the backing buffer across array ops.
Replying to
That's what I'd like more than 140 chars on, yeah. :) Impl of pass-by-val array + un/shared backing.
1
1
Hopefully one day you'll be able to read stdlib/Array.swift, but I still haven't heard about that.
1
Show replies



