Re: Blogging on Perl6 anonymous proto/multi

2016-02-15 Thread Lloyd Fournier
I made a comment on your blog which is awaiting moderation. Anyways here it
is for people on the mailing list:

I agree that being able to compose dispatchers and candidates procedurally
is very useful. And you can sorta do it. Check out:

https://github.com/LLFourn/p6-CompUnit-Util#dispatcher-manipulation

especially this line:
https://github.com/LLFourn/p6-CompUnit-Util/blob/master/lib/CompUnit/Util.pm6#L233
where I have to create a proto. This works but there is a serialization bug
which breaks precompilation if it's done at compile time.

but doing it at runtime should work:

sub create-proto($name) {
my $proto = (my proto anon (|) {*}).clone;
$proto.set_name($name);
return $proto;
}

my $proto = create-proto('foo');
$proto.add_dispatchee(anon sub candidate1('one') { 'one' });
$proto.add_dispatchee(anon sub candidate2('two') { 'two' });

say $proto.('one');
say $proto.perl;
.say for $proto.candidates;


The above will work but it's quite fragile. Try assigning the sub to a
variable first and then .add_dispatchee (it will die). It definitely needs
a nicer interface. The design docs say that protos should have .push and
mentions that you should be able to do Proto.new.
https://design.perl6.org/S06.html#Introspection


On Mon, Feb 15, 2016 at 6:36 AM yary  wrote:

> Back in June of last year some discussion about multi-subs got me
> thinking and posting about anonymous proto/multi routines here. It's
> been bubbling in the back of my mind since then, and as my Valentine
> to the language, I've posted my thoughts at
>
> http://blogs.perl.org/users/yary/2016/02/apropos-proto-perl6c-multi-thoughts.html
>
> It's a more coherent (I hope!) follow-up to
> https://www.mail-archive.com/perl6-language@perl.org/msg34937.html
>
> Would appreciate feedback on the merits or perils of exposing a way
> for creating a truly anonymous multi. It's something the design spec
> isn't explicit on.
>
> -y
>


Re: Naming debate- what's the location for it?

2018-02-16 Thread Lloyd Fournier
I'm about to publish some blog posts with using Perl 6  to demonstrate some
cryptographic primitives. I was thinking about calling it "rakudo" to at
least intrigue people and make them google it. Couldn't we call the
language rakudo and the implementation nqp-rakudo? (ie a rakudo
implementation in nqp)

LL


On Thu, Feb 15, 2018 at 5:02 AM Patrick R. Michaud 
wrote:

> On Wed, Feb 14, 2018 at 05:55:54PM +, raiph mellor wrote:
> > (Perl) Rakudo
> > ===
> >
> > If jnthn and pmichaud and larry can warm to this idea, then:
> > [...]
> > The 'Perl' could be dropped from Rakudo specific propaganda,
> > calling the language just Rakudo instead, to reinforce that it refers
> > to 6e and beyond. But the Perl could be retained in any material
> > covering both Raptor and Rakudo as a reunified tech / community.
>
> FWIW, I am VERY MUCH AGAINST the idea of naming a language after its
> implementation.  I've seen the confusion it causes in other environments
> and we ought not repeat that mistake here, especially since we don't have
> to.
>
> Whatever things end up being called, don't confuse the implementation(s)
> with the language definition.
>
> Pm
>