> What is: > > $x = date(); > > going to return? Probably the current scalar context result (i.e. a date string) > An object that has many different -ify methods: > stringify > numify > hashify > listify > objectify (!) Possible, but blech. > How then does this work? > > somesub( date() ); Usually list context, so usually returns list. > Depends on the prototype, we could determine it before the subroutine > call. Might also be able to lazily evaluate the argument list for > non-prototyped lists. If it says: > > sub somesub { > my @foo = @_; > } > > then listify the object. Urgh. If you want lazy eval, say so explicitly: sub somesub (?@) { my @foo = @_; } > But that way lies casts so you can say that you want the first thing > from date()'s list value .... I hate casts. I would trust mjd to > tell me that it could be done right, but until he says that, I'm > against anything that requires casting. I'll be against casts *even* if MJD blesses them. I REALLY hate casts. Damian
- Re: RFC 73 (v1) All Perl core functions should return ob Nathan Torkington
- Re: RFC 73 (v1) All Perl core functions should retu... Chaim Frenkel
- Re: RFC 73 (v1) All Perl core functions should retu... David L. Nicol
- Re: RFC 73 (v1) All Perl core functions should retu... Steve Simmons
- Re: RFC 73 (v1) All Perl core functions should retu... Dan Sugalski
- overloading assignment operators David L. Nicol
- Re: overloading assignment operators Dan Sugalski
- Re: RFC 73 (v1) All Perl core functions should return ob Damian Conway
- Re: RFC 73 (v1) All Perl core functions should retu... Nathan Torkington
- Re: RFC 73 (v1) All Perl core functions should retu... Dan Sugalski
- Re: RFC 73 (v1) All Perl core functions should retu... Damian Conway
- Re: RFC 73 (v1) All Perl core functions should retu... Chaim Frenkel
- Re: RFC 73 (v1) All Perl core functions should retu... Damian Conway
- Re: RFC 73 (v1) All Perl core functions should retu... Bart Lateur
- Re: RFC 73 (v1) All Perl core functions should retu... Chaim Frenkel
- Re: RFC 73 (v1) All Perl core functions should retu... Damian Conway
- Re: RFC 73 (v1) All Perl core functions should retu... Chaim Frenkel
- Re: RFC 73 (v1) All Perl core functions should retu... Damian Conway
- Re: RFC 73 (v1) All Perl core functions should retu... David L. Nicol
- Re: RFC 73 (v1) All Perl core functions should retu... Damian Conway
- Re: RFC 73 (v1) All Perl core functions should retu... Dan Sugalski