»ö« 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. |
|||
SmokeMachine | m: my $x = 3; my @a = $x xx 3; my $b = $x xx 3; $x = 5; say @a; say $b | 00:00 | |
camelia | [3 3 3] (5 5 5) |
||
thundergnat | IOninja: Yep, that's what I ended up with. | ||
00:00
Cabanossi joined
|
|||
IOninja | m: say ($y xx 10).^name | 00:00 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$y' is not declared at <tmp>:1 ------> 3say (7⏏5$y xx 10).^name |
||
IOninja | m: say ('x' xx 10).^name | ||
camelia | List | ||
naxieAlDle | ahhh… this is what bothers me | ||
IOninja | c: 2015.10 say ('x' xx 10).^name | ||
committable6 | IOninja, ¦2015.10: «List» | ||
naxieAlDle | c: d192f1c29a^,d192f1c29a my $y = <y>; my @y; @y[0] = $y xx 10; say @y; @y[0][4] = <o>; say @y; | ||
committable6 | naxieAlDle, ¦d192f1c29a^: «[(y y y y y y y y y y)]Cannot assign to a readonly variable or a value in block <unit> at /tmp/U4RgS3eglu:1 «exit code = 1»» ¦d192f1c: «[(y y y y y y y y y y)][(o o o o o o o o o o)]» | ||
naxieAlDle | github.com/rakudo/rakudo/commit/d1...be4ad5771c | ||
“Make xx quite a bit faster” | 00:01 | ||
thundergnat | But It surprised me at first and I needed to ponder what was going on | ||
IOninja | naxieAlDle: what bothers you? That you got faster xx? | ||
naxieAlDle | IOninja: that we got this behavior unintentionally | ||
IOninja | That's not the part you quoted. | 00:02 | |
A developer can't think of all the edge cases something may affect. We have tests for that job and in this case they didn't catch the issue. | |||
naxieAlDle | I'm just pointing out that this was unintentional | 00:03 | |
IOninja | Saying "'Make xx quite a bit faster'....this bothers me" will just make that developer contribute elsewhere I think... | ||
naxieAlDle | that's not what I meant, sorry | ||
IOninja | m: my $x = 42; my $a = $x, $x, $x; say $a; $x = 72; say $a | ||
camelia | 42 42 |
||
IOninja | m: my $x = 42; my $a = ($x, $x, $x); say $a; $x = 72; say $a | 00:04 | |
camelia | (42 42 42) (72 72 72) |
||
IOninja | star: my $x = 42; my $a = ($x, $x, $x); say $a; $x = 72; say $a | ||
camelia | (42 42 42) (72 72 72) |
||
00:04
k-man left
|
|||
naxieAlDle | c: d192f1c29a^,d192f1c29a my $y = 25; say ($y xx 10).WHAT | 00:04 | |
committable6 | naxieAlDle, ¦d192f1c29a^: «(Seq)» ¦d192f1c: «(List)» | ||
naxieAlDle | ah-ha | ||
but still… | |||
IOninja | The Seq probably still had that problem, hidden behind reification | 00:05 | |
00:05
k-man joined
|
|||
IOninja | c: d192f1c29a^,d192f1c29a my $y = 25; my @a = ($y xx 10).cache; say @a; say @a | 00:05 | |
committable6 | IOninja, ¦d192f1c29a^,d192f1c: «[25 25 25 25 25 25 25 25 25 25][25 25 25 25 25 25 25 25 25 25]» | ||
00:06
risou_awy is now known as risou,
nadim left
|
|||
IOninja | risou: your incessant nick-change away feature is kinda spammy. It's common courtesy not to have that enabled. | 00:07 | |
00:08
kanishka left
|
|||
thundergnat | The only reason I brought it up is that there were some changes to make xx thunk the left hand side at one point to make things like rand xx 4 work like most people expect. | 00:09 | |
I rashly thought that it would "thunk" containers too... To the extent that I thought at all. | 00:10 | ||
IOninja | Yeah, that's been that way for a while. | ||
m: sub x { $ = rand }; my @a = x() xx 2; say @a; say @a | |||
camelia | [0.185815223569128 0.452429042720225] [0.185815223569128 0.452429042720225] |
||
IOninja | m: sub x { $/ = rand }; my @a = x() xx 2; say @a; say @a | 00:11 | |
camelia | [0.514069592865973 0.394482647460151] [0.514069592865973 0.394482647460151] |
||
IOninja | m: my @a = ($/ = rand) xx 2; say @a; say @a | ||
camelia | [0.124562822271418 0.124562822271418] [0.124562822271418 0.124562822271418] |
||
thundergnat | Anyway, not a big deal. Mostly just mumbling about my own misunderstanding. | ||
IOninja | thundergnat: it *is* pretty surprising. | 00:12 | |
00:12
dct left
|
|||
thundergnat | Something else I was wondering. I there any way in Perl 6 to open STDIN non blocking? | 00:13 | |
*Is | |||
IOninja | ATM only a hackish way | 00:14 | |
thundergnat | Is that something that is just NYI? Or something that should be in module space? | ||
IOninja | Something like keep retrying to use it (e.g. if you're using prompt()) until it stops throwing, so it ends up using the thread that opened it | 00:15 | |
thundergnat: NYI. It's something to do with with libuv being paranoid about who's reading stuff. | |||
thundergnat | Ah. | ||
IOninja | m: my @a = ($,) xx 10; @a[0][0] = 42; say @a | 00:17 | |
camelia | [(42) (42) (42) (42) (42) (42) (42) (42) (42) (42)] | ||
IOninja | heh | ||
thundergnat | I've used Term::termios to do immediate reads of key-presses (no need to hit enter) but it still blocks if there isn't a character ready and I couldn't find any obvious way to O_NONBLOCK $*IN. | 00:18 | |
IOninja | Oh, THAT's what you mean./.. | ||
I thought you meant via threads. | 00:19 | ||
00:19
BenGoldberg joined
|
|||
IOninja | like, do `start prompt "blah"`; cause that fails ATM | 00:19 | |
Well... the obvious way to do what you want is to read via a channel and poll the channel, but that uses threads, so you're hit with the issue I originally mentioned :( | 00:20 | ||
00:23
risou is now known as risou_awy
|
|||
IOninja | thundergnat: tried .readchars? | 00:23 | |
The docs say "up to.." so maybe it doesn't block... | |||
.readchars(1) | |||
m: $*IN.slurp.chars.say | |||
camelia | No such method 'slurp' for invocant of type 'IO::Handle' in block <unit> at <tmp> line 1 |
||
thundergnat | Hmm. I don't remember trying that. | 00:24 | |
IOninja | m: $*IN.readchars(1000000000000000000000000000); say "hi" | ||
camelia | Cannot unbox 90 bit wide bigint into native integer in block <unit> at <tmp> line 1 |
||
IOninja | m: $*IN.readchars(100000000000000000); say "hi" | ||
camelia | hi | ||
IOninja | Seems to do the trick in the bot... | ||
thundergnat | That looks like it might work. | 00:25 | |
\o/ | |||
IOninja | \o/ | ||
00:28
Cabanossi left
|
|||
IOninja | c: d192f1c29a^,d192f1c29a my $y = 25; my @a; @a[0] = $y xx 10; say @a; $y = '♥'; say @a; say @a | 00:28 | |
committable6 | IOninja, ¦d192f1c29a^: «[(25 25 25 25 25 25 25 25 25 25)][(25 25 25 25 25 25 25 25 25 25)][(25 25 25 25 25 25 25 25 25 25)]» ¦d192f1c: «[(25 25 25 25 25 25 25 25 25 25)][(♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥)][(♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥)]» | ||
00:30
Cabanossi joined
00:31
dogbert17_ left
|
|||
IOninja | thundergnat: filed your container thing: rt.perl.org/Ticket/Display.html?id...xn-1452835 | 00:34 | |
IMO there's no DWIM in that case... just a WAT | |||
naxieAlDle | IOninja++ | 00:37 | |
thundergnat | I vaguely remember Timtoady doing some special casing during the GLR where assigning a list to an array would decontainerize since that is what most people would expect. | 00:40 | |
The problem is that for multi dim arrays, there is no way to be able to tell if the nth level wants to be an item or array, so you need to explicitly assign it. | 00:41 | ||
(as an array if you want it to be one.) | |||
IOninja | m: my $y = 25; my @a[1;10]; @a = $y xx 10,; say @a; $y = '♥'; say @a | 00:44 | |
camelia | [[25 25 25 25 25 25 25 25 25 25]] [[25 25 25 25 25 25 25 25 25 25]] |
||
IOninja | probably can be fixed with a new nqp::decont() | 00:46 | |
IOninja is too tired to do it right now... | 00:47 | ||
00:51
ZzZombo_ joined,
ZzZombo left,
ZzZombo_ left,
ZzZombo_ joined,
ZzZombo_ is now known as ZzZombo
00:55
khw left
00:58
khw joined
01:01
cdg left
01:02
mscha left
01:07
lukaramu_ left
01:08
ZzZombo left
01:09
ZzZombo joined,
ZzZombo left,
ZzZombo joined
01:12
cibs left
01:14
cibs joined
01:15
skids joined
01:19
zakharyas left,
zakharyas joined
01:20
zakharyas left
01:25
k-man left
01:26
k-man joined
01:28
agentzh left
01:34
riatre joined
01:38
risou_awy is now known as risou
01:39
killbill joined
01:41
labster left
01:43
thundergnat left
01:44
ZzZombo left
01:45
ZzZombo joined
01:46
ZzZombo left,
ZzZombo joined
01:52
raschipi joined
01:55
killbill left,
raschipi left
01:57
itaipu joined
01:58
Cabanossi left
|
|||
samcv | I have my grant about ready to submit. if somebody could read through and proofread it for me that would be great gist.github.com/samcv/121351d79e4b...fa3a7980b3 | 01:58 | |
02:00
Cabanossi joined
|
|||
naxieAlDle | .oO( ≈½ instead of ~1/2 :) ) |
02:00 | |
02:08
travis-ci joined
|
|||
travis-ci | Doc build errored. Tom Browder 'declare $string so xt test passes' | 02:08 | |
travis-ci.org/perl6/doc/builds/208405299 github.com/perl6/doc/compare/2321b...0eb45b6c1b | |||
02:08
travis-ci left
|
|||
samcv | eww github's pod renderer renders it as At the current time ~½ | 02:11 | |
tfw perl 5 unicode | |||
02:12
setty1 left,
setty1 joined,
mcmillhj joined
|
|||
samcv | just gonna use the word `half` instead | 02:12 | |
naxieAlDle | haha | 02:14 | |
02:20
mcmillhj left
|
|||
astj | Hi. with recent rakudo's change, requiring different modules under same namespace like `require Foo; require Foo::Bar;` seems broken? | 02:24 | |
It say "Lexical 'Foo' already declared". github.com/astj/p6-Require-Bug-Demo | |||
02:26
itaipu left
02:29
labster joined
02:33
itaipu joined
02:40
yqt left
02:44
Cabanossi left
02:45
ilbot3 left,
Cabanossi joined
02:47
ilbot3 joined,
ChanServ sets mode: +v ilbot3,
itaipu left
02:53
raschipi joined
02:55
raschipi left
03:00
xtreak joined,
spebern` left
03:02
ZzZombo_ joined
03:04
ZzZombo left
03:12
cdg joined
03:14
noganex joined
03:16
dataf3l joined
03:17
noganex_ left
03:19
dataf3l left
03:21
dataf3l joined
03:28
Cabanossi left
03:30
Cabanossi joined
03:36
cdg left,
cdg_ joined
03:37
cdg_ left
03:39
agentzh joined,
mcmillhj joined,
cdg joined,
dataf3l left
03:40
cdg left
03:41
cdg joined
03:43
mcmillhj left
03:45
mcmillhj joined
03:50
mcmillhj left
03:51
cdg left,
cdg joined
03:59
mcmillhj joined
04:03
mcmillhj left
04:04
wamba joined
04:11
mcmillhj joined
04:12
skids left
04:17
mcmillhj left
04:21
kanishka joined
04:24
mcmillhj joined
04:28
Cabanossi left
04:29
BenGoldberg left
04:30
Cabanossi joined
04:32
xtreak left
04:36
xtreak joined
04:45
cdg left
04:53
mcmillhj left
04:55
Cabanossi left
04:58
Cabanossi joined
04:59
naxieAlDle left
05:01
mcmillhj joined
05:05
mcmillhj left
05:22
mcmillhj joined
05:25
khw left
05:26
pullphinger joined
05:27
mcmillhj left
05:42
cibs left
05:44
cibs joined,
mcmillhj joined
05:48
mcmillhj left
05:55
Cabanossi left,
mcmillhj joined
05:57
Cabanossi joined
05:59
CIAvash joined
06:00
mcmillhj left
06:03
xtreak left
06:25
mtj_ left
06:27
xtreak joined
06:28
mtj_ joined
06:29
mtj_ left
06:30
mtj_ joined
06:37
wamba left
06:41
Cabanossi left
06:42
Cabanossi joined
06:50
RabidGravy joined
06:56
bjz joined
07:03
jonas1 joined
07:06
domidumont joined
07:07
rindolf joined
|
|||
samcv | kk submitted the proposal \o/ | 07:09 | |
07:10
[ptc] joined,
domidumont left
07:11
domidumont joined,
wamba joined
|
|||
RabidGravy | Boom! | 07:22 | |
07:28
alphah left
07:29
alphah joined
07:34
cibs left
07:36
cibs joined
|
|||
El_Che | lizmat: Do you have the paper book of "Perl: The Complete Reference. Second Edition", Osborne, 2001? If not (not likely), I found one here at work. | 07:40 | |
lizmat: this is the cover: claudio.ulyssis.be/var/tmp/cover_ptcr2nd.pdf | 07:43 | ||
07:56
dct joined,
darthdeus_ left
07:57
mcmillhj joined
07:59
darthdeus_ joined
08:03
dct left
08:10
mcmillhj left
08:12
bjz left
08:15
bjz joined
08:18
xinming_ joined
08:19
mcmillhj joined
|
|||
samcv | SourceBaby, help | 08:19 | |
SourceBaby | samcv, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See modules.perl6.org/dist/CoreHackers::Sourcery | ||
samcv | Scalar | 08:20 | |
SourceBaby, Scalar | |||
08:20
nadim joined
|
|||
lizmat | El_Che: looks familiar... but not easy to check for me at the moment, as the library is currently residing in our other house :-) | 08:20 | |
08:21
xinming left
08:24
mcmillhj left
08:25
mcmillhj joined
08:30
mcmillhj left
08:32
dakkar joined
08:38
wamba left
08:41
Cabanossi left
08:43
Cabanossi joined
08:54
mcmillhj joined,
parv joined
|
|||
El_Che | lizmat: there is no urgency what so ever. I'll set it aside. I have seen that on your shelf, but it may have been the 1ste edition. Hence the question. | 08:55 | |
lizmat | oki, thanks for thinking about it :-) | ||
08:55
darutoko joined
|
|||
samcv | s: Scalar | 08:56 | |
SourceBaby | samcv, Something's wrong: ERR: Cannot resolve caller sourcery(Scalar); 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 | ||
lizmat clickbaits p6weekly.wordpress.com/2017/03/06/...elative-≥/ | 08:59 | ||
09:00
girafe left
09:01
mcmillhj left
|
|||
samcv | lizmat, how do you feel about nested if else's github.com/rakudo/rakudo/blob/nom/...7441-L7450 | 09:01 | |
personally they are super distracting to me, would it be okay to change them all to be standard convention? or no | 09:02 | ||
lizmat | they're not my favourite, but I can live with them :-) | ||
*if* you change them, make sure it is only cosmetics that you change and note that in the commit message | |||
samcv | kk | 09:03 | |
lizmat | jnthn prefers fewer lines of code over more lines of code, so he can see better what is going on | ||
09:04
smls joined
|
|||
samcv | does he like nested? | 09:04 | |
09:05
xtreak left
|
|||
lizmat | he likes fewer lines of code | 09:06 | |
samcv | i dislike them because it distracts me when I'm scanning a file visually, eyes linger on that line which doesn't have that much content. kk | ||
lizmat | I dislike them when I'm editing and moving blocks of code around | 09:07 | |
but other than that I don't care too much | 09:08 | ||
El_Che: woolfy just confirms to me that we have the book already | |||
smls | Is is possible for a unit-test script to replace an imported function as seen by the module it's testing? | 09:10 | |
My situation is like this: | |||
1) Module A exports a subroutine which connects to the Internet and returns something. | |||
2) Module B `use`s module A, and calls this function. | |||
3) When unit-testing module B, I'd like it to use a mock version of this function, that doesn't connect to the Internet (and instead is controlled by the test file). | |||
lizmat | smls: maybe wrap the sub exported by A, and not calling the original code ? | 09:13 | |
smls | How can the test file control what it returns? | 09:14 | |
lizmat | m: module A { our sub foo() is export { "foo" } }; import A; &A::foo.wrap(-> { "bar" }); say A::foo; say foo # seems that wrapping doesn't change the imported | 09:18 | |
camelia | bar foo |
||
lizmat | m: module A { our sub foo() is export { "foo" } }; import A; BEGIN &A::foo.wrap(-> { "bar" }); say A::foo; say foo | 09:19 | |
camelia | bar bar |
||
lizmat | ah, needs to be wrapped at compile time | ||
smls: that could work, no ? | 09:20 | ||
smls | The .wrap would have to happen inside module B though, right? | 09:21 | |
How can the test file control what it is wrapped with? | |||
lizmat | smls: don't think so: the wrap in my code didn't happen in the scope of A either | ||
you need to have the subroutine be "our" though | 09:22 | ||
smls | lizmat: It happened in the scope that `use` A, which would be module B in my scenario | ||
09:22
TEttinger left
09:23
Xliff_ joined
09:24
pullphinger left
09:25
aindilis left
09:26
Xliff left
09:30
itaipu joined
|
|||
smls | m: module A { our sub foo() is export { "foo" } }; module B { import A; our sub call-foo() { foo } }; use Test; import B; &B::foo.wrap(-> { "bar" }); is B::call-foo, "bar"; | 09:31 | |
camelia | No such method 'wrap' for invocant of type 'Any' in block <unit> at <tmp> line 1 |
||
09:31
pullphinger joined
09:32
mxco86 left
|
|||
smls | ^^ this is more like the situation at hand | 09:32 | |
lizmat | m: module A { our sub foo() is export { "foo" } }; module B { import A; our sub call-foo() { foo } }; use Test; import B; BEGIN &B::foo.wrap(-> { "bar" }); is B::call-foo, "bar"; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> An exception occurred while evaluating a BEGIN at <tmp>:1 Exception details: No such method 'wrap' for invocant of type 'Any' in code at <tmp> line 1 |
||
smls | B::call-foo is what I want to unit test | 09:33 | |
lizmat | smls: must be afk for a few hours, will check when back | ||
smls | ok | ||
09:36
xtreak joined
|
|||
smls | In Perl 5, symbol table mangling (or Sub::Override or Test::MockModule) should do the trick. | 09:46 | |
But in Perl 6, lexical scopes can't be modified once compiled (correct me if I'm wrong), so that approach doesn't work... | |||
09:59
nadim left,
nadim joined
10:02
mcmillhj joined
10:03
labster left
10:08
mcmillhj left
10:09
mcmillhj joined
10:13
cibs left
10:14
cibs joined
10:17
itaipu left
10:18
mcmillhj left
10:21
mcmillhj joined
10:28
mcmillhj left
|
|||
smls | let's take this to SO: stackoverflow.com/questions/4264580...g-a-module | 10:29 | |
10:35
rindolf left
10:36
andrzejku joined
10:38
itaipu joined
|
|||
samcv | smls, let me know if you find the answer | 10:39 | |
10:40
Cabanossi left
|
|||
El_Che | smls: is inhereting from that class and overwritting the method and option? That's something I often do | 10:41 | |
s/overwriting/overriding/g | 10:42 | ||
10:43
Cabanossi joined
|
|||
smls | El_Che: There are no classes here, only modules that export subroutines. | 10:45 | |
But yeah, refactoring it to be more "OO" would be a last-resort solution, though it seems LTA that this should be neseccary in order to make unit tests possible. | |||
jnthn | I'd probably provide a way for the module to be configured with an alternative | 10:46 | |
Even if that's just an optional export of a set-internet-fetching-thingy(&foo) | |||
El_Che | smls: I see. | ||
jnthn | Or just make it an optional argument to the subroutine under test, and have it pick the one from the module as the default | 10:47 | |
El_Che | smls: I guess "everything is a package" in perl5 is a nice thing :) | ||
jnthn | That way the code becomes more extensible as well as more testable | ||
El_Che | jnthn: test code in the regular sub? Not very nice | ||
jnthn | I'm sure there's ways to do clever stuff with CompUnit repos, by sticking something at the head of the chain that will intercept and mess with imported symbols | ||
El_Che: That ain't what I said | |||
El_Che rereads | 10:48 | ||
jnthn | use BlahWithBar; sub do-some-thing($foo) { ... bar() ... } | 10:49 | |
Could instead me | |||
*be | |||
use BlahWithBar; sub do-some-thing($foo, :&bar-strategy = &bar) { ... bar-strategy() ... } | |||
With appropriate naming | |||
That way not only do you get a way to test it, but you get a way for people so supply an alternative implementation to the default chosen, if they should need to | 10:50 | ||
10:50
ZzZombo joined,
ZzZombo left,
ZzZombo joined
|
|||
smls | jnthn: Hm, that's actually not a bad idea in the case I'm working on. | 10:51 | |
Still, sometimes that's not something one wants. | 10:52 | ||
10:52
ZzZombo_ left
|
|||
jnthn | Sometimes, in which case I suspect some clever module that lets you fake up imports at a distance would be needed | 10:53 | |
smls | Is there a module wishlist somewhere, so I can add "Test::MockImport based on CompUnit magic" ? :P | ||
jnthn | I think so | ||
perl6-most-wanted or whatever it's called | |||
If you were doing OO stuff I'd point at Test::Mock :) | |||
I think import mocking wants to be a separate module, though | 10:54 | ||
smls | jnthn: What the &bar weren't imported but defined in the same module as &do-some-thing, would there be any way to override that when loading the module from the test script? | 10:56 | |
*What if | 10:57 | ||
10:59
itaipu left
|
|||
smls | I.e. disable pre-compilation, and do something to the module while it is compiled & loaded by the use statement. | 10:59 | |
jnthn | smls: Possibly; I'm not immediately sure how I'd arrange that, though an evil way would be to slurp in the source and append a CHECK block before compiling it that does .wrap on the sub in question, and never defers to the original but instead calls the thing we want to test | 11:02 | |
Uh, thing we want to mock it with, I meant | |||
smls | That doesn't sound much more evil than the Perl 5 solutions (glob assignment etc.)... :) | 11:04 | |
11:05
xtreak left
11:08
xtreak joined
11:09
bjz_ joined
11:10
bjz left
11:14
araraloren joined
|
|||
IOninja | Is Bart Weigmans here? | 11:17 | |
11:19
mscha joined
|
|||
mscha | m: say eⁱ | 11:19 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: eⁱ used at line 1 |
||
mscha | m: say e**i | ||
camelia | 0.54030230586814+0.841470984807897i | ||
IOninja | ⁱ is not a power operator | 11:20 | |
mscha | I know. :-) | ||
Too bad there's not a superscript π in Unicode. I want an all-Unicode version of ... | 11:21 | ||
m: e**(π×i) + 1 ≅ 0 | |||
camelia | ( no output ) | ||
mscha | m: say e**(π×i) + 1 ≅ 0 | ||
camelia | True | ||
araraloren | write a module for it | 11:22 | |
mscha | m: sub postfix:<ⁱ>(Numeric $x) { $x**i }; say eⁱ; | 11:24 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: eⁱ used at line 1 |
||
mscha | m: sub postfix:<ⁱ>(Numeric $x) { $x**i }; say 2.71828182845905ⁱ; | ||
camelia | 0.540302305868138+0.841470984807898i | ||
IOninja | ha-ha | ||
jnthn | IOninja: He's brrt and on #moarvm | 11:25 | |
Geth | perl6-most-wanted: d6062de102 | smls++ | most-wanted/modules.md Add module ideas to help with mocking non-OO code in unit tests |
11:27 | |
doc: d5bff8fabe | (Zoffix Znet)++ | README.md Trigger rebuild To see if there are Pod parsing issues with latest Rakudo |
11:29 | ||
mscha | m: sub postfix:<ⁱ>(Numeric $x) { $x**i }; say (e)ⁱ; | 11:32 | |
camelia | 0.54030230586814+0.841470984807897i | ||
11:33
xtreak left
|
|||
mscha | m: say ³⁄₄₇; | 11:33 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Bogus postfix at <tmp>:1 ------> 3say ³7⏏5⁄₄₇; expecting any of: infix infix stopper postfix statement end statement modifier … |
||
11:36
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:39
Actualeyes left
|
|||
tbrowder | mscha: ref unicode super- and subscripts, do you know if there is a set of font data ( as in Font::AFM) for the unicode font you use (font matrics is the term for that data)? | 11:40 | |
11:40
mcmillhj joined
|
|||
mscha | tbrowder: no, sorry, I don't know much about fonts, just using the default browser font. | 11:43 | |
11:43
wamba joined
11:44
Actualeyes joined
11:45
mcmillhj left
|
|||
tbrowder | never mind, i'm thinking of printed matter, not on-line browser stuff | 11:45 | |
although the bright folks here could create the css and wrapper stuff to present the sub- and superscripts | 11:46 | ||
IOninja | That already comes with browsers in the form of <sup> and <sub> elements | 11:49 | |
11:51
lukaramu joined
11:58
mcmillhj joined,
Actualeyes left
12:00
parv left,
Actualeyes joined
12:02
bjz joined
12:03
bjz_ left
12:04
ZzZombo left,
smls left
12:05
raschipi joined
12:06
mcmillhj left
12:08
mcmillhj joined
12:11
Cabanossi left
12:13
Cabanossi joined
12:17
mcmillhj left
12:20
mcmillhj joined
12:22
GK___1wm____SU joined,
GK___1wm____SU left
12:24
travis-ci joined
|
|||
travis-ci | Doc build passed. Zoffix Znet 'Trigger rebuild | 12:24 | |
travis-ci.org/perl6/doc/builds/208553583 github.com/perl6/doc/compare/4c0eb...bff8fabe70 | |||
12:24
travis-ci left
12:25
lep_ joined,
lep-delete left
12:26
ZzZombo joined,
ZzZombo left,
ZzZombo joined
12:28
mcmillhj left
12:34
aborazmeh left
12:37
wamba left
12:40
Cabanossi left
12:42
mr-foobar left
12:43
Cabanossi joined
12:44
pullphinger left,
sena_kun joined
12:45
mcmillhj joined
12:53
mcmillhj left,
wamba joined
12:57
mr-foobar joined
13:00
Sound joined
13:01
mcmillhj joined
13:06
mcmillhj left
|
|||
[Coke] | (yay, doc xtest clean) | 13:19 | |
13:26
rindolf joined,
cdg joined
13:27
cdg left
13:28
cdg joined
13:32
wamba left
13:33
lukaramu_ joined
|
|||
[Coke] | IOninja: (d5bff8fabe) there is a file -specifically- in the repo for those shenanigans | 13:35 | |
IOninja | Which one is it? | 13:37 | |
[Coke] | util/trigger-rebuild.txt | ||
13:37
lukaramu left,
kurahaupo__ joined
|
|||
[Coke] | because samcv was adding trailing whitespace to things and causing 'make xtest' to fail. | 13:37 | |
IOninja | Well, I didn't add any whitespace | 13:38 | |
Don't know why there's a special file for this at all TBH | |||
Geth | doc: 272259097d | (Will "Coke" Coleda)++ | doc/Type/Str.pod6 remove trailing whitespace |
||
[Coke] | because we shouldn't be making irrelevant changes to trigger rebuilds. | ||
making random changes for that sort of thing gums up blame, history, sometimes tests... | 13:39 | ||
13:40
Chinese_soup joined,
Cabanossi left
|
|||
[Coke] | for her, we depend on a specific version of a 3rd party lib; we should actual depend on it and declare the dependency, and have that trigger the rebuild; yours could have been a dep on a specific version of rakudo | 13:40 | |
she created the file as a compromise, so at least all the commits of that type would be in one place. | 13:41 | ||
13:42
Cabanossi joined
|
|||
[Coke] | (I realize this lies more towards "theoretically" than "practically") | 13:45 | |
13:48
bjz left
13:50
bjz joined,
mcmillhj joined
13:54
lizmat left,
kurahaupo__ is now known as kurahaupo
14:04
mr-foobar left
14:08
mr-foobar joined
14:12
risou is now known as risou_awy
14:16
yqt joined
14:22
Sound left
14:23
lizmat joined,
cdg_ joined
14:25
cdg left
14:29
bjz left
14:39
smls joined
|
|||
smls | m: my %hash = a => {b => 42}; dd %hash{"a"}{"b"}; | 14:39 | |
camelia | Int % = 42 | ||
smls | m: my %hash = a => {b => 42}; dd %hash{"a";"b"}; | ||
camelia | (42,) | ||
smls | ^^ Why does a multi-dimensional Hash index return a List, even if a single leaf node was selected? | 14:40 | |
m: my @array = 0, [0, 42]; dd @array[1;1] | 14:41 | ||
camelia | Int <element> = 42 | ||
smls | ^^ In case of Arrays, this doesn't happen. | ||
lizmat | smls: feels rakudobuggable | 14:42 | |
smls | will do | ||
14:42
raschipi left
14:50
ZzZombo left
14:53
naxieAlDle joined
14:54
ZzZombo joined,
ZzZombo left,
ZzZombo joined
14:56
skids joined
|
|||
[Coke] | which way is the bug? (slices should always return lists, no?) | 14:58 | |
m: my @array = 0, [0, 42]; dd @array[1;1][0]; | 14:59 | ||
camelia | 42 | ||
[Coke] | Or, I suppose, it doesn't matter, because you can treat an element like a list. | ||
naxieAlDle | mscha: you can mention your unicode ideas here: gist.github.com/AlexDaniel/c89bd2786f9b63f31e4c | 15:00 | |
but that's just a list of all ideas, not a list of something we actually want to add to Perl 6… | 15:01 | ||
IOninja | Not always. @parameters and @.attributes will reject it | 15:03 | |
m: sub (@){}( (@)[1;1] ) | 15:04 | ||
camelia | Type check failed in binding to '<anon>'; expected Positional but got Any (Any) in sub at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
IOninja | m: class { has @.x }.new: x => (@)[1;1] | 15:05 | |
camelia | ( no output ) | ||
IOninja | Just params I guess | ||
m: class { has @.x; method foo { dd @.x } }.new(x => (@)[1;1]).foo | 15:06 | ||
camelia | Array @!x = [Any] | ||
IOninja | m: class { has @.x; submethod BUILD (:@!x) {} }.new: x => (@)[1;1] | ||
camelia | Type check failed in binding to '@!x'; expected Positional but got Any (Any) in submethod BUILD at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
15:08
poska joined
|
|||
poska | hey guys | 15:08 | |
how do you use variables inside rule definitions in a grammar? | 15:09 | ||
e.g. rule foo { \d+ {$!my-special-variable} } | 15:10 | ||
this doesn't seem to work | |||
15:10
Cabanossi left
|
|||
smls | [Coke]: .[1; 2] is not a slice, it indexes a singular element. No reasoin to expect .{"a"; "b"} to be different. | 15:10 | |
[Coke]: .[1, 2] would be a slice, as would .[1; 2,] - i.e. when the subscript for at least one dimension is an Iterable. | 15:11 | ||
IOninja | poska: what are you trying to accomplish? | 15:13 | |
15:13
Cabanossi joined
|
|||
IOninja | private attributes won't work, since ever rule is a separate instance of Cursor or something like that | 15:13 | |
poska | i have a rule which must repeat a fixed amount of times | ||
and with each parse call, this amount differs | 15:14 | ||
IOninja | OK | ||
Well, you can use dynamic variables to pass that information | |||
poska | could you share a working snippet of this? | ||
IOninja | m: my $*FOO = 3; say grammar { token TOP { $<foo>=.**{$*FOO} .+ } }.parse: 'abcdefghij' | 15:15 | |
camelia | 「abcdefghij」 foo => 「abc」 |
||
IOninja | m: my $*FOO = 10; say grammar { token TOP { $<foo>=.**{$*FOO} .+ } }.parse: 'abcdefghij' | ||
camelia | Nil | ||
IOninja | m: my $*FOO = 10; say grammar { token TOP { $<foo>=.**{$*FOO} .+ } }.parse: 'abcdefghijddassdadas' | ||
camelia | 「abcdefghijddassdadas」 foo => 「abcdefghij」 |
||
poska | nice! thank you | 15:16 | |
IOninja | m: say grammar { token TOP { $<n>=\d+ {my $*FOO = +$<n>} <bar> .+ }; token bar { .**{$*FOO} } }.parse: '3abcdefg' | ||
camelia | Dynamic variable $*FOO not found in regex bar at <tmp> line 1 in regex TOP at <tmp> line 1 in block <unit> at <tmp> line 1 Actually thrown at: in regex bar at <tmp> line 1 in regex TOP at <tmp> line 1 in block <unit> at <tmp>… |
||
IOninja | m: say grammar { token TOP { $<n>=\d+ :my $*FOO = +$<n>; <bar> .+ }; token bar { .**{$*FOO} } }.parse: '3abcdefg' | ||
camelia | Use of Nil in numeric context in regex TOP at <tmp> line 1 「3abcdefg」 n => 「3」 bar => 「」 |
||
IOninja | m: say grammar { token TOP { $<n>=\d+ {} :my $*FOO = +$<n>; <bar> .+ }; token bar { .**{$*FOO} } }.parse: '3abcdefg' | ||
camelia | 「3abcdefg」 n => 「3」 bar => 「abc」 |
||
IOninja | m: say grammar { token TOP { $<n>=\d+ {} :my $*FOO = +$<n>; <bar> .+ }; token bar { .**{$*FOO} } }.parse: '5abcdefg' | ||
camelia | 「5abcdefg」 n => 「5」 bar => 「abcde」 |
||
IOninja | It's also available in Actions | 15:17 | |
naxieAlDle | m: my $x = ‘hello’; say ‘hello’ ~~ /<{$x}>/ | ||
camelia | 「hello」 | ||
IOninja | (and the empty block {} is there to update the $/ variable so that $<n> capture would be in it) | ||
smls | poska: You could maybe also pass it down as a parameter: rule n-times ($n) { . ** {$n} }; | ||
Call it like <n-times(5)> | 15:18 | ||
poska | i didn't know you can pass parameters to rules | ||
naxieAlDle | there are some limitations to this, if I recall correctly | ||
namely you cannot have parameterized protos or something | |||
poska | are dynamic variables accessed globally? | 15:19 | |
IOninja | poska: they're accessed in dynamic scope | ||
poska | is it possible to pass a parameter to the grammar on construction and then expose it as a dynamic variable? | 15:20 | |
moritz | yes, you could override the parse method in the grammar to set the dynamic variable when parsing beings | 15:21 | |
*begins | |||
IOninja | you can use dynamic variables in token parameters: e.g. token foo ($*FOO) {... } and then it'll be available | ||
poska | okay, still need to wrap this in my head :D i'm quite new to p6 | 15:22 | |
IOninja | You can use :$args name param, can't you? No need to override anything | ||
m: say grammar { token TOP ($*FOO) { $<foo>=.**{$*FOO} .+ } }.parse: 'abcdefghij', :args[3] | |||
camelia | 「abcdefghij」 foo => 「abc」 |
||
IOninja | yup | ||
15:24
lukaramu_ left
15:28
perlpilot left
|
|||
smls | m: grammar A { token TOP ($n) { <foo($n)> .* }; token foo ($n) { . ** {$n} } }; say A.parse("Hello world", args => \(4)) | 15:31 | |
camelia | 「Hello world」 foo => 「Hell」 |
||
smls | poska: This ^^ is what I meant, with passing it down as a parameter. | ||
poska | can you explain what does args => \(4) do? | 15:32 | |
smls | 'args' is a named argument accepted by the .parse method | ||
it takes a Capture of arguments to pass to rule TOP | 15:33 | ||
[Coke] | m: say (\(4)).perl | ||
camelia | \(4) | ||
smls | \( ) constructs a Capture, which is a collection of positional and/or named arguments that can be passed to a function or method | ||
poska | so it's sort of a function signature? | 15:34 | |
smls | it's something that can be *passed* to a signature | ||
a.k.a. an "argument list" | 15:35 | ||
poska | ok, this integrates perfectly! thanks | 15:37 | |
in the python world i imagine this as foo(*(1, 2, 3)), when the function naturally accepts foo(1, 2, 3) | |||
15:38
perlpilot joined
|
|||
IOninja | There's no need to make it a capture | 15:40 | |
smls | poska: In Perl6, | takes the role of Python's * in that case | ||
m: sub a ($x, $y, :$foo) { say $x; say $y; say $foo }; my $args = \(1, 2, foo => 42); a |$args | |||
camelia | 1 2 42 |
||
IOninja | m: grammar A { token TOP ($n) { <foo($n)> .* }; token foo ($n) { . ** {$n} } }; say A.parse("Hello world", :args[4]) | 15:41 | |
camelia | 「Hello world」 foo => 「Hell」 |
||
IOninja | m: 4.Capture | ||
camelia | ( no output ) | ||
IOninja | m: |4.Capture | ||
camelia | ( no output ) | ||
IOninja | Wonder why it complains about :4args ... | ||
m: dd 4.Capture | |||
camelia | \() | ||
IOninja | m: dd |4.Capture | ||
camelia | block <unit> | ||
IOninja | m: dd [|4.Capture] | ||
camelia | [] | ||
IOninja | That's why :( | ||
15:42
itaipu joined
15:43
cdg_ left
15:44
cdg joined
|
|||
IOninja | Well, never mind. Seems .Capture is kinda busted, so makes sense to pass Capture to :args | 15:46 | |
15:47
lizmat left
15:48
khw joined
|
|||
IOninja | Oh, wait, it's the slipping of a capture that's busted... | 15:49 | |
m: dd [ [:42x].Capture ] | |||
camelia | [\(:x(42))] | ||
IOninja | m: dd [ |[:42x].Capture ] | ||
camelia | [] | ||
IOninja | m: grammar A { token TOP (:$n) { <foo($n)> .* }; token foo ($n) { . ** {$n} } }; say A.parse("Hello world", args => \(:42n) ) | 15:50 | |
camelia | Nil | ||
IOninja | m: grammar A { token TOP (:$n) { <foo($n)> .* }; token foo ($n) { . ** {$n} } }; say A.parse("Hello world", args => \(:2n) ) | ||
camelia | 「Hello world」 foo => 「He」 |
||
IOninja moves this to #perl6-dev | |||
15:52
poska left
15:53
movl joined
|
|||
IOninja | nevermind, .Capture isn't busted :) | 15:56 | |
moritz | it's just creative! :-) | ||
IOninja | :) | ||
15:57
sufrostico left
15:58
ZzZombo left,
ZzZombo joined
|
|||
smls | dd 4.List; dd 4.Capture; | 15:58 | |
IOninja: Is that ^^ also correct? | 15:59 | ||
15:59
ZzZombo is now known as Guest58048
|
|||
smls | m: dd 4.List; dd 4.Capture; | 15:59 | |
15:59
Guest58048 left,
Guest58048 joined
|
|||
camelia | (4,) \() |
15:59 | |
15:59
Guest58048 is now known as ZzZombo
|
|||
IOninja | smls: no, but there's a ticket for that. | 15:59 | |
smls | ok | ||
IOninja | Well, not IMO | 16:00 | |
It calls a Mu candidate that rakes for attributes and perhaps value types should provide their own Capture | |||
m: dd class { has $.x = 42 }.new.Capture; | |||
camelia | \(:x(42)) | ||
16:03
jonas1 left
|
|||
IOninja | Mu.Capture doesn't really makes sense to me. | 16:04 | |
m: dd now.Capture | |||
camelia | \(:tai(<2936116123547/1972>)) | ||
IOninja | I'd just do it as { self.list.Capture } | ||
timotimo | turns any object into a capture by exposing its attributes | ||
it's for doing stuff like for @pairs -> (:$key, :$value) { } | 16:05 | ||
IOninja | That stuff uses .Capture? | ||
timotimo | i thought so? | ||
IOninja | m: dd :42a.Capture | ||
camelia | \(:key("a"), :value(42)) | ||
araraloren | I make a binding for a library ftplib, which name should be good ? Net::Ftplib or Net::ftplib or other ? | 16:06 | |
IOninja | Net::FTPlib | ||
FTPlib | |||
araraloren | IOninja, Hm, thanks. | ||
timotimo | you can call it "Al" | 16:07 | |
16:07
sufrostico joined
|
|||
IOninja | m: for :42a -> (:$key, :$value, :$uc) { dd [$key, $value, $uc]} | 16:07 | |
camelia | ["a", 42, Mu] | ||
timotimo | yeah, the "call method" semantics for pairs is just when you smartmatch | 16:08 | |
IOninja | m: use MONKEY; augment class Pair { has $.uc = 'foo' }; for :42a -> (:$key, :$value, :$uc) { dd [$key, $value, $uc]} | ||
camelia | P6opaque: no such attribute '$!uc' in type Pair when trying to get a value in block <unit> at <tmp> line 1 |
||
IOninja | augmentation failurage? | 16:09 | |
timotimo | interesting | ||
does Pair have a custom .Capture? i'd assume it does | |||
but actually ... huh? | |||
that's not what that'd be | |||
s: Pair, "Capture", \() | |||
SourceBaby | timotimo, Sauce is at github.com/rakudo/rakudo/blob/76a5...Mu.pm#L680 | 16:10 | |
timotimo | m: use MONKEY; augment class Pair { has $.uc = "foo" }; .say for Pair.new.^attributes.flat | ||
camelia | Mu $!key Mu $!value Mu $!uc |
||
IOninja | m: for (4,) -> ($z) { dd [$z]} | ||
camelia | Too few positionals passed; expected 1 argument but got 0 in sub-signature in block <unit> at <tmp> line 1 |
||
IOninja | So I guess if 4.Capture gives \(4), the above will start to work... | ||
smls | I've always considered the -> (:$key, :$value) feature somewhat of a hack, and hope it'll me made unnecessary by a future -> ($key => $value) syntax... :) | 16:11 | |
16:11
Cabanossi left
|
|||
timotimo | m: use MONKEY; augment class Pair { has $.uc = "foo" }; Pair.new."$_"() for Pair.new.^attributes.flat | 16:11 | |
camelia | No such method '$!key' for invocant of type 'Pair' in block <unit> at <tmp> line 1 |
||
[Coke] | smls: what if you have more than 2? | ||
timotimo | m: use MONKEY; augment class Pair { has $.uc = "foo" }; Pair.new.key | ||
camelia | ( no output ) | ||
timotimo | what the hay? | ||
smls | [Coke]: I meant specifically for destructuring keys. | ||
[Coke] | smls: ok | ||
timotimo | m: use MONKEY; augment class Pair { has $.uc = "foo" }; Pair.new."key"() | ||
camelia | ( no output ) | ||
timotimo | oh, i had to substr the name, sure | 16:12 | |
smls | [Coke]: Have you actually used the syntax for any other methods than .key. and .value? | ||
IOninja | I have | ||
[Coke] | timotimo: also you're not printing anything? | ||
smls: doubtful | |||
timotimo | m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new."$_.substr(2)"() for Pair.new.^attributes.flat | ||
camelia | No such method 'substr' for invocant of type 'Attribute' in block <unit> at <tmp> line 1 |
||
timotimo | m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new."$_.name.substr(2)"() for Pair.new.^attributes.flat | ||
camelia | (Mu) (Mu) P6opaque: no such attribute '$!uc' in type Pair when trying to get a value in block <unit> at <tmp> line 1 |
||
IOninja | smls: github.com/perl6/routine-map/blob/...wer.p6#L11 | ||
timotimo | m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new."uc"() for Pair.new.^attributes.flat | ||
camelia | P6opaque: no such attribute '$!uc' in type Pair when trying to get a value in block <unit> at <tmp> line 1 |
||
16:12
domidumont left
|
|||
timotimo | m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new.uc() for Pair.new.^attributes.flat | 16:12 | |
camelia | P6opaque: no such attribute '$!uc' in type Pair when trying to get a value in block <unit> at <tmp> line 1 |
16:13 | |
timotimo | so how come that explodes that way? | ||
16:13
Cabanossi joined
|
|||
timotimo | m: use MONKEY; class Test { has $.a = "one", has $.b = "two" }; augment class Test { has $.uc = "foo" }; Test.new.uc() | 16:13 | |
camelia | P6opaque: no such attribute '$!uc' in type Test when trying to check if it's initialized in block <unit> at <tmp> line 1 |
||
smls | IOninja: Is PATH_INFO a method, or a Hash entry in that case? | ||
IOninja | smls: hash key | 16:14 | |
SmokeMachine | m: multi trait_mod:<is>(Variable $v, :$injected) {say $v.willdo}; my $a is injected # ← what's this willdo? | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Too few positionals passed; expected 2 or 3 arguments but got 1 at <tmp>:1 |
||
IOninja | m: class Pair { has $.uc = "foo" }; say Pair.new.uc | 16:15 | |
camelia | foo | ||
IOninja | m: use MONKEY; augment class Pair { has $.uc = "foo" }; say Pair.new.uc | ||
camelia | P6opaque: no such attribute '$!uc' in type Pair when trying to get a value in block <unit> at <tmp> line 1 |
||
IOninja | m: use MONKEY; augment class Pair { has $.uc = "foo" }; 'say Pair.new.uc'.EVAL | ||
smls | IOninja: Then it would work with the suggested alternae syntax too: -> % (PATH_INFO => $_, *%) | ||
camelia | P6opaque: no such attribute '$!uc' in type Pair when trying to get a value in block <unit> at EVAL_0 line 1 in block <unit> at <tmp> line 1 |
||
SmokeMachine | ok, its for trait_mod:<will> | 16:16 | |
IOninja | smls: that would make it inconsistent with the rest of the language. | ||
moritz | SmokeMachine: some voodoo used for installing phasers | ||
IOninja | If :PATH_INFO($_) stops working in that particular instance. | ||
IOninja & | 16:17 | ||
smls | IOninja: It's mostly the fact that it translates into a method call in same cases, that I find weird. | ||
IOninja | smls: it doesn't tho | ||
smls: as timotimo++ showed above, it uses the .Capture method on the given object and passes the capture to the subcapture. | |||
smls | The how does -> (:key($foo)) work when passing a Pair? | ||
oh | |||
IOninja | Pair.Capture rakes the key/value attributes | ||
m: dd :42a.Capture | |||
camelia | \(:key("a"), :value(42)) | 16:18 | |
IOninja | and ^ that gets passed | ||
mscha | naxieAlDle: thanks, I'll have a look, and if I have any that aren't yet mentioned - it looks pretty complete at first glance - I'll add them, if they're not too ridiculous. (I won't bother with eⁱ for instance. :-) | 16:19 | |
smls | IOninja: Still weird tho :P | 16:20 | |
16:23
cibs left
|
|||
smls | IOninja, timotimo: Any idea why Mu.Capture doesn't simply do method Capture { \( |self ) } ? | 16:24 | |
Would be much less surprising IMO. | |||
timotimo | huh? | 16:25 | |
smls | 4 --> \(4) | ||
timotimo | why would it do that, though? | ||
smls | :4a --> \(:4a) | ||
(1, 2) --> \(1, 2) | |||
16:25
cibs joined
|
|||
timotimo | m: dd $*KERNEL.Capture | 16:25 | |
camelia | \(:auth("unknown"), :desc(Str), :name("linux"), :release("#1 SMP Fri Dec 9 16:18:38 UTC 2016 (3ec5648)"), :signature(Blob), :version(v4.4.36.8.default)) | ||
smls | (a => 2) --> \(:a(2)) | ||
16:25
grondilu joined
|
|||
jnthn | Because otherwise it'd be useless for destructuring objects | 16:27 | |
IOninja | m: dd bag(<a b c c>).Capture | ||
camelia | \() | ||
jnthn | The deafult in Mu is fine, though it's apparent that various built-in types could have a more useful .Capture method | ||
IOninja | jnthn: would you agree that .Capture method can be added to some core types, e.g. on Int and Bag .Capture produces an empty list | 16:28 | |
OK. | |||
jnthn | But be careful about Pair, because there's likely code out there that destructures it into a key and a value | ||
Yeah, .Capture on Bag producing an empty capture isn't too helpful | |||
smls | jnthn: Why does it need to destructure objects though? | ||
IOninja | m: dd (|bag(<a b c c>)).Capture | ||
camelia | \(:a(1), :b(1), :c(2)) | ||
IOninja addss it to todo list | |||
jnthn | smls: huh? | ||
timotimo | it needs to do that because that's a feature of the language | 16:29 | |
smls | I mean, .Map / .Hash doesn't do that either... | ||
timotimo: But is it a sensible feature...? | 16:30 | ||
jnthn | No, I'd not expect them to | ||
Yes, it is. | |||
And it's done this way so that objects can implement Capture to decide who they can be destructured using signatures | 16:31 | ||
*how | |||
smls | Well, I've never seen it used in practice outside of the :key($a), :value($b) which could be much nicer with a dedicted syntax for destructuring pairs. | 16:32 | |
jnthn | m: sub foo(Complex $c (:$re, :$im)) { say $re; say $im; }; foo(2 + 3i) | 16:33 | |
camelia | 2 3 |
||
16:34
ChoHag left
|
|||
jnthn | Also can be useful in multi-dispatch for pattern-matching inside of objects | 16:34 | |
16:35
cibs left
16:37
cibs joined
16:40
adu joined
16:41
zakharyas joined
|
|||
smls | jnthn: But don't you think it's strange that a torning a lone Pair into a Capture behaves so differently from other data structures containing Pairs: | 16:41 | |
m: say {a => 1, b => 2}.Capture; say (a => 1, b => 2).Capture; say (b => 2).Capture; | |||
camelia | \(:a(1), :b(2)) \(:a(1), :b(2)) \(:key("b"), :value(2)) |
||
16:41
Cabanossi left
|
|||
jnthn | smls: Arguably, though it'd be a breaking change to make it do so. | 16:43 | |
16:43
Cabanossi joined
|
|||
jnthn | And arguably the way it is now is consistent with Rat, Complex, and Range | 16:44 | |
So it comes down to "pick which consistent you want to be" | |||
smls | As for destructuring objects, that too could be supported with a dedicated syntax without making Mu.Capture pretend that objects are hashes. | 16:45 | |
E.g.... | |||
($key => $value) -- subsignature that destructures a Pair | |||
(:$key($value)) -- possible alternate syntax | |||
(.$im, .$re) -- subsignature that destructures an object | |||
(.im($IM), .re($RE)) -- with custom variable names | |||
or something | |||
16:46
wamba joined
16:49
araraloren left
|
|||
jnthn | It's not about pretending objects are hashes. An argument capture, represented by Capture, is well-defined as something with a positional part and a named part. A signature is something that processes a Capture. The .Capture coercer says "tell me how you'd like to look as an argument list" - and given captures exist almost exclusively to be processed by signatures it's pretty clear the resulting Capture should be useful for unpacking with a Signat | 16:59 | |
$key => $value in a signature is actually reasonable syntax for destructuring something passed as a Pair. The matter two are asking for changes to entire nature of signatures/captures and how we process them. | 17:00 | ||
17:00
itaipu left
|
|||
jnthn | *latter two | 17:01 | |
smls | Hm, ok | 17:02 | |
[Coke] | jnthn: first long send ended at "with a Signat" | 17:04 | |
smls | I guess if all value tyes were to get a .Capture that contains the value as a single positional arguemt, and all Associative types (Pair, Bag...) get a Hash-like .Capture, it would be servicable... :) | 17:05 | |
Except that as you said, the unfortunate Pair.Capture is already used in practice and thus can't be changed in 6.c | |||
jnthn | [Coke]: That was nearly the end: "...with a Signature." | ||
smls: Yeah, it's also rather hard to change generally because it's a method, so what happens if the callee is 6.c and the caller is 6.d and so forth... | 17:06 | ||
We might decide the breakage is worth it, though I don't have a good feel for that | |||
Giving Bag and so on a Hash-like .Capture would make sense since they're Associative | 17:08 | ||
17:11
Sound joined
17:12
girafe joined
|
|||
[Coke] | for masak et al: fibonacci convention this year promises to be as big as the last two, combined! | 17:14 | |
17:16
cibs left
17:17
cibs joined
|
|||
moritz | [Coke]++ # autopun | 17:21 | |
17:22
mr-foobar left
|
|||
jeek | [Coke]++ | 17:22 | |
17:24
cdg_ joined
|
|||
moritz just read on twitter: don't use "fortnight" as your password, it's two week | 17:25 | ||
17:26
cdg left
|
|||
arnsholt | *groan* | 17:29 | |
17:31
ChoHag joined
17:32
grondilu_ joined
17:34
grondilu left
17:41
st_elmo joined
|
|||
alphah | Hello perl 6, I'm following Grammar example from perlgeek.de/blog-en/perl-6/2017-00...mmar.html, I'm trying to make token header matches only specific words but not able to. | 17:41 | |
here is a link for my code gist.github.com/anonymous/2192a932...f5e5badfbc | |||
IOninja | there's no token header in your code? | 17:42 | |
alphah | token object replaced header | 17:43 | |
there is a config template file as well in the pstepin link, the config file uses slightly different syntax than INI file showed in example | 17:44 | ||
IOninja | alphah: I don't fully understand the question. The included text file gets successfully parsed by that grammar... What's the isseu? | 17:45 | |
17:45
dakkar left
|
|||
Geth | perl6-most-wanted: 183886b829 | (Itsuki Toyota)++ | most-wanted/bindings.md Add a WIP module for Charting |
17:46 | |
alphah | my question is how to limit "object" token to match specidif words,for example <main>and <dev> match,,, but <other_word> should not match | ||
IOninja | m: gist.github.com/zoffixznet/be2ca6f...132a4f4525 | 17:47 | |
camelia | Don't know what main category is in regex object at <tmp> line 17 in regex realm at <tmp> line 22 in regex TOP at <tmp> line 23 in block <unit> at <tmp> line 33 |
||
IOninja | m: gist.github.com/zoffixznet/1e35289...17b4a68513 | 17:48 | |
camelia | 「<dev> key value 」 realm => 「<dev> key value 」 object => 「<dev> 」 0 => 「dev」 block => 「key value 」 law => 「key value 」 key => 「key」 space => 「 」 value => 「value」 |
||
IOninja | That's one way... | ||
The <?{...}> thing executes a piece of code and match succeeds if code's last statement's value is truthy | |||
and || { die... } will only trigger when the previous chunk failed to parse | 17:49 | ||
alphah | hmm, is there a way to do it with proto token object {*} | ||
? | |||
IOninja | Not at the moment. | ||
But you can just use another token... token object-prep { <object> || {die... } } for example | 17:50 | ||
or token object { .... <section-name> .... }; token section-name { [main|dev|whatever] || {die "Don't know the section"} } | 17:53 | ||
17:53
Geth left
17:54
buggable left
|
|||
alphah | I think that's good enough, I will use last one | 17:54 | |
17:54
Geth joined,
ChanServ sets mode: +v Geth
|
|||
alphah | Thanks IOninja | 17:54 | |
17:54
sufrostico left,
buggable joined,
ChanServ sets mode: +v buggable
18:00
robertle left
18:02
sufrostico joined
18:09
sufrostico left
18:11
cibs left,
sufrostico joined
|
|||
IOninja | A thought occurs... | 18:11 | |
my @a; @a[^3]»++ <-- that's not thread-safe, is it? | 18:12 | ||
or my BagHash $b .= new; $b<a b c>»++ | |||
timotimo | yeah, that'll grow the array in steps | ||
that's bad news | |||
IOninja | Man | 18:13 | |
naxieAlDle | ouch… | ||
IOninja | We should really come up with another op for autothreading. And leave » unthreaded | ||
18:13
cibs joined
|
|||
moritz | I'm not really convinced with need actual autothreading | 18:14 | |
most operators are rather cheap, so doing them in parallel typically doesn't make much sense | |||
IOninja | Yeah | 18:15 | |
moritz | is the author/owner of www.0racle.info/ in here? and if yes, under what nickname? | ||
18:15
lizmat joined
|
|||
naxieAlDle | .seen 0racle | 18:15 | |
yoleaux | I haven't seen 0racle around. | ||
moritz | ah, perlawhirl, it seems | 18:16 | |
naxieAlDle | yes | ||
IOninja: I've also always disliked how » is different from map | 18:17 | ||
or deepmap, or whatever it actually is | |||
IOninja | heh | ||
naxieAlDle | I still can't predict what it does | ||
18:18
kanishka left
|
|||
naxieAlDle | but it's too short, I can't get myself not to use it… | 18:18 | |
18:18
vendethiel joined
|
|||
Geth | doc: bduggan++ created pull request #1240: Add "Perl 6 from Python -- Nutshell" page |
18:18 | |
IOninja | Sounds like you want a 1-character map... | 18:19 | |
buggable: eco 1-character map | |||
buggable | IOninja, M 'M, the 1-character Map: non-nodal, non-autothreading .map(*.some-method)': github.com/zoffixznet/perl6-M | ||
18:20
integral left
|
|||
Geth | doc/master: 13 commits pushed by (Brian Duggan)++, (Zoffix Znet)++ review: github.com/perl6/doc/compare/27225...c597301713 |
18:20 | |
doc/py-nutshell: 2df66cc4ac | (Brian Duggan)++ | doc/Language/py-nutshell.pod6 various pod and punctiation fixes and rewording |
|||
IOninja | I'll fix xtest | ||
[Coke] glares at IOninja. :) | |||
danke. :) | |||
IOninja | I'm just very excited to have a Python-* doc | ||
[Coke] | 'sfine, it's 'x' for a reason. | 18:21 | |
wow, it fails a LOT of xtest. | 18:22 | ||
note that some of the xtest test let you do "perl6 xt/foo.t path/to/file.t" | |||
(should make it faster to rule out the probably one file he edited. | |||
IOninja | "# & uares 79 14: uar es, uar-es," ... what are 79 14 numbers? I don't see where there's an "uares"... only \squares and squares | 18:24 | |
18:25
domidumont joined
|
|||
IOninja | Also gives "# & is's 50 48:" but searching for "is's" gives me nothing | 18:26 | |
oh it's in code block nevermind | 18:27 | ||
class :: is Foo is Bar {} <-- is `is` in there an operator or a trait? | 18:28 | ||
18:28
domidumont1 joined
|
|||
IOninja | s: &infix:<is> | 18:28 | |
SourceBaby | IOninja, Something's wrong: ERR: ===SORRY!=== Error while compiling -eUndeclared routine: infix:<is> used at line 6. Did you mean 'infix:<+|>', 'infix:<∖>', 'infix:<ne>', 'infix:<o>', 'infix:<**>'? | ||
IOninja | Trait it is... | ||
[Coke] | aye, trait. | ||
m: is π | 18:29 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: is used at line 1 |
||
18:29
domidumont left,
john51 left,
Ven joined
18:30
domidumont joined
18:31
domidumont left,
domidumont joined
18:32
domidumont1 left
|
|||
IOninja | how come xt/aspell.pws is ignore? I need to a word into it (lexicographically) | 18:32 | |
in .gitignore I mean | 18:33 | ||
hm, it gets updated fromsomewhere... /me looks | 18:34 | ||
ah, found it. xt/words.pws | |||
18:34
john51 joined
18:36
domidumont1 joined
|
|||
IOninja | what to do with `uares` thing? gist.github.com/zoffixznet/4ef748e...f9e5f969e5 | 18:37 | |
Oh, it's this line that causes it: "my \squares = [];" what do I do | |||
18:39
domidumont left
|
|||
IOninja | guess I'll just add uares to code.pws | 18:39 | |
Geth | doc: 652347dcd8 | (Zoffix Znet)++ | 3 files Fix aspell tests failures |
||
18:40
xzhao joined
18:41
Ven left
|
|||
Geth | doc: 449c88dc95 | (Zoffix Znet)++ | doc/Language/py-nutshell.pod6 Fix nbsp tests |
18:42 | |
18:42
Sound left
18:43
espadrine joined
18:45
movl left
18:46
wamba left
|
|||
IOninja | Is perl6 xt/examples-compilation.t supposed to take ages without producing any output? | 18:46 | |
IOninja realises "I'll fix xtest" really mean, I'll spam #perl6 with questions on how to fix it :P | |||
Oh, sure, NOW it produces output -_- | 18:47 | ||
timotimo | it checks on IRC if you've complained yet | ||
IOninja | :) | ||
18:49
Ven joined
18:52
Ven left
18:53
domidumont joined
18:55
Cabanossi left
18:56
domidumont1 left
18:58
Cabanossi joined
|
|||
Geth | doc: 3417c13cf9 | (Zoffix Znet)++ | xt/space-after-commma.t Make xt/space-after-commma.t report line numbers for failures |
18:58 | |
18:58
movl joined
|
|||
IOninja | :o TIL you can use `&` instead of `|` in regexes: [ <!before ' '> & <!before $> ] | 19:00 | |
19:00
ChoHag left
|
|||
moritz | or just <?before <-[ characters here]> > | 19:02 | |
Geth | doc/py-nutshell-more: 6 commits pushed by (Brian Duggan)++ | ||
19:02
TimToady left
|
|||
[Coke] | ^^ that compare is bad. | 19:04 | |
Geth | doc: 6434cce19d | (Zoffix Znet)++ | xt/examples-compilation.t Whitelist python docs from compilation tests |
||
doc: 2715812df4 | (Zoffix Znet)++ | xt/space-after-commma.t Revert "Make xt/space-after-commma.t report line numbers for failures" This reverts commit 3417c13cf941009e10183a8d9dea683c676d56d0. It reports lines for processed doc, not original |
19:05 | ||
IOninja | Well... I now feel sufficiently useless. | ||
[Coke] | IOninja: note that you can :skip-test for individual pod blocks in the cases where 2/3 of them are python (it's a PITA, so this is fine to get the tests clean, thanks.) | ||
IOninja++ | 19:06 | ||
does python allow commas after spaces? | 19:09 | ||
19:09
Ven joined
|
|||
[Coke] | if not, we can blacklist doc/Language/py-nutshell.pod6 in the comma test. | 19:10 | |
Geth | doc: 17ef6722cd | (Brian Duggan)++ | doc/Language/py-nutshell.pod6 move comma for xtest |
19:11 | |
19:13
risou_awy is now known as risou,
xzhao left
|
|||
[Coke] | If that was the failure, we should rewrite the test. | 19:13 | |
19:14
xzhao joined,
TimToady joined
|
|||
[Coke] | that doesn't pass the test. | 19:14 | |
Geth | doc/py-nutshell-more: 379e364dfd | (Brian Duggan)++ | doc/Language/py-nutshell.pod6 Spacing, Perl 6 vs Perl 6 (nbsp) |
19:15 | |
[Coke] | 17ef6722cd ^Hcan be reverted. | 19:16 | |
IOninja | mhm, yeah, I think there's a confusion with the comma test. For me it reported just two lines. I think Brian is changing all the commas or something | ||
Geth | doc: 74c08b984f | (Zoffix Znet)++ | doc/Language/py-nutshell.pod6 Revert "move comma for xtest" This reverts commit 17ef6722cdd2dde019a24b74a0e38130cfc8f083. |
19:17 | |
IOninja | OK. I'll run xtest from scratch and fix anything that pops up. | ||
19:18
sufrostico left
|
|||
Geth | doc: 9bd2c0113c | (Zoffix Znet)++ | doc/Language/py-nutshell.pod6 Fix all the comma xtest failures |
19:19 | |
doc/py-nutshell-more: 7a393c3aa8 | (Brian Duggan)++ | doc/Language/py-nutshell.pod6 added back lexicographically (since it's now in our dictionary) |
|||
19:20
lukaramu joined
|
|||
Geth | doc: bduggan++ created pull request #1241: Perl 6 -> Python in a nutshell, fixes |
19:21 | |
19:21
cdg_ left
19:22
cdg joined
19:24
CIAvash left
19:25
Ven left
|
|||
Geth | doc: 6c687324fa | (Zoffix Znet)++ | xt/space-after-commma.t Make xt/space-after-commma.t diag() the line with the issue |
19:25 | |
[Coke] | why is bd working on this on the branch while you're in mastere? | 19:26 | |
19:26
GK___1wm____SU joined
19:27
GK___1wm____SU left,
smls left
|
|||
IOninja | Because I jumped in to fix the issues, like a kid on sugar rush... And I guess Brian is not on IRC, so they only thing they saw is your comment on the branch I merged that it fails xtests. | 19:27 | |
[Coke] | I commented on his second-PR in progress. | 19:28 | |
19:29
Ven joined
19:30
risou is now known as risou_awy
19:31
eroux joined
19:32
andrzejk_ joined
|
|||
IOninja | Well, my bad. | 19:32 | |
19:33
mscha left
|
|||
IOninja | wonder what's the significance of my latest comments highlighted in light blue... | 19:34 | |
unread or something? | |||
19:35
bdmatatu joined
|
|||
IOninja | i.imgur.com/Px95wM1.png | 19:35 | |
bdmatatu: \o | 19:36 | ||
Sorry for jumping it like that. I guess I was too excited about pythong docs :) | |||
bdmatatu | Howdy! | ||
No problem, sorry for the conflcts | |||
19:37
ChoHag joined
|
|||
bdmatatu | I'll see if pr 1241 passes xtest before I push the commits to master. | 19:40 | |
TimToady | bisect: my $x = 1,$_ | ||
bisectable6 | TimToady, On both starting points (old=2015.12 new=e2db7b8) the exit code is 0 and the output is identical as well | ||
TimToady, Output on both points: «» | |||
TimToady | I guess that never warned, for some reason | ||
19:40
lizmat_ joined
|
|||
TimToady | m: 1,$_ | 19:40 | |
camelia | WARNINGS for <tmp>: Useless use of constant integer 1 in sink context (lines 1, 1) |
||
TimToady | m: 1,42 | 19:41 | |
camelia | WARNINGS for <tmp>: Useless use of constant integer 1 in sink context (lines 1, 1) Useless use of constant integer 42 in sink context (lines 1, 1) |
||
TimToady | m: $_ | ||
camelia | WARNINGS for <tmp>: Useless use of $_ in sink context (line 1) |
||
TimToady | odd | ||
IOninja | m: dd 4.Capture | ||
camelia | \() | ||
19:41
Ven left
|
|||
IOninja | TimToady: would you say it'd be OK for ^ that and non-Associative Cools to do method Capture { self.list.Capture } do they don't end up empty like that? | 19:41 | |
TimToady | well, the current behavior is certainly a WAT | 19:42 | |
IOninja | OK | ||
m: -> ($x) {}( 4 ) | |||
camelia | Too few positionals passed; expected 1 argument but got 0 in sub-signature in block <unit> at <tmp> line 1 |
||
IOninja | ^ that would start to work. | ||
If 4.Capture gives \(4) | |||
TimToady | that may, of course, produce other WATs if you fix it :) | 19:43 | |
IOninja | hehe | ||
TimToady | maybe it should blow up instead? | 19:44 | |
19:44
lizmat left
|
|||
IOninja | Dunno. It becoming \(4) kinda follows the "anything is a 1-item list" thing. | 19:45 | |
TimToady | otherwise we'll end up with a bunch of code with superstitious () | ||
and it'll be working for the wrong reason | |||
IOninja | Ahhh | ||
OK. I'll give the "blow-up" approach a try first. | |||
19:45
cdg left
|
|||
TimToady | m: -> [$x] {}( 4 ) | 19:46 | |
camelia | Type check failed in binding to '<anon>'; expected Positional but got Int (4) in block <unit> at <tmp> line 1 |
||
19:46
cdg joined
|
|||
TimToady | m: -> [$x] {}( [:4ty] ) | 19:46 | |
camelia | Too few positionals passed; expected 1 argument but got 0 in sub-signature in block <unit> at <tmp> line 1 |
||
IOninja | m: my $a but Real, Numeric; | ||
camelia | ( no output ) | ||
TimToady | we were thinking about fixing that one to not turn into a Capture, too | 19:47 | |
IOninja | ^ there's a ticket for that not producing a warning: rt.perl.org/Ticket/Display.html?id...et-history | ||
19:47
darutoko left
|
|||
TimToady | I think that might be in my todo list already | 19:47 | |
19:49
Ven joined
|
|||
naxieAlDle | c: 2015.10,2015.11,2015.12 my $x = 1,$_ | 19:50 | |
committable6 | naxieAlDle, ¦2015.10,2015.11: «WARNINGS:Useless use of variable $_ in sink context (line 1)» ¦2015.12: «» | ||
naxieAlDle | bisect: old=2015.10 my $x = 1,$_ | 19:51 | |
bisectable6 | naxieAlDle, Bisecting by output (old=2015.10 new=e2db7b8) because on both starting points the exit code is 0 | ||
Geth | doc: fe20283f23 | (Brian Duggan)++ | doc/Language/py-nutshell.pod6 indentation in py-nutshell |
||
bisectable6 | naxieAlDle, bisect log: gist.github.com/de8bef3c557d7a6317...56950c3078 | ||
naxieAlDle, (2015-12-12) github.com/rakudo/rakudo/commit/f9...d9fb452cf1 | |||
naxieAlDle | TimToady: not sure if that's helpful, but still: ↑ | ||
IOninja | bdmatatu: typo: s/Perl 6/Python/; "Decorators in Perl 6 are a way of wrapping a function in another one." | 19:52 | |
bdmatatu | oops, thanks | ||
19:53
lizmat_ left
|
|||
Geth | doc: 773b08a674 | (Brian Duggan)++ | doc/Language/py-nutshell.pod6 typo about decorators |
19:53 | |
19:54
kyan joined,
integral joined,
integral left,
integral joined
19:55
Ven left
|
|||
El_Che | bdmatatu: I don't know what you did in Spain in the past, but I had 3 spaniards that told me they loved your talk [on cfgmgt camp, monday an tuesday after fosdem] | 19:55 | |
bdmatatu | thanks! Have never been there actually | 19:56 | |
El_Che | bdmatatu: I found it curious that they were all from Spain and not from the same group at fosdem :) | 19:57 | |
19:57
dotness joined
|
|||
DrForr | We had the group from Portugal and Granada, IIRC. | 19:58 | |
TimToady | IOninja: btw, thanks, it was your 'my $a = $x, $x, $x;' that alerted me to the fact that it wasn't warning on $x there | ||
El_Che | DrForr: one of the guys that spoke to me was indeed from granada. On other from Capside (Perl 5) so I guess Barcelona or Madrid. The other I don't know where is was from | 20:00 | |
DrForr | Barcelona probaby. | 20:01 | |
*probably | |||
El_Che | I know nothing | ||
DrForr | n/ick JonSnow | ||
IOninja | :) | ||
20:02
domidumont left
20:03
eroux left
20:08
dotness left
20:09
Ven joined
20:10
eroux joined
20:11
bdmatatu left
20:15
lostinfog joined
20:20
lostinfog left
20:23
lizmat joined,
wamba joined
|
|||
Woodi_ | hi #perl6 :) | 20:23 | |
20:25
Ven left
|
|||
Woodi_ | found in open(2) manual: openat() can be used for per-thread "current working directory": first fd for dir is opened and than used to open file in that dir: int openat(int dirfd, const char *pathname, int flags); | 20:26 | |
geekosaur | good luck with portability | 20:28 | |
Woodi_ | there is also int openat(int dirfd, const char *pathname, int flags, mode_t mode); but how they do that in C ?? | ||
geekosaur | it's a syscall | ||
you're passing a context to the kernel's namei() for path resolution | |||
Woodi_ | geekosaur: it's _POSIX_C_SOURCE >= 200809L :) | ||
20:29
Ven joined
|
|||
geekosaur | pretty sure it's *optional* in POSIX | 20:29 | |
20:30
itaipu joined
|
|||
Woodi_ | geekosaur: not so bad with portability, IMO stackoverflow.com/questions/1670135...ort-openat | 20:33 | |
geekosaur | ...and how bout windows? | 20:34 | |
Woodi_ | here is some "way" stackoverflow.com/questions/3213852...-of-openat | 20:38 | |
20:39
Ven left
|
|||
Woodi_ | geekosaur: above I asked how they make two functions with same name but different params count... you probably answered about something else... | 20:40 | |
geekosaur | oh, you mean mode_t? it's always passed to the kernel but only used if you are creating a file, so they're cheating | 20:41 | |
it passes "garbage" (either the frame pointer or part of a local variable --- but the ABI ensures there's always *something* there so it can't trap) if you leave it off | 20:42 | ||
Woodi_ | I was hoping it's just macro :) | 20:43 | |
geekosaur | this would be considered bad form but it's how the open*() functions in C have always worked so they just accept the poor design as something too embedded to change | ||
varargs macros are even worse... | 20:45 | ||
20:49
Ven joined,
lichtkind_ joined
|
|||
IOninja | wooooooooooooo fancy pants: perl6.vip/ | 20:49 | |
20:52
lichtkind left
|
|||
[Coke] has concerns about new perl 6 branding | 20:53 | ||
looks shiny, though! | |||
lesse, 4/15, I'll be safely in my new job and maybe able to perl6 again. :) | 20:54 | ||
moritz looks forward to it | |||
20:56
Ven left
20:57
lizmat left
|
|||
IOninja | [Coke]: what concerns? | 20:57 | |
geekosaur | oh also C compilers in pedantic mode will warn if you leave off the parameter. (see also fcntl() which has the same behavior, get operations ignore the 3rd parameter but set-s require it) | 20:58 | |
(C compiler developers *hate* this ancient-C-ism...) | |||
[Coke] | IOninja: well, not knowing anything about what it is, is it really a "rakudo" thing, etc. | 20:59 | |
I know you're good about that sort of thing, so am not as worried as I could be. :) | |||
geekosaur apologizes for delays, 2 CL games on here :p | |||
(plus it means I get to play nanny for a soccer-related irc channel) | 21:00 | ||
IOninja | [Coke]: yeah, it'a really a rakudo thing. But no one knows what Rakudo is so I deliberately violating the distinction | 21:02 | |
21:02
Ven joined,
sufrostico joined,
breinbaas left
|
|||
moritz | should I be seeing more than a logo and a date on that site? | 21:03 | |
IOninja | nope | ||
moritz | ok | 21:04 | |
21:07
sufrosti1o joined
|
|||
[Coke] | IOninja: If you know you're deliberately not labelling something rakudo that is rakudo, you might want to get buyin first. | 21:10 | |
21:10
aindilis joined,
Cabanossi left
|
|||
[Coke] | because I am sure you're going to have to have that conversation after the fact with some folks. | 21:10 | |
IOninja | [Coke], what's a buyin? | 21:12 | |
moritz | buy-in? | ||
IOninja | what's a buy-in? | ||
[Coke] | agreement. | ||
"I buy in to your argument." | |||
21:12
Cabanossi joined
|
|||
[Coke] | sorry for the amerenglish. | 21:12 | |
IOninja | What sort of agreement? I do not intend to break amy licensing requirements. | 21:13 | |
21:14
risou_awy is now known as risou
|
|||
[Coke] | IOninja: well, since I have no idea what you're doing, I can't really argue against it effectively. :) | 21:14 | |
but the community has tried hard to keep the distinction between the rakudo compiler and the language, as you know. If this confuses that, there will no doubt be disagreements to be had. That's all. I'm not suggesting you're violating any licenses. (because I don't know what you're doing. :) | 21:15 | ||
anyway, shiny logo. | 21:16 | ||
IOninja | I mentioned it a few days ago. I'm making a decent Perl 6 release. | 21:17 | |
Rakudo Star that doesn't suck. | |||
[Coke] | -1 from me if it's not got Rakudo in the name. | ||
(FWIW) | |||
IOninja | The community seems to be deadlocked to me about what the proper release should look like, so I'm doing my own thing. If people wanna use it, great, if not fine with me. | 21:18 | |
21:18
TEttinger joined
|
|||
moritz | IOninja: what's your vision for it? | 21:18 | |
21:20
sufrostico left
|
|||
IOninja | 2017.04.15 | 21:21 | |
IOninja & | |||
moritz has long been toying with the idea of a more minimalistic distribution, something like rakudo + zef + maybe some docs | |||
21:21
sufrosti1o left
|
|||
moritz | but so far I haven't found the motivation/tuits/whatever to actually do it | 21:21 | |
21:22
sufrostico joined
21:23
sufrosti1o joined
21:25
itaipu left
|
|||
jnthn | IMO, so long as a distribution calls itself "X Perl 6" or "Perl 6 X" and it's not being obviously gratuitous with that (like "Official Perl 6" :P) then there's enough room to keep the compiler/langauge distinction clear. Especially if it's got some kinda description like "Includes the Rakudo Perl 6 compiler, docs, and a module installer" or whatever. | 21:26 | |
El_Che | moritz: that's what I do for my debs/rpms (which I use in docker and on my machines) | 21:28 | |
[Coke] | jnthn++ yup, that seems reasonable. | ||
21:31
eroux left,
risou is now known as risou_awy
21:33
andrzejk_ left
|
|||
[Coke] | IOninja++ # getting stuff done | 21:38 | |
gfldex | AMD made us a CPU: „At 44 cores and 1866MHz, the Naples machine has twice as much memory bandwidth as the Xeon,“ | 21:39 | |
jnthn wonders how fast that'll spectest :) | 21:40 | ||
gfldex | will take another 3 month to find out, sadly | 21:41 | |
21:41
Cabanossi left
|
|||
jnthn | And then it's probably pretty costly | 21:41 | |
21:43
Cabanossi joined
21:44
khw left
|
|||
gfldex | they can't be as costly as a Xeon | 21:45 | |
moritz | are there even 44 core xeons? | 21:48 | |
gfldex | no | ||
21:49
bjz joined
21:51
itaipu joined
|
|||
TEttinger | xeon phi, though | 21:54 | |
moritz | TEttinger: is that like a mixture between a CPU and a GPU? | 21:56 | |
ingy | Greetings... | ||
moritz | \o ingy | 21:57 | |
ingy | Is this expected: gist.github.com/97279bfa8a3dfc44bf...7265ff229e | ||
21:57
rindolf left
|
|||
TEttinger | moritz: the first iteration of it was, yes. the second came out june 2016, and is I believe a normal processor (CPU) | 21:57 | |
21:57
skids left
|
|||
ingy | Works fine when the say line is A) not broken B) broken after 2nd heredoc | 21:57 | |
moritz | ingy: looks pretty much expected to me | 21:58 | |
TEttinger | "Initially in the form of PCIe-based add-on cards, a second generation product, codenamed Knights Landing was announced in June 2013. These second generation chips could be used as a standalone CPU, not just as an add-in card." | ||
gfldex | ingy: what happens if you flip the order of the markers? | ||
moritz | ingy: heredocs start in the line after the q:to, so the second q:to is part of the heredoc contents | 21:59 | |
jnthn | Won't the q:to"...", "Hi", 4; be quoted as part of the first heredoc? | ||
Right, they're about line end, not statement end | |||
ingy | I read somewhere that the content parsing starts after a newline is found | 22:00 | |
oic now | |||
22:00
mcmillhj left
|
|||
ingy | I didn't have a second statement | 22:01 | |
so no ; required | |||
sorry my eyes were playing tricks on me | |||
Geth | doc: c9cce414a1 | (Wenzel P. P. Peppmeyer)++ | doc/Language/quoting.pod6 heredoc parsing is picky |
22:02 | |
perlpilot wonders what the P5 docs say about this | 22:03 | ||
22:03
sena_kun left
|
|||
perlpilot | not much apparently | 22:04 | |
"...and all lines following the current line down to the terminating string are the value of the item." | |||
ingy | when I broke after the 2nd marker, it ran, and I saw Hi and 4 printed and thought I could split the line there | ||
but now I see what happened. sorry for the bother | 22:05 | ||
22:06
as_ joined
|
|||
as_ | rakudo: say 4.roots; | 22:06 | |
camelia | Too few positionals passed; expected 2 arguments but got 1 in block <unit> at <tmp> line 1 |
||
as_ | rakudo: say 4.roots(2); | ||
camelia | (2+0i -2+2.44929359829471e-16i) | ||
as_ | I with Complex numbers use Rats :) | 22:07 | |
22:09
cdg_ joined
22:11
cdg left
22:16
itaipu left
22:19
dct joined,
nadim left
22:20
Ven left
22:27
nadim joined
22:28
mcmillhj joined
|
|||
IOninja | m: class RatComplex is Complex { has Rat $.im; has Rat $.re; }; dd RatComplex.new(4, 0).roots: 2 | 22:28 | |
camelia | (<2+0i>, <-2+2.44929359829471e-16i>).Seq | ||
IOninja | Close enough :P | ||
naxieAlDle | m: say -2.5e+99-2.8e+16i | 22:29 | |
camelia | -2.5e+99-2.8e+16i | ||
IOninja | m: dd 4.0.atan2: 0.0 | 22:31 | |
camelia | 1.5707963267949e0 | ||
IOninja | we'd need a ratty atan2 | ||
22:33
mcmillhj left
|
|||
naxieAlDle | huggable: Life, the Universe and Everything :is: -1.2e+34-5.6e+78i | 22:33 | |
huggable | naxieAlDle, Added Life, the Universe and Everything as -1.2e+34-5.6e+78i | ||
naxieAlDle | oh… | 22:34 | |
huggable: Life, the Universe, and Everything :is: -1.2e+34-5.6e+78i | |||
huggable | naxieAlDle, Added Life, the Universe, and Everything as -1.2e+34-5.6e+78i | ||
SmokeMachine | can I bind a Proxy inside a Variable? | ||
IOninja | m: (42+0i).roots.say | 22:35 | |
camelia | Too few positionals passed; expected 2 arguments but got 1 in block <unit> at <tmp> line 1 |
||
SmokeMachine | m: my $v = Variable.new; $v.var := Proxy.new: FETCH => {42}, STORE => -> $value {} | ||
22:35
espadrine left
|
|||
camelia | 5===SORRY!5=== Error while compiling <tmp> Cannot use bind operator with this left-hand side at <tmp>:1 ------> 3ew: FETCH => {42}, STORE => -> $value {}7⏏5<EOL> expecting any of: postfix |
22:35 | |
IOninja | naxieAlDle: what's it about? | ||
22:35
dct left
|
|||
naxieAlDle | IOninja: nothing, just a number that scares the shit out of me | 22:36 | |
SmokeMachine | better question: how can I, at compile time, set a variable to run a block and get its return as value at run time? | ||
22:39
Voldenet left,
breinbaas joined
22:43
bdmatatu joined
22:44
mcmillhj joined,
Voldenet joined,
Voldenet left,
Voldenet joined
|
|||
SmokeMachine | m: our $val; ENTER {$val = 42}; multi trait_mod:<is>(Variable $a, :$qqq!) {$a.block.add_phaser("ENTER", {$a.var = $val})}; my $ext is qqq; say $ext # some thing like this (←) but the $val will be setted after ENTER... | 22:45 | |
camelia | 42 | ||
22:45
adu left
|
|||
SmokeMachine | m: our $val = 42; multi trait_mod:<is>(Variable $a, :$qqq!) {$a.block.add_phaser("ENTER", {$a.var = $val})}; my $ext is qqq; say $ext # like this ← | 22:47 | |
camelia | (Any) | ||
22:48
st_elmo left,
mcmillhj left,
bdmatatu left
22:49
mcmillhj joined
22:57
cdg joined
22:59
cdg_ left
23:01
sufrosti2o joined
23:02
mcmillhj left,
sufrostico left,
sufrosti1o left
23:03
as_ left
23:04
BenGoldberg joined,
sufrostico joined
23:07
RabidGravy left
23:11
Cabanossi left
23:12
bwisti joined
23:13
Cabanossi joined,
mcmillhj joined
23:15
risou_awy is now known as risou,
bjz left,
girafe left
23:16
n1ce left
23:18
mcmillhj left
|
|||
ingy | moritz, jnthn: were you aware that a heredoc terminator could have a newline in it? gist.github.com/5220054601da6323b4...e7900ce059 | 23:18 | |
ingy wonders how that would play out on Win32 :) | 23:19 | ||
23:20
kurahaupo left
|
|||
IOninja | works fine | 23:23 | |
23:24
kyan left,
wamba left,
mst left
|
|||
IOninja | ingy: I'll raise ya | 23:25 | |
m: say q:to/my $x = 42;say $x/Some thingmy $x = 42;say $x | |||
camelia | Some thing |
||
IOninja | (bot changes  to proper newline) | ||
23:25
aindilis left
23:26
mst joined
|
|||
IOninja | m: say q:to/say q:to「say q:to'heh'」/Hello, World!say q:to「say q:to'heh'」 | 23:29 | |
camelia | Hello, World! |
||
23:29
mcmillhj joined,
aindilis joined
23:30
labster joined
23:32
risou is now known as risou_awy
|
|||
IOninja | m: say q:to/zsay q:to「say q:to'heh'」; my $x = 'AlexDaniel';say "Hi", $x.comb.pick(*);say ":D";my @a = "naxialeDile".comb.shift.pop.shuffle.squish.rand.say;say @a[*-$**];/Hi, naxieAlDle!zsay q:to「say q:to'heh'」; my $x = 'AlexDaniel';say "Hi", $x.comb.pick(*);say ":D";my @a = "naxialeDile".comb.shift.pop.shuffle.squish.rand.say;say @a[*-$**]; | 23:33 | |
camelia | Hi, naxieAlDle! |
||
23:33
mcmillhj left
23:34
cschwenz joined
23:36
movl left
|
|||
cschwenz | so i have a variable, $info, and (via the magic of $info.perl) i have found it contains <anon|123456789098765>.new(key=>"value", ...) | 23:36 | |
how do i access the key/value pairs inside $info? | |||
(as $info{"key"} does not work) | 23:37 | ||
IOninja | cschwenz: they're not keys. That's a class and those are attributes. Try `say $info.key` | 23:38 | |
m: class { has $.key = 'value' }.new.perl.say | |||
camelia | <anon|78142480>.new(key => "value") | ||
cschwenz | :facepalm: thanks! | 23:39 | |
IOninja | m: class { has $.key = 'value' }.new.key.say | ||
camelia | value | ||
IOninja | Yesh, the `.perl` on those sucks ATM. | ||
cschwenz | i should go to bed and tackle this in the morning. :-P | ||
23:40
cschwenz left
|
|||
IOninja | m: class { has $.key = 'value' }.new.Capture{"key"}.say | 23:40 | |
camelia | value | ||
23:40
Cabanossi left
|
|||
IOninja | Magic :P | 23:40 | |
23:43
Cabanossi joined
23:45
mcmillhj joined
23:50
mcmillhj left
23:51
movl joined,
mcmillhj joined
23:56
mcmillhj left
23:59
cdg left,
cdg joined
|