Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-toolchain, 2016-07-19

| Channels | #perl6-toolchain index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:59 ugexe that gist can probably be whittled down to a role that just contains its .content though and applied to a Distribution::Hash
01:49 ilbot3 joined #perl6-toolchain
01:49 Topic for #perl6-toolchain is now Fire is step THREE! | https://github.com/perl6/toolchain-bikeshed | Channel logs: http://irclog.perlgeek.de/perl6-toolchain/today | useful prior art: https://metacpan.org/pod/CPAN::Meta::Spec
03:25 ugexe https://github.com/rakudo/rakudo/blob/nom/src/core/Distribution.pm#L13 # This is really hurting
03:25 ugexe m: role Bar { method meta {1}; method content {1}; }; class Foo does Bar { }; my $foo = Foo.new but Distribution; $foo.meta
03:25 camelia rakudo-moar 18455a: OUTPUT«Method 'meta' must be implemented by Foo+{Distribution} because it is required by role Distribution␤  in block <unit> at <tmp> line 1␤␤»
03:32 ugexe thats really bad
03:36 ugexe have to apply a anonymous role on top of that and explicitly call the 3rd candidate
04:15 ugexe CURI.install( (($dist but Distribution) but role :: { method meta { my $call := self.WALK(:name<meta>)[2]; self.$call }; method content(|c) { my $call := self.WALK(:name<content>)[2]; self.$call(|c) } }), :$force)
06:12 domidumont joined #perl6-toolchain
06:13 nine ugexe: with just the lib/Inline/Perl5.pm6 as $content-id, my content method now has to guess if this is a source file or resource. It's never good when software has to guess :/
06:17 domidumont joined #perl6-toolchain
06:49 domidumont joined #perl6-toolchain
14:07 ugexe it doesn't have to guess, because resources should be listed under the `resources` field in the meta
14:08 ugexe and because CURI controls where it gets install location it already has to make that same guess
14:09 nine But .content doesn't get any info about where to look. I cannot know if lib/Inline/Perl5.pm6 is a source or resource
14:09 ugexe .content knows it can call self.meta
14:09 nine And then has to iterate over provides to see if any entry matches. And if not do the same for resources
14:10 nine That's what I mean with "guess"
14:10 ugexe thats not a big deal, Distribution doesn't need to be some super quick lookup table
14:11 ugexe otherwise you can just do this https://github.com/ugexe/Perl6-CompUnit--Repository--Tar/blob/master/lib/CompUnit/Repository/Tar.pm6#L13-L14
14:13 nine .content as specified in S22 doesn't have that problem and resolves any ambiguity between source and resource files and is not exactly harder to use
14:13 ugexe resources as is does not follow s22 at all
14:14 ugexe everything in the resources hash as-is has to be located in resources/ anyway
14:14 ugexe there is no lib/Inline/Perl5.pm6 that is a resource because it would be resources/lib/Inline/Perl5.pm6
14:16 ugexe what I implemented is a hyrid of s22 and ipfs
14:20 ugexe i implemented the s22 way originally but it didnt make sense to use it with the way resources was implemented
14:29 ugexe if, for some reason, someone doesn't want to list a resource in resources they can simply set %files themselves and prefix `resources/` to the name-path and point that at the real path
14:29 ugexe $.meta<files>{'resources
14:30 ugexe $.meta<files>{'resources/' ~ 'lib/Whatever.pm6'} => 'lib/Whatever.pm6'
14:39 ugexe https://gist.github.com/ugexe/1026b2730abe6d2a126c#file-dist-pl6-L85 # Here is s22 style implementation of content which I only point out to note that i've explored that idea and didnt just brush it off
14:41 ribasushi joined #perl6-toolchain
16:32 domidumont joined #perl6-toolchain
16:41 FROGGS joined #perl6-toolchain
19:13 FROGGS joined #perl6-toolchain
23:18 stmuk_ joined #perl6-toolchain

| Channels | #perl6-toolchain index | Today | | Search | Google Search | Plain-Text | summary