On Mon, May 02, 2005 at 03:04:57AM -0600, Luke Palmer wrote:
: S12 says:
: 
:     subtype Str_not2b of Str where /^[isnt|arent|amnot|aint]$/;
: 
: My brain parses this as:
: 
:     subtype Str_not2b[Str where /.../];
: 
: Or:
: 
:     subtype Str_not2b[Str] where /.../;
: 
: Neither of which really reflect how it is really parsed.

It's closer to the former, but perhaps more like

    subtype Str_not2b[returns => :(Str where /.../)];

: It looks like
: `subtype` has a special syntax.  I find this to be free of special
: syntax and clearer to boot:
: 
:     type Str_not2b ::= Str where /^[isnt|arent|amnot|aint]$/;

I don't.  That "type" keyword is just a strange way to write the
"::" sigil.

: Why don't we just ditch the `subtype` keyword?

Because by similar arguments we should also disallow

    sub foo ($x, $y, $z) {...}
    class Dog is Mammal {...}

in favor of

    &foo ::= sub ($x, $y, $z) {...}
    ::Dog ::= class is Mammal {...}

I'd rather have most declarative keywords out front, and reserve ::=
for bindings that require unusual calculations on the RHS.  Though as
Thomas pointed out, you can still write

    ::Str_not2b ::= Str where /^[isnt|arent|amnot|aint]$/;

if you really want to.

Larry

Reply via email to