> Date: Tue, 15 Oct 2002 12:24:56 -0700
> From: Michael Lazzaro <[EMAIL PROTECTED]>

> In Perl, variable names always begin with a special character called
> a sigil,

Ahem, "funny character."  The Camel glossary has no entry for "sigil"
(though I realize it's common terminology).

> 
> Any value may be forced, however, into being an explicit type: this is
> commonly known as casting or typecasting. Typecasting is the act of
> transforming a value of one type into a value of another type. The
> typecasting operator in Perl is as:
>
> 5 as int
> 5 as string
> 5 as MyNumber

Weren't we going to use constructor-style typecasting (at least as it
currently stands)?

          int(5)
          # or
          int.new(5)


> The keyword but is provided as a synonym for is. A typical use for but
> is in expressions where the property is perhaps "surprising" in some
> way.

Nope.  C<but> is entirely different from C<is>.  I think the best
description is that C<is> is for variables, and C<but> is for values.
I can't be sure this is always the case, however....  Indeed, many of
your examples use C<is> when they should use C<but>.

> Variables may be given two types of assertions, which are declared
> using on get and on set:
> 
> my Dog $dog
>     on get { ... }
>     on set { ... };

I'd imagine that these, too, would be properties.

    my Dog $dog is retriever {...}   # :-P

Luke

Reply via email to