[Issue 6987] New: The "Memory Management" documentation incorrectly claims arrays are passed by reference.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 22 03:51:10 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6987

           Summary: The "Memory Management" documentation incorrectly
                    claims arrays are passed by reference.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody at puremagic.com
        ReportedBy: blood.of.life at gmail.com


--- Comment #0 from Bernard Helyer <blood.of.life at gmail.com> 2011-11-22 03:50:14 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list