[EMAIL PROTECTED] (Luke Palmer) writes:
we have a definitive
^^
Remember that this is Perl 6. You keep using that word, etc.
--
void russian_roulette(void) { char *target; strcpy(target, bullet); }
=head1 Ccaller and Continuations
Here's another blend known paradigms document from Luke. The idea
is to rethink Ccaller to provide even more information than it
already does, in an elegant way. To get us started:
As in Perl 5, the Ccaller function will return information about
the
--- Brent Dax [EMAIL PROTECTED] wrote:
method x ($me: $req, ?$opt, +$namedop, *%named, [EMAIL PROTECTED]) { ... }
Yikes. And I thought we were trying to get *away* from line noise?
Seriously, can't we use something rather prettier, like this?
method x($me: $req, $opt is
If one has a simple sub such as factorial:
sub factorial(int $a) {...}
then one subsequently declares the multi form of factorial to pick up the
non-integer form:
multi factorial(num $a) {...}
Does this promote the original declaration of factorial to a multi?
if not what happens?
Richard
The problem is that if you have multiple optional or named
parameters, things start getting uncomfortably prolix, and default
values end up a long way from their owners:
multi substr(Str $str, $from is optional = $CALLER::_,
$len is optional = Inf, $new is optional) {...}
So now putting C-style comments in p6 should be about as easy as
macro circumfix:/*...*/ () is parsed(/.*?/) { }
That's so easy I might even *use* it, lol
Not that I've ever really felt the need with # and =doc/=cut.
But just to make sure I'm getting it:
macro
Will infix operators be allowed to be macros instead of subs?
They'd be kinda necessary for infix operators for which standard sub
conventions are insufficient and need to diddle the parse tree instead,
such as short-circuiting operators.
It would also allow Damien's original ~ operator (R2L
Oh goody, two with one blow:
--- Damian Conway [EMAIL PROTECTED] wrote:
Larry wrote:
: multi foo (@a is Array of int) {...}
:
: my int @a = baz(); # is Array of int
: my @b = baz(); # is Array of Scalar
:
: foo(@a);# @a is typed correctly, so OK
:
Damian Conway:
# Brent Dax wrote:
#
# method x ($me: $req, ?$opt, +$namedop, *%named, [EMAIL PROTECTED]) { ... }
#
# Yikes. And I thought we were trying to get *away* from
# line noise?
# :^)
#
# Seriously, can't we use something rather prettier, like this?
#
# method
Simon Cozens:
# [EMAIL PROTECTED] (Luke Palmer) writes:
# we have a definitive
# ^^
# Remember that this is Perl 6. You keep using that word, etc.
It *is* definitive, Simon...at least this week. ;^)
--Brent Dax [EMAIL PROTECTED]
@roles=map {Parrot $_} qw(embedding regexen
Larry wrote:
: multi foo (@a is Array of int) {...}
:
: my int @a = baz(); # is Array of int
: my @b = baz(); # is Array of Scalar
:
: foo(@a);# @a is typed correctly, so OK
: foo(@b);# @b is not explicitly typed as Cint; OK or FAIL?
snip
I dunno. I can argue that
On Tuesday, March 11, 2003, at 08:41 AM, Brent Dax wrote:
Almost makes you wish for those backwards declarations from C that
computer scientists always gripe about, eh? :^) Well, what about
this?
multi substr(Str $str, $from = $CALLER::_ is optional, $len =
Inf is optional, $new is
--- Michael Lazzaro [EMAIL PROTECTED] wrote:
On Tuesday, March 11, 2003, at 06:42 AM, Richard Proctor wrote:
If one has a simple sub such as factorial:
sub factorial(int $a) {...}
then one subsequently declares the multi form of factorial to pick
up
the
non-integer form:
On Tuesday, March 11, 2003, at 11:19 AM, Austin Hastings wrote:
But you can't wrap multi-ness, as far as I can tell.
[A6]
And it happens that the multimethod dispatch is smart enough to find
the ordinary single-invocant sysread method, even though it may not
have been explicitly declared a
--- Michael Lazzaro [EMAIL PROTECTED] wrote:
On Tuesday, March 11, 2003, at 11:19 AM, Austin Hastings wrote:
But you can't wrap multi-ness, as far as I can tell.
[A6]
And it happens that the multimethod dispatch is smart enough to
find
the ordinary single-invocant sysread method,
Piers Cawley wrote:
Coroutines end and DFG
Nobody explained what DFG stands for.
It's a commonly used TLA standing for Data Flow Graph, which accompanies
the CFG (Control Flow Graph). Both are necessary for register allocation.
leo
The Perl 6 Summary for the week ending 20030309
Ooh look, it's another of those Perl 6 Summaries where Piers tries to
work a gratuitous reference to Leon Brocard into a summary of what's
been happening to the Perl 6 development process this week.
As tradition dictates, we'll start
--- Leopold Toetsch [EMAIL PROTECTED] wrote:
Piers Cawley wrote:
Coroutines end and DFG
Nobody explained what DFG stands for.
It's a commonly used TLA standing for Data Flow Graph, which
accompanies the CFG (Control Flow Graph). Both are necessary
for register allocation.
leo
So
From A6:
I worry that generalized wrappers will make it impossible to compile fast
subroutine calls, if we always have to allow for run-time insertion of
handlers. Of course, that's no slower than Perl 5, but we'd like to do better
than Perl 5. Perhaps we can have the default be to have
Richard Proctor asked:
If one has a simple sub such as factorial:
sub factorial(int $a) {...}
then one subsequently declares the multi form of factorial to pick up the
non-integer form:
multi factorial(num $a) {...}
Does this promote the original declaration of factorial to a multi?
if
On Tue, 11 Mar 2003, Damian Conway wrote:
These are basically all just two edge-cases. Namely:
@var == LIST
and:
LIST == @var
Have you considered:
LIST == @var.operator:=
LIST == @var.STOREARRAY
LIST == @var.how_do_i_spell_the_assignment_method
?
Various folks have suggested that the default assignment syntax:
sub foo(?$bar is copy = 1) {...}
be considered merely a shorthand for something like:
sub foo(?$bar is copy is default(1)) {...}
thereby allowing:
sub foo(?$bar is default(1) is copy ) {...}
and hence (mirabile
The effect of a macro is lexical; but the name may be installed in
either a package or a lexical scope. If the name is installed in a
class, can it be invoked via a variable of that class?
Example (SQL query integrated via macro):
my Database $db = MySqlDatabase.connect(...);
$db.select *
Will it be possible in perl6 to overload multis on the const-ness of a
parameter, like C++ does? For instance,
multi getX(Foo $self:) returns Int {...} #const version
multi getX(Foo $self: is rw) returns Int is rw {...} #non-const version
If getX were called on a const Foo object
On Tuesday, March 11, 2003, at 12:39 PM, Austin Hastings wrote:
You want Cmulti to tell the compiler to build in multiple dispatch.
Any invocation of Cfoo after Cmulti foo is going to be a penny
dropped into the great Pachinko game of multimethod-dispatchery. By
default, if no winning multi
Joe Gottman wrote:
Will it be possible in perl6 to overload multis on the const-ness of a
parameter, like C++ does? For instance,
multi getX(Foo $self:) returns Int {...} #const version
multi getX(Foo $self: is rw) returns Int is rw {...} #non-const version
That second one would have to
Michael Lazzaro asked:
Are you concerned about having an Cis default() spelling at all
No, not at all. It really is a shorthand for a trait, after all, so it should
almost certainly have a trait name. Besides, Cis default is probably needed
for non-parameter variables too:
my %nickname
John Williams wrote:
Have you considered:
LIST == @var.operator:=
LIST == @var.STOREARRAY
LIST == @var.how_do_i_spell_the_assignment_method
That's probably:
LIST == @var.STORE(*);
which is still pretty darn ugly. ;-)
Damian
I don't know that that means we couldn't have an Cis default()
spelling, though. And Cis variadic (or something easier to spell)
for the * case. If we have Cis optional and Cis named, I think
it would be appropriate to have names for the other linenoise as
well.
I'd say please.
So now putting C-style comments in p6 should be about as easy as
macro circumfix:/*...*/ () is parsed(/.*?/) { }
Yep.
But just to make sure I'm getting it:
macro circumfix:soapbox.../soapbox () is parsed(/.*?/) {
\n# much ranting deleted here . . . .\n
}
will actually work? :)
Austin Hastings wrote:
You're treading dangerously close to the SM line there...
Sure. That's exactly what types are for.
Does it make sense to say Cuse strict params; for this stuff?
I'd much rather that simply using typed params invoked type stricture.
Damian
John Siracusa wrote:
From A6:
I worry that generalized wrappers will make it impossible to compile fast
subroutine calls, if we always have to allow for run-time insertion of
handlers. Of course, that's no slower than Perl 5, but we'd like to do better
than Perl 5. Perhaps we can have the default
On Wed 12 Mar, Michael Lazzaro wrote:
On Tuesday, March 11, 2003, at 12:39 PM, Austin Hastings wrote:
You want Cmulti to tell the compiler to build in multiple dispatch.
Any invocation of Cfoo after Cmulti foo is going to be a penny
dropped into the great Pachinko game of
33 matches
Mail list logo