Deep equivalence test of data structures

2008-09-14 Thread Carl Mäsak
Recently, in November, we've had reason to clone the Rakudo Test.pm and add an implementation (viklund++) of is_deeply, for testing whether two arrays, pairs or hashes are deeply -- recursively -- equivalent. The method does what you'd think it does, checks the types of its parameters and recurses

Re: Recommended Perl 6 best practices?

2008-09-14 Thread Carl Mäsak
Conrad (): Is there something more up-to-date concerning Perl 6 best practices that are presently-recommended (by p6l or @Larry) than the following item on the Perl 6 wiki? If you ask me, best practices evolve as a countering force to enough people using less-than-ideal practices to create

Re: Recommended Perl 6 best practices?

2008-09-14 Thread Patrick R. Michaud
On Sun, Sep 14, 2008 at 04:18:44PM +0200, Carl Mäsak wrote: Conrad (): Is there something more up-to-date concerning Perl 6 best practices that are presently-recommended (by p6l or @Larry) than the following item on the Perl 6 wiki? [...] That said, I do have one Perl 6-specific best

What should +:21a produce?

2008-09-14 Thread Patrick R. Michaud
Given that we have say +'12';# 12 say +'0b1100';# 12 say +'0x0c'; # 12 what should the following produce? say +':21a';# 0? Failure? 12? Pm

What should 'my $str $x; $x ~= a' return?

2008-09-14 Thread Moritz Lenz
Well, the subject line already contains my question. I wrote some tests about scalar autovivification. The short sequence: my Str $x; $x ~= 'a'; produces 'Stra' in pugs, because $x contains a Str proto object, that stringifies to the type name. From my understanding of the synopsis that's

Re: negated operators and disjunctions (was: Recommended Perl 6 best practices?)

2008-09-14 Thread Eric Wilhelm
# from Carl Mäsak # on Sunday 14 September 2008 07:18: die Unrecognized directive: TMPL_$directive    if $directive ne 'VAR' | 'LOOP' | 'IF'; One is tempted to assume that this means the same as $directive ne 'VAR' || $directive ne 'LOOP' || $directive ne 'IF', but it doesn't. Actually, it

Re: How to define a new value type?

2008-09-14 Thread TSa (Thomas Sandlaß)
On Sunday, 14. September 2008 16:08:19 Patrick R. Michaud wrote: So, how does one get an object to pretend to be a value type for purposes of assignment? I think a straight forward approach is to overload the assignment operator on the actual types of the lhs and rhs. The dispatch target than

Re: Deep equivalence test of data structures

2008-09-14 Thread Michael G Schwern
Eric Wilhelm asked me to chime in here. is_deeply() is about checking that two structures contain the same values. This is different from checking that they're the same *things*, that they are in fact the same object or reference. You need both. Reading eqv() it seems that yes, it is doing like

Re: Deep equivalence test of data structures

2008-09-14 Thread Patrick R. Michaud
On Sun, Sep 14, 2008 at 01:59:22PM -0700, Michael G Schwern wrote: Eric Wilhelm asked me to chime in here. is_deeply() is about checking that two structures contain the same values. This is different from checking that they're the same *things*, that they are in fact the same object or

Re: How to define a new value type?

2008-09-14 Thread John M. Dlugosz
TSa (Thomas Sandlaß) thomas-at-sandlass.de |Perl 6| wrote: I think a straight forward approach is to overload the assignment operator on the actual types of the lhs and rhs. The dispatch target than clones the value to be stored in the lhs container after being checked against the container's

Re: What should +:21a produce?

2008-09-14 Thread Darren Duncan
FastStone Capture http://portabler.blogspot.com/2008/09/faststone-capture.html CloneDVD http://portabler.blogspot.com/search/label/CloneDVD%202 Other Software Collection - CloneDVD mobile (1) - http://portabler.blogspot.com/search/label/CloneDVD%20mobile - Corel Draw 11 Portable (1) -