»ö« 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.
audiatorix Hey dudes. I'm still adjusting to 6's new regex system. Any idea why the following is producing this error?: No such method 'Letter' for invocant of type 'Match' 00:23
my regex arg { <Letter>+ } 00:24
my regex call { <arg>[\,\s*<arg>]* }
'aa' ~~ /<call>/ # error produced here
raschipi Where is letter defined? 00:25
audiatorix It's one of the defaults, no?
Or does it need to be L?
Same error with L
mr_ron rakudo: my regex arg { <:Letter>+ }; say so "abc" ~~ /<arg>/ 00:28
camelia True
audiatorix Ah, needs the colon
raschipi Yeah, it's missing the : to be a chaachter class.
audiatorix Right, so char classes need colons and other regexes do not 00:29
Thanks
raschipi There's <alpha> without the colon too. 00:30
raschipi as a predefined subrule as you asked for 00:30
audiatorix Yeah just saw that
I was just testing out my knowledge before writing something more complicated to parse basically function calls 00:31
making a templater
AlexDaniel switching to another laptop is harder than moving to another place :-S 00:41
raschipi audiatorix: remember to call a predefined regex with a dot in front to supress capture: 00:54
m: say 'abc' ~~ /<alpha>+/; say 'def' ~~ /<.alpha>+/
camelia 「abc」
alpha => 「a」
alpha => 「b」
alpha => 「c」
「def」
b2gills AlexDaniel: I was locked out of my password manager once, because I was using a laptop that I hadn't used recently. (I eventually found a way to get in) 01:02
AlexDaniel b2gills: :O 01:03
b2gills It required using the /info cmd on IRC to get an IP address to SSH into
AlexDaniel being locked out of your password manager sounds really horrible 01:05
I do have backups of my passwords *somewhere*… maybe I should practice the emergency situation :-/ 01:06
raschipi AlexDaniel: Make sure you can restore from your backups, it's important. 01:07
AlexDaniel well, my passwords is the only thing I have to backup. All code I write is in git repos (so also pushed somewhere), everything else I really don't care about 01:09
not that I wouldn't be sad for a minute or two if I lose it, but I am not spending my time trying to create backups for it :)
raschipi Buy a strong box and store your passwords there. 01:11
AlexDaniel alternatively, just upload it to github… then I only have to backup my private key :D 01:12
raschipi How to you want to use your private key to access github without it's password? 01:13
AlexDaniel it can be a public repo 01:14
raschipi Instead make it passwordless, then. Then just keep it safe. 01:16
audiatorix Any idea why this regex is invalid?: -<[ \$ \, ]>+ 01:34
What I'm trying to achieve is "anything but literal $ or literal , one or more times"
geekosaur shouldn't that start with <-[ instead of -<[ ? 01:35
audiatorix Ah, so it should 01:36
What's the logic behind that?
[] on their own simply group 01:37
geekosaur same reason an older regex does something different with [-... vs. -[...
<> is a meta-operation of some kind, - prefix means invert, [] is char class. vs. without the <>, [ ] is non-capturing group 01:38
audiatorix Ah okay, that's what I was thinking once I saw the answer
geekosaur the first character after a < in a < > is special, - inverts the metaop, . prevents capturing (used with named rules like <ws> or <digit>) etc.
(this is oversimplifying a bit) 01:39
audiatorix Cool 01:40
So, different question: in a grammar, how do I specify that, in a given place, either token A or token B may appear?
geekosaur A | B 01:42
audiatorix <A> | <B> ?
AlexDaniel yea
geekosaur with brackets around if it's part of a larger thing e.g. <foo> [ <bar> | <baz> ] <quux> 01:43
AlexDaniel or maybe || if you care about order and not about longest token matching
audiatorix And if I needed to use that more than once, would throwing it in a sub-regex make sense (so that a new token doesn't need to be created for it) 01:45
AlexDaniel “sub-regex”? 01:46
I guess there's no problem with creating another token for it. But I don't know what would be the best practice
audiatorix named regex
I'm thinking if I make another token, it will make the structure more complex where it doesn't need to be 01:47
geekosaur um, they all add the same complexity
they just have different default behaviors
(i.e. different default flags on the things they create, like :sigspace or :ratchet etc.) 01:48
audiatorix Ah
dang, I was thinking for some reason that `regex` didn't become part of the resulting structure when parsing
geekosaur they're all just specialized variants of methods 01:49
geekosaur the closest you get to not adding more structure is an interpolating variable that isn't treated as a literal <$foo> and that has other issues, including performance and potential security concerns 01:51
[Coke] n
~>OA
audiatorix Okay, I'll just have it twice in the TOP token 01:52
[Coke] ... weird.
audiatorix not a huge deal
Thanks a ton
raschipi audiatorix: I gave you the answer above, put them into another method but call it with a dot to avoid making the capture more complex. 01:55
m: say 'abc' ~~ /<alpha>+/; say 'def' ~~ /<.alpha>+/ 01:56
camelia 「abc」
alpha => 「a」
alpha => 「b」
alpha => 「c」
「def」
audiatorix Oh, so you did. My bad 01:59
raschipi audiatorix: Did my suggestion work? 04:18
Geth doc/split-and-rephrase-lines-in-footer: c108ce774f | (Zak B. Elep)++ | 2 files
Split and rephrase lines in the footer

The first paragraph/line was getting too long, so split it a bit and rephrase to emphasize source location and actions to either report issues and/or edit/fork.
Fixes #1535.
07:24
doc/split-and-rephrase-lines-in-footer: 4cff7ee700 | (Zak B. Elep)++ | lib/Pod/Htmlify.pm6
:lipstick: phrasing for "from POD6 at perl6/doc"...

  "From POD6 from perl6/doc" sounds odd...
piojo Have others gotten this error when trying to build?: "Unhandled exception: Unable to allocate an array of 8 elements" 07:40
The first instance of the error is: 07:42
perl.exe -MExtUtils::Command -e cp 3rdparty\dyncall\dyncallback\\*.h .rakudobrew\moar-blead-nom\install\include\dyncall Unhandled exception: Unable to allocate an array of 8 elements at <unknown>:1 (src/vm/moar/stage0/ModuleLoader.moarvm:) from <unknown>:1 (src/vm/moar/stage0/ModuleLoader.moarvm:<dependencies+deserialize>) from <unknown>:1 (src/vm/moar/stage0/nqp.moarvm:<dependencies+deserialize>)
building on windows, and it worked last time I tried.
travis-ci Doc build passed. Zak B. Elep ':lipstick: phrasing for "from POD6 at perl6/doc"... 07:45
travis-ci.org/perl6/doc/builds/273197377 github.com/perl6/doc/compare/c108c...ff7ee700c1
piojo_ lemme ask a different question: the *best* way to build, if I'm not lazy, is to set up different directories for each repository and build/install each one separately? 08:01
piojo_ Or do developers also use rakudobrew? It can't tell whether it's versatile enough to find the commit that breaks the build, for example 08:02
raschipi I don't think anyone that builds on windows hangs around on IRC... 08:04
raschipi piojo_: I think you're the closest thing to a windows expert as there is in Perl6. 08:07
El_Che stmuk_builds star on windows as well, so he probably knows more about the win build process 08:11
piojo_ raschipi: haha. Someone must have made perl6 run on windows! 08:16
raschipi: oh, I see. is stackoverflow a better place to go for windows-specific questions? 08:17
raschipi I have no idea where you'll fing perl6-on-windows users to help you, sorry. 08:18
piojo_ thanks. forget windows, then 08:19
Is the right way to build perl6 to build nqp, moar, and rakudo one at a time?
and to consider them separate projects which should be debugged (and git-bisected) totally separately? 08:20
El_Che: is stumuk_ the person who makes star releases for win? 08:22
*stmuk_, I mean
tyil is there a zef command I can use to make it install all deps from a given META6.json? 08:29
zakame cd to where the META6.json is then `zef install --deps-only .` 08:30
tyil thanks :>
Geth doc: c108ce774f | (Zak B. Elep)++ | 2 files
Split and rephrase lines in the footer

The first paragraph/line was getting too long, so split it a bit and rephrase to emphasize source location and actions to either report issues and/or edit/fork.
Fixes #1535.
08:34
doc: 4cff7ee700 | (Zak B. Elep)++ | lib/Pod/Htmlify.pm6
:lipstick: phrasing for "from POD6 at perl6/doc"...

  "From POD6 from perl6/doc" sounds odd...
doc: 3444fe4033 | (Rafael Schipiura)++ (committed using GitHub Web editor) | 2 files
Merge pull request #1541 from zakame/split-and-rephrase-lines-in-footer

Split and rephrase lines in the footer
stmuk_ piojo_: yes I build star on Windows every three months, although it's not my main platform of choice 08:46
piojo_ stmuk_: by the way, thank you for that service! 08:47
stmuk_: so if I want to debug build problems, I should work with 3 separate repositories for nqp, moar, and rakudo?
stmuk_ yes and that applies to all platforms 08:48
sumdoc how to enabe autocompletion in Perl 6 REPL? Any idea? 08:48
Autocompletion 08:49
piojo_ stmuk_: thanks. I assume the READMEs in the code are enough, without a lot of custom setup needed? (I'm not thinking modules, just the core perl6) 08:50
stmuk_ yes
I use mingw gcc as shipped with strawberry perl or MSVC should also work 08:51
raschipi sumdoc: You need linenoise.
stmuk_ at least for 64 bit (I don't think anyone has done a 32 bit build for a while)
raschipi github.com/hoelzro/p6-linenoise/#tab-completion
piojo_ stmuk_: thanks, that's what I'm using too. I'll try to get it working, or at least find the bad commit soon 08:52
stmuk_ ci.appveyor.com/project/rakudo/rak...o5hwnug90w suggests the windows build is fine
piojo_: I'll also try a build very shortly
piojo_ stmuk_: I think moar is the problem, not rakudo
sumdoc raschipi linenoise or readline !! Which one better? 08:53
stmuk_ yes that's usually the issue
raschipi sumdoc: readline doesn't have tab completion. 08:54
sumdoc raschipi OK lemme build with linenoise
raschipi what do you say about rlwrap? 08:55
raschipi I use rlwrap, but it also doesn't have tab completion. 08:56
piojo_ raschipi: does rlwrap interfere with tab completion, if you use rlwrap+linenoise? 08:57
raschipi I never tried it. 08:58
piojo_ and can linenoise be configured for <esc><backspace> to delete a whole word like it does with readline?
eh, I should just read the docs. I'm sure it's answered somewhere
raschipi zakame: your code is in effect now, go have a look. 08:59
zakame thanks raschipi !
sumdoc raschipi OK I am going with Linenoise. But what was good about rlwrap than linenoise u r using rlwrap. Just a curiosity!! 09:06
raschipi I don't install modules. 09:07
sumdoc raschipi Thanks 09:07
raschipi Oh oh... 09:18
docs.perl6.org/routine.html has a ton of 404 links... 09:19
docs.perl6.org/routine/.= for example 09:20
tyil I'm trying to run perl6 on FreeBSD, but I got the error "Missing serialize REPR function for REPR VMException (BOOTException)" 09:29
it runs fine on Funtoo
tyil also, how would I go about running a perl 6 program as a daemon? 09:48
stmuk_ tyil: I just built using rakudobrew on FreeBSD 11.1 and it worked fine for me 09:53
tyil hmm 09:54
stmuk_ maybe you have stuff hanging around from a older build?
tyil the program I'm trying to run is github.com/scriptkitties/musashi, the command Im using to run it is perl6 -I/home/musashi/musashi/lib /home/musashi/musashi/bin/musashi.pl6 09:55
sumdoc Linenoise build is failing in rakudo Any help?
github.com/hoelzro/p6-linenoise/issues/22
tyil no, its a new vm with perl 6 built for the first time last night 09:55
tyil if it matters, I did not use rakudobrew, but just cloned github.com/rakudo/rakudo and ran perl Configure.pl --gen-moar --gen-nqp --backends=moar 09:56
sumdoc Are there any dependencies for Linenoise? 09:57
stmuk_ sumdoc: just a C compiler 09:59
tyil stmuk_: if I run the program as a service (github.com/scriptkitties/musashi/b...sashi.rc), it starts correctly 10:02
but it doesnt run as a background service yet, so that would be my next issue
stmuk_ piojo_: yes I can reproduce the windows build failure "Unhandled exception: Unable to allocate an array of 8 elements" 10:27
HoboWithAShotgun good day you wonderful people. what's the perl 6 way of constraining a class' attribute? 10:44
Skarsnik has Int $.attribute ? 10:45
HoboWithAShotgun like i want a "has $.radians" that will only accept values between -pi and + pi
timotimo if you want extra constraints, define a subset type and use that there
m: subset Radians of Real where -pi < * < pi; class A { has Radians $.r }; say try A.new(r => 1); say try A.new(r => 4)
camelia A.new(r => 1)
Nil
Skarsnik fun 10:46
Juerd -pi to +pi? Why not 0 to tau? 10:47
timotimo actually, any value between -Inf and Inf is a value in radians :P 10:48
Juerd Sure, but if you're limiting, wouldn't it make sense to limit that to 0 <= r < tau? 10:49
timotimo m: say tau
camelia 6.28318530717959
piojo_ stmuk_: thanks. I intend to do a git rebase, but I won't be able to until monday 10:50
HoboWithAShotgun ah, my code involves triangles, so only values between 0 and 90° make sense 10:58
180° sorry
HoboWithAShotgun but it works, thanks. at first tests failed, but then i realized <= instead of < 11:00
+ i need
HoboWithAShotgun allright, i now have this class: hastebin.com/kinucobije.pl which allows values between -360 and 360 degrees 11:16
how do i now derive Angle::Triangle from that wich is identical only so it limits between 180 and -180 11:17
HoboWithAShotgun also, can i override the error message that i get when i assign an ivalid value to my subtype? 11:20
Skarsnik probably with subset again ?
HoboWithAShotgun goes rtfm 11:21
Skarsnik m: class A { has $.x}; subset B of A where $.x < 20; say try A.new( a => 30; say try B.new( B => 30);
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable $.x used where no 'self' is available
at <tmp>:1
------> 3ss A { has $.x}; subset B of A where $.x7⏏5 < 20; say try A.new( a => 30; say try B
expecting any of:
term
Skarsnik m: class A { has $.x}; subset B of A where $.x < 20; say try A.new( x => 30; say try B.new( x => 30);
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable $.x used where no 'self' is available
at <tmp>:1
------> 3ss A { has $.x}; subset B of A where $.x7⏏5 < 20; say try A.new( x => 30; say try B
expecting any of:
term
timotimo github.com/zoffixznet/perl6-Subset-Helper 11:26
timotimo stmuk_: did you see what i wrote in #moarvm? 11:48
stmuk_ timotimo: I have now! 12:03
I have to go out shortly but can quickly look now and slowly look later 12:04
timotimo OK!
i hope it'll be enlightening
[Coke] (windows) I have a build I run occasionally. 12:08
updated rakudo, rebuilding... 12:11
(also if you're having a windows build issue, msvc or gcc?) 12:12
sumdoc I have updated the blog. Added about mounting the folder. sumdoc.wordpress.com/2017/09/06/ho...-notebook/ 12:24
[Coke] I can't duplicate a win64 failure with strawberry perl, msvc, and nom/master/master 12:25
galx how can I use perl6 on WinXP 12:27
?
timotimo oh, huh, i don't know if anybody has tried that before 12:28
have you tried just building it and seeing where it fails? 12:29
galx no, but I can try
[Coke] ... xp?
galx I have an old laptop with winxp installed 12:30
i know it's crazy yeah :)
timotimo building rakudo will need more than 1gb of ram
jnthn If it's 64-bit then can always try one of the MSIs
timotimo huh, i wasn't actually aware that windows xp already came in 64bit variants 12:31
but i guess 64bit processors are not new at all
galx it's 32 12:32
[Coke] github.com/rakudo/rakudo/blob/nom/...windows.md might help
galx thank you!
[Coke] ... you may not have a version of VS2017 you can install; it is possible to build just using strawberry perl's toolchain. 12:33
jast windows xp x64 is fairly rare 12:33
timotimo we don't require a very new visual studio
[Coke] (ugh, also my MD formatting is wonky there, if anyone wants to try to clean that, I'd appreciate it. :|
timotimo: right, 2017 was just the one available in the demo copy of windows I grabbed. 12:34
sumdoc -- 13:38
sumdoc Is there a perl 6 package to work with web API? 14:35
moritz HTTP::UserAgent 14:39
moritz back from vacation 14:42
timotimo also WWW and the curl bindings 15:02
b2gills .ask TimToady I would like your input on a document for implementors of Perl 6 dialects since there are currently 2 that I know of gist.github.com/b2gills/7e2781dfd7...59bd751115 15:05
yoleaux b2gills: I'll pass your message to TimToady.
HoboWithAShotgun I managed to create a Num variable that contains 10 which is not equal to 10 15:40
timotimo cool, what's your num - 10? 15:41
HoboWithAShotgun 1.77635683940025e-15 15:47
but then why does it print as 10?
p6: my $l = sqrt(2) * 10; my $d = 45; my $r = $d / 360 * tau; my $y = sin( $r ) * $l; my $x = sqrt( $l**2 - $y**2 ); say $x == $y; 15:48
camelia False
HoboWithAShotgun the trig functions and tau probably produce rounding errors 15:49
p6: my $l = sqrt(2) * 10; my $d = 45; my $r = $d / 360 * tau; my $y = sin( $r ) * $l; my $x = sqrt( $l**2 - $y**2 ); say $x; say $y; 15:53
camelia 10
10
tbrowder .tell nine I just filed issue #101 with Inline::Perl5; failure using Expect::Simple
yoleaux tbrowder: I'll pass your message to nine.
HoboWithAShotgun see? outputs as 10 even though x is 10.00000000...whatver
half an hour wasted 15:54
HoboWithAShotgun .tell mum I gonna be late for dinner 15:58
yoleaux HoboWithAShotgun: I'll pass your message to mum.
ilmari tbrowder: works for me 16:33
This is Rakudo version 2017.08-79-g4b02b8aad built on MoarVM version 2017.08.1-110-gab28683b2 16:34
ilmari how do you get the version of a loaded module in perl6? like perl5's Foo->VERSION or $Foo::VERSION? 16:38
ugexe in perl6 its just $*REPO.need(CompUnit::DependencySpecification.new(:short-name<Foo>)).distribution.meta<ver> 16:39
Skarsnik 'just' 16:41
ilmari ah, so intuitive
very discoverable
moritz we might want a shortcut for that :-)
ugexe also it only works for ::Installable repos, ::FileSystem ones dont set a CompUnit.distribution 16:42
github.com/rakudo/rakudo/pull/1132 would allow it to work with ::FileSystem however. 16:43
the short-cut would be to somehow hook up META6.json info to ::Foo.^ver 16:44
ilmari huh, doesn't perl6's -M take an import list? 16:46
ugexe i dont think our -M does anything but take the short name 16:47
e.g. `-M "Test:ver<6.c>"` does not work while `-e 'use Test:ver<6.c>` does 16:49
ilmari wanted to write a V module like perl5 has
perl5 -MV=Foo # shows all versions of Foo in @INC
ugexe all versions of Foo in @INC doesn't mean the same thing as in perl6 though 16:51
ilmari all versions in $*REPO.repo-chain? 16:53
ugexe let me rephrase: it wouldnt suffice for determining which version of something will get used 16:54
i guess thats the same as @INC though with use lib, so nm 16:55
ingy I just noticed that: perl6 -e 'say "ok" while True' | head 16:57
doesn't terminate like perl5 does 16:58
ilmari Unhandled exception: Failed to write bytes to filehandle: Broken pipe
but exit status zero?! 17:00
ingy that's bash
the exit code of head
ilmari doh
ugexe m: say $*REPO.repo-chain.map(*.?installed()).grep(*.defined).map(*.Slip).grep({ .meta<name> eq "Test" || (.meta<provides>{"Test"}:exists) }).map(*.meta<ver version>.first); # this is the logic part anyway
camelia (v6.c)
ingy I don't get the broken pipe 17:01
it just hangs
ilmari yes, with set -o pipefail (not popefail, as I first typed) it shows exit status 1 from perl6
which version?
This is Rakudo version 2017.08-79-g4b02b8aad built on MoarVM version 2017.08.1-110-gab28683b2
ingy python -c 'while True:print("ok")' | head # gives a broken pipe
yes | head # seems like nice behaviour 17:02
This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
on mac
ilmari perl5 exits with status 141 but no message
ingy so does `yes` ! 17:03
141
that's a 13
141 - 128
ilmari which is SIGPIPE 17:04
but now, pubtime!
ingy so that's probably what perl6 should do 17:05
if anyone cares
BooK I'm testing radical changes to Bool by taking all concerned lines from src/Perl6/Metamodel/BOOTSTRAP.nqp and in src/core/Bool.pm and s/Bool/Foo/ to test them faster, and in isolation, without needing to recompile between attempts 18:25
is that something that could work?
Right now, I get: Type 'stub' is not declared. Did you mean 'Sub'? 18:26
so I assume I need to load some definition for stub
jnthn For code in CORE.setting it's often a fine approach
For something that is so bootstrap-sensitive, there's a very high chance of things not working when put back later
`stub` is actually a non-standard language extension only in NQP, for the sake of the bootstrap. It doesn't exist in real Perl 6. 18:27
So that bit can't really be copied out, but you could simulate it with a stub class in full Perl 6
my class Foo { ... }
BooK ok 18:28
the line I was replacing was: my stub Bool metaclass Perl6::Metamodel::EnumHOW { ... }; 18:29
so just dropping the stub would do it 18:30
cono is there any way to define alternation in regexp with backtracking ? 18:36
yoleaux 6 Sep 2017 12:43Z <Zoffix> cono: the latest and greatest Rakudo has a fix for your issue. You should be getting your Any again: github.com/rakudo/rakudo/commit/d0d105b8b6
cono already seen this, thanks :) 18:37
cono gist.github.com/cono/30bd639285662...daa29471b0 so, I want if <number> fails it backtrack and tries <tree-op> token 18:38
| - longest, || - left associated, I want some "\\" which going to be left associated but with backtracking, so if first token in alternation fails, it tries next one 18:41
cono in this case: 1 + 2 + 3, will be something like expr( tree-op(tree-op(number(1), op('+'), number(2)), op('+'), number(3)) ) 18:44
jnthn cono: Are you writing this in a token/rule? 18:51
ah, you linked code and I missed it :)
Geth doc/molecules-patch-2: 65cf7b1d1b | (Christopher Bottoms)++ (committed using GitHub Web editor) | doc/Type/IO/Socket/Async.pod6
Fixed three space indent
BooK how can I initialize a sigilless version of Bool to do the equivalent of the stub in npq? I think my \Bool2 := ...; and then I can call the stuff found in bootstrap on that new name, the first of which would be Bool2.HOW.set_base_type(BooK, Int); 18:53
BooK etc 18:54
BooK I want to first build a Bool2 identical to the regular Bool, and then tweak it so that it can do the Enumeration role, and we can remove the duplication 18:54
jnthn BooK: Probably something like Metamodel::EnumHOW.new_type(:name('Bool2')) 18:55
cono: The thing is that token (and rule) mean that backtracking state should *not* be retained
cono: || if a regex will indeed backtrack
cono: If you replace token with regex in the first 3 rules it seems to work out
moritz or maybe my \Bool2 = Bool but Enumeration; 18:56
Geth doc: d15be280c7 | (Christopher Bottoms)++ (committed using GitHub Web editor) | doc/Type/IO/Socket/Async.pod6
Does this resolve #1538?

Does simply removing the `if` statement resolve #1538?
doc: 65cf7b1d1b | (Christopher Bottoms)++ (committed using GitHub Web editor) | doc/Type/IO/Socket/Async.pod6
Fixed three space indent
doc: c0596fe916 | (Jonathan Worthington)++ (committed using GitHub Web editor) | doc/Type/IO/Socket/Async.pod6
Merge pull request #1540 from perl6/molecules-patch-2

Does this resolve #1538?
BooK moritz: the plan is to test writing a different implementation of Bool, without having to recompile every time I change a thing
so writing Bool2 without depending on Bool explicitely, just copy-pasting
jnthn bbl 18:58
BooK m: BEGIN { use nqp; my \Bool2 := Metamodel::EnumHOW.new_type(:name<Bool2>, :base_type(Int)); Bool2.HOW.set_base_type(Bool2, Int); } 19:00
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while evaluating a BEGIN
at <tmp>:1
Exception details:
5===SORRY!5=== Error while compiling
Base type has already been set for Bool2
at :
cono jnthn: thanks! :) 19:01
BooK m: BEGIN { use nqp; my \Bool2 := Metamodel::EnumHOW.new_type(:name<Bool2>); Bool2.HOW.set_base_type(Bool2, Int); } 19:02
camelia ( no output )
BooK mmm
I think that failed later 19:03
BooK right, it gave me: getstaticcode requires a static coderef 19:09
BooK I guess I'm now deep in the guts, and my only operation tool knowledge relates to a spoon 19:10
moritz if you install methods with add_method or so, you might needs to wrap the code in nqp::getstaticcode() 19:11
BooK moritz: the error comes from this line: Bool2.HOW.add_method(Bool2, 'key', nqp::getstaticcode(sub ($self) { nqp::getattr_s(nqp::decont($self), Bool2, '$!key'); })); 19:19
tbrowder ilmari: my bad, my Inline::Perl5 was too old--an upgrade fixed it. I think I'll add a cron job to upgrade all modules every week or so...
BooK so I guess the question is "how do I make that sub a static coderef?
tbrowder .tell nine my version was too old, closing issue 101
yoleaux tbrowder: I'll pass your message to nine.
BooK (going to lose network soon, the plane is about to take off) 19:21
moritz BooK: looks good to me, assuming that $!key is set up correctly first 19:24
moritz how do I access the actions object inside a grammar? 20:03
moritz ah, self.actions 20:13
Geth doc: 9826038dd1 | (Moritz Lenz)++ | doc/Type/Cursor.pod6
Document Cursor.actions
20:17
Geth doc: c65e01f3a8 | (Moritz Lenz)++ | doc/Type/Match.pod6
Document Match.actions
20:24
moritz book-driven development
BooK while in the plane I played around with IO::Socket::INET, and got this strange behaviour 20:55
This code: say "Accepted {IO::Socket::INET.new(:localhost<localhost>, :localport(4444), :listen).accept}";
does what's expected when running `telnet localhost 4444`, but hangs with `nc localhost 4444` 20:56
Skarsnik does localhost is ipv6?
BooK more importantly, nc dies this: localhost [127.0.0.1] 4444 (?) : Connection refused
the default for INET is ipv4 20:57
Skarsnik connect does not pass the Inet family for example
I would not be surprised listen does not the then xD 20:58
Skarsnik yep it's ignored 21:00
ugexe :localhost<127.0.0.1> 21:01
BooK Skarsnik: so telnet is doing ipv6 and nc ipv4 ? and perl6 defaults to ipv6 ?
Skarsnik moar does not use the sa-family from Rakudo at all
BooK, moar will get what is the first sa family the system return for localhost 21:02
geekosaur actually that would be a bit odd because telnet6 is not quite the same protocol 21:02
Skarsnik for me it's ipv6
geekosaur hm, looks like linux's does merge them these days though 21:03
so you'd want to verify with: telnet -4 ...
Skarsnik not sure if that should be fixed or just documented x) 21:04
BooK you're saying that the socket new gets the famiky from the name rsolution? 21:06
Skarsnik yes
github.com/MoarVM/MoarVM/blob/mast...ket.c#L302 and github.com/MoarVM/MoarVM/blob/mast...ket.c#L270 21:07
BooK so even if I passed an explicit family it would overriden by the one from the resolution
Skarsnik yes, since it's never used 21:08
BooK well if name resolution returns several candidates, it could look at the family and pick 21:08
Skarsnik I think IO::Socket::INET is not really the focus but more IO::Socket::Async
BooK I think it should be vonsidered a bug and will try to write it up 21:10
Skarsnik I could patch up since I already added stuff in that (to add source address and source port in connect) 21:11
galx m: 21:23
I have a problem 21:25
pastebin.com/vMvRFr8M
I want `a` token to match "abc def" and `b` token to match "etc." 21:26
but it fails anyway
how to do that correctly?
BooK Skarsnik: reading your links now 21:44
oh so it's in MoarVM? 21:45
BooK where is the link between rakudo and moarvm done? nqp? 21:46
Skarsnik probably rakudo/core/io/Socket/INET.pm6 ? 21:48
there is no nqp side for connect
MasterDuke BooK: generally yes, nqp:: ops are implemented by moarvm 21:49
cono m: grammar Grammar { regex TOP { ^^ <a> <ws> <b> $$ }; regex a { <word>+ % <ws> }; token word { <alpha>+ }; regex b { <alpha>+ "." }; }; Grammar.parse("abc def etc.").say
camelia 「abc def etc.」
a => 「abc def」
word => 「abc」
alpha => 「a」
alpha => 「b」
alpha => 「c」
ws => 「 」
word => 「def」
alpha => 「d」
alpha => 「e」
alpha => 「f」
ws => 「 」
cono galx: ^^
Skarsnik buggable, find listen 21:50
cono by doing <alpha>+ % "something> you are asking to make <alpha> "something" <alpha> "something" up to infinity
Skarsnik don't remember wich bot allow to grep in the code x)
BooK right, github.com/rakudo/rakudo/blob/nom/...ET.pm#L122 and github.com/rakudo/rakudo/blob/nom/...ET.pm#L132
so in there, there is a default of PIO::PF_INET i.e. IPv4 21:52
cono and rule also should be changed to regex, to make backtracking mechanism possible
MasterDuke Skarsnik: greppable6 searches all the ecosystem modules
BooK but the name resolution is not done there
Skarsnik yeah and moar does not get this info
BooK note sure what $PIO is here: github.com/rakudo/rakudo/blob/nom/...ET.pm#L117
MasterDuke s: IO::Socket::INET.new, 'listen'
SourceBaby MasterDuke, Something's wrong: ␤ERR: Type check failed in binding to parameter '&code'; expected Callable but got Nil (Nil)␤ in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤ in block <unit> at -e line 6␤␤
BooK s: IO::Socket::INET.new, :listen # I think 21:53
SourceBaby BooK, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Unable to parse expression in argument list; couldn't find final ')'␤at -e:7␤------> <BOL><HERE><EOL>␤
BooK s: IO::Socket::INET.new( :listen ) # better
SourceBaby BooK, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Unable to parse expression in argument list; couldn't find final ')'␤at -e:7␤------> <BOL><HERE><EOL>␤ 21:54
MasterDuke s: IO::Socket::INET.new, \(:listen)
SourceBaby MasterDuke, Something's wrong: ␤ERR: Earlier failures:␤ Nothing given for new socket to connect or bind to. Invalid arguments to .new?␤ in block <unit> at -e line 6␤␤Final error:␤ Cannot resolve caller sourcery(Failure, Capture); none of these signatures match:␤ ($thing, Str:D $method, Capture $c)␤ ($thing, Str:D $method)␤ (&code)␤ (&code, Capture $c)␤ in block <unit> at -e line 6␤␤
BooK anyways
BooK github.com/perl6/nqp/blob/master/s....nqp#L2047 # this is where the link is made, right? 21:58
BooK Skarsnik: github.com/MoarVM/MoarVM/blob/mast...#L231-L233 # this look interesting 22:01
perlpilot cono: I dunno ... using token like that is a good habit to get into. It's only the `a` rule that really needs backtracking.
cono BooK: you can look to my series of ticket to add get_port op: github.com/MoarVM/MoarVM/pull/602, there is a cross links between moar nqp and rakudo
perlpilot: a and TOP 22:02
b should token, agree 22:03
should be*
Skarsnik BooK, na it's just to tell you the returned type for this function is not good if you get a ipv6 stuff, but it kinda work since the 2 struct for ipv4/ip6 start the same 22:04
anyways, time for bed ^^ 22:05
perlpilot m: grammar G { rule TOP { <a> <b> }; regex a { <word>+ % <.ws> }; token b { <word> \. }; token word { <.alpha>+ }; }; say G.parse("abc def etc.");
camelia 「abc def etc.」
a => 「abc def」
word => 「abc」
word => 「def」
b => 「etc.」
word => 「etc」
BooK cono: well, I'm not wanting to add a new op, just fix this one 22:06
cono perlpilot: heh, thanks. works indeed 22:07
BooK well, I disagree with Skarsnik: MVM_io_resolve_host_name is what returns the socket to be used, and if the Perl6 IO::Socket::INET gave a family, that should be a hint on which to pick when there's a choice 22:08
github.com/MoarVM/MoarVM/blob/mast...ket.c#L242 # result here is a linked list 22:09
but moar just picks the first item in the list
BooK I'd say that family should be passed, and the first item in the list that match the family spec is return 22:10
and still the first is no family is given
BooK do I make sense ? 22:10
struct addrinfo has this as its last item: struct addrinfo *ai_next; 22:12
"The items in the linked list are linked by the ai_next field."
luckily, MVM_io_resolve_host_name is not used it too many places 22:13
BooK writing a moarvm bug report for the issue 23:18
the problem is that it requires a signature change, I think
github.com/MoarVM/MoarVM/issues/683 # I hope this makes sense 23:24
raschipi BooK: Makes sense, but can't it be solved by having a multi? If one uses the old call, and if they send the list they would ge the new one? 23:28
BooK raschipi: in which language? nqp? 23:29
rakudo should definitely use the new call, because it's supposed to ask for a specific family 23:30
I understand changing the signature of MVM_io_resolve_host_name creates some compatibility problems, but I'm not versed enough in C or MoarVM to propose a good solution to that 23:31
BooK design.perl6.org/S32/IO.html#IO%3A...%3A%3AINET # I see this was not the most fleshed out part of the design docs 23:37
raschipi I have to mention there's a RIGTH THING™ to do when picking an AF_INET family to communicate: happy eyebals, RFC 6555 23:41