Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Array interpolation in Rakudo

by Utilitarian (Vicar)
on Aug 10, 2010 at 08:37 UTC ( #853978=note: print w/replies, xml ) Need Help??


in reply to Array interpolation in Rakudo

At the moment Using Perl 6 in the section on interpolation has this to say
TODO: explain (non-)interpolation of arrays and hashes once Rakudo gets that right
You are seeing the expected behaviour rather than a bug:
You may see a bug if you attempt, (haven't got access to Rakudo @ work)
my @array = ( 1 , 2 , 3 , 4 ); say "The array is {@array}";
The {} curly braces within double quotes should allow any expression to be interpolated into the string.

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Replies are listed 'Best First'.
Re^2: Array interpolation in Rakudo
by moritz (Cardinal) on Aug 10, 2010 at 09:06 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://853978]
help
Chatterbox?
[choroba]: The documentation just says the second argument should be "characters"
[Eily]: It can also be used to force a copy, and remove magic from a variable
[Eily]: there was a post some time ago about variable coming from regex taking more space than the same string defined directly IIRC

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2018-02-22 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (295 votes). Check out past polls.

    Notices?