@ does the Positional role % does Associative & does Callable $ causes its value to be an item (its values do not flatten into an outer list when you use `flat`)
my %hash is SetHash; Array does Positional, and all of its values are itemized We are unlikely to call $ variables "generic" because the word "generic" is too generic. For example Java has generics, and they are not variables. Why muddy the waters by using a word that has many different meanings in different programming languages? On Fri, Jun 9, 2017 at 1:21 AM, Richard Hainsworth <rnhainswo...@gmail.com> wrote: > It also seems to me that 'scalar' gives the wrong impression compared to > arrays. A scalar in a vector is a component of a vector. > > I was thinking of "generic". > > Hence "$variable" is a generic variable because it can hold any type of > content. > > > > On Friday, June 09, 2017 02:10 PM, Gabor Szabo wrote: >> >> Looking at https://docs.perl6.org/language/variables there are 4 >> variable types with sigil: $, @, %, &. >> In Perl 5 I used to call them scalar, array, hash, and function >> respectively, even if the scalar variable had a reference to an array >> in it. >> >> How do you call them in Perl 6? >> >> As I understand @ always holds an array (@.^name is always Array or >> some Array[type]). Similarly % always holds a hash and & is always a >> function or a method. >> So calling them array, hash, and function sounds good. >> >> However I am not sure what to call the variables with a $ sigil? >> Should they be called "scalars"? Wouldn't that case confusion as there >> is also a container-type called Scalar. >> >> The word "scalar" appears twice in the document describing the >> variables: https://docs.perl6.org/language/variables and a total of >> 135 in the whole doc including the 5to6 documents and the document >> describing the Scalar type. >> The document describing the Scalar type: >> https://docs.perl6.org/type/Scalar the term "$-sigiled variable" is >> used which seems to be a bit long for general use. >> >> So I wonder how do *you* call them? >> >> Gabor