they actually pay me for this
Highly valuable information I have learned today:
eval { foo }; is permissible syntax.
eval { foo } is not.
I want those six hours of my life back, goddamnit.
I think
omegabeth is right. This is clearly all because Mercury is in retrograde.
eval { foo }; is permissible syntax.
eval { foo } is not.
I want those six hours of my life back, goddamnit.
I think
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
no subject
no subject
The individuals born under this sign are thought to be loyal, strong-willed, complex, capable of genius, thoughtful, supportive, protective, generous, intense, humble, quiet, brave, and emotional. Scorpios can also be jealous, stubborn, demanding, grudge-holders, obsessive (especially with sex), secretive, possessive, angry, suspicious, hedonism, and unreliable. Also, Scorpios tend to be suicidal and for good reason.
no subject
no subject
no subject
no subject
have you met my friend
no subject
no subject
no subject
I actually don't know
no subject
no subject
Actually, no, that was a real answer. :) I will still tease people about Eris being in retrograde if I think _they_ don't know the real answer, though. :P
no subject
no subject
no subject
no subject
no subject
no subject
And heck, if you could Have It Your Way, it might even be a Lisp which specified support in the language for threading, networking, and graphics, instead of leaving it up to the vendor. Where do I sent the check for the Qwrrty Way? ;-)
no subject
no subject
But at least you balanced your parens. =)
no subject
And of course I balanced my parens. I'd hate to have to trace the bug if I didn't. :-)
no subject
(And that brings us back around to the topic of the post again, I think.)
no subject
no subject
no subject
no subject
no subject
no subject
But still. Code like if ($foo) { bar } is legitimate with or without a trailing semicolon. Why isn't eval { foo } okay?
I'm sure Tom or Randal would be able to explain why there is a very important semantic distinction between a block in a control statement and a block passed as an argument to a function. As far as I'm concerned they can bite my skinny white ass. TMTOWTDI, indeed.
no subject
if ($foo) { bar } is a construct; an if statement and a following block of statement(s). Blocks are enclosed by curly braces.
eval { foo }; is a single statement with the block { foo } being the argument to the eval function. Since that block is an argument to eval, it doesn't have any syntactical "identity" as a block in the program itself. The statement needs a semicolon to separate it from the next statement in the program, just as if it had read, say, eval $biteme;.
I'm pretty sure that's right. Perl has always been big on interpreting language elements in very different ways in different contexts, which is really confusing sometimes and is one of my biggest beefs with the language.
no subject
That's fine as far as it goes, but this is one big glaring counterexample.
I suppose that means I should submit it as a bug. Maybe if I get sufficiently motivated. :-)
no subject