develooper Front page | perl.perl6.language | Postings from March 2005

lists in string context

Thread Next
From:
Juerd
Date:
March 12, 2005 11:32
Subject:
lists in string context
Message ID:
20050312193240.GL30120@c4.convolution.nl
An old exegesis says that ~<foo bar> is "foo bar". It was still _('foo',
'bar') back then, though. This behaviour I couldn't find in the
Synopses, but it wouldn't be the first time I completely overlook
important information while looking for it.

I think having it stringify as "foobar" is more useful, because in my
scripts I more often join on '' than on ' '. For short join(' ') syntax,
we already have "@array[]". Huffman's principle agrees, for the scope of
my repositories.

With this, I wonder what reverse(LIST) does in scalar context. Does it
join on '', like Perl 5 does? Or on ' ', consistent with current design
for ~LIST?

My gut prefers that both scalar reverse LIST and ~LIST join LIST on ''.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

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