in reply to How can I use the the return value of split without assigning?

I mean, split returns a list; a list can be interpreted as an array; pop expects an array. Seems logical to me?

Yes, but backwards from the way the language works. Sorry, them's the breaks. This code doesn't work:

1++;

So I'll make a terrible analogy which someone like Dominus will have to correct, but maybe it'll help.

A constant is not a scalar. A scalar can hold a constant. (told you it was bad). A list is not an array. An array can hold a list. You can use a scalar anywhere you can use a constant, but you can't use a constant anywhere you can use a scalar. You can use an array anywhere you can use a list, but you can't use a list anywhere you can use an array.

One's read only, and the other's modifiable. That's why you can perform operations on scalars and arrays.

Make sense?

  • Comment on Re: How can I use the the return value of split without assigning?
  • Download Code