Announce: Niecza Perl 6 v1
To mark one month since the first announcement of Niecza, to be known
retroactively as v0, this is another announcement, to be known as v1.
Further announcements will occur at intervals on the last Monday of
each month.
You have my assurance that the 'v1' tag, avai
On Mon, Dec 27, 2010 at 8:50 PM, Daniel Carrera wrote:
>
> So TTIR just means that any two terms must be separated by something, like
> an operator (2+5). Which basically is common sense and I'm actually
> surprised to hear that in Perl 5 you could have two terms one after the
> other with nothing
On Tue, Dec 28, 2010 at 2:06 AM, Chas. Owens On Mon, Dec 27, 2010 at All of
your examples are in fact terms. A term is a thing that is
> considered one unit. So, numbers, strings, and variables are all
> obviously terms. A function or method call that includes parentheses
> is also a term. But
On Mon, Dec 27, 2010 at 19:41, Daniel Carrera wrote:
snip
> Hmm... I think this will only make sense to me if I ask you to define what a
> "term" is, but I am sure that this term (pun intended) is difficult to
> define. In particular, if a number like 5 is a term, then I would think that
> the fol
On Tue, Dec 28, 2010 at 1:21 AM, Mason Kramer wrote:
> Sorry.
>
> TTIAR = Two Terms In A Row.
>
> It's always a syntax error in Perl6, unlike Perl 5.
>
> print, say, and sin as you've used them are not terms, actually. They're
> expressions which happen to be function calls. You're calling .WHAT
Sorry.
TTIAR = Two Terms In A Row.
It's always a syntax error in Perl6, unlike Perl 5.
print, say, and sin as you've used them are not terms, actually. They're
expressions which happen to be function calls. You're calling .WHAT on their
return values. This is predictable going forward fro
On Mon, Dec 27, 2010 at 18:49, Daniel Carrera wrote:
snip
> That's cool. Thanks. I notice it works on numbers and string literals:
> "hello".WHAT # Str()
> 3.WHAT # Int()
> 3.3.WHAT # Rat()
> pi.WHAT # Num()
> (1+3i).WHAT # Complex()
>
> But it seems to give very inconsis
On Mon, Dec 27, 2010 at 18:18, Daniel Carrera wrote:
> On Mon, Dec 27, 2010 at 10:03 PM, Moritz Lenz wrote:
>
>> or
>>
>> my $closure = $r1 > $r2 ?? { %matches{$p1}++ } !! { %matches{$p2}++ };
>> # invoke it
>> $closure();
>>
>
>
> That's very cool. Perl 6 is a functional language with lambdas and
On Tue, Dec 28, 2010 at 12:38 AM, Mason Kramer wrote:
> One method-like thing that's come in handy for me as I've tinkered with the
> language is .WHAT.
>
> { ... }.WHAT
> Block()
>
> AFAIK, you can use .WHAT on *any* term, because every term in Perl6 is an
> object that is implemented by a class,
One method-like thing that's come in handy for me as I've tinkered with the
language is .WHAT.
{ ... }.WHAT
Block()
AFAIK, you can use .WHAT on *any* term, because every term in Perl6 is an
object that is implemented by a class, and every class has a corresponding type
object (which is what .
On Sat Jun 26 11:43:15 2010, pmichaud wrote:
> Now fixed in a579f8e. Closing ticket.
>
> Pm
How do I see if a thing does Callable?
rakudo: sub foo {}; say &foo ~~ Callable
rakudo cae7f9: OUTPUT«1»
rakudo: sub foo {}; say &foo.^does(Callable)
rakudo cae7f9: OUTPUT«1»
Ahh, yep that's what
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #81352]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=81352 >
rakudo: say defined Nil; say defined ()
rakudo cae7f9: OUTPUT«01»
* masak submits ra
On Mon, Dec 27, 2010 at 10:03 PM, Moritz Lenz wrote:
> or
>
> my $closure = $r1 > $r2 ?? { %matches{$p1}++ } !! { %matches{$p2}++ };
> # invoke it
> $closure();
>
That's very cool. Perl 6 is a functional language with lambdas and
everything.
Daniel.
--
No trees were destroyed in the generation
On Mon, Dec 27, 2010 at 10:03 PM, Chas. Owens > { } by itself creates a
lambda (i.e. an anonymous function), so it may
> > be that you are returning an anonymous function that never gets
> > executed. Try using parentheses instead of braces.
>
> Or better yet, don't use anything. Since ++ has hi
On Mon, Dec 27, 2010 at 10:00 PM, Moritz Lenz wrote:
> But there's a good reason: .method is a term on its own, and actually
> means $_.method. So if you write @names.foo .bar, that's two terms in a
> row.
>
That is indeed a good reason. I think I knew about it but forgot. That now
the $_ varia
On Mon, Dec 27, 2010 at 16:00, Chas. Owens wrote:
> On Mon, Dec 27, 2010 at 15:55, Daniel Carrera wrote:
>> On Mon, Dec 27, 2010 at 9:49 PM, Chas. Owens wrote:
>>>
>>> The [conditional operator][1] is now spelled test ?? true !! false not
>>> test ? true : false.
>>
>> Thanks!
>> Now the followi
On 12/27/2010 09:55 PM, Daniel Carrera wrote:
> On Mon, Dec 27, 2010 at 9:49 PM, Chas. Owens wrote:
>
>> The [conditional operator][1] is now spelled test ?? true !! false not
>> test ? true : false.
>>
>
> Thanks!
>
> Now the following code works:
>
> %matches{ $r1 > $r2 ?? $p1 !! $p2 }++;
>
On 12/27/2010 09:12 PM, Daniel Carrera wrote:
> Thanks. The blacklash "unspace" works.
>
> my @sorted = @names.sort({ %sets{$_} })\
>.sort({ %matches{$_} })\
>.reverse;
>
> Though I'm a bit sad that you need that and you can't just separate methods
> with s
On Mon, Dec 27, 2010 at 15:55, Daniel Carrera wrote:
> On Mon, Dec 27, 2010 at 9:49 PM, Chas. Owens wrote:
>>
>> The [conditional operator][1] is now spelled test ?? true !! false not
>> test ? true : false.
>
> Thanks!
> Now the following code works:
> %matches{ $r1 > $r2 ?? $p1 !! $p2 }++;
>
>
On Mon, Dec 27, 2010 at 9:49 PM, Chas. Owens wrote:
> The [conditional operator][1] is now spelled test ?? true !! false not
> test ? true : false.
>
Thanks!
Now the following code works:
%matches{ $r1 > $r2 ?? $p1 !! $p2 }++;
I'm still having trouble with the other alternative:
$r1 > $r2
On 27-12-2010 21:46:05, Daniel Carrera wrote:
> Hello,
>
> Looking at the first example in "Using Perl6", I have:
>
> if $r1 > $r2 {
> %matches{$p1}++;
> } else {
> %matches{$p2}++;
> }
>
> I was thinking that it should be possible to make this more compact, but the
> two ideas I tried d
On Mon, Dec 27, 2010 at 15:46, Daniel Carrera wrote:
> Hello,
>
> Looking at the first example in "Using Perl6", I have:
>
> if $r1 > $r2 {
> %matches{$p1}++;
> } else {
> %matches{$p2}++;
> }
>
> I was thinking that it should be possible to make this more compact, but the
> two ideas I trie
Hello,
Looking at the first example in "Using Perl6", I have:
if $r1 > $r2 {
%matches{$p1}++;
} else {
%matches{$p2}++;
}
I was thinking that it should be possible to make this more compact, but the
two ideas I tried didn't work:
# Idea 1 gives: Unable to parse postcircumfix:sym<{ }>, c
On Mon, Dec 27, 2010 at 8:37 PM, Darren Duncan wrote:
> A relevant reading would be
> http://perlcabal.org/syn/S02.html#Whitespace_and_Comments I think; what
> you are trying to do may not directly be allowed, though there may be
> workarounds such as by using "unspace".
>
Thanks. The blacklash "
Daniel Carrera wrote:
I tested the first program using the latest release of Rakudo Star.
The first program has the following:
my @sorted = @names.sort({ %sets{$_} }).sort({ %matches{$_} }).reverse;
This works correctly, but it's long and I'd rather format this line like this:
This works corre
Hello,
After a long absence (been busy) I'm trying to re-learn Perl 6. I'm
reading the book "Using Perl 6", from Jonathan S, Moritz, Mäsak, PM
and Jonathan W.:
http://github.com/downloads/perl6/book/2010.08.a4.pdf
I tested the first program using the latest release of Rakudo Star.
The first pro
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #81336]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=81336 >
rakudo: say 0 ~~ 0 ~~ 0
rakudo cae7f9: OUTPUT«Bool::False»
* masak submits rakudobug
27 matches
Mail list logo