I think changing the manual a bit would be a good idea. It's quite easy to 
submit patches to the docs on GitHub.

But I think the difficulty is deciding what exactly to say in the manual and 
where to say it. The manual tends to assume a slightly higher level of CS 
knowledge than many readers have had. This question and the questions we often 
get on the list about Array{Int} vs. Array{Integer} reflect the terseness of 
the manual. If you don't know exactly what pass by sharing means or what 
invariance means, it's easy to assume you do know what they mean -- despite 
have an incorrect understanding of the terms.

Arguably describing this as a "use of A[:]" is slightly wrong -- this is nearly 
the definition of what A and A[:] mean. The manual might be better off just 
telling people to stop and make sure they understand what pass by X means by 
reading Wikipedia. The Wikipedia section on call by sharing makes the reasons 
for Julia's behavior very clear: 
http://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_sharing

 -- John

On Nov 20, 2014, at 5:57 PM, Peter Simon <[email protected]> wrote:

> Thanks--great post!  Seems like this use of A[:] should also be documented in 
> the manual.  The only thing I could find there is a somewhat oblique 
> reference in the definition of the broadcast! function.  I'm willing to take 
> a stab at it but would be happy to defer to someone with possibly more 
> appreciation of the nuances involved.
> 
> --Peter
> 
> On Thursday, November 20, 2014 9:51:02 AM UTC-8, John Myles White wrote:
> I wrote about it once to try to help people who find this confusing: 
> http://www.johnmyleswhite.com/notebook/2014/09/06/values-vs-bindings-the-map-is-not-the-territory/
> 
>  -- John
> 
> On Nov 20, 2014, at 5:48 PM, Peter Simon <[email protected]> wrote:
> 
>> I've seen this technique suggested several times in the news group, but 
>> can't seem to find an explanation in the Julia manual.  Is it documented?
>> 
>> Thanks,
>> --Peter
>> 
>> On Thursday, November 20, 2014 5:12:04 AM UTC-8, [email protected] wrote:
>> Thank you :) 
> 

Reply via email to