Larry Wall [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
On Wed, May 05, 2004 at 04:25:45PM -0400, Austin Hastings wrote:
:
: method x ($me: $req, ?$opt, +$namedopt, *%named, [EMAIL PROTECTED]) {...}
: vs:
: method x($me: $req, ?$opt, ~$namedopt, *%named, [EMAIL
On Tue, May 04, 2004 at 04:14:44PM -0600, Luke Palmer wrote:
Dov Wasserman writes:
Since in the rest of Perl 6, the '~' operator involves string
representation, perhaps the standard +$foo marker should really be ~$foo:
i.e., $foo only has a (string) name, not a numeric position. Thus ~$foo
On Wed, May 05, 2004 at 09:02:14AM -0500, Jonathan Scott Duff wrote:
: Hmm... I'm quite sure that I like ~ better than + for mnemonic purposes.
:
: I agree.
I think + is easier to see. Mnemonic value is a secondary issue in
something that will be used so heavily.
Larry
-Original Message-
From: Larry Wall [mailto:[EMAIL PROTECTED]
On Wed, May 05, 2004 at 09:02:14AM -0500, Jonathan Scott Duff wrote:
: Hmm... I'm quite sure that I like ~ better than + for mnemonic
purposes.
:
: I agree.
I think + is easier to see. Mnemonic value is a secondary
On Wed, May 05, 2004 at 04:25:45PM -0400, Austin Hastings wrote:
: In this case, the reliance on saying:
:
: if (+$x 9) ...
:
: to disambiguate logical/arithmetic/string/whatever context in expressions is
: going to sit at cross purposes to the +-as-required-arg usage. It'll be yet
:
At 1:55 PM -0700 5/5/04, Larry Wall wrote:
On Wed, May 05, 2004 at 04:25:45PM -0400, Austin Hastings wrote:
: In this case, the reliance on saying:
:
: if (+$x 9) ...
:
: to disambiguate logical/arithmetic/string/whatever context in expressions is
: going to sit at cross purposes to the
-Original Message-
From: Larry Wall [mailto:[EMAIL PROTECTED]
On Wed, May 05, 2004 at 04:25:45PM -0400, Austin Hastings wrote:
: In this case, the reliance on saying:
:
: if (+$x 9) ...
:
: to disambiguate logical/arithmetic/string/whatever context in
expressions is
:
On 5/5/04 6:24 PM, Austin Hastings wrote:
To answer Dan's posting: I fully expect to never use any of these
sigils, myself. I'm sure there will be traits for this- nice
verbose traits. (Signatures are about as write-once as you can get...)
method x(
requires:invocant $me,
requires
On Wed, 5 May 2004, John Siracusa wrote:
Anyway, once we're spelling things out, don't forget to throw in some
traits for params that are required and must be provided as pairs.
Damian promised! ;)
Looking thru what exists of P6C I saw this in P6C/Nodes.pm:
use Class::Struct P6C::signature
Long-time lurker, first time poster. Dittos, kudos, etc.
Back on the topic of required named parameters, I think John Siracusa's
initial post did a good job of separating the two concepts of parameter
mandate (required vs. optional) and parameter designation (by position vs.
by name). Each of
Dov Wasserman writes:
Long-time lurker, first time poster. Dittos, kudos, etc.
Welcome aboard.
Since in the rest of Perl 6, the '~' operator involves string
representation, perhaps the standard +$foo marker should really be ~$foo:
i.e., $foo only has a (string) name, not a numeric position.
On Tue, 2004-04-20 at 10:51, John Siracusa wrote:
Hm, so how would the is required trait that Damian posted work? Would it
simply be shorthand for a run-time check that I don't have to write myself?
I was under the impression that it would work the way I described earlier:
sub foo(+$a
On 4/22/04 5:33 PM, Aaron Sherman wrote:
On Tue, 2004-04-20 at 10:51, John Siracusa wrote:
Hm, so how would the is required trait that Damian posted work? Would it
simply be shorthand for a run-time check that I don't have to write myself?
I was under the impression that it would work the way
On 4/22/04 6:52 PM, John Siracusa wrote:
Yes, it appears that runtime checks for the existence of required params
will continue to be a necessary part of Perl programming.
...of course, there are at least two ways to do runtime checks:
* runtime checks that the programmer has to write
On Mon, Apr 19, 2004 at 01:44:53PM -0400, John Siracusa wrote:
: On 4/19/04 1:30 PM, Larry Wall wrote:
: On Mon, Apr 19, 2004 at 01:14:57PM -0400, John Siracusa wrote:
: : I know we are running out of special characters, but I really, really think
: : that required named parameters are a
John Siracusa asked:
Well, actually, we saved you last summer when we decided to make +
mean that the parameter must be named.
...named and required, or named and optional?
Named and optional, by default.
IOW, is this all true?
sub foo(+$a, +$b) { ... }
foo(); # compile-time
On 4/19/04 9:05 PM, Damian Conway wrote:
You want:
sub foo(+$a is required, +$b is required) { ... }
Yes, that would be just fine :)
-John
At 9:50 AM -0400 4/20/04, John Siracusa wrote:
On 4/19/04 7:16 PM, Larry Wall wrote:
Well, no, we're still stuck at run-time validation of that. In the case
of methods you can't really do anything else anyway, generally speaking.
Why is that?
Because at compile time all you have is a generic
On 4/20/04 10:42 AM, Dan Sugalski wrote:
At 9:50 AM -0400 4/20/04, John Siracusa wrote:
On 4/19/04 7:16 PM, Larry Wall wrote:
Well, no, we're still stuck at run-time validation of that. In the case
of methods you can't really do anything else anyway, generally speaking.
Why is that?
At 10:51 AM -0400 4/20/04, John Siracusa wrote:
On 4/20/04 10:42 AM, Dan Sugalski wrote:
At 9:50 AM -0400 4/20/04, John Siracusa wrote:
On 4/19/04 7:16 PM, Larry Wall wrote:
Well, no, we're still stuck at run-time validation of that. In the case
of methods you can't really do anything else
Those with encyclopedic knowledge of the perl6-language list will recall my
impassioned, but ultimately futile plea for required named parameters--that
is, required arguments to a function that must be supplied as pairs rather
than positionally.
Here's a post from the middle of that old thread:
On Mon, Apr 19, 2004 at 01:14:57PM -0400, John Siracusa wrote:
: I know we are running out of special characters, but I really, really think
: that required named parameters are a natural fit for many common APIs. A12
: has reinforced that belief. Save me, Dami-Wan Wallnobi, you're my only
:
At 1:14 PM -0400 4/19/04, John Siracusa wrote:
I know we are running out of special characters, but I really, really think
that required named parameters are a natural fit for many common APIs.
Well... maybe, but ponder a likely common case--automatically
redelegated initialization methods with
On 4/19/04 1:30 PM, Larry Wall wrote:
On Mon, Apr 19, 2004 at 01:14:57PM -0400, John Siracusa wrote:
: I know we are running out of special characters, but I really, really think
: that required named parameters are a natural fit for many common APIs. A12
: has reinforced that belief. Save
On Mon, Apr 19, 2004 at 10:30:18AM -0700, Larry Wall wrote:
On Mon, Apr 19, 2004 at 01:14:57PM -0400, John Siracusa wrote:
: I know we are running out of special characters, but I really, really think
: that required named parameters are a natural fit for many common APIs. A12
: has
On 4/19/04 1:41 PM, Dan Sugalski wrote:
At 1:14 PM -0400 4/19/04, John Siracusa wrote:
I know we are running out of special characters, but I really, really think
that required named parameters are a natural fit for many common APIs.
Well... maybe, but ponder a likely common
At 1:50 PM -0400 4/19/04, John Siracusa wrote:
On 4/19/04 1:41 PM, Dan Sugalski wrote:
At 1:14 PM -0400 4/19/04, John Siracusa wrote:
I know we are running out of special characters, but I really, really think
that required named parameters are a natural fit for many common APIs.
Well...
27 matches
Mail list logo