HaloO All,

Luke Palmer wrote:

But what are some nice, abstract concepts that these could represent.
One that I've been thinking of is:

    * @something is necessarily ordered: there is a well-defined "first element"
    * %something is necessarily a set: adding something twice is always 
redundant

Or something like that.  I've noticed in my recent programming which has
been heavily algorithmic that sets are ubiquitous.  % would still mean
hash by default, but hash would mean a "set of pairs".

Up to a point all three sigiled types &, @ and % can be interpreted as sets: & maps the argument(s) to the return value --- and can have side effects @ maps the integer index/slice to the return value % maps the key(s)/slice to the return value

Each of these comes with a corresponding postcicumfix dereferencer.
 & with .()
 @ with .[]
 % with .<> and .ÂÂ

Is that too abstract?


Maybe now is the time to figure out what they *do* mean.

I see them more as part of the type declaration. So that

my Int $var;

could also be written in the extreme as

my var is Scalar of Int;

Unless the parser needs the sigil for actually finding the name
that is declared?

In any case I would like all sigils to be optional as it is the
case for  & and :: already. Of course they *are* needed to disambiguate
when needed. After all---as Larry and others use to say---the "type
system is optional" and "everything is fair if you predeclare".

The above lifts the question up to the type system which in my eyes
needs some more clarifications. In that sense it's actually not optional
at all, but *defines* the behaviour of the whole Perl6 language. It's
only optional on the sytactic level, or better gives very flexible defaults.

Reading about A. J. H. Simons's "Theory of Classification" has made
me a true admirer of the design of Perl6 as it is right now.
(See http://www.dcs.shef.ac.uk/~ajhs/classify/index.html). I would
really like to hear how this works out on Perl6! Perhaps we could
interesst some students or researcher of theoretical computer science
to write a paper or so?

Regards,
--
TSa (Thomas SandlaÃ)



Reply via email to