Re: Provisional Foo [Was: [svn:perl6-synopsis] r9176 - doc/trunk/design/syn]

2006-05-11 Thread Smylers
Larry Wall writes:

> Yes, the false value is False now, just as the true value is not True.

It's not?  I thought somebody had just said that it was?

> The reason for changing them is to avoid confusion with the built-in
> true() function,

Makes sense.

> So arguably, we could have a rule or policy that 0-ary functions are
> generally uppercase, not just the constant ones.  Instead of time,
> we'd have Time.

Does that actually gain us anything?

> Then the 0-or-1-ary functions could be rand(42) vs Rand, and the Rand
> form would never look for an argument.

Personally I think that'd be more confusing.  It isn't particularly
intuitive, and it makes switching from one form to another more awkward
cos you don't just have to change the params after the function name but
also the case of the letter at the start.

And what about functions with names starting with an underscore?

> Defining a
> 
> sub baz ($x?) {...}
> 
> would also define
> 
> sub Baz () {...}
> 
> Could also say that, unlike a provisional "foo", a provisional "Foo"
> would be considered 0-ary rather than list op.

Who would benefit from this?  To me it just seems like more complexity,
and encouraging hard-to-spot typos as we have things which differ only
in case.  Surely if somebody has a function call C which they
explicitly want to mark as being 0-ary then writing it as C<(baz)> or
C is already a sufficiently convenient way of doing this, and is
intuitive to the casual reader.

I think the effort in learning this special case outweighs any benefit
it brings.

Smylers


Re: Provisional Foo [Was: [svn:perl6-synopsis] r9176 - doc/trunk/design/syn]

2006-05-11 Thread Nicholas Clark
On Thu, May 11, 2006 at 10:24:24AM -0700, Larry Wall wrote:

> function as a subset type.  Constant functions are naturally 0-ary,
> and in C culture tend to be uppercase anyway.  So arguably, we could
> have a rule or policy that 0-ary functions are generally uppercase,
> not just the constant ones.  Instead of time, we'd have Time.
> Then the 0-or-1-ary functions could be rand(42) vs Rand, and the Rand
> form would never look for an argument.  Defining a

I'm not convinced that this holds, as Rand isn't constant, whereas the C
uppercase convention applies to constants. Also, the C convention tends to
be all-caps, unless I've mis-understood which convention you're referring to.

> sub baz ($x?) {...}
> 
> would also define
> 
> sub Baz () {...}
> 
> Have to think about that some more, though.  Could also say that,

Presumably it's titlecase rather than uppercase.
This doesn't introduce any interesting ambiguities, does it?
IIRC the "fun" stuff involves lowercase and Greek letter sigma following
something, which therefore isn't relevant here.

Nicholas Clark
-- 
I'm looking for a job: http://www.ccl4.org/~nick/CV.html