Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Macro question

13 views
Skip to first unread message

Abhijit A. Mahabal

unread,
Aug 2, 2003, 11:29:05 PM8/2/03
to perl6-l...@perl.org
This is a rather silly question:

The code:
macro foo() { return {my $x = 7} }
foo;
print $x;

is equivalent to which of the following?

{my $x = 7}
print $x;

or

my $x = 7;
print $x;


Thanx,
abhi.

Larry Wall

unread,
Aug 3, 2003, 12:14:23 AM8/3/03
to perl6-l...@perl.org
On Sat, Aug 02, 2003 at 10:29:05PM -0500, Abhijit A. Mahabal wrote:
: This is a rather silly question:

More like

do { my $x = 7 };
print $x;

I suspect.

Larry

0 new messages