Best practices?

2018-09-02 Thread Parrot Raiser
What would be the criteria for deciding whether to name P6 constants using lower-case or UPPER_CASE names? Generally, system constants and variables use upper-case, so lower-case keeps user variables in a separate name space. Do user-defined constants belong there, or in upper-case to indicate

Re: Recommended Perl 6 best practices?

2008-12-21 Thread Larry Wall
On Sat, Dec 20, 2008 at 11:45:38PM -0500, Brandon S. Allbery KF8NH wrote: On 2008 Dec 20, at 13:39, Carl Mäsak wrote: Maybe this counts as a best practice, or maybe it's more of a pattern. In a recent piece of code, I found a way to exploit code blocks to act like return statements with side

Re: Recommended Perl 6 best practices?

2008-12-20 Thread Carl Mäsak
Maybe this counts as a best practice, or maybe it's more of a pattern. In a recent piece of code, I found a way to exploit code blocks to act like return statements with side effects. The resulting code became very clean, so I decided to blog about the way it works.

Re: Recommended Perl 6 best practices?

2008-12-20 Thread Brandon S. Allbery KF8NH
On 2008 Dec 20, at 13:39, Carl Mäsak wrote: Maybe this counts as a best practice, or maybe it's more of a pattern. In a recent piece of code, I found a way to exploit code blocks to act like return statements with side effects. The resulting code became very clean, so I decided to blog about the

Re: Recommended Perl 6 best practices?

2008-10-01 Thread TSa
HaloO, Martin D Kealey wrote: Surely it is more important that ($a ne $b) should be equivalent to not( $a eq $b ) regardless of whether either variable contains a junction? IIRC, ne is just an abbreviation of !eq where ! in turn as a meta operator means to pull the negation to the front. Are

Re: Recommended Perl 6 best practices?

2008-10-01 Thread TSa
HaloO, one nifty thing could be negation propagation in chained comparisons: ($a ne $b ne $c) === !($a eq $b || $b eq $c). This again insures some sanity if any of $a, $b or $c are junctions. BTW, the boolean connectives , || and ^^ shouldn't be auto-threaded through junctions. Regards, TSa.

Re: Recommended Perl 6 best practices?

2008-09-30 Thread Patrick R. Michaud
On Tue, Sep 30, 2008 at 02:31:46PM +1000, Jacinta Richardson wrote: Carl Mäsak wrote: The correct form using junctions would be this: die Unrecognized directive: TMPL_$directive if $directive ne 'VAR' 'LOOP' 'IF'; which makes sense, because this does give us: $directive

Re: Recommended Perl 6 best practices?

2008-09-30 Thread Martin D Kealey
On Tue, 30 Sep 2008, Patrick R. Michaud wrote: Just for pedantic clarity, what C $directive ne 'VAR' 'LOOP' 'IF' really gives is all( $directive ne 'VAR', $directive ne 'LOOP', $directive ne 'IF' ) In other words, the result of the expression is an all() Junction. In boolean context

Re: Recommended Perl 6 best practices?

2008-09-30 Thread Jacinta Richardson
Carl Mäsak wrote: Do not combine 'ne' and '|', like this: 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. Instead,

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

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

Recommended Perl 6 best practices?

2008-09-13 Thread Conrad Schneiker
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? http://www.perlfoundation.org/perl6/index.cgi?perl_6_books_and_media Perl 5 Books with Perl 6 Relevance * Perl