pugs -e 'say shift [1, 2, 3].shift'
pugs -e 'say shift([1, 2, 3].shift)'
pugs -e 'say shift([1, 2, 3]).shift'
do not ever return, but yet does not seem to chew up the CPU either.
Meanwhile, these examples:
pugs -e 'say pop [1, 2, 3].pop'
pugs -e 'say pop([1, 2, 3].pop)'
pugs -e 'say pop([1, 2, 3]).pop'
all print '3'.
Just a weird one, I thought I would share it. I am not even sure it is
really a bug to be honest (other than the fact it does not seem to
return).
Stevan
I don't see how those can be semantically valid, even if they parse.
I read them as shifting the return value of a shift, which would
be an attempt to shift on a scalar.
: Meanwhile, these examples:
:
: pugs -e 'say pop [1, 2, 3].pop'
: pugs -e 'say pop([1, 2, 3].pop)'
: pugs -e 'say pop([1, 2, 3]).pop'
:
: all print '3'.
Same problem. 3.pop doesn't mean much. All I can figure is that
it's following the list-in-scalar context rule to make [3].pop
out of it.
Larry