D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6987 - The "Memory Management" documentation incorrectly claims arrays are passed by reference.
Summary: The "Memory Management" documentation incorrectly claims arrays are passed by...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: spec
Depends on:
Blocks:
 
Reported: 2011-11-22 03:50 UTC by Bernard Helyer
Modified: 2012-01-21 01:07 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Bernard Helyer 2011-11-22 03:50:14 UTC
http://www.d-programming-language.org/memory.html

>Consider the case of passing an array to a function, possibly modifying the 
>contents of the array, and returning the modified array. Since arrays are passed 
>by reference, not by value, a crucial issue is who owns the contents of the 
>array?

The semantics of using an array passed to a function may be reference like, but the array is most certainly not 'passed by reference'. Glossing this over will lead to confusion for people later on when they resize an array passed to a function and wonder why the changes haven't been reflected at the call site.
Comment 1 Bernard Helyer 2011-11-22 03:53:26 UTC
I would suggest something like

"as the contents of an array are accessed through a reference..."