in reply to Need explanatiin for subtle difference

A good explanation is somewhat more subtle than other monks have indicated. First, we must realize that return inherits its context from the use of the function call. In both of your cases, it is scalar context. The difference between an actual array and a list in scalar context is documented in List Value Constructors. In your example, we should expect the array size from an actual array and the last element from a list. This is what you report.
Bill
  • Comment on Re: Need explanatiin for subtle difference