develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24250] "return" required in some anonymous closures

Thread Previous | Thread Next
From:
Tels
Date:
October 20, 2003 09:53
Subject:
Re: [perl #24250] "return" required in some anonymous closures
Message ID:
200310201855.47388@bloodgate.com
-----BEGIN PGP SIGNED MESSAGE-----

Moin,

Dave Mitchell <davem@fdgroup.com>:
> This isn't a bug, it's a feature :-)
> 
> sub () {$lexical} is a constant sub generator, ie each call to 'sub'
> returns a new constant sub rather than a closure.

Oh. That got me by surprise. I thought that I followed p5p quite closely, but 
someone introcuded a new bug^H^H^Hfeature while I was not looking. And a 
confusing one. I think these should not be different:

	sub () { $lexical; }
	sub () { return $lexical; }

Best wishes,

Tels

- -- 
 Signed on Mon Oct 20 18:54:19 2003 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 "Yeah, baby, yeah!"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBP5QTkncLPEOTuEwVAQE85gf+KtNnAsgerq4BpXMKTCvfk7VKnvlPnA2m
neuMEtVGB8wgk1ZyC4jNzn42c2/34DtLbmtEdIjGVuumSlTDX6aYq/0FLMWcwvdj
tvWdCsOPpcpYEk84ChxYgQhokzbeXNnWBzDSlEP8cq/Eiv4R6zxIt49713OnN/qx
BfowOCZmUtcdRfQhOchiLtsZUebDRt2FXvORumse8ltK92feGTYpInho/8JPAdnr
0UkF45NFVHBYtCEGNEaj4ZFpdkY8b7/kAwPUkzr1kcq9LVq9vpC+LS6uCM6lf+TG
xFt3R7wEYgcCRKml5/d8wymRuuJNgxEoOXqvOEBmarH78pz7mm2QOA==
=XQ90
-----END PGP SIGNATURE-----


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About