»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
u-ou $today.coffees[1].drink; 00:16
jdv79_ just got back from a beer trip in nl and be. 00:20
jetlagged 00:22
samcv u-ou, $today.coffees.elems 00:55
u-ou usually about 4
AlexDaniel m: say 5...^10 01:19
camelia (5 6 7 8 9)
AlexDaniel m: say 5^...10
camelia 5^..0.1
AlexDaniel hah
samcv ok so what is the best way to compare elements of two arrays 02:32
that are almost identical but may have one or two words in different spots
well elements, elements are words but. that's beside most of the point
i simplified way wuold be to just count how many of each element exist, but order is important 02:33
but i mostly want to know at what indexes one has additional elements compare dto the other or if the element is different 02:34
BenGoldberg samcv, Find a good string similarity algorithm, then change it to arrays of strings instead of arrays of chars. 02:36
samcv hm
thanks
technically i need to compare similarity of two documents by words 02:37
BenGoldberg Looking for plagarism?
samcv no checking licenses
and yes i know tools exist for this
though maybe i'm making a module right now and don't know it ;) 02:38
spdx has a json of all the license text's. so i need to compare the documents not regarding whitespace or case 02:39
but punctuation matters
BenGoldberg wonders whether a plagiarism detector might actually be the right tool for the job ;) 02:41
samcv and people often put in random copyrgiht lines, sometimes at the end sometimes at the end or other text, so would be nice if it could tell you "oh this is the part that differs: 'copyright 2005 some persons name here and associates\nSome random other line here someone could add in"
maybe
but... it needs to be the right order of the words
but that might work maybe. but it's critical that ALL the matching sections have the right order and not new words added in
BenGoldberg Normalizing whitespace and capitalization is the easiest part.
samcv whereas that's common in plagarism and they are plagarizing as much if they add one word extra or not 02:42
yes of course
do we have a plagarism detector module ;)
BenGoldberg, i may take the approach of making a bag for every license. then taking my unknown license document and finding which bag is closest by the words it contains 02:43
then it has the best match, and then checks it for ordering of words etc
japh_com is it possible to get a list of all of the classes/modules that are loaded in memory? something akin to ".^methods(:all)" but for all of the classes that are loaded... I'm assuming this has to be done at the NQP or maybe Metamodel level... Working on a debugger ui... 02:44
samcv but it's important to be able to tell the user running the program which lines differ and it's not like "This is not the license of my software project. Copyright foo bar"
and it detects it as the project being that license. would be not good
samcv that would be nice japh_com let me know. there is some way maybe 02:44
BenGoldberg Maybe a Bayesian classifier? 02:46
samcv well. i mean i want to get back the words which are different between the two
would that do that
or you mean for comparing the bags 02:47
MasterDuke_ japh_com: have you looked at jnthn's heap profile analyzer?
kurahaupo_ samcv: sounds like the sort of thing that would be easily thwarted by a global search-and-replace with some synonyms
samcv what would kurahaupo_
uh
well.
how does that defeat it i don't see
if they alter the text of the license... 02:48
also there are guidlines for certain words which are equivilant like en_GB and en_US
japh_com @MasterDuke_ Great suggestion. Checking jonathan's heap profile analyzer code now :-) 02:49
BenGoldberg kurahaupo_, We're assuming that the people in whose code (or docs) these liscences are embeded aren't deliberately making it harder for readers to identify which license it is.
samcv if you scroll down here to section 8.
spdx.org/spdx-license-list/matching-guidelines gives guidelines for words which are the same
geekosaur well, there's supposed to be a way to introspect GLOBAL::, but it doesn't seem to work currently 02:54
geekosaur oh, I guess it's just stuff imported into the current scope 02:55
m: say SETTING::.keys
camelia ($=pod &symlink $_ $/ RESTRICTED-CLASS &restricted !UNIT_MARKER &UNLINK-PATH &SYMLINK-PATH &MAKE-DIR &CHANGE-DIRECTORY &rmdir $=finish EXPORT PIO &CHMOD-PATH &chmod $! Proc NativeCall &COPY-FILE &rename &open ::?PACKAGE GLOBALish &shell &pipe &link &RENA…
u-ou squeaks 04:03
sjn m: say (1 ... ^5).perl # why does this "work"? 04:23
camelia (1, 0, 1, 2, 3, 4).Seq
mst m: say (1, ^5).perl 04:27
camelia (1, ^5)
mst ok, not that then
moritz it's just 1, ^5 05:54
m: say 1, ^5 05:55
camelia 1^5
moritz m: say flat 1, ^5
camelia (1 0 1 2 3 4)
samcv geekosaur, do you think the set operators would be the easiest way to find the closest two bags to each other? 06:02
let's say i have like 40 bags and need to sort them by most items in common
timotimo m: say (1 ... [9, 9, 9]) # sjn 06:24
camelia (1 2 3 4 5 6 7 8 9 9 9)
timotimo a bit late, but whatevs
timotimo now why it immediately stops after 1, i'm not sure 06:25
m: say (1 ... [0, 9, 9]).perl
camelia (1, 0, 9, 9).Seq
moritz because 0 < 1 06:32
m: say 1 ... [4, 6, 8]
camelia (1 2 3 4 6 8)
timotimo i was totally expecting it'd compare against the length of the list :P 06:34
samcv also wtf is going on. i insntall App::Mi6 and try running the bin. and it doesn't start because some resources file 06:36
/home/samantha/perl6/share/perl6/site/resources/19DFC05B99EC4E218A1A8D9A1B966919724DE593 only contains `@ perl6 %~dpn0 %*`
timotimo yes
samcv if i clone the git, and zef install . all is fine
timotimo you see, it has a "mi6" and a "mi6.bat"
the mi6.bat contains only that exact line
samcv :\
i do not use windows 06:37
timotimo i expect zef is stripping extensions for binary scripts
and just installs one after the other, thus overwriting mi6 with mi6.bat
the solution is to not have two files with the same basename in bin/
is there not yet an issue in the mi6 repo?
BBL
samcv it installs fine with zef install . though
why difference?
apparently doesn't work on windows either github.com/skaji/mi6/issues/6 06:38
also no issue about this problem on linux
samcv well opened an issue 06:45
timotimo yeesh, that's a year old 07:04
samcv well mi6 added license field support :P
very quickly
japh_com anyone concerned about the pod2html conversion problems on docs.perl6.org/perl6.xhtml ? for example: my $e = enum &lt;one two three>; 07:44
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/04/24/...ing-times/ 07:55
masak lizmat++ 08:00
masak zoffix++ # perl6.party/post/The-Failure-Point-of-a-Release 08:06
masak that's one of the best posts about release management I've ever read. very insightful 08:07
pmurias my int $?BITS := nqp::iseq_i(0x1ffffffff,8589934591) ?? 64 !! 32; # how is this NQP code supposed to work?
masak feels like he should maybe reply to stackoverflow.com/questions/4356161...quote-text 08:11
masak I don't have time right now, but I'll try to after $dayjob 08:12
nadim_ lizmat++ 08:12
masak IIUC, blippy (who asked the SO question) is aiming to get the program text out of the $expr AST argument being passed 08:14
his attempt at doing so amazes me a bit -- that's not something I'd've tried
I think something like $expr.Str ought to work -- assuming we want the standard stringification of ASTs to yield the program *code* itself, and not something more AST-y 08:15
nadim_ a few weeks ago this link was, I believe, in a P6 weekly, interesting read an nifty example of what lazy evaluation can be used for. But the main part was about attribute grammars. I find the idea interesting, grammar that can ct on objects rather than text. first things that comes to mind is XSD/DDT or even complex searches. Does P6 Grammar already support that or could easily be extended? is it altogether rubbish? 08:17
wiki.haskell.org/The_Monad.Reader/...ars_Matter
masak nadim_: p6 grammars are (currently) fairly Str-centric 08:27
nadim_: there's been discussion about allowing them on Cat, but Cat is still (IIRC) wildly unimplemented
nadim_: I could see some uses on Buf, especially if it leads to a whole serialization/deserialization story 08:28
lizmat my thoughts on that are that if we would have a string representation of bytes, that would translate to NFG, we would be set I think 08:29
because grammars do NFG :-)
masak lizmat: hm :) 08:36
lizmat: seemsme that if you'd regex on bytes, there'd certainly be some byte sequences best expressed as (say) UTF-8-encoded strings -- but the strength would be that not all of them would be 08:37
"Sometimes a byte is just a byte" -- Freud
ach, anyway. rough consensus and working code. I should just throw together a prototype of what I mean by byte matching :> see where it leads
timotimo i remember talk about regex on objects 09:11
timotimo i'd love that in Perl6::Optimizer :) 09:11
it would be a bit like signature unpacking but more easily accomodating alterations inside of an object graph 09:12
pmurias in what test file should a test for 0xffffffff go in? 09:22
moritz as a literal? 09:25
pmurias yes, it's broken on 32bit rakudos 09:26
moritz maybe t7spec/S02-literals/radix.t or S02-literals/numeric.t
s/7/\// 09:27
nadim_ timotimo: if we have that on regex I guess it wouldn't be far to have it in Grammars. Was the talk in a blog or in the ether?
timotimo i dont remember. it might have been in the specs actually 09:30
the main thing about this is that we compile some backtracking code for you 09:31
the step from regexes to grammars is tiny
though it might be "interesting" to come up with what match objects are going to look like
i.e. there will not be a sensible value dor from/toi bet 09:32
timotimo nadim, design.perl6.org/S05.html#Matching...on-strings 09:42
nadim_ timotimo++ 09:53
Geth ecosystem: ea2efae775 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
META.info -> META6.json
10:02
Geth ecosystem: b2b15ee727 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
META.info -> META6.json

  raw.githubusercontent.com/MattOate.../META.info is currently
busted due to naming it META.json. PR sent. Set to META6.json in list
10:07
xiaomiao mmh. releasing an update to rakudo that doesn't work with released versions of nqp is a little bit silly 10:09
could I please have an updated version of nqp packaged up? :)
Zoffix xiaomiao: in 3 weeks 10:11
xiaomiao Zoffix: that's a little bit confusing
Zoffix xiaomiao: it's a total clusterfuck from where I'm viewing it. 10:12
Zoffix xiaomiao: perl6.party/post/The-Failure-Point-of-a-Release 10:12
xiaomiao: The 2017.04.2 release works with 2017.04 nqp and 2017.04 moarvm; it's just have the regex/grammar bug (mentioned in that post). At this point, we'd need to recut point releases of three different projects, using the unbeaten path, which has a good chance of resulting in even more issues, so we (I?) knocked it on the head and finished for 2017.04. Next release, 2017.05 will auto-resolve all the 10:14
issues.
Zoffix xiaomiao: there's also a Rakudo Star release candidate you can use instead 10:14
xiaomiao: pl6anet.org/drop/ 10:15
NeuralAnomaly: status
NeuralAnomaly Zoffix, [✘] Next release will be in 3 weeks and 4 days. Since last release, there are 14 new still-open tickets (12 unreviewed and 0 blockers) and 72 unreviewed commits. See perl6.fail/release/stats for details
xiaomiao Zoffix: I see. Mostly reasonable (bugs happen, bugfixes happen). But having a rakudo release that can't be built against released nqp is not very nice
(not complaining, just pointing out that you've accidentally made distro packagers a bit sad) 10:16
Zoffix xiaomiao: I understand that.
xiaomiao I think I'll just grab rakudo-2017.04.2 and pretend the issues don't exist
Zoffix Sounds like a plan ;) 10:17
winnie_ m: say "test" 12:36
camelia test
Geth ecosystem: a3f75d687d | (Moritz Len)++ | META.list
Track META name changes
12:50
Geth ecosystem: 776fa56185 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
Use new meta name
13:00
dalek t-ZMQ: bf473e7 | (Zoffix Znet)++ | META (2 files):
Use modern META filename

The `META.info` is a legacy, pre-Christmas name. While it's still currently supported,
  `META6.json` is the new name. And since a lot of people simply copy some module's
structure, the old name still proliferates, so we're trying to get rid of it for good by sending PRs to any modules that use the old name, to switch to the modern name.
13:01
t-ZMQ: ef1d56e | timo++ | META (2 files):
Merge pull request #12 from zoffixznet/patch-1

Use modern META filename
Geth Pod-To-HTML: cc4399ae61 | (Zoffix Znet)++ (committed using GitHub Web editor) | 2 files
Use modern META filename

The `META.info` is a legacy, pre-Christmas name. While it's still currently supported, `META6.json` is the new name. And since a lot of people simply copy some module's structure, the old name still proliferates, so we're trying to get rid of it for good by sending PRs to any modules that use the old name, to switch to the modern name.
14:20
Geth doc: 45cd208ee0 | (Zoffix Znet)++ (committed using GitHub Web editor) | 2 files
Use modern META filename
14:23
yaml-pm6: 3d70a2e81c | (Zoffix Znet)++ (committed using GitHub Web editor) | 2 files
Use modern META filename
testml-pm6: 210c2a6c75 | (Zoffix Znet)++ (committed using GitHub Web editor) | 2 files
Use modern META filename
14:24
El_Che Win 10 bash support on new release: github.com/nxadm/rakudo-pkg/releas...2017.03_03 14:37
Geth ecosystem: 8f59111638 | (Zoffix Znet)++ | META.list
[automated commit] META.info -> META6.json

Changed 49 URLs
14:38
Geth ecosystem: ac6f230c60 | (Zoffix Znet)++ | META.list
[automated commit] META.info -> META6.json

Changed 3 URLs
14:51
Geth ecosystem: 540879260f | (Zoffix Znet)++ | META.list
[automated commit] META.info -> META6.json

Changed 11 URLs
15:30
Geth ecosystem: ad9e9e4094 | (Zoffix Znet)++ | META.list
[automated commit] META.info→META6.json (4 URLs)
16:02
Zoffix FWIW: the automate commits are done by a script that checks for updates every 30m. I've sent ~380 PRs to swap META.info to META6.json, I think ~60 were already merged, so ~320 are yet to come. I can make Geth ignore these commits, if they're too spammy. 16:13
timotimo could you turn these commit messages into a single line perhaps? 16:14
"11 URLs changed at github.com/perl6/ecosystem/commit/540879260f"
[Coke] "eh, it's fine" 16:16
timotimo: last one was a single line.
timotimo it's actually three lines
[Coke] the last one is one line of commit message, with the usual pre-amble and post-amble of one line eaach. 16:17
timotimo :)
[Coke] the one before that is 3 lines of commit message.
no reason to shrink it past that, IMO.
Zoffix OK then ":) 16:18
Geth ecosystem: 136ca2e210 | (Zoffix Znet)++ | META.list
[automated commit] META.info→META6.json (2 URLs)
16:32
Geth Swapped META.info → META6.json in 2 dists in github.com/perl6/ecosystem/commit/136ca2e210 16:47
Zoffix \o/
Worked the first time :}
Added "Commit filters" feature to geth 16:48
Geth ecosystem: 53792e4c9e | (Zoffix Znet)++ (committed using GitHub Web editor) | PULL_REQUEST_TEMPLATE.md
Fix typo
16:49
timotimo neat 16:54
Geth ecosystem: bd5e6bd3f2 | (Nick Logan)++ (committed using GitHub Web editor) | META.list
Update META.list
16:56
timotimo oh, people are unaware of the automatic script 16:57
not really surprising, just interesting
Geth Swapped META.info → META6.json in 1 dists in github.com/perl6/ecosystem/commit/2ec7a3e9b8 17:03
Geth ecosystem: 2d7f6b1593 | (Zoffix Znet)++ (committed using GitHub Web editor) | README.md
Add correct name of meta file to README
17:29
Geth Swapped META.info → META6.json in 1 dists in github.com/perl6/ecosystem/commit/538ddf2174 18:16
[Coke] off by one error 18:17
.tell zoffix off by one error on your message in 538ddf2174 18:18
yoleaux [Coke]: I'll pass your message to zoffix.
Geth ecosystem: dd52a27f8c | (Zoffix Znet)++ | tools/meta.p6
Add META.info -> META6.json swapping script

If future generations would want to repurpose it or something
18:29
Geth ecosystem: 5b2e139c80 | (Zoffix Znet)++ (committed using GitHub Web editor) | tools/meta.p6
Fix bugglet
18:32
samcv good * everyone 19:24
timotimo hey samcv 19:26
samcv so i have 40 bags and need to compare how similar some other Bag i have is to each of them 19:27
fastest way?
/easist
timotimo well, easiest is easy :) 19:30
moritz I guess you need nested loops, an in there, get the intersecction of a pair of bags
samcv ∩?
moritz two 19:31
samcv two what
moritz two nested loops
samcv by an 'in' did you mean intersection i.e. `∩` 19:32
samcv m: say (1,2,2,3).Bag ∩ (1,2,2).Bag 19:32
camelia bag(1, 2(2))
moritz ah, yes
samcv omg linenosie why you no support utf-8 ahhhh
moritz m: say (1, 2, 2, 3).bug 19:33
camelia No such method 'bug' for invocant of type 'List'
in block <unit> at <tmp> line 1
moritz m: say (1, 2, 2, 3).Bag
camelia bag(1, 3, 2(2))
moritz m: say (1, 2, 2, 3).Bag.sum
camelia Cannot resolve caller Numeric(Pair: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
moritz m: say (1, 2, 2, 3).Bag.values.sum
camelia 4
samcv ok. and then find the intersection probably divide it be the number of items in the verbatim license file 19:34
and then find the one that has the most interaction
because obv you'd get a way big intersection otherwise if you had an infinitely long document that wasn't the license 19:35
moritz m: sub s(\x) { x.values.sume }, simalarity(Bag \a, Bag \b) {2 * s(a ∩ b) / (s(a) + s(b) }; similarty((1, 2, 2, 3).Bag, (1, 3).Bag)
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')'
at <tmp>:1
------> 3 s(\x) { x.values.sume }, simalarity(Bag7⏏5 \a, Bag \b) {2 * s(a ∩ b) / (s(a) + s(b
expecting any…
moritz m: sub s(\x) { x.values.sum }; simalarity(Bag \a, Bag \b) {2 * s(a ∩ b) / (s(a) + s(b) }; say similarty((1, 2, 2, 3).Bag, (1, 3).Bag)
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')'
at <tmp>:1
------> 3b s(\x) { x.values.sum }; simalarity(Bag7⏏5 \a, Bag \b) {2 * s(a ∩ b) / (s(a) + s(b
expecting any…
samcv hmm cool
moritz m: sub s(\x) { x.values.sum }; sub similarity(Bag \a, Bag \b) {2 * s(a ∩ b) / (s(a) + s(b) }; say similarty((1, 2, 2, 3).Bag, (1, 3).Bag) 19:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in parenthesized expression; couldn't find final ')'
at <tmp>:1
------> 3a, Bag \b) {2 * s(a ∩ b) / (s(a) + s(b) 7⏏5}; say similarty((1, 2, 2, 3).Bag, (1, 3
ex…
moritz m: sub s(\x) { x.values.sum }; sub similarity(Bag \a, Bag \b) {2 * s(a ∩ b) / (s(a) + s(b)) }; say similarty((1, 2, 2, 3).Bag, (1, 3).Bag)
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
similarty used at line 1. Did you mean 'similarity'?
moritz m: sub s(\x) { x.values.sum }; sub similarity(Bag \a, Bag \b) {2 * s(a ∩ b) / (s(a) + s(b)) }; say similarity((1, 2, 2, 3).Bag, (1, 3).Bag)
camelia 0.666667
moritz \o/
took me only a few dozen attempts
tyil thats not too bad 19:37
robertle until (quite) a while ago, I could call a method in a different module, which would do "require ::Foo", and that made Foo available to the code calling into this module. this does not work anymore, which seems right as importing into the caller sounds wrong 19:43
but is there a differnt way to do this? I am trying to do something like "Pluggable"...
timotimo right, you can't import "into the caller", you can only import into a "user", because then you can have a sub EXPORT 19:44
[Coke] it's now lexically scoped.
(which might impact your use case)
robertle ok, that makes sense. but is there a way to get the old behavior back? otehrwise I can't see how to dynamically load plugins... 19:45
timotimo after you've required a module, you can stash it away in any datastructure you want 19:46
geekosaur the code is present but not in scope. you could access it by global name instead of names imported into the lexical namespace?
robertle I think what I am after is your "stash it" with an emphasis on the "it". currently i stash the require'd module name rather than the actual thing 19:47
ceci nest pas une pipe
Geth Swapped META.info → META6.json in 6 dists in github.com/perl6/ecosystem/commit/a2be897f78
timotimo yeah, you ought to stash the module away, or chosen subs inside it or whatever 19:48
robertle hmm, how do I get to the actual module from it's name? 19:51
timotimo you "require ::($name)" it, no? 19:52
m: my $name = "Test"; require ::($name); say ::($name).WHAT
camelia (Test)
timotimo m: my $name = "Test"; require ::($name); say ::($name).WHO 19:53
camelia Test
robertle right, that's what I do. and of course I could do a .new right after that, and store the result
timotimo well, you don't want to .new a module
robertle but that only works for modules that have a new, and has other problems
samcv moritz, thanks for that. should work pretty well for my uses :)
robertle I would rather store the module itself, and then pass that to someone else so that they can do .new on it without having to require it themselves
robertle like store the class rather than an instance of it 19:54
timotimo why would you ever .new on what require gives you? 19:54
i mean, if it has a "unit class" in it, then sure
samcv m: say "blah".isa(Str:D) 19:55
camelia False
samcv this does not work
robertle exactly, it was just an example! so I want to dynamically load plugins. if the plugins are classes, then you could do .new on them. but they could just be modules, e.g. each with a sub do-sth() in them
robertle hmm, makes less and less sense the more I think about it 19:56
robertle essentially I need a replacement for Module::Pluggable in perl5 19:57
robertle until some time ago I could do this easily in perl6, but the (good) change to make require lexically scoped breaks that 19:57
so I am looking for some work around it... 19:58
if my plugins are always classes, then the plugin system can do require and then .new and store instances rather than the class. that's a bit oif a pity, but workable 20:00
but for non-oo, regular modules I seem to be bust...
geekosaur there's a Package with that name though 20:01
robertle Pluggable? yeah, that is broken too...
alphah hello Perl6, I'm getting this error when trying to merge two hashes, (it happens when left side hash is empty) 20:06
Lists on either side of non-dwimmy hyperop of are not of the same length while recursing
left: 2 elements, right: 1 elements
[Coke] m: my %stuff; { require Test ; %stuff<t> = Test } ; %stuff<t>.WHAT;
camelia ( no output )
[Coke] alphah: can you gist the code?
tyil samcv: ^
alphah I'm printing the hash before merging (That part in code is in TOP method for grammar action), here is in the output below:
tyil does Hash::Merge suffer from this? 20:07
samcv i don't think that's published to the eco yet tho?
tyil but before it is :'D
samcv yes alphah show us your code
me and tyil gonna publish a hash merging module shortly 20:08
alphah Alright one moment, Will paste rest of info I have then show code
./bin/program.p6 dummy
[Coke] alphah: use a nopaste or gist service if it's more than a few lines.
tyil I'll wirte up a testcase either way
alphah cnf hash: ${:origin("/tmp"), :yolo}
cmd hash: {}
tyil also, `nc termbin.com 9999 < file.pm6` 20:09
alphah cnf hash: ${:origin("/tmp"), :yolo}
cmd hash: Nil
Lists on either side of non-dwimmy hyperop of are not of the same length while recursing
left: 2 elements, right: 1 elements
I dont get that error if I added cmd arg:
alphah@slackwork$ ./bin/program.p6 yolo dummy
g cnf: ${:origin("nono"), :yolo}
g cmd: {:yolo}
[Coke] alphah: please use a nopaste service.
alphah ok, one second 20:10
robertle [Coke]: awesome!
tyil samcv: seems like merging a hash into an empty hash is ok for us 20:11
samcv yeah prolly
[Coke] m: my %stuff; { require Test ; %stuff<t> = Test } ; %stuff<t>.WHAT.say # forgot the say
camelia (Test)
samcv don't see why it wouldn't
[Coke] Assuming you can't keep your require in the scope it's needed in, that trick might help.
samcv alphah, does this description fit your needs? github.com/scriptkitties/p6-Hash-Merge
and if so what is not covered here or does not work for you
method name may change 20:12
alphah samacv looks exactly what I need, but need to test it first 20:13
samcv oh ok
cool.
also [Coke] what sholud i call the method so it won't conflict with any future merge method?
[Coke] samcv: unless you pick some-long-name-that-will-very-likely-never-conflict, you can't know. 20:14
samcv mix lower and uppercase letters.... hehehe 20:15
[Coke] I would use the simplest thing that works for now, and if a new version of p6 appears with a merge method, you can make yours be conditional on version.
samcv %hash.MeRgE
alphah Coke: here is the whole file, the problem happen in method TOP. (Please ignore the naming I'm using) 20:18
gist.github.com/anonymous/5393f31f...a4886625db
samcv oh no. zef is failing building on uhm 20:20
idk why
travis-ci.org/scriptkitties/p6-Has.../225752270
failing on 2017.04.3-50-gd057efd and 2017.03 but not on nom? idk
tyil zef is not supposed to fail
samcv no 20:21
it is not
oh it's working on the newer travis build. maybe travis just derped
crisis averted. TRAVVIISSSSS 20:22
pmurias m: my str $foo = 'Infinity on Linux but not on windows'; my num $n = $foo;say $n
camelia Inf
pmurias ^^ can someone please check what the above does on Rakudo on windows?
samcv that. hm
did not know we could turn strings into nums like that... 20:23
geekosaur that's what Cool does 20:24
samcv yes. didn't know it did that when asigning a string to a number like that. but i guess it makes sense sorta 20:25
didn't know about Inf though
or that you could have random text after a number and have it not freak out
i never tried
pmurias geekosaur: it's a low level coercion that doesn't involve Cool 20:26
geekosaur that does sound like trouble tbh 20:27
pmurias it also seems to be operation system dependent, which sucks ultra hard
geekosaur calculist.blogspot.com/2006/02/nancy-typing.html
use care converting random strings to numbers...
pmurias m: my str $nancy = "NaNcy"; my num $n = $nancy; say $n == $n; 20:32
camelia False
[Coke] alphah: and how do you trigger the error you were mentioning? 20:34
do we have a "how to ask for help" link somewhere? 20:35
alphah I have the main program includes, have this line my %hash = LawCmd.create(@*ARGS.Str); and run the program as "alphah@slackwork$ ./bin/program.p6 dummy" 20:36
Coke:
alphah that will trigger the error, because %cmd arg hash will be empty, but running the program as "alphah@slackwork$ ./bin/program.p6 yolo dummy", I dont get that error 20:37
[Coke] so you're not showing us the code?
you're showing us some other code?
alphah Coke: I pasted the whole file
alphah this is the other file that has this line of code: 20:38
[Coke] (if I run your code with "dummy" as an arg, nothing happens)
you posted one file, then said you had another file.
part of helping us help you is to make it easy to see what's going on with the existing code you have, or for you to golf that code to highlight the problem (remove extraneous code until only the problem you're dealing with is present in the code) 20:39
alphah sorry my mistake, thought I posteed the second,, really the second file doesn't have anything at all important, except creating the hash... posting it now
[Coke] ok. I'm heading out shortly, hopefully someone can help you out. Good luck. 20:40
alphah Alright, Thanks, here is the other file anyway gist.github.com/anonymous/8f7584cf...d5dc39f8fd 20:41
I'm ccreating account on gist so I can have the code easily available next time 20:42
[Coke] ok, that still doesn't compile, and also has a dependency on a file in /etc 20:43
I tried to switch the use's to load the first file, but then get stuck on other errors.
[Coke] I would recommend golfing down your error. make a small 10 line program which highlights the issue you're having; hardcode whatever data you need to show the issue. 20:45
(%physics<star> ««=«« $<star>.ast if $<star>; looks weird to me, fwiw) 20:47
alphah alright will do that, I was trying to do that, by printing the two hashes that got produced from the program (as these the only things <<=<< op deals with during merging), Iposted them earlier but will make a small program that shows the issue 20:48
Thank you for help
[Coke] might help the next person if you posted that output in a separate gist.
alphah Coke: gist.github.com/anonymous/b4b512d2...aee8675fc7 20:52
the program out put and the conf file 20:53
alphah , I would like to mention as well that, TOP regex breaks Grammar::Debugger Don't know why 20:53
Zoffix alphah: did you sort it out yet? 21:14
samcv moritz, cool :) 21:16
Finding similarity
(Artistic-2.0 => 0.997442 ClArtistic => 0.562578 Artistic-1.0-Perl => 0.538067 O
seems to work pretty great
Zoffix m: say +StrDistance.new: :before<Artistic-2.0>, :after<ClArtistic> 21:17
camelia 6
Zoffix m: say +StrDistance.new: :before<Artistic-2.0>, :after<Artistic-1.0-Perl> 21:18
camelia 6
Zoffix heh
m: say +StrDistance.new: :before<Artistic-2.0>, :after<Artistic-1.0-Perfsdfdsfsdfsdfsdfsdfsdl>
camelia 27
alphah Zoffix: Not yet, I'm still having the error. Also what makes it difficult to track is I can't use Grammar::Debugger to follow step by step, it just ccrash if I enabled Grmmar::Debugger, (feels like writing sh*tty code) 21:18
Geth Swapped META.info → META6.json in 8 dists in github.com/perl6/ecosystem/commit/66b891e9fa 21:19
Zoffix alphah: well, how can I repro the issue? So far I have a bunch of gists, but they don't fit together well.
alphah: stick --ll-exception flag to perl6; it'll tell you where the error is at
alphah Zoffix: I just created the account at Github and pushed the code there: github.com/alphah77/galaxy 21:21
Zoffix alphah: OK. And how do I make it error out? 21:22
alphah and error shows when run "./bin/galaxy.p6 dummy" , also the conf file should be in "/etc/galaxy/laws" ,,, (laws file also is in "bin" directory in the project 21:23
works as expected without error in many other cases: for example "./bin/galaxy.p6 yolo dummy" . works fine. 21:25
Zoffix alphah: what does this supposed to do again? I don't know hyperops: %physics<galaxy> ««=«« $<galaxy-laws>.ast;
alphah that should merge the hash produced by .ast $<galaxy-laws>.ast to %physics<galaxy> hash,,, overwriting duplicates keys, and save result in %physics<galaxy> 21:27
Geth ecosystem: Tyil++ created pull request #331:
Add Hash::Merge
alphah and the error happens when $<galaxy-laws>.ast produces empty hash
Zoffix alphah: so why not avoid that error same way as in: %physics<star> ««=«« $<star>.ast if $<star> 21:28
m: my %h = foo => { bar => { ber => 42 } }; my %h2 = foo => { meow => { moo => 72 } }; %h ««=«« %h2; dd %h 21:30
camelia Hash %h = {:foo(${:bar(${:ber(42)}), :meow(72)})}
Zoffix wouldn't call that merging...
alphah Zoffix: It's actually inside if statment, so I'm using the same conditional, the conditional is at line 145
Zoffix m: my %h = foo => { bar => { ber => 42 } }; my %h2 = foo => { meow => { moo => 72 } }; %h «=« %h2; dd %h 21:31
camelia Hash %h = {:foo(${:bar(${:ber(42)}), :meow(72)})}
Zoffix How come two «« are used?
alphah: this is where the error points; I don't see an `if` statement up there: github.com/alphah77/galaxy/blob/ma...cs.pm#L144 21:32
alphah lol, that was typo, I was using <<=<< ,, thats probably confused me.. I just fixed it and tested again but give same issue
Zoffix Well, right that was just a side note. The original issue is there's no conditional for when $<galaxy-laws>.ast is empty 21:33
Or rather Any
alphah you are right 21:35
Zoffix And when I fix that it dies with "Laws are not consistent", which I'm guessing is normal 21:35
alphah Not that should not be the expected behavior, this erro means that Grammr LawCMD did not parse correctly, which it should have in this case 21:36
Zoffix Well, good luck :) 21:37
I think this is the largest Perl 6 program I ever looked at so far :P
Geth ecosystem: 669fbcc805 | (Patrick Spek)++ (committed by Zoffix Znet) | META.list
Add Hash::Merge (#331)

See github.com/scriptkitties/p6-Hash-Merge/
21:38
alphah lol, this is my very first program ever,, II know I made many stupid mistakes on it,, but it's just learning program 21:39
Zoffix tyil: FWIW, you can `git pull --rebase` to pull in changes from master without creating a new commit for the merge.
alphah: that's pretty cool! My first program ever was much shorter and didn't do much useful things :) 21:40
\o
Geth Swapped META.info → META6.json in 5 dists in github.com/perl6/ecosystem/commit/77fbe95b4d 21:49
Geth Swapped META.info → META6.json in 9 dists in github.com/perl6/ecosystem/commit/03fd5ec588 22:20
samcv ack my license checker is broken now. not sure why 22:25
finding 74% similarity for artistic 2.0, and MIT finds 0.47 (when i checked the files and they're def those) 22:26
so the percentages seem off
samcv oh oopsie. forgot to normalize the text first! 22:27
samcv that would do it... 22:27
samcv working great for Artistic-2.0. hm maybe i need to set an upper limit based on different words instead of on percent 22:36
because MIT will show like 95% even if only like 5 words are different
and artistic will have 99.7% in that case 22:37
*artistic2
Geth Swapped META.info → META6.json in 2 dists in github.com/perl6/ecosystem/commit/966bed1aff 23:20
samcv timotimo, what the hell is this 'at 1: can't parse objects starting in M yet (context: ETA.in)' 23:57
in JSON::Fast...
why not...
hm. something weird is going on here. printing to screen works fine but json::pretty says it only got 9 charecters 23:58