Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Hash Curious

by gfldex (Initiate)
on Oct 18, 2021 at 19:46 UTC ( #11137699=note: print w/replies, xml ) Need Help??


in reply to Re^2: Hash Curious
in thread Hash Curious

I don't quite agree with this table. Please consider the following code.
constant term:<$container> = 1,2,3; say $container, $container.WHAT; # (1 2 3)(List) say "answer: $container"; # answer: 1 2 3 dd $container; # (1, 2, 3) # note the lack of naming of the container sub s($first, *@rest){ dd $first, @rest; } s($container); # $(1, 2, 3) # Array element = []
Here, $container is not a container. It is a List of Values and also a scalar. In quote interpolation it is handled like a list but in a signature as a scalar. In plain Raku (not in a signature, not in a quote, regex, etc.) '$' may not indicate Scalar.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137699]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2021-11-28 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?