This week on the Perl 6 mailing lists
This summary has been posted early because I will be going to OSCON Europe on Sunday. Next week's summary will include any threads which were not included this week.
Language
multi method dispatching of optional arguments
Last week,
Mark Stosberg wanted the specifications to address what should happen
in MMD when optional arguments are present (S12). He patched
mmd-draft.txt
and sent the text to the newsgroup. Luke Palmer
offered a suggestion.
Ph. Marek wondered if there will be MMD based on the value of parameters, as in Haskell. Audrey Tang confirmed this and pointed to S06. Trey Harris updated it with a reference to S12. Ruud H.G. van Tol also offered an example of syntax.
This week, Larry Wall clarified further, noting that every scalar value is a one-element subset of its type.
Inf appears to be unspec'ed
Mark Stosberg was unable to find the formal definitions for Inf
, not
and true
. Later he found them, and was able to add smart links.
Reduced assignment operator?
Audrey Tang noted that S03 was inconsistent about the treatment of assignment operators in the reduction operator. Audrey further commented that she doesn't see a problem with supporting assignment reductions as a syntactic exception. Larry Wall replied that it was worth supporting.
Outlaw to declare a lexical twice in the same scope
Steve Lukas quoted S04: "If you declare a lexical twice in the same
scope, it is the same lexical." He felt that declaring the same lexical
should give an error, because when he does this, he's made a mistake.
Rick Delaney disagreed; for development or debugging he will often add
a second declaration line to temporarily override the first.
Juerd agreed with Steve. He appreciates that my $foo
always gives
a new variable, so he does not need to know anything about the surrounding
code. Carl Mäsak also wanted the compiler to catch second declarations.
Naming the method form of s///
Earlier,
Mark J. Reed noted that according to S05, the string method equivalent of
s///
is subst
. He felt it might be easily confused with substr
and suggested replace
.
A long discussion on how the method would actually work followed.
Recently, Larry Wall noted that he should clarify the role of =
with regard to preceding declarators. They control how often the
expression is evaluated.
META vs meta
David Brunton noted that S12 specifies $obj.META
, but in Pugs it is
implemented as $obj.meta
. He wanted to know if he could change meta
to META
. Larry Wall replied that he was considering renaming the
method to use interrogative pronouns. David Green commented on Larry's
proposed names, and Larry responded.
Sam Vilain wondered if upper case was needed. Jonathan Scott Duff thought that it fit in with Perl's culture. Aaron Sherman had some other suggestions for avoiding namespace pollution.
David Brunton wanted to know if there was some reason that the meta methods could not be part of a default function package. Aaron Sherman gave two reasons why this was not desirable.
single named param
Gaal Yahas wondered if :(:$x)
was a single named parameter called $x
or a default invocant and a single required positional named $x.
Audrey Tang replied that a default invocant would not make sense
because there is nothing to default to. Gaal then wondered what
invocant is constructed for method foo ($just_a_named_param)
. Larry
Wall replied, and Mark Stosberg also commented. Audrey answered too.
[svn:perl6-synopsis] r11965 - doc/trunk/design/syn
Larry Wall made a commit to S03, which led Ruud H.G. van Tol
to ask if [=] $x, @y
was equivalent to
$x = @y[0] = @y[1] = @y[2] ... @y[-2] = y[-1]
. Larry replied
that they were. Ruud asked for additional clarification.
Unpacking tree node parameters
Earlier,
Gaal Yahas asked for some clarification on the intent in S06's "Unpacking
tree node parameters" so that he could introduce the optional use of the
colon more gradually.
This week, Audrey Tang replied with answers to Gaal's questions.
[svn:perl6-synopsis] r11969 - doc/trunk/design/syn
Several threads grew from Larry Wall's commits on the X
operator.
Darren Duncan expressed his appreciation for it.
Miroslav Silovic asked if it would be possible
to extend next
to pass arguments to the 'nexted' iterator.
In thread [svn:perl6-synopsis] r11971 - doc/trunk/design/syn, Daniel Hulme requested a variant which does the diagonal order.
[svn:perl6-synopsis] r11975 - doc/trunk/design/syn led to
additional comments. Carl Mäsak wanted to know why X-X
is
needed if X
already concatenates strings. Daniel Hulme
thought it was an incomplete change which should have read
XX
. Carl agreed, but thought X,X
would be nicer.
assigning to named parameters
Aaron Sherman wondered if it would be possible to treat named parameters
as lvalues, so that foo(:a<1>, :b<2>)
could become
foo(:a=1, :b=2)
.
-X file test operators
Aaron Sherman raised ambiguity issues between identifiers with dashes in their
names, like the file test operators, and unary minus (-4). Juerd replied with
proposals for phasing out -e
and friends in favour of some more
flexible/modern approaches. Larry Wall cleared up the syntax for calling
prefix operators as methods, and other funny method names.
Acording to S05, due to the longest token rule -e
will be parsed as the prefix
op -e
, and not as prefix unary minus and call to e
. However, this is only
the case if the prefix operator -e
is actually defined.
A discussion on identifiers with funny characters in them also started under this thread.
Parrot Porters
JSON compiler
Will Coleda announced that he had added a JSON compiler with help from Jerry Gay and Nuno Carvalho.
[svn ci] apps/p3
Leopold Toetsch announced that he'd created a Parrot-based slide presentation program. He requested improvements and suggestions.
[perl #40316] [NEW] opcodes not tested script
Fonseka created ticket [perl #40316] to include a patch for a script which outputs the opcodes not covered by tests. Currently all but 7% of the opcodes are used in real tests.
The thread continued in Re: [perl #40316] [NEW] opcodes not tested script, after the code was committed as r14594. Leopold Toetsch commented on how disassemble was largely untested, and Fonseka replied.
[perl #40319] [PATCH] PGE test file written in PIR revisited
In ticket [perl #40319], Nuno Carvalho reported that he
had cleaned t/compilers/pge/06-grammar.t
and included a
patch. Patrick R. Michaud noted that test 10 was marked 'todo'
but passed, and wanted to know why it was marked 'todo'. Patrick
applied it as r14606 and r14607.
The Interp structure
Alberto Simões
has been trying to improve compilers/imcc
to make it reentrant
by removing globals and creating an object with the variables which
is relevant to the parser. He noted that an Interp structure is
being passed, but believes this does not duplicate the functionality
he is creating, and asked for a confirmation.
Libraries, dynpmc and Visual C++
Ron Blaschke reported a fatal error when linking gdbmhash.dll
on
Windows XP with Visual C++. Will Coleda applied the patch as r14586
and asked for someone using GCC on Win32 to confirm that the code still
worked.
Accelerating Method Dispatch
chromatic posted a link to thoughts on method dispatch by Piers Cawley and Avi Bryant. He wondered if it was similar to PIC. Andy Armstrong replied that the articles describe branch prediction for method dispatch, which he felt was different from PIC. Leopold Toetsch thought there were some similarities, and that further optimization was possible.
[TODO] fill Parrot_register_move() with code : new implementation
Karl Forner included a patch to revise Parrot_register_move()
to address some bugs and improve speed. The algorithm was explained
in detail. It was applied as r14621. Leopold Toetsch commented on
the implementation.
HOWTO give options to parrot in tests
Karl Forner is working on [perl #40064]. He is wondering how
he can run the script with options, and wanted to know if TEST_PROG_ARGS
would be an appropriate choice. Leopold Toetsch suggested subclassing
Parrot::Test.
Global Variables Hunting
Alberto Simões
requested that anyone who found a global variable under IMCC/PIR
parser add a 'HITME!' comment near it and alert him.
cur_namespace under imcc.y
Alberto Simões
wanted to know if cur_namespace
in imcc.y
had the same meaning
as the one in imc.h
. He wanted to merge them.
Version PMC
Leopold Toetsch noted that GMP 4.1.1 segfaulted during multiplication. He corrected the problem by compiling and installing a new GMP, but he would like to create a diagnostic to warn about the bad GMP version.
Users
the CGI.pm in Perl 6
Darren Duncan made the suggestion that CGI.pm be improved for Perl 6 rather than simply ported. He listed a few ways in which it could be improved. Mark Stosberg replied and mentioned some of the points he considered most important. These suggestions in particular received further discussion: removing HTML generation methods, renaming the module, and incorporating session management.
Trey Harris agreed with Mark's sentiment
about excluding HTML methods from CGI.pm, but felt this could lead to
limited Perl 6 adoption. Thomas Wittek suggested use perl5:CGI
for legacy support and allowing CGI.pm to develop. Amir E. Aharoni
was also in favor of the backwards-compatibility module, and an improved
default. David Cantrell wondered if anyone was actually using HTML-generation.
In Andy Dougherty's opinion, there are probably many people using
it that way, because it features heavily in the documentation.
Leon Timmermans admitted to using them a few times, and wanted
a modern equivalent, but in a separate module. There were a number
of other comments. The general gist seemed to be that HTML-generation
functionality is used and should still be available, but optional.
The discussion of HTML methods led to Steffen Schwigon's observation that CGI.pm could use a name change to make it appear more modern. Darren Duncan and Juerd also disliked the current name. David Cantrell and Darren discussed whether 'CGI' implies an implementation or a standard interface.
In CGI Session management (was Re: the CGI.pm in Perl 6), Michael Snoyman suggested making session management easier, and perhaps integrating it. Yuval Kogman requested that session handling be left to a plugin, and offered to share what he had learned from redesigning the Catalyst session handling.
Trying to use Perl5 modules
Richard Hainsworth has been trying to discover how to use Perl 5 modules in Perl 6. He included some code which worked in Perl 5, and asked how he could use them in Pugs. Trey Harris replied that imports currently don't work, and showed a workaround. Audrey Tang answered that imports were implemented a few weeks ago, but implicit imports aren't supported yet.
Richard also wanted to know where .can
is documented.
Google "Welcome to the home page for Perl 6" (Perl 6 Wiki)
Conrad Schneiker noticed that Google had indexed the Perl 6 Wiki but that it hasn't yet reached the top search results.
Compiler
typo in HTTP::Server::Simple
Zack Hobson found a problem with the port number reported in startup by HTTP::Server::Simple in Pugs if the default port is used, and included a patch, which Carl Mäsak applied.
Acknowlegements
This summary was prepared using Mail::Summary::Tools, now available on CPAN.
If you appreciate Perl, consider contributing to the Perl Foundation to help support the development of Perl.
Yuval Kogman assisted with this summary.
Thank you to everyone who has pointed out mistakes and offered suggestions for improving this series. Comments on this summary can be sent to Ann Barcomb, kudra@domaintje.com.
Distribution
This summary can be found in the following places:
Comments
You can follow this conversation by subscribing to the comment feed for this post.