0
$\begingroup$

Edit: the original question was answered on StackOverflow, so I won't be deleting it or reposting it here.


A month ago, before this site existed, I had asked a question on StackOverflow which was fairly theoretical in nature and got no attention (low views, no votes up or down, no answers, not even any comments). It's this question about how Swift handles deep vs. shallow copies for a value type, and why the results differ slightly when I would expect them to be exactly the same.

Since Swift is a less common tag on StackOverflow (I believe it was only 4% of SO users as of last year's survey), any questions that aren't straightforward tend to sit unanswered for a very long time compared to the more popular tags. But, as this particular question could also be considered as being about an implementation decision in an existing programming language (which I saw are on topic here), might it be more likely to be answered on this site?

If the community decides that the question is worthwhile and that it would fit here, I will delete the original and re-post the question on PLDI.

$\endgroup$

1 Answer 1

1
$\begingroup$

I think it could, but the focus would be different.

On StackOverflow, as currently written, I interpreted it as "why does a copy not call init?" (and I have answered it accordingly). Here, it would make more sense to ask "why did Swift decide to make copying an internal operation rather than calling an init?" -- or, perhaps, asking why a language would more generally choose one or the other.

$\endgroup$
1
  • $\begingroup$ That is very helpful to know, that the question wouldn't have been suitable as-is but would require a reframing in terms of the rationale behind that particular design decision. Thanks! $\endgroup$ Commented Jun 28, 2023 at 21:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .