Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: The extent of double-quotish interpolation #635

Closed
p5pRT opened this issue Sep 20, 1999 · 5 comments
Closed

Re: The extent of double-quotish interpolation #635

p5pRT opened this issue Sep 20, 1999 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 20, 1999

Migrated from rt.perl.org#1500 (status was 'resolved')

Searchable as RT1500$

@p5pRT
Copy link
Author

p5pRT commented Sep 20, 1999

From The RT System itself

That's not true since 5.005_57. See Hugo's patch that went in at
change#3406.

and I think this should be fixed. However, I agree that it would be a
terrible blunder to fix this and break

@​a = ()[0,1];

Here, @​a should have zero elements, not two. This would be sensible and
leave your (getpwent)[7,0] example intact.

Ah, I think I see what you mean now. You want these to behave differently​:

DB<1> print $count = @​array = ((undef) x 3)[0,1,2]
0
DB<2> print $count = @​array = ()[0,1,2]
0

You'd have the first version start returning three, but leave the second
version alone. The potential for breakage here is certainly reduced
compared to what I misunderstood the original request to be, since there
are fewer cases that would change. And it's quite possible that it's
the latter case that people rely upon more than it is the former one.
Whether it's exclusively the latter case that matters, I wonder. But you
can't know what color the yolk is until you break the egg.

Omlette makers can sometimes tell without breaking anything. :-)

Sarathy
gsar@​activestate.com

@p5pRT
Copy link
Author

p5pRT commented Sep 20, 1999

From The RT System itself

That's not true since 5.005_57. See Hugo's patch that went in at
change#3406.

That means that perldata.pod needs an update.

--tom

@p5pRT
Copy link
Author

p5pRT commented Jul 13, 2005

From @schwern

[RT_System - Mon Sep 20 02​:46​:44 1999]​:

Ah, I think I see what you mean now. You want these to behave
differently​:

DB<1> print $count = @​array = ((undef) x 3)[0,1,2]
0
DB<2> print $count = @​array = ()[0,1,2]
0

You'd have the first version start returning three, but leave the second
version alone. The potential for breakage here is certainly reduced
compared to what I misunderstood the original request to be, since there
are fewer cases that would change. And it's quite possible that it's
the latter case that people rely upon more than it is the former one.
Whether it's exclusively the latter case that matters, I wonder. But you
can't know what color the yolk is until you break the egg.

Omlette makers can sometimes tell without breaking anything. :-)

And they do behave differently.

0 ~/tmp$ perl -le 'print $count = @​array = ((undef) x 3)[0,1,2]'
3
0 ~/tmp$ perl -le 'print $count = @​array = ()[0,1,2]'
0

So I guess whatever this was about its been resolved.

@p5pRT
Copy link
Author

p5pRT commented Jul 13, 2005

The RT System itself - Status changed from 'stalled' to 'open'

@p5pRT p5pRT closed this as completed Jul 13, 2005
@p5pRT
Copy link
Author

p5pRT commented Jul 13, 2005

@schwern - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant