»ö« 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.
00:01 mcmillhj joined, cpage_ joined 00:04 rindolf left 00:05 araujo joined 00:06 mcmillhj left
Geth doc: antquinonez++ created pull request #1336:
Fix broken link, Perl 6 nbsp issue
00:06
00:19 AlexDaniel left 00:34 Sound joined 00:47 mcmillhj joined, kurahaupo__ left 00:48 kurahaupo joined
Geth doc: a43667a050 | (Antonio Quinonez)++ (committed by Zoffix Znet) | doc/Language/performance.pod6
Fix broken link, Perl 6 nbsp issue (#1336)
00:48
00:50 Cabanossi left, kurahaupo_ joined 00:51 kurahaupo_ left, Cabanossi joined, kurahaupo_ joined 00:52 mcmillhj left, kurahaupo left 00:55 kurahaupo_ left, kurahaupo joined 00:56 imcsk8 left, imcsk8_ joined 00:57 kurahaupo_ joined 00:59 kurahaupo left 01:03 mcmillhj joined, geekosaur left 01:06 geekosaur joined 01:09 mcmillhj left 01:10 Sound left 01:14 dj_goku joined, dj_goku left, dj_goku joined 01:17 cdg joined 01:20 dj_goku left 01:26 cdg left, cdg joined
bioduds Hello, friends 01:28
I'm trying to find bitwise operations documentation link
not finding, can you please point me where? 01:29
01:31 Actualeyes joined
Juerd bioduds: At docs.perl6.org/ type "bitwise" to get a list of suggestions 01:37
There doesn't seem to be a document detailing this specifically.
bioduds thank you very much juerd 01:39
yes, I need to rotate, xor and a few others
01:42 mcmillhj joined
bioduds I found shift 01:43
instead of << is +<
>> is +>
xor I found too 01:44
thanks
01:44 ilbot3 left 01:47 mcmillhj left 01:48 ilbot3 joined, ChanServ sets mode: +v ilbot3
Juerd bioduds: All the numeric bitwise operators begin with + 01:48
01:51 mcmillhj joined 01:56 mcmillhj left 02:06 Sgeo left
bioduds great, thanks, juerd :^) 02:07
02:07 Sgeo joined 02:12 cpage_ left 02:15 mcmillhj joined, cpage_ joined 02:20 mcmillhj left
BenGoldberg m: sub foo(&arg (int32 --> num64)) { say 'ok'; pi }; constant Bar = &foo.signature.params[0]; sub baz(Bar $cb) { $cb.() }; baz(&foo); 02:30
camelia Type check failed in binding to parameter '$cb'; expected Parameter but got Sub (sub foo (&arg (int32 ...)
in sub baz at <tmp> line 1
in block <unit> at <tmp> line 1
02:31 mcmillhj joined
BenGoldberg m: sub foo(&arg (int32 --> num64)) { say 'ok' }; constant Bar = &foo.signature.params[0].type; sub baz(Bar $cb) { $cb.(12) }; baz(&foo); 02:33
camelia Type check failed in binding to parameter '&arg'; expected Callable but got Int (12)
in sub foo at <tmp> line 1
in sub baz at <tmp> line 1
in block <unit> at <tmp> line 1
02:34 Cabanossi left 02:35 finanalyst joined
BenGoldberg m: sub foo(&arg (int32 --> num64)) { say 'ok' }; constant Bar = &foo.signature.params[0].type; sub baz(Bar $cb) {}; baz(sub (Str) {}); 02:35
camelia ( no output )
BenGoldberg m: sub foo(&arg (int32 --> num64)) { say 'ok' }; constant Bar = &foo.signature.params[0].type; sub baz(Bar $cb) {}; dd &baz.signature;
camelia :(Callable $cb)
02:36 mcmillhj left, Cabanossi joined
BenGoldberg frowns. 02:36
02:39 cdg left 02:42 cyphase left
pilne ? 02:46
02:47 mcmillhj joined, pilne left 02:48 cyphase joined 02:54 mcmillhj left 02:57 noganex_ joined 02:59 noganex left 03:03 dj_goku joined, dj_goku left, dj_goku joined 03:06 mcmillhj joined 03:08 dj_goku left 03:12 mcmillhj left 03:14 khw left 03:16 xinming left 03:17 xinming joined 03:19 curt_ left, Cabanossi left 03:20 Cabanoss- joined 03:21 Cabanoss- is now known as Cabanossi 03:41 mcmillhj joined, Herby_ left 03:46 mcmillhj left 03:47 Cabanossi left 03:50 luis joined, Cabanossi joined, aborazmeh joined, aborazmeh left, aborazmeh joined 03:56 zoll joined 04:00 zoll left, mcmillhj joined 04:02 KDr2 joined 04:05 mcmillhj left, xiaoyafeng joined
xiaoyafeng hello, i found perl6 can deal: (2-sqrt(3))*(2+sqrt(3)) correctly 04:07
but it can't deal my $m; ($m - $m) 04:08
it throws Malformed initializer 04:09
04:10 zoll joined
zengargoyle m: my $m = 0; say ($m - $m); 04:10
camelia 0
xiaoyafeng but if I don't know what $m is firstly 04:12
I don't want pass a value to $m firstly
zengargoyle exactly, how can you subtract and unknown from an unknown.
xiaoyafeng I just know $m is a rational value 04:13
zengargoyle but if it has no initial value, how can you subtract it from itself?
xiaoyafeng $m could be any value 04:14
$m - $m is 0
zengargoyle an uninitialized Rat is basically the Rat type value and not an actual Rat since it doesn't actually have a value. 04:16
m: my Rat $m; say $m.WHAT; say ($m-$m); say ($m-$m).WHAT;
camelia (Rat)
Cannot look up attributes in a Rat type object
in block <unit> at <tmp> line 1
04:18 Cabanossi left
xiaoyafeng so it there a way to initial a rat, but not actually pass a value? 04:20
04:20 Cabanossi joined
zengargoyle i was trying to remember that bit :) 04:20
hobbs $x - $x == 0 isn't *quite* an identity on Rat, Rat supports NaNs 04:22
zengargoyle but i think it applies more to say an array of Rats or a subclass type of thing.
and wherever you're defining 'my $x' in the first place why not 'my $x = 0.0'? 04:23
hobbs but even leaving that aside, I don't think you can do what you want :) 04:24
zengargoyle or it would be more typing than just assigning the default value with '= 0.0' yoursef.
xiaoyafeng I think it's more like a logic problem, I mean when I declare a Rat, it should be initialized. no matter what I pass to. 04:26
I thought perl6 can handle it because it has lazy evaluation 04:28
zengargoyle that's where i think you could possibly subclass Rat into MyRat or something and have it default to a value.
and hobbs comment ... which would you choose for default? 0.0 or NaN?? 04:30
xiaoyafeng hmmm, that's a idea.... 04:31
hobbs well my point was that there's a value that makes ($m - $m) == 0 false, so it's not correct to replace it with true for a truly unknown $m
xiaoyafeng !!
$m = NaN; $m- $m is equal to NaN
hobbs yes 04:32
xiaoyafeng maybe I have to set default value is 0.0?
hobbs you could, but I would be tempted to say that whatever you're doing it for, is wrong :)
xiaoyafeng yes, it's not what I want 04:33
zengargoyle welcome to Perl6, "I reject your design and substitute my own." :P 04:34
xiaoyafeng :P 04:35
zengargoyle m: my Rat $m .= new; say ($m.Rat - $m.Rat); 04:37
camelia 0
zengargoyle m: my Rat $m .= new; say ($m - $m);
camelia 0
xiaoyafeng great! 04:38
zengargoyle without an initializer it's a type-object, with initializer it's whatever you initialize with, with .=new it's the default value (if any)?/???????
hobbs m: my Rat $m .= new; say $m.perl 04:39
camelia 0.0
xiaoyafeng defalut value still is 0.... ;) 04:40
zengargoyle probabbly boils dow to which of 0, NaN, -NaN?, Inf, -Inf would DWIM. :) 04:42
and the Int vs Rat vs Num vs Numeric or whatever where some are as big as you can think and some are CPU floating point but everything has a 0. 04:44
04:51 dj_goku joined, dj_goku left, dj_goku joined 04:55 zengargoyle left 04:56 dj_goku left, zoll left 04:57 zengargoyle joined 04:59 llfourn joined 05:00 astj joined, astj_ left 05:01 resol joined 05:03 samcv left, Cabanossi left 05:04 samcv joined 05:05 Cabanossi joined 05:10 skids left 05:19 mcmillhj joined 05:20 xiaoyafeng left 05:24 mcmillhj left 05:34 Cabanossi left, geekosaur left 05:35 Cabanossi joined 05:36 geekosaur joined 05:46 xtreak joined 05:56 zapwai left 06:02 ufobat joined 06:03 Cabanossi left 06:05 Cabanossi joined 06:07 mcmillhj joined 06:08 aborazmeh left 06:12 mcmillhj left 06:21 Cabanossi left 06:23 Cabanossi joined, mcmillhj joined 06:28 mcmillhj left, resol left 06:33 Actualeyes left 06:35 parv joined 06:39 mcmillhj joined, dj_goku joined, dj_goku left, dj_goku joined 06:44 dj_goku left 06:47 mcmillhj left 06:49 Actualeyes joined 06:51 darutoko joined 06:55 CacoS joined 06:57 domidumont joined 07:01 domidumont left 07:02 domidumont joined 07:06 Cabanossi left 07:08 kurahaupo joined, kurahaupo left, darutoko- joined, kurahaupo joined 07:09 Cabanossi joined 07:11 darutoko left, kurahaupo_ left 07:12 kurahaupo_ joined, kurahaupo left 07:21 kurahaupo joined, kurahaupo left 07:22 kurahaupo joined 07:23 BenGoldberg left 07:24 kurahaupo_ left 07:26 kurahaupo left, kurahaupo joined 07:30 kurahaupo_ joined, kurahaupo_ left 07:31 kurahaupo_ joined 07:33 kurahaupo left, robertle left, pmurias joined 07:34 kurahaupo joined 07:35 kurahaupo left 07:36 kurahaupo_ left, kurahaupo__ joined 07:48 domidumont left 07:49 darutoko joined 07:52 darutoko- left 07:55 mcmillhj joined 07:57 lowbro joined 08:00 darutoko left 08:01 mcmillhj left, simonm left 08:06 zakharyas joined, Cabanossi left 08:09 xtreak left, Cabanossi joined 08:10 xtreak joined 08:11 mcmillhj joined 08:13 xtreak left, xtreak joined 08:15 cdg joined 08:16 mcmillhj left 08:18 nadim joined 08:21 g4 joined, g4 left, g4 joined 08:23 bacek_ left, bacek_ joined 08:27 dj_goku joined, dj_goku left, dj_goku joined, mcmillhj joined 08:32 dj_goku left 08:34 mcmillhj left 08:41 rindolf joined 08:47 mcmillhj joined 08:52 mcmillhj left 08:53 Cabanossi left, cpage_ left 08:54 Cabanossi joined 08:56 imcsk8_ left, Cabanossi left, Cabanossi joined 08:57 Cabanossi left 08:59 Cabanossi joined 09:00 Cabanossi left 09:02 Cabanossi joined 09:03 mcmillhj joined 09:06 xtreak left, xtreak joined, robertle joined 09:11 mcmillhj left 09:13 imcsk8 joined, cdg_ joined 09:15 cdg left 09:21 xtreak left 09:22 xtreak joined 09:26 xtreak left
avalenn m: my $matcher = regex {'c' .*}; 'abcd' ~~ /'c' .*/ ; say $/ ; for 1 {'bcde' ~~ $matcher; say $/ ;} 09:26
camelia 「cd」
「cde」
Geth specs: 5c9262e200 | (Stefan Seifert)++ | S22-package-format.pod
Uniquify headlines in S22 to work around a rendering bug in design.perl6.org

The renderer seems to add the contents of the completely separate "bin" sections.
09:27
09:27 xtreak joined 09:30 cdg_ left 09:32 cyphase left 09:37 cyphase joined 09:39 itaylor57 left
finanalyst trying to debug, but perl6-debug is not recognised. tried perl6-debug-m but Debugger::UI::CommandLine not recognised. tried "zef install Debugger::UI::CommandLine" and get 'entity not recognised'. 09:46
how to debug?
forget above. Typo in terminal. 09:48
But standard info on debugging says: type perl6-debug, but that does not work 09:49
avalenn m: my $matcher = regex {'c' .*}; 'abcd' ~~ /'c' .*/ ; say $/ ; for 1 {'bcde' ~~ $matcher; say $/ ;} 09:57
camelia 「cd」
「cde」
09:58 cpage_ joined
moritz finanalyst: define "does not work" 10:02
oh, never mind 10:03
finanalyst: one thing you could try is cloning github.com/jnthn/rakudo-debugger and in the clone to "zef install ."
zengargoyle i think that's what i'll miss from Task::Star, a few common things you're going to want pretty soon after install in one simple 'zef install Task::Whatever'. 10:10
and sorta thinking of debian apt where auto-installed dependencies are different than requested packages. if ever there's a zef command to remove something and the things that it used that aren't used by anything else but that you actually use all the time in one-liners or just have come to expect to be available. 10:13
10:13 finanalyst left 10:15 dj_goku joined
zengargoyle maybe a Task::MyFavs which really just reads your ~/.myfavs.txt and installs them. :) 10:18
or like the p5 Task::BeLike:: namespace. 10:19
10:21 dj_goku left 10:29 AlexDaniel joined
stmuk a Task::Meteor which just had docs and debuggers might be easy to maintain 10:31
nadim m: my $j = 1 | 'a' | True ; my $s = set (1, 'a', True, $j) ; dd $s 10:32
camelia Set $s = set(1,"a",any(1, "a", Bool::True),Bool::True)
10:33 gregf_ joined
nadim am I wrong or is dd displaying the elements in the wrong order? 10:33
I am expecting 1, a, True, and then the junctpion 10:34
zengargoyle pretty sure Sets are un-ordered 10:35
moritz junctions aren't ordered
and sets too, right
nadim ok
zengargoyle i'm also pondering writing some p5 that groks p6 stuff (modules mostly) because i miss bash tab completion types of things. 10:36
like perldod <TAB> <TAB> is a nice way to browse installed modules for documentation. 10:37
s/dod/doc/
nadim sets and junctions are not the most fun things to dump; so far Data::Dump::Tree does not support them, could anyone point to where dd or gist handle them? maybe I get an idea there. 10:38
zengargoyle and i'm on dsl so all the network stuff + p6 still a bit slow .... sorta stars to drive me a bit batty every so often.
moritz nadim: dd seems to handle them in the example you gave above, no?
nadim yes it does, Data::Dump::Tree does not and I'd like to have a look at how dd does it 10:39
zengargoyle really wants to bust out a 'use the source nadim' but it's not 5/25 anymore. 10:41
get the rakudo src and start looking: src/core/Any.pm line 590:sub dd(|) { 10:45
moritz and I guess it ends up calling .perl
10:49 zakharyas1 joined 10:51 marcovorg joined
zengargoyle yeah, dd is like 18 lines but does use nqp but otherwise not that complicated. 10:52
10:59 astj left 11:00 astj joined 11:02 xtreak left 11:05 astj left 11:06 kurahaupo__ left, kurahaupo joined 11:08 astj joined 11:10 bjz joined 11:16 zakharyas1 left 11:20 parv left 11:22 Cabanossi left 11:24 zakharyas left, Cabanossi joined 11:25 zakharyas joined 11:27 zakharyas1 joined 11:30 zakharyas left 11:31 KDr2 left 11:36 gdonald left 11:40 Cabanossi left, Cabanossi joined
nebuchadnezzar interesting that perl6maven.com/interactive-perl6 does not speak about “@” and “%” sigils and use only “$” 11:42
11:44 CacoS left
AlexDaniel nebuchadnezzar: yea, weird. But you are free to do that if that's what you're into :) 11:45
you'll still have to use @ sometimes
m: my $x = [‘a’, ‘b’, ‘c’]; for @$x { .say }
camelia a
b
c
AlexDaniel m: my $x = [‘a’, ‘b’, ‘c’]; for $x { .say }
camelia [a b c] 11:46
AlexDaniel well… or any other way
m: my $x = [‘a’, ‘b’, ‘c’]; for $x.list { .say }
camelia a
b
c
11:51 astj left 11:57 bjz left
zengargoyle at least it's not my \x 'cause python is cool and sigils are noise. 11:57
El_Che moritz: how is the book going? 11:58
11:58 xtreak joined 11:59 raschipi joined 12:02 unixms joined 12:04 dj_goku joined, dj_goku left, dj_goku joined 12:05 araraloren joined, wamba joined 12:08 astj joined 12:09 dj_goku left, unixms left
araraloren afternoon 12:10
raschipi hi araraloren 12:12
araraloren hi raschipi :) 12:13
12:13 eliv joined 12:14 Zoffix joined 12:15 bjz joined 12:16 mcmillhj joined, sufrosti1o left
Zoffix FWIW, hashes, sets, bags, and mixes are unordered only in list "view". If you print or .perl them they *are* ordered (if you ignore the current bug where sets aren't) 12:16
12:16 sufrostico left 12:17 sufrosti2o left 12:18 domidumont joined
raschipi Yeah, they call .sort before printing 12:18
12:20 mcmillhj left
araraloren ?_? 12:22
zengargoyle araraloren: i guess Zoffix is talking about the previous discussion of how dd prints things out. 12:24
12:25 fatguy joined
Zoffix That's the only recent discussion involving hashes and ordering :/ 12:26
zengargoyle assuming araraloren's ?_? was from just joining. 12:27
Zoffix What stood out more to me in the maven article aren't the sigils but the excessive use of .WHAT as a means to inspect the type. It's not really a versatile or reliable way, as I explained in a comment: www.reddit.com/r/perl/comments/6df...s/di2g70s/ 12:28
araraloren It's better to be consistent, why not sort it .
[Coke] if you want it sorted, why not sort it explicitly? 12:29
Zoffix [Coke]: why sort it explicitly if we can sort it for the user? 12:30
[Coke] because sorting ain't free.
12:30 curt_ joined
[Coke] but I don't have a strong objection. 12:30
zengargoyle also suprised that set and other like things do sort on .perl 12:31
raschipi The article also uses the { } hash contructor, but the recommended way is the %( ) constructor
zengargoyle or *supposed* to
Zoffix [Coke]: if you worry about such minute things, listify your hash and print it unordered
Most humans would prefer their ouput not randomized willy-nilly
Ah, finally found the ticket. And the ordering was TimToady's ruling: rt.perl.org/Ticket/Display.html?id...et-history 12:32
fatguy i got 'Cannot find method 'setlang' on object of type Perl6::HookGrammar' when running perl6-debug-m using Rakudo v2017.04.3, any idea?
raschipi So, .Str doesn't guarantee the order?
Zoffix fatguy: perl6-debug-m is bitrotten. There's a way to fix the setlang thing (I think it's fixed on HEAD alreadY), but there are more problems
raschipi: it does 12:33
And is: github.com/rakudo/rakudo/blob/f2fc...Map.pm#L48
fatguy Zoffix: thanks!
zengargoyle bows to authority. :P 12:34
12:34 domidumont left
Zoffix \o 12:35
12:35 Zoffix left
raschipi I agree that the quick and easy methods should do the right thing. Anyone wanting better performance can squeeze it themselves. 12:35
araraloren Em, Actually for me, anyway that behavior should be clear in document .
Then that's fine. 12:36
12:36 Sound joined
zengargoyle but guess if the machine doesn't care reading it back in, if it's human readable, tend to do the easy human thing. 12:36
i feel scary ghosts of when p5 started randomizing hash order and things broke. 12:37
but .gist and .perl aren't the same as .list so it's all good. 12:38
bioduds hello friend
hello friends
AlexDaniel o/
bioduds I'm currently translating a .c algorithm to perl6 12:39
could you guys help me with this part here?
what would be the equivalent in perl6 for this: memcpy( ( void * ) ( S->buf + left ), ( void * ) in, fill );
araraloren ~~ yeah, What's the problem
bioduds a simple assignment? 12:40
zengargoyle what is fill ?
araraloren void* => Pointer[void], size_t => size_t
bioduds fill is an Int 12:41
araraloren Have you read this ?
docs.perl6.org/language/nativecall...d_Pointers
The NativeCall document
zengargoyle what is this in plain copy(src, dst)? 12:42
bioduds let me see if I understood
I would have construct the c in the perl and it would execute
right? 12:43
copy is a perl funcion?
function? 12:44
if it is I guess it is what I want
araraloren It's for file copy.
copy(srcfile, destfile) 12:45
perlpilot bioduds: could you put the C code somewhere everyone can see?
zengargoyle i'm unsure whether you're trying to call nativecall type stuff (actually calling out to a C .so library) or just messing with a buffer of bytes in perl.
bioduds I could do, for instance: copy( $s512.buf + $left, $in, $fill );
araraloren yeah. We dont's know what yuor plan.
perlpilot bioduds: also, Perl doesn't really have a low-level memcpy() operation.
bioduds yes, here is the link
github.com/veorq/BLAKE/blob/master/blake512.c line 94 12:46
I'm implementing this algorithm in perl6
[Coke] I had assumed not a slavish copy of the low level with nativecall, but a "pure perl" approach was the question.
12:46 xtreak left
perlpilot bioduds: if you want to copy chunks of memory around, that feels like you want to be manipulating either a Buf 12:47
araraloren Oh, Then you probably don't need NativeCall
bioduds I am first making a raw copy as close as it can get
yes araraloren probably
perlpilot s/either//
bioduds that is quite my question
I can simply assign the value?
araraloren bioduds, you can use a `Buf` as a buffer
bioduds in order to copy the binary data? 12:48
araraloren Yeah
bioduds ok, I'll try that approach
thanks araraloren
araraloren Buf: Mutable buffer for binary data 12:49
The document said that: docs.perl6.org/type/Buf
moritz El_Che: it's going quite well; I'll probably hand in the final[tm] manuscript this month 12:50
[Coke] moritz++ 12:51
El_Che moritz: glad to hear it
12:52 xtreak joined 12:54 mcmillhj joined 12:55 yqt joined 12:57 fatguy left 12:58 ugjka is now known as ugjkatest, ugjkatest is now known as ugjka
moritz [ptc]++ is doing some final proof-reading 13:00
and I'm hoping for a contribution by TimToady++ as well :-)
perlpilot moritz: congrats on the near completion of your book :) 13:01
13:02 finanalyst joined
bioduds noobie question: is there casting in Perl6? 13:02
like (int)var for instance
moritz $var.Int
bioduds oh, thanks moritz
moritz m: say "42".Int.perl
camelia 42
13:05 ugjka is now known as ugjkatest, ugjkatest is now known as ugjka
araraloren m: say "23".Int 13:05
camelia 23
13:05 xtreak left 13:07 kyan left
zengargoyle bioduds: it sounds like you want to read some bytes from fileA and some bytes from fileB and overwrite the bytes from fileB into the bytes from fileA at +offset from the beginning of the bytes of fileA and then maybe write them back out? 13:10
El_Che Hi, I wrote a blog post about the lib ecosystem (and CPAN). I don't want to troll, so comments welcome: gist.github.com/nxadm/1b62f7d341a0...87b8ad19a2 13:13
13:17 cdg joined
raschipi El_Che: I think the testing and the good documentation aspects come from CPAN, actually. Perl6 is going to have CPAN-Testers support, and the module front-page in CPAN being the POD includded in the module will lead people to do the same things as P5 devs did. 13:23
El_Che raschipi: eventually, yes 13:24
(I agree, maybe I need to clarify that)
the point is that's not enough
raschipi It also didn't happen imediatelly for P5. Polishing things take time. 13:25
El_Che yes, that's what I think
brb
coffee break
colleages at my door
raschipi Let me get one too.
13:27 mspo joined
finanalyst moritz: are you still online? 13:36
moritz: I recently installed the latest raduko using rakudobrew. I tried 'perl6-debug'. error 'no such file'. In .rakudobrew/bin directory, I found perl6-debug-m, but not perl6-debug 13:39
Hence perl6-debug does not work 13:40
araraloren It's no perl6-debug, I think 13:41
finanalyst I tried perl6-debug-m, after installing jnthn's debugging module. But I get an 'ast' error.
araraloren: seems so. But then where is perl6-debug?
raschipi perl6-debug-m is bitrotten 13:42
araraloren I dont' know, I install Perl6 from source, there no perl6-debug in **bin** directory
raschipi the name of the command is perl6-debug-m but it doesn't work 13:43
moritz finanalyst: the 'ast' error is probably the most interesting part 13:44
if there's no bug report yet for that, might be worth opening one
finanalyst last version of rakudo had a perl6-debug executable
moritz: pastebin.com/Kb5Q0B4p 13:47
doesnt seem interesting error message to me. 13:48
masak has anyone else been confused by the fact that in the Perl world, we tend to talk about "parameters"/"arguments", but in many other communities (especially in CS), they're "formal parameters"/"actual parameters" ? 13:50
perlpilot masak: not confused, but obviously noticed the difference 13:52
13:52 dj_goku joined, dj_goku left, dj_goku joined
finanalyst moritz: I get exactly the same error for any program, even say 'hello world; 13:52
'hello world';
perlpilot though I remember the parameters/arguments distinction from C too
moritz finanalyst: then, as raschipi has said, the debugger seems to be bitrotten 13:54
finanalyst so no debugger :(
13:57 dj_goku left
zengargoyle LOL 13:59
m: my Buf $dst .= new(1..10); my Buf $src .= new(15,15); my $foo = $dst.contents.Array; my $bar = $src.contents.Array; splice $foo, 4, $bar.elems, $bar; $dst = Buf.new($foo); say $dst;
camelia Buf:0x<01 02 03 04 0f 0f 07 08 09 0a>
14:00 khw joined
zengargoyle for want of splice or substr-rw on Buf 14:01
bioduds: that's my memcpy :P 14:02
14:09 lostinfog joined, lostinfog left 14:11 skids joined 14:15 pmurias left
zengargoyle masak: i recently stumbled over argument/parameter for a moment. but with defaults and casting and pass-by-value it sorta makes sense that they're two differnt things besides formal/actual. 14:15
arguments are what you send, parameters are what you get
masak zengargoyle: I think the difference is literally only in naming
I mean, I agree with you because I also use the word "arguments" 14:16
but... the people who call them "actual parameters" just have a different way to spell "arguments" :)
zengargoyle i can see that but might then drop the 'formal' part. 14:17
jnthn I found the Perl 6 one stuck in my head a lot better. :)
In general though, using "parameters" or "arguments" handwavily works a huge amount of the time because the context makes it obvious :) 14:18
14:20 kurahaupo_ joined
zengargoyle i mostly forget which is which. 14:20
raschipi Go by the definition of parameter: "A parameter, generally, is any characteristic that can help in defining or classifying a particular system". "Argument" doesn't mean that. 14:22
zengargoyle which side of the system are you looking from? 14:23
the caller or the callee 14:24
raschipi And arguments here are close to the mathematical definition, which is the input for a function. 14:25
The argument of a function is the independent variable. 14:26
14:32 kurahaupo_ left 14:40 alimon left
bioduds thanks friends 14:40
curt_ m: class A { multi method new(Rat $x) {}; multi method new(Int $x) {} }; A.new('this'); 14:42
camelia Default constructor for 'A' only takes named arguments
in block <unit> at <tmp> line 1
curt_ That message is correct, but doesn't really nail the problem that I'm calling the constructor with incorrect positional arguments.
14:43 Zoffix joined
Zoffix m: class A { proto method new (|) {}; multi method new(Rat $x) {}; multi method new(Int $x) {} }; A.new('this'); 14:43
camelia ( no output )
Zoffix reaally
jnthn haha 14:44
Zoffix Why doesn't it explode?
jnthn That proto doesn't delegate to the candidates :)
Zoffix Ah LOL
m: class A { proto method new (|) {*}; multi method new(Rat $x) {}; multi method new(Int $x) {} }; A.new('this');
camelia Cannot resolve caller new(A: Str); none of these signatures match:
(A $: Rat $x, *%_)
(A $: Int $x, *%_)
in block <unit> at <tmp> line 1
Zoffix There :)
curt_: ^ without the proto you get the proto that also has the Mu.new candidates, so they end up handling the case and give wrongish error
curt_ I still want to allow Mu.new with named args. I should still make a proto method new? 14:46
Zoffix curt_: ah, I would just make a candidate that takes nameds 14:47
MasterDuke zengargoyle: Buf does have splice 14:48
curt_ Zoffix: thanks
MasterDuke m: my Buf $dst .= new(1..10); dd $dst; my Buf $src .= new(15,15); $dst.splice(2, 0, $src[3..5]); dd $dst;
camelia Buf $dst = Buf.new(1,2,3,4,5,6,7,8,9,10)
Buf $dst = Buf.new(1,2,0,0,0,3,4,5,6,7,8,9,10)
Zoffix m: class A { has $.bar; proto method new (|) {*}; multi method new(Rat $x) {}; multi method new(Int $x) {}; multi method new(*%_) { self.bless: |%_ }; dd A.new('this'); dd A.new: :42bar
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3_ }; dd A.new('this'); dd A.new: :42bar7⏏5<EOL>
expecting any of:
postfix
statement end
statement modifier
stateme…
Zoffix m: class A { has $.bar; proto method new (|) {*}; multi method new(Rat $x) {}; multi method new(Int $x) {}; multi method new(*%_) { self.bless: |%_ } }; dd A.new('this'); dd A.new: :42bar
camelia Cannot resolve caller new(A: Str); none of these signatures match:
(A $: Rat $x, *%_)
(A $: Int $x, *%_)
(A $: *%_)
in block <unit> at <tmp> line 1
Zoffix m: class A { has $.bar; proto method new (|) {*}; multi method new(Rat $x) {}; multi method new(Int $x) {}; multi method new(*%_) { self.bless: |%_ } }; dd A.new: :42bar 14:49
camelia A.new(bar => 42)
Zoffix curt_: ^ that seems to do the trick
zengargoyle MasterDuke: frak me 14:50
i think i got lost somewhere when splice returned the spliced bit and went on a long chase.
Zoffix BTW, it's Buf.splice isn't documented: docs.perl6.org/routine/splice 14:51
Oh, and basically untested: perl6.wtf/SETTING__src_core_Buf_pm....html#L503 14:52
zengargoyle that may be it. i *did* look at what docs said and tried anyway and figured it just wasn't the thing i wanted.
and did WTF Buf are so crippled to not support almost obvious thing! 14:53
14:53 Sound left
zengargoyle lol 14:53
Zoffix There's also subbuf-rw(
zengargoyle tried that to. 14:54
14:54 Zoffix left
zengargoyle oh, maybe not.. but sorta tried subst* stuff. 14:54
zengargoyle now blames docs. :P
curt_ Module UUID uses .roll() to generate 16 bytes of randomness to make globally unique UUIDs Is that suitable high quality randomness?
15:02 alimon joined 15:10 bjz left 15:11 fatguy joined, bjz joined 15:12 eliv left 15:15 eliv joined
zengargoyle curt_: i'd guess it used /dev/urandom (or equiv on your system). 15:15
curt_ That's the question -- does it always use /dev/urandom, or does it take a seed from that and use a pseudo-random generator subsequently 15:16
El_Che raschipi: thx for the input
raschipi -- /dev/random and /dev/urandom both use a pseudo-random generator. 15:19
zengargoyle curt_: i tried grepping nqp/MoarVM/rakudo and it looks to me like it relies on libtommath.... github.com/libtom/libtommath ... probably for a variety of mathy stuff. quick look seems to imply /dev/urandom-like or provie your own PRNG. there's also some mention of ARC4 so maybe a seed and a crypto generator. 15:20
15:21 bjz left
zengargoyle i'd guess it's at that point where we rely on some porable 3rd party libraries to do the cross platform heavy lifting. 15:22
curt_ ok thanks 15:24
zengargoyle maybe ask in perl6-dev or reddit or somewhere... i too would like a more qualified answer since .roll() picks my lotto numbers. :) 15:25
15:27 unixms joined
curt_ I trust it and honestly believe it will work fine and make perfectly good UUIDs. But I'm making bindings for libuuid anyway, just for fun. ;-) 15:27
Geth doc: antquinonez++ created pull request #1337:
Edits to performance.pod6
15:28 g4 left 15:30 ufobat left
araraloren Cool! Making a module, study from it, get fun from it :) 15:31
zengargoyle curt_: tommath uses arc4random() or rand() depending on platform support. 15:33
raschipi libuuid also has support to generating a lot of UUIDs. 15:34
15:36 devmikey joined
curt_ The linux kernel will also make good UUIDs for you `cat /proc/sys/kernel/random/uuid` 15:37
zengargoyle and linux has an arc4.ko kernel module... so.. i'm sorta guessing it boils down to platfrom best available....
araraloren UUID has 5 version the wiki said.
Night, gotta sleep now. Zzz o/ 15:39
15:39 araraloren left 15:40 dj_goku joined, dj_goku left, dj_goku joined 15:42 hythm left 15:45 dj_goku left 15:47 hythm joined 15:48 cdg left 15:54 unixms_ joined
unixms_ logout 15:55
15:55 unixms_ left, unixms_ joined 15:57 unixms_ left 15:58 unixms_ joined 15:59 unixms_ left, unixms_ joined
Geth doc: 68be3615a6 | (Steve Mynott)++ | doc/Type/Promise.pod6
the the -> the
15:59
16:00 unixms_ left, zakharyas1 left 16:09 unixms left
Geth ecosystem: 91a61347ed | (Curt Tilmes)++ | META.list
Add LibUUID

See github.com/CurtTilmes/perl6-libuuid
16:10
16:11 mcmillhj left, mcmillhj joined 16:16 finanalyst left 16:17 Actualeyes left 16:21 travis-ci joined
travis-ci Doc build errored. Steve Mynott 'the the -> the' 16:21
travis-ci.org/perl6/doc/builds/236429410 github.com/perl6/doc/compare/a4366...be3615a6b6
16:21 travis-ci left, lowbro left 16:22 setty1 joined
stmuk not my fault! 16:28
IO::String fail 16:29
16:29 eliv left 16:39 brrt joined 16:41 Actualeyes joined 16:45 itaylor57 joined 16:46 robertle left 16:56 Sound joined 16:59 domidumont joined 17:12 brrt left 17:17 robertle joined 17:21 wamba left 17:26 raschipi left, fatguy left 17:27 fatguy joined 17:28 dj_goku joined, dj_goku left, dj_goku joined, camelia left 17:29 camelia joined 17:30 ChanServ sets mode: +v camelia 17:34 dj_goku left
fatguy how to do "a01" .. "a11" range correctly in p6 ? 17:34
AlexDaniel m: .say for ‘a01’, *.succ … ‘a11’ 17:35
camelia a01
a02
a03
a04
a05
a06
a07
a08
a09
a10
a11
MasterDuke m: say "a01", "a02" ... "a11"
camelia (a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11)
17:39 ChoHag left
fatguy thanks! why it can't be implemented as simple as in p5 ? 17:41
what is this -> *.succ
perlpilot I'm curious why 'a01' ... 'a11' doesn't work. I thought the default *was* to use *.succ 17:42
hahainternet how is it simpler in perl5? 17:43
perlpilot fatguy: *.succ is the same thing as { $_.succ } and .succ is a method that generates the "successor" to the object it is used upon
[Coke] .. != ...
perlpilot m: say "a01".succ; # a02 is the successor to a01 17:44
camelia a02
[Coke] hahainternet: you don't need to say "a02" or it's equiv. as they did in the examples above, IIRC. 17:46
fatguy hahainternet: in p5 we can just do 'a01'..'a11'
[Coke] *its
fatguy perlpilot: thanks !
17:47 japhb joined
hahainternet i'm surprised that works correctly in 5 but not in 6 17:47
probably the only case i've ever seen!
fatguy me too !
hahainternet it's probably a bug (probably) 17:48
perlpilot P5 overloads .. quite a bit, P6 tries to keep it simpler.
but still ....
hahainternet
perlpilot m: .say for "a01" ... "a11"; # this has to be a bug
camelia a01
a11
17:49 sufrostico joined
MasterDuke m: .say for "a" ... "d" 17:50
camelia a
b
c
d
17:50 Zoffix joined
Zoffix perlpilot: it moves each char individually, so 0 goes to 1 and it's done 17:50
MasterDuke i think ... can only figure out from two terms in the very trivial cases
Zoffix is looking into IO::String failurage
MasterDuke m: .say for "a01" ... "a15" 17:51
camelia a01
a02
a03
a04
a05
a11
a12
a13
a14
a15
17:51 brrt joined
Zoffix 1->5 for 0; 1->5 for 1; it's done 17:52
MasterDuke m: .say for "a01" ... "a21"
camelia a01
a11
a21
Zoffix m: say ("foo000.txt" ... "foo999.txt").head: 10
camelia (foo000.txt foo001.txt foo002.txt foo003.txt foo004.txt foo005.txt foo006.txt foo007.txt foo008.txt foo009.txt)
Zoffix ^ usecase
fatguy: it probably could, but it's the case of many volunteers working on this at different times. The string range is kinda iffy, though TimToady seems to grok it well 17:54
perlpilot That's saying more about the semantics of *.succ than anything else I think
Zoffix mhm 17:55
perlpilot as I understand it, if there's a single item on the LHS, it uses *.succ to obtain the next item and compare with the RHS. In this instance, I think it doesn't do that.
m: "a01".succ.say
camelia a02
17:55 bacek_ left
AlexDaniel perlpilot: I'm shocked as well 17:55
17:56 bacek_ joined
Zoffix perlpilot: it's more involved. 17:56
AlexDaniel I decided to stay away from stringy ranges, it's just better this way for my mental health
(or sequences)
Zoffix I still have "read SEQUENCE source and document all cases" on my todo list. I'm sure there is nice and simple overall picture.
Sure, it's easy to poke random crap into the machine and be "socked" at the result :) 17:57
s: &SEQUENCE
334 lines it is: github.com/rakudo/rakudo/blob/95b4...#L112-L436
Looking at all that nested bracing, feels like it could be made faster with a bit of nqp glue :) 17:58
AlexDaniel it's easy to read the source, understand it and then use this unpredictable crap in your code. I'd much rather not.
Zoffix pfft
AlexDaniel on a slightly related note, RT #129131 17:59
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=129131
Zoffix tl;dr
wonder if I agree with ticket-Zoffix tho :P
AlexDaniel tl;dr “Agreed, that's weird. I'm unsure why it's counting down and is indeed "too smart" for what I'd expect it to do.” 18:00
basically summarizes the whole thing, even though it wasn't said about the whole thing
fatguy m: say ("node01abc" ... "node19abc").head: 11
camelia (node01abc node02abc node03abc node04abc node05abc node06abc node07abc node08abc node09abc node11abc node12abc)
Zoffix boo; all this waiting and doc build still fails on latest rakudo
AlexDaniel: I think current Zoffix thinks we should burn string Ranges with fire, then split Range to int and non-int and that would be nice :) 18:01
AlexDaniel Zoffix: can you elaborate on the “split Range to int and non-int” part? 18:02
18:03 cygx joined
Zoffix AlexDaniel: basically we have ~18 conditionals checking if the range $!is-int: github.com/rakudo/rakudo/blob/nom/...e/Range.pm 18:03
perlpilot AlexDaniel: strings are split up into sections and each section is incremented independently.
Zoffix So feels like it's aching to split up into int and non-int range and get rid of those conditionals
18:04 travis-ci joined
travis-ci Doc build errored. Steve Mynott 'the the -> the' 18:04
travis-ci.org/perl6/doc/builds/236429410 github.com/perl6/doc/compare/a4366...be3615a6b6
18:04 travis-ci left
AlexDaniel by “int” do you mean numeric? :) 18:04
Zoffix No
AlexDaniel okay
Zoffix m: dd (1..10).is-int
camelia Bool::True
cygx another surprise (at least to me): ranges *normally* don't go backwards, eg
18:04 nadim left
cygx m: say @("9".."1") 18:04
camelia ()
Zoffix ^ by int I mean all ranges that return True for .is-int
cygx they do if you have two chars:
m: say @("09".."11") 18:05
camelia (09 08 07 06 05 04 03 02 01 19 18 17 16 15 14 13 12 11)
Zoffix cygx: IIRC that case gets passed on to `...`
AlexDaniel m: dd (0..∞).is-int
camelia Bool::False
AlexDaniel Zoffix: well, I'll take that 18:06
cygx looks to me like an unbalanced WAT to DWIM ratio 18:07
Zoffix There's another surprise in Ranges BTW
m: say (2e200 .. 2e300)[^10] 18:08
camelia (2e+200 2e+200 2e+200 2e+200 2e+200 2e+200 2e+200 2e+200 2e+200 2e+200)
Zoffix :)
AlexDaniel the only DWIM about it is “ha, I can generate filenames!”
Zoffix There's more weird cases there were you start excluding the end point and stuff
cygx only if you do so very carefully
m: say @("01".."20")
camelia (01 00 11 10 21 20)
AlexDaniel and some of this shit is just flat out wrong 18:09
Zoffix Oh, and I don't know offhand the codepoints, but there are infinite loops inside certain ranges, because a codepoint further down the range normalizes to an earlier codepoint, so it keeps looping in that area when you try to reify it
AlexDaniel m: say (0..-∞).reverse[^10]
camelia (Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf)
Zoffix AlexDaniel: and what's right?
That's just a bug 18:10
Also, we seem to be talking about .. and ... interchangeably
AlexDaniel you're right, you're right
that said, I wouldn't be wrong to say that most people will expect them to behave more or less similarly 18:11
Zoffix Yeah, it's in my todo list
Along with "Fix Inf..Inf and Inf...Inf producing infinite seqs" "Also fix .minmax for (Inf..-Inf).minmax.say giving Inf, -Inf" and "Also fix (1..Inf).int-bounds; that makes [+] 1..* fail weirdly"
18:11 Sound left
Zoffix m: dd [+] 1..* 18:12
18:12 Sound joined
camelia (timeout)WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was:
Cannot coerce Inf to an Int
in block <unit> at <tmp> line 1
18:12
MasterDuke heh. a case of TMI 18:13
AlexDaniel TMI?
MasterDuke too much information
"Cannot coerce Inf to an Int␤ in block <unit> at <tmp> line 1" was useful, but the rest wasn't 18:14
Zoffix would be cool if zef's `look` command carried over your ENV :/ 18:16
18:17 inokenty left
Zoffix looks like IO::String got quite busted out with the encoding refactor; 'cause it relies on .lines being implemented in terms of .get 18:22
Gonna make an IO::UFO module soonish, so people could use it to make custom handles instead of hacking up everything or relying on specific configuration of guts... 18:23
also has a bug "my $x = IO::String.new: :buffer("hello-world"); say $x.get" "No such method 'key' for invocant of type 'Num'" 18:25
AlexDaniel oh… I just realized… 18:30
that you can .reverse string ranges too
AlexDaniel nnnnNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOooooooooooooooooooooooooo
mst AlexDaniel is haunted! 18:32
18:32 dwarring joined
AlexDaniel well, the whole .reverse thing is broken 18:34
18:36 khw left
Zoffix m: sub foo($lines? is copy) { $lines = Inf if not $lines.DEFINITE or $lines === *; dd $lines }; foo 42 18:36
camelia Num $lines = Inf
Zoffix makes a face
Ah, I see
m: sub foo($lines? is copy) { $lines = Inf if not $lines.DEFINITE or $lines === Whatever; dd $lines }; foo 42
camelia Int $lines = 42
Zoffix is too used to nqp::istype() :)
still not it... now do I do nqp::istype($foo, Whatever)? 18:38
m: sub foo($lines? is copy) { $lines = Inf if not $lines.DEFINITE or $lines ~~ Whatever; dd $lines }; foo * 18:39
camelia Num $lines = Inf
Zoffix m: sub foo($lines? is copy) { $lines = Inf if not $lines.DEFINITE or $lines ~~ Whatever; dd $lines }; foo 42
camelia Int $lines = 42
Zoffix k
18:39 cygx left 18:44 khw joined
Zoffix ugh... Fixed the two IO::String bugs, but hit on Rakudo bug >_< 18:51
m: my $p = :42a; say $p ~~ Inf
camelia Cannot resolve caller Numeric(Pair: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
Zoffix c'mon, bruh
.tell hoelzro Sent you a PR fixing a couple of bugs; an old one in .get() and a new one in .lines due to latest Rakudo encoding refactor no longer using .get for .lines; github.com/hoelzro/p6-io-string/pull/8 18:56
yoleaux Zoffix: I'll pass your message to hoelzro.
Zoffix ^ that fixes the doc build
18:56 dct joined
Zoffix flies away into the sun, cape flapping in the wind 18:56
18:56 Zoffix left 18:58 brrt left 19:00 pilne joined 19:01 ChoHag joined
dwarring p6: "tst.txt".IO.spurt([~] 'a' .. 'z'); my $ioh = "tst.txt".IO.open(:r); say $ioh.read(4); $ioh.seek(1, SeekFromCurrent); say $ioh.read(4); 19:01
camelia Blob[uint8]:0x<61 62 63 64>
Blob[uint8]:0x<>
dwarring bisect: "tst.txt".IO.spurt([~] 'a' .. 'z'); my $ioh = "tst.txt".IO.open(:r); say $ioh.read(4); $ioh.seek(1, SeekFromCurrent); say $ioh.read(4); 19:02
bisectable6 dwarring, Bisecting by output (old=2015.12 new=95b4e5d) because on both starting points the exit code is 0
19:05 jeek left
MasterDuke AlexDaniel: ^^^ 19:06
19:07 bisectable6 left
dwarring anyway, nothing returned from second read after seekFromCurrent 19:08
Recent regression. I'll put in an RT
19:12 bisectable6 joined, ChanServ sets mode: +v bisectable6
AlexDaniel blargh 19:14
again?
bisect: "tst.txt".IO.spurt([~] 'a' .. 'z'); my $ioh = "tst.txt".IO.open(:r); say $ioh.read(4); $ioh.seek(1, SeekFromCurrent); say $ioh.read(4); 19:15
bisectable6 AlexDaniel, Bisecting by output (old=2015.12 new=95b4e5d) because on both starting points the exit code is 0
AlexDaniel, bisect log: gist.github.com/1b6f1bdabefa1cb133...1abceea153
AlexDaniel, (2017-05-25) github.com/rakudo/rakudo/commit/93...8133f8f22e
AlexDaniel dwarring: ↑ ?
19:16 rindolf left 19:17 dj_goku joined, dj_goku left, dj_goku joined, domidumont left 19:19 alimon left 19:20 Zoffix joined
Zoffix dwarring: you're missing :bin on open 19:20
dwarring: oh wait, I think .read is still supposed to work in non-bin mode under new encoding paradigm 19:21
Zoffix looks
dwarring: yeah. Will fix in ~3 hours. In the meantime, you can open in `:bin` mode to workaround it
19:21 dj_goku left
Zoffix m: "tst.txt".IO.spurt([~] 'a' .. 'z'); my $ioh = "tst.txt".IO.open(:r, :bin); say $ioh.read(4); $ioh.seek(1, SeekFromCurrent); say $ioh.read(4); 19:22
camelia Buf[uint8]:0x<61 62 63 64>
Buf[uint8]:0x<66 67 68 69>
dwarring Zoffix: thanks
Zoffix: RT #131376 19:23
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=131376
Zoffix clicks Take 19:24
19:24 brrt joined
AlexDaniel dwarring: thanks for reporting the bug :) 19:25
AlexDaniel slaps bisectable
dwarring AlexDaniel: yw
Zoffix Yeah, dwarring++ fast reporting, considering this refactor went in like 4 hours ago :) 19:26
dwarring builds in the morning 19:27
Zoffix At least I hope I can fix it... The whole seek-non-bin-handle chunk is missing: github.com/rakudo/rakudo/blob/nom/...#L482-L488
dwarring adding :bin works for me 19:28
Zoffix Ah, OK now I get it.
Zoffix will fix in ~3 hourts
AlexDaniel
.oO( in ≈3 hurts )
Zoffix Also Zoffix-- # wrote crappy seek tests 19:29
moritz Zoffix++ # writing seek tests at all 19:30
AlexDaniel whateverables-- for being stupid bots and not writing any tests at all 19:32
19:33 dct left 19:34 alimon joined 19:36 stmuk_ joined 19:38 stmuk left 19:40 cdg joined 19:42 dct joined 19:47 jeek joined
tony-o ingy: that thing is probably very bitrotted - i can take a look at it on sunday 19:51
robertle tony-o: not sure you got my message the other day: travis seems to work ok against my pluggable branch, so you probably only need to press the button on travis-ci.org/tony-o/perl6-pluggable and yours will too 20:01
Zoffix When does END in a module, in relation to program that loads it and other modules? 20:12
moritz last-loaded first, IIRC 20:13
Zoffix Ok 20:14
Gonna make a Promise::AutoAwait that automatically awaits (non-blockingly) sunk Promises. Was pondering the possible explosions of my awaiting for them in END 20:15
moritz shop.oreilly.com/product/0636920065883.do Think Perl 6 now available! 20:16
Zoffix w00t 20:17
So many books we got... I thought it was already available there long time ago; am I thinking of different book? 20:18
brrt moritz++
moritz Zoffix: it was available for a preview of the first $N chapters (where $N around 8 or 12 or so) 20:20
Zoffix Ahhh
20:20 brrt left
moritz brrt: I didn't do much :-) 20:20
(just a bit of proof-reading, and dropping a link now and then) 20:21
20:22 brrt joined 20:23 cdg left, cdg joined 20:29 brrt left, kaare__ left, kaare__ joined 20:34 xiaomiao left 20:35 mcmillhj left 20:37 xiaomiao joined 20:41 devmikey left
tinita Zoffix: btw,this is what I ended up with: github.com/yaml/yaml-perl6/blob/ma...Loader.pm6 20:44
20:48 alimon left
Zoffix hehe, well, I'm glad I don't have to maintain all that pushing and popping :) 20:49
20:49 mcmillhj joined
tinita Zoffix: suggestions welcome =) 20:49
Zoffix m: for 0, 2 … 12 { .say } 20:50
camelia 0
2
4
6
8
10
12
Zoffix Another way to write that loop(...;...; $i += 2) thing
tinita cool, thanks
i was trying to do: 20:51
Zoffix tinita: no suggestions :) it'd require underatanding what that code is doing... and maybe current way is the best. I don't know :)
*understanding
tinita %$hash = @$array; # perl5
Zoffix $hash = $array.Hash # perl 6
tinita is there a way in perl 6 for this?
tinita trying 20:52
well
Zoffix I think $hash = %$arrau will work too
tinita i think i tried something like that
the problem is, the $hash then changes
but i have a "reference" to it somewhere else
Zoffix Ahh
tinita because YAML has anchors/aliases
Zoffix Unsure offhand of a way 20:53
20:53 mcmillhj left
tinita Zoffix: can I use $i in that for loop somehow? 20:54
tinita reads the docs...
20:54 brrt joined
Zoffix m: for 0, 2 … 12 -> $i { $i.say } 20:55
camelia 0
2
4
6
8
10
12
Zoffix It's just a block. You can give it any signature
m: for 0, 2 … 14 -> $i, $j { [$i, $j].say } 20:56
camelia [0 2]
[4 6]
[8 10]
[12 14]
tinita ok, thanks. loop isn't working yet, though
for 0, 2 .. $array.elems -> $i {
20:56 mcmillhj joined
Zoffix tinita: it's three dots 20:57
20:57 skids left
Zoffix Or unicode elipsis: … 20:58
20:58 jast left
Zoffix Right now you're looping over two items; 0 and Range from 2 to $array.elems 20:58
.. creates Range object; ... (or …) creates a Seq object 20:59
tinita hm, i get warnings now, still trying to figure out...
20:59 jast joined
tinita ah, elems -1 21:00
for 0, 2 ... $array.elems - 1 -> $i {
Zoffix: thanks
Zoffix oops, sorry :)
m: for 0, 2 …^ 12 -> $i { $i.say }
camelia 0
2
4
6
8
10
tinita np =)
Zoffix You can also use …^ to exclude end point
tinita tests succeed \o/ 21:01
21:01 ChoHag left, mcmillhj left 21:03 setty1 left 21:05 dj_goku joined, cpage_ left 21:10 dj_goku left 21:12 mcmillhj joined 21:13 mr-foobar left 21:16 yqt left 21:17 mcmillhj left 21:19 cpage_ joined 21:21 brrt left 21:29 bwisti left 21:36 Sound left
ingy waves 21:48
Zoffix \o 21:50
22:09 cbd_ joined
cbd_ subset question: I want to define a subset of Int arrays that only have two elements 22:09
how is it done?!?
Zoffix cbd_: typed Int arrays or just arrays containing Int objects? 22:10
cbd_ I'm not sure I understand the difference
If I were to say: my Int @arr = (1,2) which is that? 22:11
Zoffix Typed
m: subset Foo of Array where {.all ~~ Int and .elems == 2}; my Foo $a = [2, 3];
camelia ( no output )
Zoffix ^ that one isn't typed 22:14
m: subset Foo of Array[Int] where .elems == 2; my Foo $a = Array[Int].new: 2, 3;
camelia ( no output )
Zoffix ^ that one is, but as you can see, you need to do more work to create one when you're assigning stuff to it 22:15
cbd_ That first example you gave gives an error when I run it
Cannot modify an immutable Int
Zoffix cbd_: what's your perl6 version?
cbd_ ah wait...
my fault 22:16
Though I am not sure I see the distinction between the two different forms 22:19
Both restrict to an array of two Int objects?
Zoffix cdg: unsure. I think one is a compile-type check and the other is runtime check. 22:21
22:22 cpage_ left 22:25 bpmedley joined
cbd_ The latter is the compile-time check? 22:25
22:25 cdg left
Zoffix The typed one is a compile-type check (I don't really know; I'm no expert) 22:26
cbd_ sure
well thank you for helping out 22:29
Zoffix Any time.
22:30 cbd_ left 22:31 skids joined
lizmat m: my Int @a[2] # an Int array of 2 elements ? 22:31
camelia ( no output )
Zoffix Oh :( didn't think of that one >_< 22:32
lizmat m: my Int @a[3]; sub a(@b where *.shape eqv (2,)) { say "foo" }; a @a 22:33
camelia Constraint type check failed in binding to parameter '@b'; expected anonymous constraint to be met but got Array[Int] (Array[Int].new(:shape...)
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat m: my Int @a[2]; sub a(@b where *.shape eqv (2,)) { say "foo" }; a @a
camelia foo
22:34 bjz joined
lizmat goes to bed 22:34
KotH good evening 22:40
has anyone ever done something as crazy as using perl6 as an embedded language in an other application?
if so, where can i get the codez? ;-) 22:41
jnthn m: my Int @a[2]; sub a(@b[2]) { }; a @a
camelia ( no output )
jnthn m: my Int @a[3]; sub a(@b[2]) { }; a @a
camelia Constraint type check failed in binding to parameter '@b[2]'; expected anonymous constraint to be met but got Array[Int] (Array[Int].new(:shape...)
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
jnthn lizmat: You can get that with a lot less typing ;)
KotH: Presumably the person who did the Inline::Perl6 module for Perl 5 (which embeds Perl 6 in Perl 5) was crazy enough :) 22:42
KotH ah! didnt think about that one 22:43
thanks!
22:48 wamba joined 22:53 dj_goku joined, dj_goku left, dj_goku joined
KotH jnthn: hmm.. if i understand the code correctly, it works by running perl6 in which it runs perl5 code and uses the callbacks into perl6 to run perl6 code from perl5 ..... not exactly what i was looking for 22:54
jnthn KotH: Yeah, it actually gets a lot of code re-use that way 22:55
KotH: But the general principle is about right
You run a Perl 6 program that registers callbacks via. NativeCall, which you can then call from your native code to trigger stuff to happen in Perl 6 22:56
ingy Isn't Inline::Perl6 ancient?
KotH jnthn: but doesnt really work if main() needs to be that other application 22:57
jnthn KotH: In the Perl 5 case, main() is Perl 5
Uh, in the Inline::Perl6 case even 22:58
KotH hmm.. then i dont get how it works ^^'
22:58 dj_goku left
jnthn ingy: Only if Octover 2016 is ancient ;) 22:58
*October
ingy I thought it was more 2006 :) 22:59
jnthn Dunno, mebbe the name got repurposed or something 23:01
KotH: I think it hangs off the `moar` executable of MoarVM really just calling a bunch of functions in libmoar to set up the VM and get it to run something, to instead at a convenient point run some Perl 6 code instead. 23:02
metacpan.org/source/NINE/Inline-Pe...rl6.xs#L84 # here is where it injects the script to run 23:04
23:05 cpage_ joined
KotH jnthn: yeah.. i overlooked Perl6.xs which does replicate part of MoarVM's main() 23:08
23:11 Actualeyes left
KotH thanks a lot! 23:18
23:20 dct left
jnthn np, good luck :) 23:22
23:24 Actualeyes joined 23:34 PerlJam joined
Zoffix m: with '/tmp/foo99'.IO { .spurt: "meowsmeows"; with .open { .read: 4; .seek: 1, SeekFromCurrent; say .read: 4 } } 23:55
camelia Buf[uint8]:0x<6d 65 6f 77>
Zoffix dwarring: ^ that's fixed now
\o
23:55 Zoffix left