On 12/11/23 14:47, Andy Bach wrote:
 I have found that when using `say` for debugging, it has been known to print 
out the
previous value of a variable and not the current value.  `print` does not do 
this.

That would certainly be a surprise to me. I'd think I was misunderstanding my program, rather than a bug in say.

Hi Andy,

1) I can not duplicate the issue in a small program

2) I did a `say ($x)` on top of a `print "$x\n"`
and got two different answers.  The `say` was the
previous value of the variable.  (It about drove
me crazy trying to figure out what was going on.)

I have had this happen several times in my large programs.
This makes me think it is an issue in the code optimizer.
And it may very well be fixed now.

In my Modula 2 days, I had to turn off the code optimizer
as these issues were crazy making.  So I did recognize the
problem.  So far, the only instance of  optimizer
problems I have found in Raku has been with `say`.  And
it is easily worked around.  Raku itself is very well done
and is fun to program in.

If you have read any of my code, you know I have written
print modules to write out in color and to write out to
the STDERR: black, blue, green, red.  I have been thinking
of writing a `println`, but it would not be all that useful
as I am always up to something at the end of the line.

-T

Reply via email to