»ö« 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.
travis-ci Doc build errored. Zoffix Znet 'Show non-$/ var use in actions in example 00:06
travis-ci.org/perl6/doc/builds/248167658 github.com/perl6/doc/compare/69964...2888310a06
travis-ci Doc build errored. seatek 'Coke discovered my missing be' 00:41
travis-ci.org/perl6/doc/builds/248176364 github.com/perl6/doc/compare/d9288...d74e95cf20
seatek wasn't there some better way to die? I'm kinda remembering it... like a lazy sort of die 00:58
all i get is lazy diets from Google 00:59
geekosaur Failure? 01:06
which is a suspended exception that will explode if you use it as a normal value, although you can test for it and thereby defuse it 01:07
seatek fail! yes that's it! :) thanks geekosaur :) 01:11
geekosaur oh, you want the sub/method 'fail'
seatek m: my $a = 'Dog'; my $rx = rx/^D.*/; say so $a ~~ $rx 04:40
camelia True
seatek That's neat
m: my $a = 'Dog'; my $r = '^D.*'; my $rx = rx/$r/; say so $a ~~ $rx 04:41
camelia False
seatek That confuses me
Is there a way to get a variable interpolated as a regex?
I've been digging 04:42
geekosaur <$var> 04:42
seatek oh my gosh that works 04:43
thank you so much ++geekosaur :)
but <<$r>> doesn't. i'll maybe try wrapping my head around it later 04:45
geekosaur regex language is not the same as regular perl 6. in regex language < > indicates some kind of special behavior
seatek that's what i was just thinking - universe into itself 04:46
geekosaur design.perl6.org/S05.html#Extensibl...%3C...%3E)
geekosaur (that page may be a little out of date, those docs were preliminary specifications that have since been succeeded by actual code and tests, but they capture the intended design) 04:49
seatek so kinda like <alum> and <punct> -- meaning, do something weird with what's in here, and if it's a variable, go ahead and interpolate it
seatek ok looks like the "do something weird" is more like... i don't know... but wow... those brackets... amazing how many things can be associated with such tiny atomic stuff 04:57
seatek It's strange how this language can be so clear and minimal, and at the same time be so Baroque 04:59
seatek my moarvm has cherubs and filigree in it. on a tensor 05:07
lookatme afternoon 06:16
zoll hi 06:21
Geth doc: ufobat++ created pull request #1397:
Describe $*MAIN-ALLOW-NAMED-ANYWHERE
07:12
pmurias native ints are 64 bit? 09:44
yes 09:45
lizmat pmurias: unless you're on a 32-bit system 10:35
m: say $?BITS
camelia 64
lizmat that would be 32 on a 32-bit system 10:35
although I must admit I have never been able to test that
pmurias it's 32-bit on the js backend too because JavaScript doesn't yet have native 64bit integers :/ 10:40
jnthn On MoarVM it ends up being 64-bit everywhere, fwiw 10:43
But it's spec'd as being machine defined
Or backend defined, rather
ilmari pmurias: shouldn't it be 53 on js? ;)
pmurias ilmari: that was one choice, I'm emitting the integer stuff as 32bit using the tricks asm.js uses 10:51
ilmari: which is basically |0 in a lot of places
tadzik why 53? :o 10:52
tbrowder .tell DrForr my Perl6::Parser PR passes all tests
yoleaux tbrowder: I'll pass your message to DrForr.
ilmari tadzik: that's the precision of 64bit floats
tadzik ah 10:53
ilmari they have a 53 bit mantissa, so with a zero exponent you can represetnt integers up to 2^53 exactly
tadzik I see
Geth doc: 4a2d0f21d3 | (Gabor Szabo)++ | doc/Language/testing.pod6
add closing marks that were missing
10:59
travis-ci Doc build passed. Gabor Szabo 'add closing marks that were missing' 11:31
travis-ci.org/perl6/doc/builds/248322990 github.com/perl6/doc/compare/ecd74...2d0f21d387
[Coke] I love ack, but I really wish that ack 2.0 would stop telling me that -a is the default. JUST LET ME TYPE IT. 11:57
I feel like it's trying to punish me for being a loyal user from the 1.0 days. :(
zengargoyle heh, write a wrapper in ~/bin that removes -a. :) 12:01
jast or you could stop typing it ;) 12:17
DeadDelta lizmat │ that would be 32 on a 32-bit system 12:23
DeadDelta lizmat: it's 64-bits still; at least on moar. $?BITS is computed to be the size of native int, while It's $*KERNEL.bits that gives 32 on 32-bit boxes, is computed by what uname gives 12:24
zengargoyle heh, i think i once had a gripe about using uname because the output varies wildly across distros. 12:26
DeadDelta Don't gripe. Make it better. 12:27
It's all up in this file: github.com/rakudo/rakudo/blob/nom/.../Kernel.pm
zengargoyle nah, i sorta remember discussing this with lizmat a long time ago and coming to no good conclusion. 12:30
it's more that parts of uname are just user/distro specified with no real logic behind it. it's more human-consumable then actually specified info. 12:31
good for per-distro/os usage, not good for cross platform utility. 12:32
debian ubuntu arch freebsd solaris redhat centos ... all put different sorts of things into what uname -flag returns. 12:34
raschipi Is it the uname binary that generates the string or is the kernel that returns a distro-specific string when uname(2) is called?
How does autoconf detects it? 12:35
zengargoyle raschipi: i don't recall exactly, i just remember trying various uname across all the OS i had access to at the time and throwing up my hands.
zengargoyle some of the fields are little more than a -Dsomething=somethin when building a kernel. some are using amd64 vs x86_64, some are adding extra bits of info to the strings. 12:37
raschipi Building systems usually make these determinations, autoconf, cmake, etc. Could look there to gather ideas. 12:38
zengargoyle they're really only mostly consistent across a 'distro'-ish. like if you get a version X.X.X or a string-X.X.X or X.X.X_something_other 12:39
tyil cant you just use `uname -m`, that should be pretty consistent 12:40
zengargoyle no longer has access to a plethora of OS to test against. 12:41
just on Solaris old $WORK had a 40 line or so script for specific version detection. 12:42
tyil I guess you can use `file $(which perl6)` to do a very dirty check to see what the package manager made of it :p 12:44
oh, `file $(which moar)` 12:46
raschipi Debian allows 32-bit moar to be installed in a 64-bit system. If there are multiple installations, that wouldn't be correct. 12:52
cschwenz p6: class Foo does Rational { }; 12:59
camelia 5===SORRY!5=== Error while compiling <tmp>
No appropriate parametric role variant available for 'Rational'
at <tmp>:1
cschwenz ^^^ what am i doing wrong?
DeadDelta cschwenz: Rational takes two parameters, the types for numerator and denominator 13:00
p6: class Foo does Rational[Int,Int] { };
camelia ( no output )
cschwenz DeadDelta++
thanks! :-)
lizmat DeadDelta: is there a reason to have Rational not default to [Int,Int] ? 13:12
DeadDelta No idea 13:12
lizmat tries a spectest with defaults 13:14
DeadDelta Considering the attributes get default 0 and 1 values, the range of options is kinda limited :D
p6: class Foo does Rational[Num, Num] { }; Foo.new
camelia Type check failed in binding to parameter 'nu'; expected Num but got Int (0)
in block <unit> at <tmp> line 1
DeadDelta heh
lizmat cschwenz: github.com/rakudo/rakudo/commit/41ed2c03ab 13:22
$ 6 'class Foo does Rational { }; dd Foo.new(42,50)' 13:23
Foo.new(numerator => 21, denominator => 25)
cschwenz lizmat++ :-) 13:29
Geth doc: c4cbc81682 | (Jan-Olof Hendig)++ | 2 files
Fixed a few incorrect/missing »
13:45
mr_ron m: { my int $a = 42; loop (my int $i = 0; $i < 10_000_000; $i++) { $a += 1 + $a % 3 } ; say $a; say now - ENTER now }; # nicer perf now 14:02
yoleaux 28 Jun 2017 10:11Z <DeadDelta> mr_ron: yesterday's discussion about natives was wrong. Literals *are* supposed to work work with native multies if they can fit (which they now do, once again, on latest commit)
camelia 15000042
1.0506027
DeadDelta And there's more discussion on that topic happening right now in #perl6-dev 14:03
mr_ron { my int $a = 42; for (1..10_000_000) { $a += 0 + $a % 3 } ; say $a; say now - ENTER now } # slower - in Perl5 ranges are faster
m: { my int $a = 42; for (1..10_000_000) { $a += 0 + $a % 3 } ; say $a; say now - ENTER now } # slower - in Perl5 ranges are faster
camelia 42
2.9684946
mr_ron m: { my int ($a, $one, $limit) = (42, 1, 10_000_000); for ($one..$limit) { $a += 0 + $a % 3 } ; say $a; say now - ENTER now } # still slower
camelia 42
4.8303067
14:04
DeadDelta I think Range just goes through .succ. There might not be any special native-int magic in it
s: ((my int $ = 1) .. (my int $ = 2)).iterator, 'pull-one'
DeadDelta s: ((my int $ = 1) .. (my int $ = 2)).iterator, 'pull-one' 14:05
SourceBaby DeadDelta, Sauce is at github.com/rakudo/rakudo/blob/d5bf...r.pm#L1665 14:06
DeadDelta Ah, nm, we do have it. lizmat++
mr_ron m: { my int $a = 42; for (1..10_000_000) { $a += 1 + $a % 3 } ; say $a; say now - ENTER now } # slower - in Perl5 ranges are faster 14:08
camelia 15000042
3.01248510
mr_ron m: { my int ($a, $one, $limit) = (42, 1, 10_000_000); for ($one..$limit) { $a += 1 + $a % 3 } ; say $a; say now - ENTER now } # still slower
camelia 15000042
5.16865642
timotimo it doesn't do the for-to-while-loop optimization
because the start and end points aren't constants 14:10
we could of course do it anyway
that wants careful testing
mr_ron I am sick right now and have to come back 14:26
colomon Dunno where things stand with MAIN / $*MAIN-ALLOW-NAMED-ANYWHERE, but the only reason I haven’t used it extensively in my code is because I didn’t know it existed before this morning. Of course, I’d really prefer it if the default was True rather than False… 14:29
DeadDelta colomon: the things stand at it being removed and replaced with a hash of options instead of a single scalar option. With (currently) the only option being the allow named anywhere option. 14:30
in 10 hours 14:31
colomon sounds good.
DeadDelta buggable: eco getopt 14:36
buggable DeadDelta, Found 6 results: Getopt::Tiny, Getopt::Long, Getopt::Type, Getopt::Kinoko, Getopt::Std. See modules.perl6.org/#q=getopt
raschipi What $*MAIN-ALLOW-NAMED-ANYWHERE does? 14:37
DeadDelta Nothing.
:)
It doesn't exist. Pay no attention to the man behind the curtain 14:38
raschipi I will ask lizmat since she implemented it in the first place.
DeadDelta raschipi: gist.github.com/zoffixznet/187333d...4cab37e513 14:39
raschipi And the interface being built will allow dor this to be set for each option instead of all-or-nothing? 14:41
colomon has been doing this using @*ARGS = |@*ARGS.grep(/^"--"/), |@*ARGS.grep({ $_ !~~ /^"--"/ }); 14:42
DeadDelta raschipi: the only change being made is we're making the options for handling MAIN more extensible. Instead of shoving in yet another global the next time someone wants something different, we'd just handle another key in a hash 14:43
And looking at Getopt::* impls; wouldn't be a terrible idea to allow passing a class that handles options to, say, %*MAIN-SUB-OPTIONS<parser> and have it use the class to parse out the options any way the user want, while still receiving them via the MAIN sub 14:44
raschipi Sounds very good.
DeadDelta You want the unixy things? %*MAIN-SUB-OPTIONS<parser> = Getopts::Unixy. You like git-like parsing? %*MAIN-SUB-OPTIONS<parser> = Getopts::GitLike 14:45
raschipi So, the global variable won't be substituted by a Hash, but by a key in a hash that will deal with other things related to the problem
zengargoyle while we're at it.... is there an example somewhere of a 'modulino'? i.e. a class/module/unit like thing that can be either use'd or run directly.
lucasb m: say < oh --hai oh --hai >.sort(* !~~ /^ '--'/) 14:46
camelia (--hai --hai oh oh)
lucasb ^^ I wonder if such idiom would fit colomon's need
DeadDelta Useless use of regex :)
m: for ^10000 { $ = < oh --hai oh --hai >.sort(* !~~ /^ '--'/) }; say now - INIT now
camelia 0.5954372
colomon m: say < oh --hai ohno --haiku >.sort(* !~~ /^ '--'/)
camelia (--hai --haiku oh ohno)
DeadDelta m: for ^10000 { $ = < oh --hai oh --hai >.sort: *.starts-with('--').not }; say now - INIT now 14:47
camelia 0.1742473
colomon lucasb: is it stable? rearranging the order of the arguments (other than moving —’s forward) would be bad
lucasb colomon: if the sort is stable? sorry, idk. 14:49
DeadDelta: yeah, .starts-with seems better suited for this job, thanks :)
colomon m: say < oh --hai ah —boo >.sort(* !~~ /^ '--'/)
camelia (--hai oh ah —boo)
colomon stupid IRC client 14:50
lucasb is there a 'partition' method for arrays? eg. split the elements into 2 arrays based on an predicate given as argument?
raschipi classify
colomon lucasb: yes
raschipi "Transforms a list of values into a hash representing the classification of those values according to &mapper;" 14:51
&mapper being *.starts-with('--') 14:52
lucasb m: say < a --b c --d >.classify(*.starts-with('--')).values
camelia ([--b --d] [a c])
colomon m: say < a --b c --d >.classify(*.starts-with('--')).values.slip
camelia No such method 'slip' for invocant of type 'Seq'. Did you mean any of these?
Slip
flip
sin
skip

in block <unit> at <tmp> line 1
lucasb now, just need to join :)
DeadDelta m: say < a --b c --d >.classify(*.starts-with('--')).values.Str 14:53
camelia --b --d a c
DeadDelta Oh
[Coke] to DeadDelta's point, made github.com/coke/ack2/commit/5693a0...430fd8d5f5 ; now at least I can ack in peace.
DeadDelta m: say < a --b c --d >.classify(*.starts-with('--')).values».Slip.flat
camelia (--b --d a c)
Burgos Hello! 14:53
DeadDelta \o
m: say < a --b c --d >.classify(*.starts-with("--")).values»<>.flat 14:54
camelia (--b --d a c)
Burgos I was just curious and tried to use autosplit with perl6 (rakudo), but it doesn't seem like it's supported
DeadDelta What's autosplit?
[Coke] what is autosplit?
Burgos `perl -F: -lane ...`
[Coke] heh
Burgos namely, option `-a`
Burgos googling doesn't help much 14:55
I found this draft, where it says it should stay the same: design.perl6.org/S19.html
moritz perldoc perlrun explains it
Burgos but brings nothing: www.google.de/search?q=site:docs.p...SvU_a6t5gK
moritz I think it's not yet implemented (though I might be wrong)
Burgos so I was just curious if it's not implemented yet
or not supported 14:56
[Coke] It's not implemented, and it's not tested in the spec, either, as far as I know.
zengargoyle moritz: ACK email.
[Coke] (so, less I than NYI: it's not on the roadmap, I don't think) 14:57
Burgos: note that the design docs are merely historical at this point.
the real spec is the tests in the roast repo.
Burgos yeah, that's why I looked in docs.perl6.org 14:58
thanks!
zengargoyle what's the 'official' NYI thing? say i have a function and just want to croak NYI, is there an easy thing?
raschipi '...' does that
DeadDelta m: X::NYI.new(:feature<meows>).throw
camelia meows not yet implemented. Sorry.
in block <unit> at <tmp> line 1
zengargoyle DeadDelta: thanks much.
[Coke] docs.perl6.org/language/5to6-nutshell says NYI, but that probably needs to be updated.
I wouldn't add anything new that throws that exception. 14:59
DeadDelta Never used that feature in Perl 5 15:00
zengargoyle m: sub f { ... }; f();
camelia Stub code executed
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
DeadDelta the perl -lane 'say pop @F'; would be perl6 -ne '.words[0].say' 15:01
zengargoyle m: sub f { X::NYI.new(:feature<f>).throw }; f();
camelia f not yet implemented. Sorry.
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
zengargoyle *sweet* 15:02
timotimo i don't think autosplit is hard to implement, honestly
DeadDelta m: sub f { ... X::NYI.new: :feature<f> }; f();
camelia f not yet implemented. Sorry.
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo hm, though maybe adding the @F lexical needs to happen so early that we might not have a good handle on it
DeadDelta m: sub f { ??? X::NYI.new: :feature<f> }; f();
camelia f not yet implemented. Sorry.
in sub f at <tmp> line 1
DeadDelta m: sub f { !!! X::NYI.new: :feature<f> }; f(); 15:03
camelia f not yet implemented. Sorry.
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
DeadDelta m: sub f { !!! X::NYI.new: feature => &?ROUTINE.name }; f(); 15:04
camelia f not yet implemented. Sorry.
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
Burgos > <timotimo> i don't think autosplit is hard to implement, honestly 15:05
yeah, could be one of the things one could easily contribute
if the rain continues over the next weekend, who knows
timotimo it is raining here right now
DeadDelta m: sub term:<♥♥♥> { die X::NYI.new: feature => callframe(1).code.name }; sub f { ♥♥♥ }; f(); 15:06
camelia f not yet implemented. Sorry.
in sub term:<♥♥♥> at <tmp> line 1
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
DeadDelta hehe neat :)
Burgos yeah, but I'm at work :( 15:09
timotimo it stopped raining. no -a for you! :P 15:10
Burgos :-) 15:13
timotimo i wonder how late we're allowed to throw lexicals into the qast tree
DeadDelta You could always do a dynamic var :) 15:16
buggable: eco LN
buggable DeadDelta, LN 'Get $*ARGFILES with line numbers via $*LN': github.com/zoffixznet/perl6-LN
DeadDelta ^ like there
timotimo hmm, a dynamic var isn't as pretty as just @F 15:19
DeadDelta Why 'F' anyway? 15:22
zengargoyle Field 15:25
timotimo actually, i wouldn't mind if we put it into $/
zengargoyle probably AWK or before, FS = Field Separator. 15:26
$/ might make it harder to sub-match on fields. 15:28
zengargoyle Re: my latest fight with grammar/actions and using ($/) 15:29
zengargoyle if $/[0] ~~ 'foo' { say $/[1] } 15:31
vs if @F[0] ~~ 'foo { say @F[1] }
raschipi What's the matter, to avoid the pitfall... 15:32
zengargoyle it seems in the actions case, use ($bar) instead of ($/) which .... i guess binds $bar to $/ or something. 15:33
i.e. manually keeping track and unpacking $/ at every level where you might need to use ~~ (or whatever uses $/) again. 15:35
DeadDelta TBH, my feeling about it is don't add @F at all
Perl 5's split does a lot of magic we don't do. And we also have .comb. 15:36
timotimo you can if $/[0] ~~ /foo/ -> $othermatch { }
perlpilot DeadDelta: and ... there's module space for this stuff.
DeadDelta -F: -lane in perl6 would produce....
m: ":foobar:ber::meow".split: ':'
camelia ( no output ) 15:37
DeadDelta m: dd ":foobar:ber::meow".split: ':'
camelia ("", "foobar", "ber", "", "meow").Seq
zengargoyle fwiw, i tried using a Block (or whatever a { .... } would be and it don't work. :)
DeadDelta Well, OK, it's the same in Perl 5.
But still, it feels to be one of those crtiptic and weird Perl 5 bells and whistles 15:38
zengargoyle it's a very common use when dealing with input from pipe like things on unixy like things. 15:40
DeadDelta What? using a bunch of switches and a @F variable instead of just using .words or .comb methods?
'-a 15:41
'-a @F' is the same length as .words and you don't have to learning anything extra
perlpilot yeah, having some specialized thing for common command line operations is very AWK/Perl 5 thinking.
perlpilot And, again, if you need some specialized thing for command line stuff ... write a module for it. 15:42
(though, I would like to see perl6 garner a -i ala P5 at some point)
zengargoyle it's the same with -n and -p 15:43
convience of not having to do that yourself for a simple -e '<some code>' 15:44
DeadDelta yeah, wtf do we even have '-' ---
DeadDelta yeah, wtf do we even have '-p' -_- 15:44
perldoc perlrun is 24 pages long. 15:45
Well, screens
19 pages of US Letter paper
zengargoyle let's make everybody write their own while/print? loops each time even though it's like 90% of the simple use case that they would want to be as simple as possible. 15:46
DeadDelta Where do you get your percentages from? 15:47
zengargoyle lol, 30 years of programming (mostly on unix though...) 15:48
DeadDelta Right, so made up.
zengargoyle aka /my ***
DeadDelta Made up numbers for a single human.
:)
perlpilot zengargoyle: would you object to `perl6 -MCU -e '...'` ? (if there were a CU module that had command utilities) 15:48
zengargoyle perlpilot: not at all 15:49
DeadDelta Or alias perl6='perl6 -MCU'
DeadDelta & 15:50
zengargoyle i could probably go through the *near* *infinite* number of files i have named '0liners' for all of the perl one-liner's i've written that use -a, but i'm lazy.
perlpilot zengargoyle: my experience so far has been that Perl 6 has enough power in the language that I don't really miss fancy command line options from Perl 5 15:51
DeadDelta It'd still be a datapoint for a single programmer
I've never used -a in my life in the ~10 years I've used Perl 5 for example.
zengargoyle DeadDelta: you've missed out. 15:52
perlpilot -a is probably more common from Perl "old timers" :)
DeadDelta zengargoyle: nope.
I didn't bother reading the 19 pages of perldoc perlrun and probably learned some other things in its place :)
DeadDelta && 15:53
travis-ci Doc build errored. Jan-Olof Hendig 'Fixed a few incorrect/missing »' 15:54
travis-ci.org/perl6/doc/builds/248377017 github.com/perl6/doc/compare/4a2d0...cbc81682b3
smls bisectable6: my @a = 1, 2, 3; say DUMP @a 16:01
bisectable6 smls, On both starting points (old=2015.12 new=41ed2c0) the exit code is 1 and the output is identical as well
smls, Output on both points: «MVMArray: Can't shift from an empty array␤ in block <unit> at /tmp/5loc42TDxz line 1␤»
smls Didn't DUMP once work, as a tool to introspect the "innards" of an array (i.e. how much has been reified etc.)? 16:03
moritz before the GLR, maybe? 16:04
smls hm, probably
[Coke] m: my @a = lazy 1,2,3; dd @a 16:07
camelia Array @a = (1, 2, 3, Any, Any, Any, Any, Any, Any, Any... lazy list)
[Coke] (it just shows 10, doesn't care what's reified) 16:08
smls [Coke]: Right, but sometimes (when debugging) it can be helpful to look under the hood. 16:10
I was looking at the lastest Perl 6 question on Stack Overflow, which involves an infinite array of arrays recursively defined with gather/take. 16:11
And calling `dd` or `say` on it, seems to simply hang indefinitely. 16:12
raschipi link?
smls stackoverflow.com/questions/448219...s-operator
smls ^^ Try to add a "dd @arrs;" after the "my @arrs = ..." line. 16:14
raschipi If the list is infinite, hanging is expected. If you try to reify an infinite list, it will hang. 16:15
It's an infinite loop.
smls m: my @a = 1..*; dd @a; 16:16
camelia Array @a = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10... lazy list)
smls raschipi: not normally ^^
[Coke] smls: can you golf that SO post to the unexpected behavior? 16:18
smls haven't tried yet
nicq20 Sorry to derail the conversation, is it possible to pass named args to a `use`? 16:19
DeadDelta nicq20: not with the current scheme
DeadDelta It just treats them as tags :/ 16:20
nicq20: or I should say, I really wanted to figure out how and failed :/
nicq20 Aww, man.
DeadDelta Even passing them as :foo.Pair triggers the tag, even tho a normal sub would take it as a positional pair :/
nicq20 I've been looking for a bit, and the only thing I could find that clearly explained is: 16:21
nicq20 Whereas UNIT::EXPORT packages deal with the named parameters passed to use, the EXPORT sub handles positional parameters. If you pass positional parameters to use they will be passed to EXPORT. If a positional is passed the module no longer exports default symbols. 16:21
docs.perl6.org/language/modules#EXPORT
DeadDelta buggable: author zoffixznet
buggable DeadDelta, Found 35 dists for zoffixznet. See temp.perl6.party/buggable/55318663...53312.html
DeadDelta nicq20: basically this is the best I cooked up: github.com/zoffixznet/perl6-Rakudo...Prereq.pm6 16:22
Passing opts as positional strings and under the hood treating them as bool named args 16:23
This line in particular: github.com/zoffixznet/perl6-Rakudo...req.pm6#L6
nicq20 DeadDelta: Thanks! I'll see if I can figure something out. 16:29
nicq20 I wonder if that can be changed with a slang. :/ 16:33
zengargoyle is the Test module fixed enough to document? 16:33
moritz yes, see docs.perl6.org/language/testing 16:34
DeadDelta zengargoyle: it's fully documented
zengargoyle Language/testing doesn't help much. * throws-like — a given block of code (or string to be evaled) throws a given 16:36
exception
DeadDelta zengargoyle: well, "throws-like" is a link to detailed explaination. Click it
zengargoyle oh, web docs.... :( 16:37
DeadDelta Oh scroll further down. It's all in that single document
zengargoyle wondering if adding POD to Test.pm6 was a good idea or not.
there is only one line for 'throws-like' in Language/testing 16:38
DeadDelta My browser tells me there are 4 16:38
zengargoyle i had to look at src for Test.pm6 to get details.
ah, i'm relying on the p6doc
DeadDelta No, POD to Test.pm6 is not a good idea, because you need special arrangements to be able to contribute to rakudo/rakudo dir, whereas anyone can contribute to perl6/doc 16:39
zengargoyle aka not-web something.
DeadDelta s/dir/repo/;
Wonder why p6doc isn't rendering Language/testing in full :/
zengargoyle has commit. :P
ah, that may be a thing.
zengargoyle thinks perldoc was one of the major things that made me choose perl over some other languages. :) 16:41
DeadDelta mhm, it's good 16:42
zengargoyle i'd rather have Test doc in POD in Test.pm6 than just on some random web page. 16:43
zengargoyle grudgingly checks web pages.... 16:44
raschipi Make it generate info so that the links work, since they will be written for the web... 16:46
[Coke] part of the issue is that we want docs that are independent of the impl. 16:46
(for modules, it's ok to tie the docs to the impl, but not for anything that's "core")
Ven`` o/ 16:47
raschipi It should still work in the command line, even if it's shipped separately from any particaular implementation... 16:47
Ven`` it's been a few years and I can't remember. 16:48
The zen slice is only useful for interpolation, yeah?
Ven`` <TimToady> on zen slices, .[] is supposed to be equivalent to @() 16:48
zengargoyle [Coke]: yeah, Test is a module that i expect to have self-hosted docs of actual workings. 16:49
raschipi Which is the same as calling .list on it as I recall.
zengargoyle last time i checked, Test was still being tweaked a bit... 16:50
perlpilot Ven``: Why do you ask?
Ven`` they were in some talk, and a student asked 16:51
DeadDelta Ven``: yes, it doesn't even reify and just returns self 16:52
Ven`` well, it returns `self.list`
DeadDelta Ven``: that's just the "anything is a 1-item list" 16:53
s: [], 'ZEN-POS', \()
SourceBaby DeadDelta, Sauce is at github.com/rakudo/rakudo/blob/7b17...ny.pm#L317
DeadDelta Actually no.
Ven``: where's the self.list? Even the Any candidate returns self
m: dd 42[]
camelia 42
raschipi Ok, so .[] and @() are different 16:55
DeadDelta Yeah 16:56
raschipi m: dd 1.[], @(1);
camelia 1
(1,)
DeadDelta Maybe the Any candidate should do self.list I thought it would and the Positionals would just do self 16:56
m: dd 1.list[], @(1); 16:57
camelia (1,)
(1,)
DeadDelta Ven``: where is that TimToady's quote from? I'll commit this tonight unless someone beats me to it 16:58
raschipi DeadDelta: ask him if he didn't use rule 2 first. Maybe it's an old quote. 16:59
DeadDelta nm, found it irclog.perlgeek.de/perl6/2013-06-12#i_7189796
I'm not going by Rule 1, but by it making sense :D 17:00
raschipi m: dd 1.[*];
camelia (1,)
DeadDelta That reifies
s: 1, 'AT-POS', \(*)
SourceBaby DeadDelta, Sauce is at github.com/rakudo/rakudo/blob/7b17...ny.pm#L299
DeadDelta wat...
m: dd Whatever.new.Int 17:01
camelia No such method 'Int' for invocant of type 'Whatever'
in block <unit> at <tmp> line 1
DeadDelta You're lying to me, robot!
zengargoyle remembers [] and [*] were slightly different
DeadDelta s: &postcircumfix:<[ ]>, \(1, *) 17:02
SourceBaby DeadDelta, Sauce is at github.com/rakudo/rakudo/blob/7b17...ce.pm#L400
DeadDelta Ahh. `SELF[^SELF.elems];`SELF[^SELF.elems];
DeadDelta s: 1, 'AT-POS', \(^(1.elems)) 17:03
SourceBaby DeadDelta, Sauce is at github.com/rakudo/rakudo/blob/7b17...ny.pm#L299
DeadDelta Still weird. It treats the range as Cool and converts it to an Int which just happens to work :/ 17:04
DeadDelta stops bot-spamming and leaves to do things
(it doesn't do the ^ Cool thing. it still goes through another &postcircumfix:<[ ]> candidate that does things) 17:05
raschipi m: say (1 .. *)[] 17:06
camelia 1..Inf
raschipi m: say (1 .. *)[*]
camelia Cannot .elems a lazy list
in block <unit> at <tmp> line 1
ufobat m: my @a = "A" .. "Z"; say @a.sort: { if $^a.starts-with("A") { Less } else { $^a cmp $^b }} 17:50
camelia Too few positionals passed; expected 2 arguments but got 1
in block at <tmp> line 1
in block <unit> at <tmp> line 1
ufobat i cant spot my mistake :( 17:51
HelpBot[perl6] ufobat: the $^a and $^b apply to your else block not to sort 17:51
m: my @a = "A" .. "Z"; say @a.sort: { $^a.starts-with("A") ?? Less !! $^a cmp $^b } 17:52
camelia (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
ufobat ah1
ufobat thank you! 17:53
HelpBot[perl6] Any time!
HelpBot[perl6] m: my @a = "A" .. "Z"; say @a.sort: { $^b; if $^a.starts-with("A") { Less } else { $a cmp $b }} 17:54
camelia (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
HelpBot[perl6] Also works. $^foo needs to be used just once, after that you can refer to it without the carrot, which is helpful in precicely such cases, where you want to use a var in some other block 17:55
m: my @a = "A" .. "Z"; say @a.sort: -> $a, $b { if $a.starts-with("A") { Less } else { $a cmp $b }}
camelia (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
HelpBot[perl6] Also good.
[Coke] "caret" 17:56
ufobat thats funny i didnt expect that you could leave out the ^
thats really helpful 17:57
[Coke] m: my @a = ("A" .. "Z").pick; say @a.sort: -> $a, $b { if $a.starts-with("A") { Less } else { $a cmp $b }}
camelia (Q)
[Coke] m: my @a = ("A" .. "Z").pick(*); say @a.sort: -> $a, $b { if $a.starts-with("A") { Less } else { $a cmp $b }} 17:57
camelia (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
[Coke] ;(just to make sure it's doing something. :)
HelpBot[perl6] m: my @a = ("A" .. "Z").pick(*); say @a.sort: { -$a.starts-with("A") || $a cmp $b } 17:58
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared. Did you mean '@a'?
at <tmp>:1
------> 3= ("A" .. "Z").pick(*); say @a.sort: { -7⏏5$a.starts-with("A") || $a cmp $b }
HelpBot[perl6] m: my @a = ("A" .. "Z").pick(*); say @a.sort: { -$^a.starts-with("A") || $^a cmp $^b } 17:59
camelia (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
HelpBot[perl6] ehehe
needs an `or` tho :)
[Coke] wonders what the point of the starts-with was there. 18:00
HelpBot[perl6] Because the input data may more than 1 letter :) 18:01
m: { dd $:a, $^a }(:72a) 18:02
camelia Int $a = 72
Int $a = 72
HelpBot[perl6] m: { dd $^a, $:a }(72) 18:03
camelia Int $a = 72
Int $a = 72
[Coke] sure, but cmp still works.
ufobat aye, but
it makes no sense in my example 18:04
[Coke] m: my @a = <A B EGG AXE ZOO APE>; say @a.sort: { -$^a.starts-with("A") || $^a cmp $^b }
camelia (A AXE APE B EGG ZOO)
ufobat i didnt work carfully ;)
[Coke] hokay
ugexe m: my @a = <A B EGG AXE ZOO APE B>; say @a.sort({ not $^a.starts-with("A") }).sort 18:24
camelia (A APE AXE B B EGG ZOO)
HelpBot[perl6] Why does that sort B before ZOO? 18:25
Oh there are two sorts, nevermind
ugexe m: my @a = <A B EGG AXE ZOO APE B>; say @a.sort.sort({ not $^a.starts-with("E") }); # probably a better example 18:27
camelia (EGG A APE AXE B B ZOO)
tbrowder ref Proc: should I change to Proc::Async instead for basic system calls, 18:38
ugexe well, it can't hurt 18:44
tbrowder sounds like a plan! thanx, ugexe 18:48
tyil !p6 "1.000.000,0".succ.say 18:56
p6: "1.000.000,0".succ.say
camelia 2.000.000,0
tyil how can I make it return 1.000.001,0?
ugexe m: "1.000.000,0" but role :: { method succ { return "1.000.001,0" } }.succ.say 19:00
camelia 1.000.001,0
geekosaur I think it just uses Perl 6's own rules to parse the number out of the Str, and like most languages Perl 6's numeric syntax is not locale aware
tyil sad 19:01
perlpilot you can always write a module for it. 19:03
HelpBot[perl6] p6: "1.000.000,0".comb(/\d+/).join.Numeric.succ.say 19:04
camelia 10000001
tyil I was just wondering as someone asked :p
HelpBot[perl6] is too used to North American numerals for 1.000.000,0 to look completely alien :P 19:05
HelpBot[perl6] m: "1.000.000,0".trans([<, .>] => ['.', '']).succ.say 19:07
camelia 1000001.0
perlpilot m: "1.000.000,0".trans(< , . > => < . , >).succ.say 19:09
camelia 1,000,001.0
perlpilot :)
HelpBot[perl6] :) 19:09
geekosaur aside from needing to map it back again... :p 19:10
perlpilot just noticed that his text is just a slightly lighter shade as everyone else's on his IRC client
I've been using this client for 1.5 years and only just noticed the difference
geekosaur (he)xchat?
perlpilot yeah
hey-joe what is perl6 one-liner like perl -e 'print((<>)[-10..-2])' ( shorter than perl6 -e 'lines.reverse[2..10].reverse' ) ? 19:35
moritz lines[*-10..*-2] 19:36
jnthn lines[*-10..*-2]
heh ;)
hey-joe "This Seq has already been iterated, and its values consumed (you might solve this by adding .cache on usages of the Seq, or by assigning the Seq into an array)" 19:37
moritz lines.list[*-10..*-2] 19:39
HelpBot[perl6] hey-joe: but normally you'd not need .list; your perl6 is just too old and has a bug 19:39
hey-joe oh! thanks moritz! 19:40
HelpBot[perl6] wait huh.
hey-joe: what's the full code that caused the Seq error?
HelpBot[perl6] ah, nm, yeah it's a bug that existed in ¦«2017.01,2017.02,2017.03,2017.04.3»: and is now fixed :) 19:42
hey-joe version is 2017.04.3;MoarVM 2017.04-53-g66c6dda; perl6 -e 'say lines[*-10..*-2]' 19:43
HelpBot[perl6] Thanks. Yes, on newer perl6 you don't need .list
moritz $ $ seq 20 | perl6 -e 'say lines[*-10..*-2]' 19:46
(11 12 13 14 15 16 17 18 19) 19:47
HelpBot[perl6] TIL about seq :) 19:47
moritz :-) 19:48
perlpilot There used to be a program called "jot" that does what "seq" does. I wonder why they called it jot? 19:56
hobbs something to do with iota and counting? 19:57
geekosaur jot's the freebsd version
(and os x)
perlpilot weird ... I remember it from like 20 years ago and I'm fairly sure I wasn't using any FreeBSD systems. 19:58
hobbs yeah, a few languages use "iota" to produce a list of sequential integers
someone must have been feeling mildly punny when they decided to call it jot 19:59
geekosaur well, any 4.2BSD offshoot
hobbs Or non-english-speaky, perhaps
perlpilot oh, I see ... jot does so much more than seq www.freebsd.org/cgi/man.cgi?query=jot 20:00
geekosaur including commercial unixes that started out 4bsd-ish and switched over to system v would still have kept jot 20:01
hobbs that's moderately silly
perlpilot maybe HPUX had it? I seem to recall that it was a hybrid unix
geekosaur very likely, yes, they were one of the switchovers 20:11
El_Che stmuk: is there a difference between rakudo-star macos pkg and the one in homebrew? (they both are directly from your sources) 20:37
moritz m: say 'ẞ'.lc; say 'ẞ'.lc.uc 21:05
camelia ß
SS
moritz the capital letter sharp s was mostly unused in idiomatic German, but now it's being officially introduced: www.tagesschau.de/inland/eszett-103.html (warning, German only)
moritz luckily they don't seem to mandate it as a case folding target 21:08
moritz m: say 'ẞ' ~~ /:i ß/ 21:09
camelia 「ẞ」
moritz m: say 'SS' ~~ /:i ß/
camelia 「S」
literal_ What's the proper way to call a sub in a dynamically loaded (`require`-d) module? 21:22
HelpBot[perl6] Didn't you ask that already last night? 21:24
literal_ Yeah but the suggested answer doesn't seem to work
HelpBot[perl6] literal_: which one?
literal_ I've got to the point where it's loading correctly 21:25
HelpBot[perl6] m: my $name = 'Test'; require ::($name); ::('&\qq[$name]::EXPORT::DEFAULT::ok')(1)
camelia ok 1 -
HelpBot[perl6] seems to work here
That's requiring module 'Test' and uses its `ok` sub
literal_ What's going on with that &\qq? What is that doing? 21:27
I know about qq but what does &\ mean there
HelpBot[perl6] It's not &\, it's & and \qq escape sequence 21:28
m: my $name = 'Test'; require ::($name); ::('&' ~ $name ~ '::EXPORT::DEFAULT::ok')(1)
camelia ok 1 -
HelpBot[perl6] And \qq can be used in single-quoted string to drop into more liberal interpolation mode, like I used it to interpolate the $name var 21:29
literal_ Any reason just $name would not work?
HelpBot[perl6] m: my $name = 'Test'; require ::($name); ::("&$name::EXPORT::DEFAULT::ok")(1)
camelia Use of uninitialized value $v of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
No such symbol '&'
in block <unit> at <tmp> line 1
HelpBot[perl6] You get the error
Though I'm not 100% sure why; I would've expected it to require parens for `&` to not be parsed as just text 21:30
literal_ That's strange
HelpBot[perl6] m: my $name = 'Test'; say "&$name" 21:31
camelia &Test
HelpBot[perl6] m: my $name = 'Test'; say "&$name::F"
camelia Use of uninitialized value $v of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
&
HelpBot[perl6] Seems it's the `::` that mess it up
Ohhh
It's not the `&` that messes it up. It just thinks I meant $name::Foo::Bar variable :)
literal_ Aha 21:32
HelpBot[perl6] m: my $name = 'Test'; require ::($name); ::("&$name\::EXPORT::DEFAULT::ok")(1)
camelia ok 1 -
HelpBot[perl6] there we go
perlpilot could have also done ... 21:33
m: my $name = 'Test'; require ::($name); ::('&'~$name~'::EXPORT::DEFAULT::ok')(1)
camelia ok 1 -
literal_ Ah beautiful, I had forgotten to add the &
perlpilot oh, you said that earlier 21:34
HelpBot[perl6]++ :)
literal_ Thanks for being patient with my stupidity
With that settled I can get to the fun bits 21:35
Geth doc: d4b10c3436 | (Jan-Olof Hendig)++ | doc/Type/Array.pod6
Added docs for method 'dynamic'. jnthn++
22:04
Geth doc: 05cc5c4da5 | (Jan-Olof Hendig)++ | doc/Type/Hash.pod6
Added docs for method 'dynamic'. jnthn++
22:17
Geth doc: 2d8b7779f9 | (Jan-Olof Hendig)++ | doc/Type/Any.pod6
Fixed broken link. AlexDaniel++
22:20
doc: c2313e5ae7 | (Jan-Olof Hendig)++ | doc/Type/Hash.pod6
Fixed indentation
22:24
Geth doc: 00a904f6cc | (Zoffix Znet)++ | doc/Type/Array.pod6
Fix/Expand Array.append docs

  - Use more precise language about what and how .append flattens
22:34
doc: 5efc7f06f7 | (Zoffix Znet)++ | doc/Type/Array.pod6
Revert "Fix/Expand Array.append docs"

This reverts commit 00a904f6ccec2e4139450aeac0bdcc0f30b822ec.
It's a rogue commit. The disicion for change was abandoned.
22:35
travis-ci Doc build passed. Jan-Olof Hendig 'Added docs for method 'dynamic'. jnthn++' 22:42
travis-ci.org/perl6/doc/builds/248558574 github.com/perl6/doc/compare/c4cbc...b10c3436a3
Geth doc: 559b74f734 | (Zoffix Znet)++ | doc/Language/functions.pod6
Remove trailing whitespace
22:42
doc: 5c766b72d3 | (Zoffix Znet)++ | doc/Language/functions.pod6
Document %*SUB-MAIN-OPTS

Closes #1397 Rakudo impl: github.com/rakudo/rakudo/commit/40b0169d08 Spec: github.com/perl6/roast/commit/754a45c006
22:44
HelpBot[perl6] colomon: ^ you showed interest in this arg.
colomon woah, spiffy — that notification popped up while I was reading the commit (via e-mail rather than IRC) 22:45
travis-ci Doc build errored. Jan-Olof Hendig 'Added docs for method 'dynamic'. jnthn++' 23:08
travis-ci.org/perl6/doc/builds/248562772 github.com/perl6/doc/compare/d4b10...cc5c4da5c1
travis-ci Doc build passed. Zoffix Znet 'Fix/Expand Array.append docs 23:08
travis-ci.org/perl6/doc/builds/248568093 github.com/perl6/doc/compare/c2313...a904f6ccec
travis-ci Doc build errored. Jan-Olof Hendig 'Fixed broken link. AlexDaniel++' 23:11
travis-ci.org/perl6/doc/builds/248563794 github.com/perl6/doc/compare/05cc5...8b7779f92d
linuksz i get the following error, when i try to run 'alacryd install': 23:19
===SORRY!===
Attempt to read past end of string heap when reading string
is it a bug in alacryd or in rakudo or in moarvm?
geekosaur that sounds like a MoarVM-level "shouldn't happen" error 23:20
linuksz what should i do? 23:21
HelpBot[perl6] linuksz: what perl6 version are you using? perl6 -v 23:22
linuksz This is Rakudo version 2017.06 built on MoarVM version 2017.06
implementing Perl 6.c.
i am using Arch Linux
Geth Swapped META.info → META6.json in 1 dists in github.com/perl6/ecosystem/commit/bddb349fee 23:25
HelpBot[perl6] tries cloning it
No such method 'install' for invocant of type 'CompUnit::Repository::FileSystem' 23:26
in sub install at /tmp/tmp.ckO0uiV3sp/lib/Alacryd.pm (Alacryd) line 45
linuksz: what code are you executing?
linuksz how do you mean this? 23:28
HelpBot[perl6] linuksz: what are you running that causes the error?
linuksz 'alacryd install' from terminal
HelpBot[perl6] hm. Well, the repo checkout gives me "No such method 'install' for invocant of type 'CompUnit::Repository::FileSystem'" 23:30
HelpBot[perl6] I'm assuming you've used `pacaur -S alacryd 23:30
to install it? 23:31
buggable: eco Alacryd
buggable HelpBot[perl6], Nothing found
HelpBot[perl6] It also doesn't appear to be a published module.
linuksz: it looks to be just a broken module installer. `zef` is what all the cool kids use these days for that purpose 23:32
buggable: eco zef
buggable HelpBot[perl6], zef 'It's like [cpanm] wearing high heels with a tracksuit': github.com/ugexe/zef 2 other matching results: modules.perl6.org/#q=zef
HelpBot[perl6] huggable: zef
huggable HelpBot[perl6], To install Perl 6's zef package manager: cd $(mktemp -d) && git clone github.com/ugexe/zef . && perl6 -Ilib bin/zef install .
travis-ci Doc build errored. Zoffix Znet 'Revert "Fix/Expand Array.append docs" 23:32
travis-ci.org/perl6/doc/builds/248568321 github.com/perl6/doc/compare/00a90...fc7f06f70d
HelpBot[perl6] It only now occured to me what the "high heels with a tracksuit" in zef's description is about :) 23:33
linuksz so the mistake is in alacryd? 23:34
timotimo HelpBot[perl6]: can you explain it to me?
is it like "parts are elegant, parts are sloppy"?
HelpBot[perl6] linuksz: looks to be, yeah. Perhaps try contacting the author if you really want to use it?
timotimo: "Yolandi Visser of Die Antwoord is quoted as saying, "It's associated with people who "soop" their cars up and rock gold and shit. Zef is, you're poor but you're fancy. You're poor but you're sexy, you've got style." 23:35
timotimo: en.wikipedia.org/wiki/Zef
timotimo oh!
i *think* i've actually read that
and must have forgotten
tbrowder i just updated my perl 6 r/w tests for the rakudo version right after jnthn updated rakudo and nqp with his IO improvements; see github.com/tbrowder/perl6-read-write-tests 23:36
linuksz annoying, because alacryd is used for many AUR packages. i will contact the author.
HelpBot[perl6] weird. never heard of it 23:39
tbrowder: can't figure out what are the actual tests. Like what code is being benched? 23:40
geekosaur arch strikes again (they broke ghc 8.0.2 recently too)
tbrowder you have to look at the code, but basically it's a test of P5 and P6 running a series of read tests of ASCII text files of 100-character lines from 10 thousand lines to 100 million lines. I'll improve the README, thanks for comment. 23:45
HelpBot[perl6] tbrowder: doesn't look like a good comparison to me. From what I can see you have utf8 encoding off in perl 5. In Perl 6 you're also using .split instead of using .lines on the handle. And lastly, your timings also include all the test script option parsing where you're using a whole bunch of regex AND I assume startup cost is also factored? 23:46
HelpBot[perl6] tbrowder: a few days ago, jnthn++ was benching reading N lines in Perl 6 vs Perl 5. The difference was like 1.24x, which is way off the 17x-20x mark your results are showing (I think jnthn++ was testing with 1-million line file) 23:49
HelpBot[perl6] leaves to kill criminals in Far Cry 4 23:50
tbrowder early on i compared ascii-only vs utf8 for p6 and there was no sig difference so the test hasn't changed; so,as you say, i do need to compare utf8 to utf8 p5 to p6, will change, thnx for looking 23:53
HelpBot[perl6] tbrowder: .split on IO::Handle slurps the entire file into memory. I would bet you'll see an improvement if you switch it to .lines 23:55
tbrowder also, early on we looked at various p6 thngs like split vs. lines vs. slurp and lines and saw no sig difference.
but i'll use what you suggest...stay tuned 23:56
travis-ci Doc build errored. Zoffix Znet 'Remove trailing whitespace' 23:58
travis-ci.org/perl6/doc/builds/248570510 github.com/perl6/doc/compare/5efc7...9b74f73464
travis-ci Doc build errored. Zoffix Znet 'Document %*SUB-MAIN-OPTS 23:58
travis-ci.org/perl6/doc/builds/248570769 github.com/perl6/doc/compare/559b7...766b72d302