On 2020-05-18 22:58, ToddAndMargo via perl6-users wrote:
On 2020-05-18 17:14, Peter Pentchev wrote:
On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users
wrote:
In 2020-05-18 16:11, Peter Pentchev wrote:
As an exercise for the reader: once the above sinks in, what exactly
will "say if 'h:/'.IO.d" do?
It returns the the result of the expression that
"if" evaluated.
OK, so why does it give you an error message if you run it? :)
Not quite.
say if 'h:/'.IO.d
...is equivalent to:
if 'h:/'.IO.d {
say;
}
....which would have been valid in Perl (apart from the parentheses
around the condition of the "if", Raku allows you to omit those), but
it is not valid Raku. Run it and see what it says.
Once again you thought that "if" returns a value. "If" does not return
a value, it is not a function, it is a statement. Just the same as "for"
does not return a value, and "while" does not return a value.
G'luck,
Peter
Hi Peter,
Of course! I am not arguing with anyone that
they are not right!
I am doing what I am doing to make things easier for
me to read in the future. Since I am already using
a very high level language, what is one more affront
to my CPU?
:-)
-T
Peter,
I am not a full time programmer. I am I.T. support
to small busienses. Programming is only about 10
to 20% of what I do. Wednesday, I get to fix an
sql server installer that things it is being given
the wrong (speaking) language. I DO EVERYTHING !!!
The things I write MUST be maintainable. When I go back
to them, I won't remember everything on the fly. EVEN
THOUGH I have copous notes and HOW TOs.
If you want me to change my wicked way, come up with
something even more understandable, human readable
"on the fly".
And with the talent you have already displayed, I know
you can. You are very, very good at this stuff.
:-)
-T