Re: Observations from a C++/Python developer that never used Perl5

2016-09-10 Thread Brian Duggan
The pair constructor seems to be in a different category than the other quoting operators since the expression that it quotes must look like an identifier: https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp#L1776 token fatarrow {

Re: Observations from a C++/Python developer that never used Perl5

2016-09-09 Thread Aaron Sherman
You cannot currently define your own quote-like operators. That will come with true macros (though you could certainly do it via a slang... everything is possible with a slang). But they are operators. Not only are they operators, but they nest other operators. vis: say "These are my args:

Re: Observations from a C++/Python developer that never used Perl5

2016-09-09 Thread Brock Wilcox
Quotes are almost a circumfix operator, but they act a bit more like a macro by controlling the parsing of the contents. But you can do some weird things like define your own quote-likes. perl6 -e ' sub circumfix:<>($v) { "{$v}" } ; say B"foo"B ' # output: foo or more verbosely perl6 -e ' sub

Re: Observations from a C++/Python developer that never used Perl5

2016-09-09 Thread Joseph Garvin
Wait, quotes *are an operator* ? If so how would I define them? If the operator returns string, what is the type of its argument? If so that's even stranger -- most languages they're a hard coded bit of syntax -- the closest thing I can think of is in C++11 you can add your own string literal

Re: Observations from a C++/Python developer that never used Perl5

2016-09-08 Thread Aaron Sherman
> > it is combining too many new things at once: Well, it is meant to be the up-front example of everything at once before the step-by-step... > * BUILD > * new These are the heart of construction. I don't think there's any avoiding that in a class tutorial. * submethod > * bless These

Re: Observations from a C++/Python developer that never used Perl5

2016-09-08 Thread Joseph Garvin
On Thu, Sep 8, 2016 at 12:25 AM, Kaare Rasmussen wrote: > I wonder what you miss from https://docs.perl6.org/language/classtut. To > me, it explains the hows and whys very thoroughly. Now, I now people have > been hard at work improving the documentation, so if you can point to

Re: Observations from a C++/Python developer that never used Perl5

2016-09-08 Thread Will Coleda
> As I recall it, macros where left out of the initial implementation. So you > have to wait for another Christmas Present :-) The version of macros that was available in Rakudo when the 6.c spec was cut was released with the compiler; It's marked experimental and is therefore subject to change,

Re: Observations from a C++/Python developer that never used Perl5

2016-09-08 Thread yary
On Thu, Sep 8, 2016 at 6:41 AM, Kamil Kułaga wrote: > In perl6 default way is to not write new, BUILD or BUILDALL and also > not to write accessors. When you create object you can provide > attributes to initialize, default accessors are generated if field is > declared with

Re: Observations from a C++/Python developer that never used Perl5

2016-09-08 Thread Kamil Kułaga
On Thu, Sep 8, 2016 at 4:00 AM, Joseph Garvin wrote: > * I can find no concise easy-to-understand explanation for how to define > what other languages would call constructors. Instead there is a mess of > bless, magic inside Mu, new, BUILD, BUILDALL... It's not clear

Re: Observations from a C++/Python developer that never used Perl5

2016-09-07 Thread Kaare Rasmussen
Hi Joseph Welcome, and I hope you'll stick around. Now, I haven't had the time to dig into Perl 6 myself, only to poke at it from time to time. But, while waiting for people who know something to respond, I'll ask you to be a little concise in certain areas. * I can find no concise