On 25.01.2017 10:47, Samantha McVey wrote:
> On Wednesday, 25 January 2017 01.45.59 PST you wrote:
>> On Tue, 24 Jan 2017 23:15:32 -0800, samant...@posteo.net wrote:
>> > CODE:
>> > my Seq $thing = (1,3,4).Seq; $thing.iterator; $thing.iterator
>> > 
>> > STDERR:
>> > This Seq has already been iterated, and its values consumed
>> > (you might solve this by adding .cache on usages of the Seq, or
>> > by assigning the Seq into an array)
>> >   in block <unit> at <unknown file> line 1
>> > 
>> > I have had lines that have multiple sequences on that, and it is very
>> > difficult to know which Seq it was without a nice error.
>> 
>> What would you suggest we do? The point of the Seq iterator is that it 
>> doesn't generally store the old values, so pretty much by definition we 
>> *can't* give more details about the contents of the Seq, and we generally 
>> don't know which variable it's stored in either.
>> 
>> Unless somebody has a good idea on how to improve this, I'd close it as 
>> "sadly won't fix".
>> 
>> Cheers,
>> Mority
>> 
>> 
> 
> I don't want the values of the Seq, I want the name of the variable.

Trying to find the name of a variable (if there is one at all) from the
object is inherently brittle, and has lead to many false positives in
the past (like reporting the name of a parameter from a routine in CORE
somewhere).

-- 
Moritz Lenz
https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/

Reply via email to