»ö« 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. |
|||
IOninja | Not really, due to nodality... | 00:01 | |
m: (^3, [1, 2, 3])».Numeric.say | |||
camelia | ((0 1 2) [1 2 3]) | ||
IOninja | m: (^3, [1, 2, 3]).map(*.Numeric).say | ||
camelia | (3 3) | ||
00:01
mcmillhj joined
|
|||
IOninja | huggable: eco 1-character | 00:02 | |
huggable | IOninja, nothing found | ||
IOninja | look hrdr! | ||
buggable: eco 1-character | |||
buggable | IOninja, M 'M, the 1-character Map: non-nodal, non-autothreading .map(*.some-method)': github.com/zoffixznet/perl6-M | ||
IOninja | Hmm | 00:03 | |
00:03
unicodable6 joined,
ChanServ sets mode: +v unicodable6
00:06
mcmillhj left
00:07
KDr2_c left,
mcmillhj joined
|
|||
IOninja | m: grammar { token TOP { <foo>+ }; token foo { <bar>**1 { make ~$/ } }; token bar { \d+ | <[a..z]>+ } }.parse: '1a2b33cc'; say $<foo>».made | 00:07 | |
camelia | [1 a 2 b 33 cc] | ||
IOninja | m: grammar { token TOP { <foo>+ }; token foo { <bar>**1 { make ~$/ } }; token bar { \d+ | <[a..z]>+ } }.parse: '1a2b33cc'; say $<foo>.map: *.made | ||
camelia | (1 a 2 b 33 cc) | ||
IOninja | One's an Array other's not :/ | 00:08 | |
skids | m: grammar { token TOP { <foo>+ }; token foo { <bar>**1 { make ~$/ } }; token bar { \d+ | <[a..z]>+ } }.parse: '1a2b33cc'; say dd $<foo> | 00:09 | |
camelia | [Match.new(ast => "1", list => (), hash => Map.new((:bar([Match.new(ast => Any, list => (), hash => Map.new(()), to => 1, orig => "1a2b33cc", from => 0)]))), to => 1, orig => "1a2b33cc", from => 0), Match.new(ast => "a", list => (), hash => Map.new((:bar… | ||
00:10
itaipu left
00:11
itaipu joined
|
|||
IOninja | m: grammar { token TOP { <foo>+ }; token foo { <bar>**1 }; token bar { \d+ | <[a..z]>+ { make ~$/ } } }.parse: '1a2b33cc'; sub foo { "[$^a]".say; }; $<foo>».&foo | 00:11 | |
camelia | [1] [a] [2] [b] [33] [cc] |
||
IOninja | m: grammar { token TOP { <foo>+ }; token foo { <bar>**1 }; token bar { \d+ | <[a..z]>+ { make ~$/ } } }.parse: '1a2b33cc'; sub foo is nodal { "[$^a]".say; }; $<foo>».&foo | ||
camelia | [1] [a] [2] [b] [33] [cc] |
||
IOninja | `is nodal` on a sub don't do nothing? | ||
00:11
Cabanossi left
00:12
raschipi joined,
mcmillhj left
00:13
Cabanossi joined,
rindolf left
|
|||
TimToady | skids: re $!braid, the class is not Cursor, but NQPCursor; see gist.github.com/TimToady/474bdc4ac...45bdcdf62c | 00:15 | |
00:15
cibs left
00:17
risou is now known as risou_awy
|
|||
skids | Hrm. I'll see if changing that line in .FOREIGN_LANGUAGE works when I get done breaking my local build. | 00:17 | |
00:17
cibs joined
|
|||
IOninja | m: use MONKEY; augment class Array { method foo is nodal { "[{self}]".say; } }; ([1, 3, 4], [1, 3])».foo | 00:18 | |
camelia | No such method 'foo' for invocant of type 'Int' in block <unit> at <tmp> line 1 |
||
IOninja | Guess it works in setting only... | ||
and yeah, I was wrong ».made and map: *.made are the same | |||
TimToady | skids: but do see the gist; I had to pull NQPCursor out of the cursor's mro, since it's not visible | 00:21 | |
00:21
raschipi left
|
|||
skids | I think it might be in Grammar.nqp. | 00:21 | |
I will put that trick in my quiver though :-) | 00:22 | ||
BenGoldberg | .tell pukku You said you are interested in a DOM manipulator which doesn't change the order of attributes when you stringify it... first, look at github.com/zostay/perl6-ArrayHash; then, look at DOM::Tiny, specifically the source of DOM::Tiny::HTML. Note that there are precisely three places where Hash.new is used; if these were changed to ArrayHash, I'm 99% sure that you'd have a solution. | ||
yoleaux | BenGoldberg: I'll pass your message to pukku. | ||
00:23
geekosaur left,
bjz left,
mcmillhj joined
00:24
geekosaur joined
|
|||
TimToady | skids: why it doesn't work, I dunno; I guess structural equivalence is not good enough between NQPCursor and Cursor, despite being derived from the same role; maybe jnthn++ has an opinion | 00:25 | |
jnthn: the original referent is irclog.perlgeek.de/perl6/2017-03-09#i_14230054 | 00:28 | ||
00:28
mcmillhj left
00:31
girafe left
00:37
bjz joined
|
|||
BenGoldberg | m: Int.^add_method( 'sink', method (Int:) { say "sunk" } ); Int.^compose; say 'pe'; say 'rl6'; | 00:38 | |
camelia | pe rl6 |
||
BenGoldberg wonders why the Int returned by the first say doesn't get it's .sink called on it. | 00:39 | ||
00:39
mcmillhj joined
|
|||
IOninja | m: Bool.^add_method( 'sink', method () { say "sunk" } ); Bool.^compose; say 'pe'; say 'rl6'; | 00:40 | |
camelia | pe sunk rl6 sunk |
||
IOninja | m: Int.^add_method( 'sink', method () { say "sunk" } ); Bool.^compose; say 'pe'; say 'rl6'; | 00:41 | |
camelia | pe sunk rl6 sunk |
||
BenGoldberg | whu? | 00:42 | |
m: dd say '' | |||
camelia | Bool::True |
||
BenGoldberg | Oh, it's returning Bool, *blushes*, /me wonders why'd he'd thought it was an Int. | 00:43 | |
00:45
Dunearhp left,
lukaramu_ left,
Dunearhp joined
00:47
mcmillhj left
|
|||
IOninja | BenGoldberg: Bool *is* an Int. But you didn't recompose the Bool after messing with Int | 00:50 | |
BenGoldberg | Ahh. | ||
BenGoldberg is thinking that adding a .sink to e.g. Int and/or Bool, and playing with callframe, would be an interesting way to produce lots of fun debugging info. | 00:52 | ||
00:56
Cabanossi left
00:58
Cabanossi joined
01:06
zakharyas left,
zakharyas joined
01:07
cdg joined
|
|||
BenGoldberg | m: class Foo { method ^parameterize(Mu:U \p, Mu \t) { say "in parameterize, t is {t}" } }; Foo[3].new; | 01:09 | |
camelia | in parameterize, t is 3 | ||
01:09
TimToady left
01:10
cdg left,
cdg joined,
zakharyas left
01:11
TimToady joined
01:12
lichtkind left
01:13
risou_awy is now known as risou
|
|||
BenGoldberg | Aha! I've got an idea for a possible solution for the NativeCall callback memory leak problem. | 01:13 | |
Basically, add a method ^parameterize(Mu:U \p, Signature:D $s) to NativeCall::Types::Pointer, which mixes something into Pointer so that two-way marshalling of perl Callables and C function pointers can happen, *and* when it goes out of scope, that's the moment when stuff gets freed. | 01:14 | ||
01:17
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:33
agentzh left
01:35
agentzh joined
01:45
aborazmeh left
01:48
cdg left
01:52
bjz left
01:55
bjz joined
01:57
Cabanossi left
01:58
Cabanossi joined
02:08
mcmillhj joined
02:16
mcmillhj left
02:18
ChoHag left
02:22
bjz left
02:23
mcmillhj joined
02:29
mcmillhj left
02:32
itaipu left
02:36
mcmillhj joined
02:39
labster left
02:41
mcmillhj left
02:45
ilbot3 left
02:47
mcmillhj joined
02:48
ilbot3 joined,
ChanServ sets mode: +v ilbot3
02:49
cibs left
02:51
cibs joined
02:52
mcmillhj left
02:57
mcmillhj joined
03:02
mcmillhj left
03:09
labster joined,
mcmillhj joined
03:11
xtreak joined
03:14
mcmillhj left
03:23
mcmillhj joined
03:26
Cabanossi left,
agentzh left
03:28
mcmillhj left,
Cabanossi joined
03:33
bjz joined
03:42
agentzh joined
03:45
noganex joined
03:48
noganex_ left
03:56
Xliff left
03:57
wamba joined
03:58
Xliff joined
04:11
Cabanossi left,
skids left
04:12
Cabanossi joined
04:21
agentzh left,
mcmillhj joined
04:26
mcmillhj left
04:39
mcmillhj joined
04:40
agentzh joined
04:44
mcmillhj left
|
|||
Geth | whateverable/master: 6 commits pushed by (Aleks-Daniel Jakimenko-Aleksejev)++ | 04:46 | |
04:50
mcmillhj joined
04:54
Cabanossi left
04:56
committable6 left,
bisectable6 left,
evalable6 left,
unicodable6 left,
statisfiable6 left,
benchable6 left,
bisectable6 joined,
ChanServ sets mode: +v bisectable6,
benchable6 joined,
ChanServ sets mode: +v benchable6,
committable6 joined,
ChanServ sets mode: +v committable6,
statisfiable6 joined,
ChanServ sets mode: +v statisfiable6,
evalable6 joined,
ChanServ sets mode: +v evalable6,
unicodable6 joined,
ChanServ sets mode: +v unicodable6
04:57
Cabanossi joined
|
|||
naxieAlDle | unidump: 🙌 | 04:58 | |
unicodable6 | naxieAlDle, gist.github.com/a1d5930e674129bf11...3bbeb2ae4a | ||
04:58
cibs left
|
|||
naxieAlDle | feedback is welcome | 04:59 | |
samcv: ↑ ^_^ | 05:00 | ||
05:00
cibs joined
|
|||
TEttinger | that's wonderful, naxieAlDle | 05:04 | |
I wonder if there's a way to generate all those gists beforehand and just link to existing ones (potentially for a site to refererence) | |||
naxieAlDle | interesting idea | 05:05 | |
TEttinger | all zillion chars in unicode 9 | ||
naxieAlDle | right now you can use more than one character | ||
TEttinger | ah ok | ||
naxieAlDle | unidump: ✓✗ | ||
unicodable6 | naxieAlDle, gist.github.com/997468ea4d379ea446...82f819737a | ||
naxieAlDle | and also, the result is going to improve over time, I think. If I'm not mistaken, some properties are not showing up | 05:06 | |
TEttinger | oh man, there are MORE??? | ||
naxieAlDle | but yes, that could be a nice addition to docs | 05:07 | |
TEttinger: no, that's a full list! But some properties are empty | |||
TEttinger | I like that they're public, gist.github.com/Whateverable | ||
sooo... somebody's testing ligatures. gist.github.com/Whateverable/1f6c6...f3f36aa20e | 05:08 | ||
sjn would have loved it if 🙌 hd the alias "YAY!" :) | |||
TEttinger | what's the plan with ligatures? | ||
naxieAlDle | dunno, should work? | 05:09 | |
m: say "aaaastaaa" ~~ m:i/st/; | |||
camelia | 「s」 | ||
05:09
BenGoldberg left
|
|||
naxieAlDle | hm :) | 05:10 | |
buggable: UNI | 05:12 | ||
buggable: tag UNI | |||
buggable | naxieAlDle, There are 30 tickets tagged with UNI; See perl6.fail/t/UNI for details | ||
05:15
mcmillhj left
05:16
mcmillhj joined
05:23
mcmillhj left
|
|||
naxieAlDle | night o/ | 05:24 | |
05:29
naxieAlDle left
05:30
flw joined,
khw left
05:31
flw left
05:37
mcmillhj joined
05:41
xtreak left
05:42
mcmillhj left
05:44
xtreak joined
05:51
mcmillhj joined
05:56
mcmillhj left
06:01
sunnavy left,
curan joined
06:02
mcmillhj joined
06:07
dotness joined,
mcmillhj left
06:13
mcmillhj joined
06:18
mcmillhj left,
Todd joined
|
|||
Todd | Hi All, what works in rhel, does not in Fedora. | 06:19 | |
sub XDisplayName(Str:D $name) is native('X11') returns Str { * }; | |||
gives | |||
annot locate native library 'libX11.so': libX11.so | |||
$ rpm -qa \*libX11\* libX11-1.6.4-1.fc25.i686 libX11-1.6.4-1.fc25.x86_64 libX11-common-1.6.4-1.fc25.noarch | |||
what is going on? | 06:20 | ||
samcv | I have a libX11.so at /usr/lib | ||
Todd | $ ls -a /usr/lib64/libX11* /usr/lib64/libX11.so.6 /usr/lib64/libX11-xcb.so.1 /usr/lib64/libX11.so.6.3.0 /usr/lib64/libX11-xcb.so.1.0.0 | ||
ls -a /usr/lib/libX11* /usr/lib/libX11.so.6 /usr/lib/libX11-xcb.so.1 /usr/lib/libX11.so.6.3.0 /usr/lib/libX11-xcb.so.1.0.0 | 06:21 | ||
it got something in both usr and usr64 | |||
samcv | Todd, that works for me on my arch computer | 06:22 | |
Todd | # ln /usr/lib64/libX11.so.6 /usr/lib64/libX11.so | ||
# ln /usr/lib/libX11.so.6 /usr/lib/libX11.so | |||
fixzed the issue. Is this a bug in NativeCall? | 06:23 | ||
06:23
Peter_WR left
|
|||
samcv | maybe, if it doesn't automatically pick a version it could be | 06:23 | |
not 100% sure | |||
06:24
Peter_R joined
|
|||
Todd | Where to file such a bug? | 06:24 | |
samcv | Todd, rt.perl.org/Search/Simple.html?q=nativecall any of these bugs yours? | ||
06:24
mcmillhj joined
|
|||
samcv | if they are not, then send the bug report by email to [email@hidden.address] | 06:24 | |
Todd | I have an account over there, I am just on the comptuer that has the log on info. I will eMail to [email@hidden.address] (or wait till tomorrow and do it on the other computer) | 06:25 | |
Thank yoU! | |||
06:27
ufobat joined
|
|||
samcv | great thank you | 06:27 | |
ufobat | good morning :) | ||
06:29
mcmillhj left
|
|||
samcv | morning ufobat | 06:29 | |
Todd | Can anyone fix the syntax for me on the following: | ||
# char *XFetchBytes(Display *display, int *nbytes_return) | |||
sub XFetchBytes(Str:D $display, int32 $length) is native('X11') returns Str { * }; | |||
Calling XFetchBytes(List) will never work with declared signature (Str:D $display, int32 $length --> Str) | |||
samcv | Todd, can you share some code and i can try it out | 06:30 | |
ufobat | Todd, are you calling it like this XFetchBytes ("foo", 1) | ||
Todd | What is the best way to send it? eMail it to [email@hidden.address] ?? | 06:31 | |
ufobat | gist.github.com/ maybe? | ||
Todd | I can probably shorten it to four lines and place it here | ||
gist looks like I need to sign up for something | 06:33 | ||
ufobat | ah you probably need to have a github account, yeah | ||
Todd | #!/usr/bin/perl6 | ||
# char *XFetchBytes(Display *display, int *nbytes_return) | |||
sub XFetchBytes(Str:D $display, int32 $length) is native('X11') returns Str { * }; | |||
06:34
mcmillhj joined
|
|||
Todd | my $Bytes; my $Length; $Bytes = XFetchBytes ( ":0.0", $Length ); | 06:35 | |
print "\$Length <$Length>\n\$Bytes <$Bytes>\n\n"; | |||
ufobat | ufobat> Todd, are you calling it like this XFetchBytes ("foo", 1) | ||
thats your mistake | |||
Todd | well five lines; looks a lot smaller without the comments. here is the reference I am using: | ||
ufobat | try this: my $Bytes; my $Length; $Bytes = XFetchBytes( ":0.0", $Length ); | ||
samcv | Todd, try vpaste.net/ | ||
Todd | tronche.com/gui/x/xlib/utilities/X...Bytes.html | 06:36 | |
06:36
xtreak left
|
|||
ufobat | there must be no space between sub-name and opening '(' | 06:36 | |
if there is a blank the (":0.0", $foo) will be a list passed to the subroutine | 06:37 | ||
06:39
mcmillhj left,
xtreak joined
|
|||
samcv | m: say (1,2,4) | 06:40 | |
camelia | (1 2 4) | ||
samcv | m: say(1,2,4) | ||
camelia | 124 | ||
06:41
Cabanossi left
06:42
Cabanossi joined
|
|||
Todd | for some reason my browser popped me overt to something weird | 06:45 | |
06:45
mcmillhj joined
|
|||
Todd | vpaste.net/9rhJO | 06:45 | |
$Bytes = XFetchBytes( ":0.0", $Length ); | 06:46 | ||
is giving | |||
Cannot unbox a type object (Any) to int. | |||
ufobat | probably your $Length is undefined? | ||
Todd | my $Length; $Bytes = XFetchBytes( ":0.0", $Length ); | 06:47 | |
ufobat | maybe try: my int32 $Length = 10; | ||
Todd | Segmentation fault (core dumped) | 06:49 | |
ufobat | i am not sure whether 'my int32' is a bad idea in this example. i think usually 'Int' is the best? | ||
Todd | oops. What did I do? | ||
ufobat | Todd, well yeah, at least youre in the C world now ;) | ||
Todd | C gives me a head ache | ||
ufobat | i cant help you any further, sorry | 06:50 | |
Todd | Int for int32 also seg faults | ||
06:50
mcmillhj left
|
|||
Todd | thank your for hte help anyway. Much apreciated | 06:50 | |
06:51
RabidGravy joined
|
|||
Todd | In the C world "int *nbytes_return" means a pointer to address on an "int", which is a form of Integer, probably 32 bit. | 06:52 | |
Is me passing "$Length" to it properly tranlated to the pointer and all? | 06:53 | ||
Just out of curiousity, isn't Perl written in C? | 06:54 | ||
06:55
effbiai left,
ChoHag joined,
abraxxa joined
06:56
mcmillhj joined
06:57
effbiai joined,
effbiai left,
effbiai joined
07:01
cibs left,
mcmillhj left
07:03
domidumont joined,
cibs joined
|
|||
Todd | my browser is still acting weird, so I am going to exit and log back in (love clicking on those street signs) | 07:04 | |
07:04
Todd left
07:05
Todd joined
|
|||
Todd | I am back in. Any luck with the seg faults? | 07:05 | |
07:07
mcmillhj joined
07:10
Cabanossi left
07:12
Cabanossi joined,
mcmillhj left
07:18
mcmillhj joined
07:23
mcmillhj left
|
|||
Todd | I am looking through perl6 docs for Str:D and finding a bunch of stuff but no explaination. What does it do? | 07:28 | |
07:28
mcmillhj joined
|
|||
gfldex | docs.perl6.org/syntax/$COLOND | 07:29 | |
Todd | Reading | 07:30 | |
07:31
wamba left
07:32
xtreak left
|
|||
Todd | so the ":D" means to use "defined". So "Str:D" means to only use "defined strings". Would "int:D" mean to only use a "defined integer"?? | 07:33 | |
And what would the difference be between "Str" and "Str:D"? Is one short hand for the other? | |||
ufobat | my Str $foo; and now $foo is undefined | 07:34 | |
07:34
mcmillhj left
|
|||
ufobat | m: my Str:D $foo; | 07:34 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable definition of type Str:D requires an initializer at <tmp>:1 ------> 3my Str:D $foo7⏏5; expecting any of: constraint |
||
ufobat | m: my Str:D $foo = "whoa!"; | ||
camelia | ( no output ) | ||
ufobat | m: my Str:U $foo; | ||
camelia | ( no output ) | ||
ufobat | m: my Str:U $foo = "whoa!"; | ||
camelia | Type check failed in assignment to $foo; expected Str:U but got Str ("whoa!") in block <unit> at <tmp> line 1 |
||
ufobat | Str means string but you dont care whether it is defined or not. with :U or :D you do care | 07:35 | |
07:35
xtreak joined
|
|||
Todd | by "defined", do you mean it has a "my", or do you mean "initialized"? | 07:37 | |
ufobat | it is more "initialized" | ||
Todd | "more" | 07:38 | |
"more"? | |||
ufobat | but thats not perfectly true, because something that is initialized can set to a "undefined" value afterwards, it is/was still initilized, right? | ||
Todd | Here is where I am confused. In the C code "char *XDisplayName(char *string);" , "char *string" is a C pointer to a string. | 07:39 | |
07:39
mcmillhj joined
|
|||
Todd | In Native call, it gets changed to | 07:40 | |
sub XDisplayName(Str:D $name) is native('X11') returns Str { * }; | |||
ufobat | i think in C you could do a: char *string; | ||
Todd | What is confusing me is how does native Call know to translate the value i am sending it to a C pointer and does "Str:D" have anythingto do with that? | 07:41 | |
ufobat | this pointer points to nowhere now? right?, thats probably the equivalent of Str:U in this example | ||
samcv | `my $var` => undefined `my $var = 'blah'` | ||
Todd | sam, what are you trying to tell me? | 07:42 | |
Does the ":U" mean "undefined"? | |||
ufobat | i dont know NativeCall yet, but i'd assume that Str:D would convert to a char * The Documentation said (C String) docs.perl6.org/language/nativecall...ing_Values | 07:43 | |
is this a char *? | |||
yeah :U is undefined | |||
07:44
mcmillhj left
|
|||
Todd | so "my $var;" is just shothand for "my Str:U $var;" ???? | 07:45 | |
ufobat | no | 07:47 | |
my $var; <- now ware could be anything | |||
s/ware/$var/ | |||
Todd | So what exactly is a "Defined string (Str:D)"? Is the purpose to undo conversatoins with other languages that are not “lexiconical”? | 07:48 | |
samcv | defined string is any string that has been defined | ||
m: my Str $thing #this string is undefined | |||
camelia | ( no output ) | ||
samcv | m: my Str $thing; say $thing.WHAT; #this string is undefined | ||
camelia | (Str) | ||
ufobat | for example real world person allways have a Str:D $name | 07:49 | |
samcv | Todd, yeah the :U means undefined | ||
ufobat | whereas pets sometimes have no name, so Str $name would be appropriate | ||
samcv | pets? | ||
ufobat | ever called your cat at home just "cat"? | ||
Todd | would not [my $var = "hello"] define it as a "Str:D"? | ||
samcv | i see your point ufobat | 07:50 | |
yes Todd | |||
07:50
sunnavy joined
|
|||
samcv | an empty string is defined, but is coerces to False | 07:50 | |
for example. and 0 as a number is defined but evals as False | |||
07:50
mcmillhj joined
|
|||
Todd | So how does C know "Str:D $name" is a C pointer to a string (array of characters)? | 07:51 | |
07:51
bjz left
|
|||
samcv | though there's `Nil` which is an undefined value. but that's a little different. but there's several ways something can not be defined | 07:51 | |
when programming in perl 6? well there's a translation layer | |||
MoarVM uses dyncall library to do it | 07:52 | ||
Todd | Does it figure it out on its own? What is a pointer and what is not? | ||
Be nice if it did | 07:53 | ||
samcv | yeah it mostly does Todd | ||
i mean as long as you actually supply the correct types | |||
like if you try using a string when the C function wants an integer, weird things happen | |||
or if you use the wrong size of integer or whatever | 07:54 | ||
Todd | I think I am not providing the correct types. | ||
samcv | show me your code again? | ||
Todd | Will do. I has gotten more complex | ||
samcv | also you may be interesting in gpxtrixie which will create a bunch of code for you. it's not always 100% correct. but you can take what you need and leave the rest. you'll need clang and uh some other thing | 07:55 | |
it supports gcc but i never have gotten it working with that | |||
07:55
mcmillhj left
|
|||
samcv | github.com/Skarsnik/gptrixie | 07:55 | |
i couldn't find gccxml on my distro, so i just used the clang one which is castxml | 07:56 | ||
Todd | vpaste.net/Ley6g | ||
07:56
bjz joined
07:57
mcmillhj joined
|
|||
Todd | I will look a gptrixie | 07:57 | |
did vpaste work? | |||
samcv | yep. also which part is not working | 07:58 | |
Todd | Calling XStoreBytes(List) will never work with declared signature (Str:D $display, Str:D $str, int32:D $len) in method CALL-ME at /usr/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 326 in block <unit> at ./XFetchBytesTest.pl6 line 39 | ||
It does not like the way I am declaring (Str:D $display, Str:D $str, int32:D $len) | 07:59 | ||
# XStoreBytes(displayptr, string, numbytes) sub XStoreBytes(Str:D $display, Str:D $str, int32:D $len) is native('X11') { * } | |||
Do you feel safe running my code? | 08:00 | ||
samcv | yeah i read it. code is fine | ||
I get this printed out: `$Display = <:0>` | |||
seems accurate | |||
Todd | The first native call works. I put it in to help figure out the other two | 08:01 | |
samcv | ah | ||
08:01
mcmillhj left
|
|||
samcv | ok so it's XStoreBytes that doesn't work | 08:01 | |
ok yeah it's returning a Display pointer | 08:02 | ||
Todd | yes. If you comment it out, XFetchBytes is whining too. | ||
samcv | looks like you need a command to get the Display* and then use that to fetch and store bytes | 08:03 | |
since it wants a display pointer | |||
08:04
bwisti left
|
|||
Todd | I thought it was either to hard code ":0.0" or to send it the result in $Display. | 08:04 | |
NativeCall would change it over to a C pointer | 08:05 | ||
samcv | i think it may be a special C type. but at minimum i know it's a pointer | ||
the XDisplayName returns a char * not a Display * | |||
Todd | In my case it returns four characters, not one. | 08:06 | |
samcv | XDisplayName you mean? | ||
Todd | Yes, maybe it is look for an integer? | 08:07 | |
samcv | no that seems fine. the problem is that you don't want the display name, you want the display pointer | ||
Todd | not ":0.0" | ||
samcv | some special object | ||
so you need something that returns a Display * | |||
08:07
dotness left,
mcmillhj joined
|
|||
samcv | Todd, ftp://www.x.org/pub/xorg/X11R7.5/doc/man/man3/XOpenDisplay.3.html looks like you want this | 08:08 | |
you give it a char * aka a string of the display name, then it gives you back a Display * | |||
which you can use for the other calls | |||
Todd | by chance is "char" is C short hand for "array of characters"? In Modula2 (where I come from), "char" is a single byte | 08:09 | |
samcv | yep exactly a char * is an array of characters and a char is defined as one bytes | 08:10 | |
that holds a ascii number usually. though you can store utf-8 in a char * | |||
Todd | so "char *" is an array of characters and "*char" is a pointer to either an array of characters or a single character? | 08:11 | |
samcv | no they are the same thing | 08:12 | |
char* and char * are the same thing | |||
err wait | |||
where do you see *char | |||
Todd | so "char *XDisplayName(char *string);" means it is returning a pointer to an array of characters and I am supplying it a pointer to an array of characters | 08:13 | |
? | |||
samcv | yep | ||
exactly | |||
Todd | And NativeCall get the dubious task of unravelling it? | 08:14 | |
samcv | yep | ||
Todd | So "char *XFetchBytes(Display *display, int *nbytes_return)" means | ||
1) it will return a pointer to an array of characters | |||
samcv | yeah that * is attached to the 'char' not the function name btw | ||
char* XFetchBytes is what most people would write | 08:15 | ||
or a space or something, not attach it to the other thing | |||
Todd | 2) I will provide is some unkown type called "Display *display" | ||
samcv | yes that is a pointer to a display object | ||
i assume it's similar to what would be a filehandle. since you have to open the display before you can use any of the functions | 08:16 | ||
Todd | 3) "int *nbytes_return" will tell me how long the returned array of characters is | ||
samcv | so think of it like that | ||
08:16
mcmillhj left
|
|||
samcv | yeah you give it a pointer to an int, and it puts the correct value in there | 08:17 | |
Todd | So what is the type I shospecify in Native Call for the return lenth or just let Natice call figure it out? | ||
samcv | so that value will probably change after you run it | ||
wait what did you say in that last sentence? | |||
length? uh. it just says int so i'd just make it an int or something. though Int might work too | 08:18 | ||
Todd | I am trying to figure out hwo to tell NativeCall that I want it to turn those two pointers into a Perl string | ||
samcv | you had it say returns Str right? | 08:19 | |
that should be all you need | |||
Todd | yes | ||
08:19
wamba joined
|
|||
Todd | I want those two pointer turned into a perl string | 08:20 | |
samcv | well you get the actual string back always if you have it return a Str | ||
only if you made it say "returns Pointer" would you get a pointer | |||
which is not as useful to you | |||
NativeCall::Types::Pointer<0x55da56b3d490> | 08:21 | ||
$Display = <:0> | |||
that seemed to work fine | |||
gist.github.com/0f84ddcac905b40d57...d7ffb72b45 at least i know i got a pointer back. so that's nice | |||
Todd | I am testing something interesting. hold a sec | ||
08:22
n1ce left,
mcmillhj joined
|
|||
samcv | but for XFetchBytes you need $display to be a Pointer not a Str | 08:23 | |
08:23
n1ce joined
|
|||
Todd | Segmentation fault | 08:24 | |
poop! | |||
samcv | did you try and take bytes | 08:25 | |
without giving it any | |||
El_Che | it's been a while since I tried nativecall, but it was fun | ||
samcv | also can you explain what those actually do | ||
El_Che | the C api I wanted to wrap, less so | ||
samcv | hehehe | ||
El_Che | lib-ldap | 08:26 | |
Todd | I ctrl-v and center clicked. There is stuff in both buffer | ||
El_Che | undocumented internal data type | ||
s | |||
and then I saw a squirrel and forgot about it | |||
08:27
mcmillhj left
08:29
mcmillhj joined
|
|||
Todd | Well, shortening it to | 08:29 | |
sub XFetchBytes(Str:D $display) is native('X11') returns Str { * }; | 08:30 | ||
Figureing NativeCall would figure it out gave me a seg fault | |||
El_Che | in my short experience most of it was figuring how to match data types | 08:31 | |
08:31
kanishka joined
08:36
mcmillhj left,
rindolf joined
|
|||
Todd | I looked up "Display" and got "hostname:number.screen_number" over at | 08:38 | |
tronche.com/gui/x/xlib/display/ope...ml#Display | |||
so it looks like I am giving it the right stuff | |||
08:39
xtreak left
08:42
xtreak joined,
mcmillhj joined
08:46
xtreak left
08:47
mcmillhj left
|
|||
Todd | I have been looking at | 08:48 | |
docs.perl6.org/language/nativecall.html | |||
and although it is very verbose, it does not show what the C call looks like and how to was rewritten in NativeCall. That is a YUUUGE oversight. | 08:49 | ||
samcv | idk if it supports returning integer pointers, but i haven't tried that before | ||
Yuge | |||
Todd | Isn't NativeCall suppose to turn all those pointer into real values? | 08:50 | |
It occures to me that I may not be calling the correct C line to read the clipboard | |||
samcv | well i've only tried it for char * and some other pointer types | ||
Todd | and I may be doign the seg fault to myself | 08:51 | |
samcv | i don't think that one is related to clipboard but | ||
08:53
mcmillhj joined
|
|||
samcv | Todd, jtanx.github.io/2016/08/19/a-cross...on-details | 08:53 | |
see this | |||
maybe this is what you want | |||
Todd | Wasn't helpful as it did not give the hooks. Rats! | 08:55 | |
samcv | it looks fairly complicated | 08:56 | |
to do X11 clipboard if you read the section | |||
but i would try installing github.com/jtanx/libclipboard and then using that api to get the clipboard. because it's pretty damn involved | |||
then use their nice api to get clipboard | |||
Todd | I didn't see it | 08:57 | |
08:58
mcmillhj left
09:00
abraxxa left
|
|||
Todd | oh poop. There is a ton more to the clipboard that just asking for it | 09:00 | |
samcv | yeah | ||
09:02
koki1 left
|
|||
Todd | okay. I will stick with doing a shell to xclip. | 09:02 | |
samcv | i wouldn't use a shell | 09:03 | |
Todd | qx? | ||
samcv | just use proc or proc async | ||
qx uses a shell | |||
you can skip running a shell and run the program directly | |||
09:04
mcmillhj joined
|
|||
Todd | This guy? docs.perl6.org/syntax/proc | 09:04 | |
samcv | docs.perl6.org/routine/run | ||
i would try run | |||
run 'xclip', '-p'; then that should do what you want | |||
Todd | Maybe it is all the C code tonight, but gee wiz the proc page is confusing. | 09:05 | |
samcv | well there's more to it i guess | ||
El_Che | samcv: did you get a camelia sticker? | 09:06 | |
samcv | no i don't have one | ||
did somebody mail me one? | |||
El_Che | I hoped so, but it doesn't look that way | 09:07 | |
if I make it to yapc eu, I'll mail one then | |||
Todd | Hi sam, would you mind showing me how to call "xclip -selection clipboard -o" with "run" | ||
samcv | Todd, yeah the proc page sucks | ||
09:07
abraxxa joined
|
|||
samcv | thanks El_Che | 09:08 | |
sec Todd | |||
09:08
salv0 joined
|
|||
Todd | If I ever get getting at this and I want to propose soem verbage to one of those pages, do 1) the powers that be get annoyed and 2) do I just post it to the bug area you sent me earlier? | 09:08 | |
09:09
mcmillhj left
09:10
Cabanossi left
09:11
TEttinger left
|
|||
Todd | This looks pretty: perl6advent.wordpress.com/2014/12/...om-perl-6/ | 09:12 | |
samcv | uhm the docs have their own ticket tracker | ||
09:12
Cabanossi joined
|
|||
Todd | It looks like "run" will only return you the exit code | 09:13 | |
samcv | nah, i'm working on what it is. hold on | 09:15 | |
09:15
mcmillhj joined
|
|||
Todd | perl6 -e "say q:x /xclip -selection clipboard -o/" | 09:15 | |
works. But does it call a shell? | |||
samcv | yep | ||
moritz | you can also use say run('yourcomamnd', :out).out.slurp-rest | ||
DrForr | ;x is an adverb modifier. | 09:16 | |
moritz | read the docs for run. They have some examples, and more explanation | ||
samcv | ok fixd it Todd | ||
09:16
abraxxa left
|
|||
samcv | Todd, gist.github.com/samcv/6d41202ee555...c77174f67b here you go | 09:16 | |
Todd | Thank you! | 09:17 | |
samcv | the page on run really needs to be a lot better | ||
Todd | gasp! | ||
I coudl be C | |||
moritz | nah, in C it would be 20 lines instead of 2 :-) | 09:19 | |
09:19
abraxxa joined
|
|||
Todd | and a bottle of asprin | 09:21 | |
the code you send only prints out | |||
my $proc = run('xclip', '-selection', 'clipboard', '-o', :out); #my $proc = run('echo', 'wat', :out); say $proc.out.get; | |||
09:22
mcmillhj left
|
|||
moritz | .get only gives you the first line | 09:23 | |
.slurp-rest gives you all the output | |||
09:23
bjz_ joined
09:24
bjz left
|
|||
Geth | doc: cdd2fceed5 | (Samantha McVey)++ | doc/Type/IO.pod6 Make `run` documentation better Explain how to capture output, and don't include confusing irrelevant information about other commands. |
09:24 | |
samcv | there we go, that's at least somewhat better | ||
will take some time for the site to update though Todd. hopefully this will make it easier for the next person. | 09:25 | ||
09:28
mcmillhj joined
09:29
xtreak joined
|
|||
Todd | I am playing with it. Yippee! | 09:30 | |
09:33
mcmillhj left,
shdb left
|
|||
samcv | :) | 09:33 | |
Geth | ecosystem: scmorrison++ created pull request #306: Add Web::Cache to ecosystem |
09:34 | |
Todd | Hi Sam, what would give me the return code from that run command along with the text? Do I have to run the line twice? | 09:36 | |
$? is the code | |||
09:38
robertle joined
09:39
mcmillhj joined
|
|||
moritz | Todd: you must call $proc.out.close | 09:39 | |
Todd: and then it's in $proc.status, if I remember correctly | 09:40 | ||
09:40
Ven joined
09:41
Cabanossi left
09:42
Cabanossi joined
|
|||
Geth | ecosystem: 2806f19851 | (Sam Morrison)++ | META.list Add Web::Cache to ecosystem See github.com/scmorrison/perl6-Web-Cache |
09:42 | |
ecosystem: 1bc15b5af8 | (Juan Julián Merelo Guervós)++ | META.list Merge pull request #306 from scmorrison/master Add Web::Cache to ecosystem Thanks! |
|||
09:44
mcmillhj left
09:47
shdb joined
09:50
mcmillhj joined
09:52
g4 joined
09:54
mcmillhj left
10:00
mcmillhj joined
|
|||
Todd | Hi Sam, I wrote myself up an example with qx, qxx, and run. Maybe you could use some of it the manual? vpaste.net/nIwaM | 10:02 | |
$proc.out.close messed up the data on the print commands above it | 10:05 | ||
what is close suppose to do? | 10:06 | ||
10:06
mcmillhj left
|
|||
moritz | close the output pipe | 10:06 | |
Todd | how do you get the data to stick? | 10:09 | |
10:09
itaipu joined
|
|||
DrForr | Superglue? | 10:09 | |
10:10
wamba left
|
|||
Todd | wait, I was echoing commads from the clipboard | 10:10 | |
10:11
mcmillhj joined
|
|||
Todd | This is a better example, as it includes the close. Also has less run on statements vpaste.net/IQ0zZ | 10:14 | |
10:15
xtreak left,
wamba joined
10:16
mcmillhj left
|
|||
Todd | what is the best way to go about popping up an informational window with an "okay" for the user to click to get rid of the window? | 10:18 | |
10:19
Ven left
10:22
Ven joined,
mcmillhj joined
|
|||
moritz | Todd: www.linuxjournal.com/article/2807 is an easy way | 10:24 | |
10:24
xtreak joined
10:27
mcmillhj left
10:28
faraco joined
|
|||
Todd | Thank you. I had been using zenity | 10:28 | |
Is there a perl module that will work on both Linux and that "other" operating system with all the bugs? | 10:29 | ||
10:29
itaipu left
|
|||
faraco | o/ | 10:31 | |
10:33
mcmillhj joined
|
|||
faraco | I got rakudo tarball, not sure what moarvm offers compared to JVM. | 10:34 | |
DrForr | MoarVM is more mature than the JVM implementation. | ||
El_Che | faraco: at the moment rakudo is the most complete/Stable implementation | ||
faraco | moarvm to go. | 10:36 | |
10:36
itaipu joined
|
|||
jnthn | Also, the startup time is a good bit shorter with MoarVM :-) | 10:36 | |
10:38
mcmillhj left
|
|||
Todd | I got to call it a night. Thank you all for the wonderful help, especially Sam! | 10:38 | |
10:39
Todd left
10:44
mcmillhj joined,
Peter_R left
10:47
Peter_R joined
10:49
mcmillhj left,
llfourn left
10:50
mcmillhj joined
10:51
Ven left,
Ven joined
10:55
mcmillhj left
10:56
Cabanossi left
10:57
Cabanossi joined
10:58
kanishka left
11:01
mcmillhj joined
11:06
mcmillhj left
11:08
xtreak left
11:10
itaipu left
11:12
mcmillhj joined
|
|||
IOninja | DrForr: wasn't there some sort of improvement comming to blogs.perl6.org? I'm trying to login to give a piece of my mind to this blog post, but it keeps telling me "permission denied" even after I reset my password :/ | 11:16 | |
Here, "Perl Developer Survey 2017" to "paint the picture of Perl in 2017!" blogs.perl.org/users/bip/2017/03/pe...-2017.html | 11:17 | ||
11:17
mcmillhj left
|
|||
IOninja | And the entire survey is about Perl 5, with a single question "have you tried Perl 6" for Perl 6. | 11:17 | |
11:18
abraxxa left
|
|||
masak | perhaps a thread where Perl 6 should figure more prominently: news.ycombinator.com/item?id=13830177 | 11:21 | |
(there's already a link to an advent post) | |||
IOninja | guess my next grant report will be on perl6.party... Can't login to blogs.perl.org at all now.. | ||
11:23
mcmillhj joined
11:27
labster left
11:28
mcmillhj left
11:34
mcmillhj joined
11:39
mcmillhj left
11:46
risou is now known as risou_awy,
mcmillhj joined
|
|||
faraco | Is there any company that already adopted Perl 6 in their production use? | 11:47 | |
11:48
lukaramu joined
|
|||
IOninja | faraco: judging by the number of people who were asking questions while mentioning the code was part of their work, quite a few. | 11:50 | |
11:50
bjz_ left
11:51
mcmillhj left
|
|||
IOninja | faraco: but the question is a bit vague. For example, I'm the only developer in my company. If I start writing in Perl 6 alone, will that mean my company adopted anything? What if I use Perl 6 for all the one-liners and one-offs but use another lang for web apps? Is that "adopting" it? | 11:51 | |
faraco: and in the past year, 95% of new code I wrote was for open source projects... It's still production use, even though there's no "company" behind the code. | 11:52 | ||
11:54
bjz joined,
perlawhirl joined
11:55
Cabanossi left
11:56
Cabanossi joined
11:57
mcmillhj joined
12:00
curan left
12:01
mcmillhj left
12:03
Ven left
12:06
Ven joined
12:08
mcmillhj joined
12:11
faraco left,
TeamBlast left
12:12
raschipi joined
12:14
TeamBlast joined,
cgfbee left
12:15
mcmillhj left
12:18
bjz left
12:19
kyan left
12:20
naxieAlDle joined
|
|||
SmokeMachine | u: arrow | 12:24 | |
unicodable6 | SmokeMachine, U+02C2 MODIFIER LETTER LEFT ARROWHEAD [Sk] (˂) | ||
SmokeMachine, U+02C3 MODIFIER LETTER RIGHT ARROWHEAD [Sk] (˃) | |||
SmokeMachine, 617 characters in total: gist.github.com/e8e2461279d01d6f2b...0c599be7b8 | |||
raschipi | m: say so 2 | ||
camelia | True | 12:25 | |
12:25
mcmillhj joined
|
|||
naxieAlDle | unidump: ½ | 12:26 | |
unicodable6 | naxieAlDle, gist.github.com/89e1ee6b4b23e6e070...7643346d78 | ||
raschipi | naxieAlDle: Nice bot, congrats. | ||
12:26
cgfbee joined
|
|||
naxieAlDle | :) | 12:26 | |
12:27
wamba left
|
|||
perlawhirl | hi perlers | 12:27 | |
raschipi | Heya perlawhirl | ||
naxieAlDle | o/ | ||
raschipi | naxieAlDle: You should contact www.fileformat.info and help them improve their Unicode information pages | 12:28 | |
perlawhirl | parts 4 and 5 of my matplotlib in p6 series are up: www.0racle.info/ | ||
i mainly ask because... what the "reddiquette", should i make a new post? | |||
perlawhirl is new to blogging | 12:29 | ||
raschipi | perlawhirl: in oposition to what? | ||
perlawhirl | ha... i dunno | ||
raschipi | Making posts with your own blogposts in reddit might get one bannned for SPAM, be careful | ||
naxieAlDle | raschipi: “Character.getNumericValue() -2” haha | 12:30 | |
IOninja | naxieAlDle++ that's fancy | ||
12:31
mcmillhj left
|
|||
perlawhirl | raschipi: i get it. i was truly unsure tho... i don't post on reddit often. all good i'll make a new post | 12:31 | |
naxieAlDle | raschipi: TEttinger suggested to pregenerate these pages and include them in our docs somewhere. I kinda like this idea | ||
IOninja | perlawhirl, post a new reddit post. No one will ban you in r/perl6, I don't know what raschipi is talking about | ||
raschipi | perlawhirl: just participate in the comments and keep it on topic and you'll be fine | ||
Well, in r/perl6 it may be, but I was talking in general | 12:32 | ||
IOninja | Even in general... I doubt anyonr got banned for posting on-topic information they produced themselves. | 12:33 | |
12:35
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
perlawhirl | IOninja: I though he was being sarcastic, tbh | 12:35 | |
raschipi | IOninja: For example, if you post the same thing to 10 subreddits and don't talk to the users, one might get in trouble. | ||
12:37
mcmillhj joined
12:43
skids joined
12:45
mcmillhj left
12:46
risou_awy is now known as risou,
mcmillhj joined
12:50
skids left
12:52
user___ joined,
gfldex left
12:54
mcmillhj left,
gfldex joined
12:55
Cabanossi left
12:56
grondilu_ joined
12:57
Cabanossi joined,
jonas1 joined,
mtsd joined
12:59
grondilu left
13:03
mtsd left
13:04
risou is now known as risou_awy
13:20
Ven left
13:22
Ven joined
13:25
ZzZombo joined,
ZzZombo left,
ZzZombo joined
|
|||
timotimo | somehow i'm having difficulty backlogging when todd's been around :\ | 13:29 | |
ZzZombo | how can I remove a character from <punct> in a regex match, so it won't match, say, apostrophes? | ||
IOninja | timotimo: hehe, I gave up backlogging months ago :) | 13:31 | |
Too much volume. | |||
timotimo | i'm glad we split the channel into #perl6 and #perl6-dev | 13:32 | |
IOninja | Definitely. | 13:33 | |
I think there's #perl6-toolchain too | |||
13:33
aborazmeh left
13:34
lukaramu_ joined,
user___ left
|
|||
timotimo | yes, and #perl6-release | 13:34 | |
i'm not in either of those | |||
IOninja | I think #perl6-release got closed down | ||
Due to lack of need. | |||
13:37
lukaramu left
|
|||
Geth | modules.perl6.org/tags: f864e5358f | (Zoffix Znet)++ | 5 files Start sketching out tags support |
13:39 | |
perlpilot | ZzZombo: <+punct-[']> | 13:41 | |
ZzZombo | thanks! | 13:42 | |
perlpilot | IOninja: #perl6-release has 8 people and 3 bots still :) | 13:43 | |
13:43
wamba joined
|
|||
perlpilot | 7 people now that I've left and told my IRC client to stop auto joining | 13:45 | |
IOninja | ... 2 bots now :) | 13:48 | |
13:48
curan joined
|
|||
timotimo | masak: a data point from the stats of perl6advent's wp-admin says that accesses coming from hacker news are a tiny number. only 6 so far. 35 visitors coming from "search engines" during its "today" period | 13:49 | |
13:51
wamba left
13:52
Mithaldu left
13:54
Cabanossi left
13:55
Mithaldu joined,
ZzZombo left
13:57
Cabanossi joined
|
|||
raschipi | I was thinking: we're further away from the first publication of Unicode than it was from the first publication of ASCII at the time. | 14:03 | |
perlpilot | raschipi: eh? | 14:05 | |
you mean the most recent modification is further away in time from the first publication? | 14:06 | ||
raschipi | Unicode is an older standard than ASCII was when Unicode was published. | ||
perlpilot | ASCII started in 1960 and was first published in 1963. Unicode was first published in 1991, when did work on Unicode start? | 14:07 | |
14:08
llfourn joined
|
|||
raschipi | 88: unicode.org/history/unicode88.pdf | 14:08 | |
I conted the date of the first written document published | |||
because it's a bright line | |||
14:13
mcmillhj joined
14:29
cale2 joined
|
|||
cale2 | What is the best way to pass a file in to a MAIN function? | 14:30 | |
Should you specify the parameter type as "IO::Path", or simply pass a Str and do `$file.IO` to turn it into one? | 14:31 | ||
14:32
skids joined
|
|||
perlpilot | cale2: you're going to get a string from the command line in any case. | 14:32 | |
jnthn | Might be able to do IO(Str) in the signature also | ||
perlpilot | yep, I just tried that and it works fine. | 14:33 | |
cale2: so ... what jnthn said :) | |||
14:33
Mudada joined
|
|||
cale2 | Ah, I was forgetting to put .IO on the end of it | 14:34 | |
Does this coerce it to an IO role-fulfiller? | 14:35 | ||
14:35
Ven left
|
|||
perlpilot | cale2: IO(Str) in the sig you mean? That's "accept a Str, but call .IO on it" essentially. | 14:36 | |
masak | timotimo: I, I meant mostly that someone/we could point out that Perl 6 does very well in the problem space the HN thread was discussing. | ||
s/I/oh/ | |||
14:37
Ven joined
14:40
cdg joined
14:41
cdg left,
cdg joined
|
|||
DrForr | my $text = $filename.IO.slurp; is a good alternative and lets you use the filename later in error messages. Not to dissuade you from the IO(Str) solution, but it feels more useful to me. | 14:42 | |
raschipi | u: 🐨 | 14:43 | |
unicodable6 | raschipi, U+1F428 KOALA [So] (🐨) | ||
IOninja | DrForr: IO::Path stringifies to filename tho | ||
cale2 | I like "slurp" more, but I needed to call "get" on the file handle so it will get the first line and effectively delete it from there on out | ||
m: say 'ABCD'[$_] for ^4; | |||
camelia | ABCD Index out of range. Is: 1, should be in 0..0 in block <unit> at <tmp> line 1 Actually thrown at: in block <unit> at <tmp> line 1 |
||
Mudada | Hi, i just tried to install a package with zef in osx but it throws me an error which i can't understand, `CompUnit::Repository install target is not writeable/installable: /Users/username/auto Need a valid installation target to continue` i tried with sudo so i dont think it's a permission problem, does anyone ever get this and solved it ? | 14:44 | |
IOninja | Strings aren't arrays. | ||
DrForr | Ah, also good to know. I'm going to write a simple brace-rebalancing thing for Perl6::Tidy over the weekend so the module can at least do something mildly useful out of the gate. | ||
cale2 | IOninja: I forgot, .comb can coerce strings to arrays | ||
14:45
g4 left,
cdg left,
Unavowed left
|
|||
IOninja | Mudada: never experienced such error :/ | 14:45 | |
cale2 | m: say 'ABCD'.comb.[$_] for ^4; | ||
camelia | A B C D |
||
14:45
Unavowed joined,
drrho left
|
|||
IOninja | Ugh. I've reached the point. I hate Perl 5. It's unprogrammable after long period of programming Perl 6. | 14:47 | |
14:47
perlawhirl left
|
|||
IOninja | and modules.perl6.org's dev server apparently just forkbombed my devbox too -_- | 14:47 | |
raschipi | IOninja: what other languages can you stand? | 14:48 | |
IOninja | raschipi: JS | 14:49 | |
raschipi | yuck | ||
IOninja | Heh | ||
perlpilot | js is becoming more perl-like over time. | 14:50 | |
naxieAlDle | .oO( "use strict" ) |
||
Mudada | rofle | 14:51 | |
naxieAlDle | .oO( … “use strict” ? ) |
||
IOninja doesn't see the resemblance | 14:52 | ||
raschipi | I try to avoid even make files because of the semantic whitespace. | 14:54 | |
naxieAlDle | raschipi: but… what do you use instead? | ||
I've been looking for a decent alternative since forever | |||
14:56
drrho joined,
Mudada left
|
|||
cale2 | m: say <a b c d e f g>.index("b"); | 14:58 | |
camelia | 2 | ||
naxieAlDle | cale2: GOTCHA! | ||
cale2 | yeah... what happened there? | 14:59 | |
moritz | strings happened | ||
m: say <a b c d e f g>.Str | |||
camelia | a b c d e f g | ||
moritz | m: say <a b c d e f g>.Str.index('b') | ||
camelia | 2 | ||
naxieAlDle | cale2: github.com/perl6/doc/issues/992 | ||
moritz | m: say <a b c d e f g>.first('b', :k) | ||
camelia | 1 | ||
naxieAlDle | wtf bdfoy downvoted it? ×D | 15:00 | |
15:01
TeamBlast left
|
|||
IOninja | naxieAlDle: he seems to be downvoting all your replies on that thread: ) | 15:01 | |
raschipi | naxieAlDle: CMake | ||
cale2 | So adding :k should fix it | ||
naxieAlDle | IOninja: not just this thread, I noticed :) | 15:02 | |
15:02
TeamBlast joined
|
|||
IOninja | He clearly likes you ;) | 15:02 | |
DrForr | O gods. | 15:06 | |
[Coke] hurls nolanlawson.com/2017/03/05/what-it...aintainer/ which was a good read. | 15:08 | ||
DrForr | "If you're gonna spew, spew into this." | 15:09 | |
15:09
Cabanossi left
|
|||
IOninja | tl;dr. Summarize it in one sentence! :) | 15:09 | |
15:12
Cabanossi joined
|
|||
stmuk | "If there’s one thing I’ve learned in open source, it’s this: the more work you do, the more work gets asked of you. " | 15:23 | |
moritz | fwiw this is not only true in open source | ||
it's basically everywhere | |||
cale2 | I like that wayne's world reference | ||
[Coke] | "the best thing about my job is that when I do it well I have to do your job too!" | ||
IOninja | mhm | ||
moritz | at work, or volunteering with dishes or cooking at home or in a sports club or whever | 15:24 | |
IOninja | Which why learning to say "No" is important. | ||
timotimo | "Latest commit b8527e9 on 10 Oct 2016" | 15:25 | |
er, ww | 15:26 | ||
Woodi_ | I think it is important when you helping and when someone is trying to abuses good heart... | ||
cale2 | "Nobody opens an issue or a pull request when they’re satisfied with your work" | ||
Is that normal? I thought that's what stars were for | |||
moritz | stars get much less attention | 15:27 | |
then issues/pull requests | |||
timotimo | i very rarely use the star feature on github | ||
moritz | fwiw I try to be happy about pull requests and bug reports, because it means somebody cares about my stuff | ||
and sometimes I manage to do that :-) | |||
timotimo | yeah | 15:28 | |
Woodi_ | cale2: that's other problem :) good is taked for granted :) hard to appreciate that... | ||
cale2 | "You feel guilty about that too, since you know open source is frequently regarded as an exclusive club for privileged white males, like yourself." What does race have to do with github contributions.... | ||
Geth | modules.perl6.org/tags: d01a07b730 | (Zoffix Znet)++ | 8 files Fully working tags handling implementation |
15:29 | |
moritz | cale2: indirectly through education and free time, which often comes through wealth | ||
cale2 | or sex for that matter | 15:30 | |
timotimo | do we have an env var or something taht turns off precompilation? | ||
nine | timotimo: nope. | ||
stmuk | I think there is a pragma | ||
timotimo | pragma isn't good enough for what i want to do | ||
nine | What do you want to do? | ||
timotimo | i'm looking to help our perl6-debugger users put breakpoints into other modules | ||
for that to work these other modules have to go through perl6-debugger's Compiler instance, too | 15:31 | ||
because it generates different code, i.e. calls into the debugger after every line | |||
cale2 | moritz: success is definitely exponential. Or it feels that way. It feels like I was working in a factory and studying just yesterday | ||
nine | timotimo: src/core/CompUnit/PrecompilationRepository.pm:16 | ||
15:36
wamba joined
|
|||
naxieAlDle | “Nobody opens an issue or a pull request when they’re satisfied with your work” – no, it simply means that nobody is using your project :P | 15:37 | |
moritz | but I can totally relate to the feeling | 15:38 | |
naxieAlDle | and if somebody found something lacking, then you simply have a user… | 15:39 | |
timotimo | nine: i see! | 15:40 | |
cale2 | that's a good point | 15:41 | |
timotimo | at some point we'll surely want a debugger that understands moarvm bytecode and its line annotations and such | 15:43 | |
15:43
bdmatatu joined
|
|||
timotimo | perhaps an implementation that instruments the bytecode using the spesh architecture | 15:43 | |
that particular piece of infrastructure has seen many uses so far, it's pretty neat | |||
cale2 | Is there a way to delete an item from an array without creating a hole? docs.perl6.org/syntax/$COLONdelete | 15:56 | |
:delete just seems to make a hole in the list with (Mu) | |||
Geth | doc: 6ec652dbda | (Will "Coke" Coleda)++ | doc/Type/IO.pod6 remove trailing whitespace |
||
doc: 8c7795d380 | (Will "Coke" Coleda)++ | doc/Language/objects.pod6 Prefer Amerenglish. (pass xt/aspell.t) |
|||
timotimo | yes, splice | ||
it'd probably be good to point towards splice from that entry | 15:57 | ||
also, you can use grep :) | 15:58 | ||
cale2 | I'm using grep to find the thing to delete | 15:59 | |
@wrong-answer.=splice(@wrong-answer.grep($correct-answer, :k), 1); | |||
pretty verbose :/ | |||
timotimo | wait, you're using grep, but you're also using :delete? | ||
did you perhaps mean "first" instead of "grep"? | 16:00 | ||
cale2 | It was previously @wrong-answer[@wrong-answer.grep($correct-answer, :k)]:delete; | ||
Sad there isn't a pretty way to do this | |||
timotimo | so why don't you @wrong-answer.grep(* ~~ !$correct-answer)? | ||
jnthn | Maybe: @wrong-answer .= grep: * !=== $correct-answer; | ||
timotimo | er, why did i put the ! there | 16:01 | |
jnthn | Or !~~ depending on what you want | ||
cale2 | Oh that would work | ||
SmokeMachine | naxieAlDle: great bot! What do you think if when you give more than one char it make the tables with more than one value column? Not more tables for each char? | ||
timotimo | oooh | 16:02 | |
that could be neat | |||
cale2 | ah much prettier: my @wrong-answer = %data.values.grep(* !~~ $correct-answer); | ||
IOninja | my @wrong = keys %data.values ∖ $correct | 16:04 | |
my $wrong = %data.values ∖ $correct | 16:05 | ||
cale2 | IOninja: | ||
"\" is difficult to search for in docs. What is that doing? | 16:06 | ||
naxieAlDle | SmokeMachine: sounds like a nice PR :) | ||
IOninja | cale2: "Set difference operator." docs.perl6.org/language/setbagmix....ix_%28-%29 | 16:07 | |
naxieAlDle | SmokeMachine: this is the whole sub: github.com/perl6/whateverable/blob...#L186-L202 | ||
SmokeMachine | naxieAlDle: I'll try! :) | ||
IOninja | cale2: it's not \ it's ∖ | ||
u: ∖ | 16:08 | ||
unicodable6 | IOninja, U+2216 SET MINUS [Sm] (∖) | ||
cale2 | is that a joke? | ||
oh... they look exactly the same | |||
IOninja | No. | ||
On some fonts, yes, they're hard to distinguish | |||
b2gills | For me \ (set minus) is slightly thicker and longer than ∖ (reverse solidus) | 16:09 | |
naxieAlDle | heh, well, with some fonts it's hard to distinguish these: 0Oo l1i :P | ||
tony-o | in monaco they're exactly the same | ||
16:10
Cabanossi left
|
|||
cale2 | calling .pick on a Seq doesn't work... | 16:11 | |
stmuk | in inconsolata they all look different | ||
naxieAlDle | m: say <a b c>.Seq.pick | 16:12 | |
camelia | a | ||
naxieAlDle | m: say <a b c>.Seq.pick | ||
camelia | c | ||
naxieAlDle | cale2: do you have an example? | ||
16:12
Cabanossi joined
16:16
ufobat left
|
|||
cale2 | oh the issue is that I can't call .push on a Seq | 16:17 | |
can I just convert that back to an Array with .Array | |||
IOninja | yes | ||
timotimo | there used to be speculation for a "lazy push" called "plan" | 16:19 | |
not sure what the status of that in general is | |||
16:20
firestarter joined
|
|||
firestarter | hey guys | 16:20 | |
timotimo | greetings | ||
firestarter | i have a question for you | ||
timotimo | are you going to ask me a very personal question? | ||
(just a dumb joke) | 16:21 | ||
firestarter | this time it will be professional, if you don't mind | ||
:) | |||
i have a grammar, which has a proto TOP token | |||
and when i call parse with an actions class | 16:22 | ||
the TOP method on my actions doesn't get called | |||
but when i change the TOP regex into a non-proto version, it gets called | |||
timotimo | you have a method "TOP" in both cases, yeah? | ||
firestarter | yes | ||
16:22
araraloren joined
|
|||
timotimo | i recall there was a stackoverflow question about proto tokens and their interaction with action methods recently | 16:23 | |
jnthn | A proto just delegates to one of the candidates, so the methods are also per candidate | ||
timotimo | right, was about to say that | ||
jnthn | So you'd write a method TOP:sym<foo>($/) { ... } etc. | ||
timotimo | so you'd have a multiple methods in your action class | ||
firestarter | wow, didn't know that | ||
IOninja | timotimo: don't worry, you're not really going to ask them anything? :) | ||
firestarter | is it possible to consolidate these methods without explicitly specifying all of them? | ||
i'm talking about the action methods | 16:24 | ||
skids | You could break the proto out to a level below TOP and make TOP just call that rule, then put an action on TOP. | ||
jnthn | Alternatively, don't use a proto but just an alternation in TOP instead | 16:25 | |
timotimo | IOninja: :D | ||
jnthn | Protos are actually just a way of spreading an alternation out into a bunch of methods, to allow extension/overriding in subclasses and/or to make it easy to process the different branches differently in the actions | 16:26 | |
IOninja swaps the brains of modules.perl6.org... | 16:27 | ||
timotimo | uh oh! :) | ||
firestarter | thanks for the explanation | ||
16:27
itaipu joined,
bdmatatu left,
lichtkind joined
|
|||
lichtkind | cheers | 16:27 | |
firestarter | and guys... how do you debug your code? | ||
lichtkind | does anyone know what MONKEY-SEE-NO-EVAL is? | ||
IOninja | .... if I remember which box its on :/ | ||
timotimo | so, uh, S05-subst*/match.rakudo.moar ... is it supposed to fail right now? | 16:28 | |
IOninja | firestarter: copius amounts of `dd` | ||
timotimo | lichtkind: it allows you to use EVAL with things other than constant strings | ||
jnthn | firestarter: If it's a grammar you're debugging, see Grammar::Tracer | ||
skids | firestarter: Also be aware of RT#125374 | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=125374 | ||
firestarter | but do you use some sort of IDE? i come from the python world, so PyCharm was like my swiss knife | ||
naxieAlDle | lichtkind: basically, you have to explicitly state that you're aware of what you're doing :) | ||
IOninja | m: my $c = "say 'all your base are belong to us'"; EVAL $c | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> EVAL is a very dangerous function!!! (use the MONKEY-SEE-NO-EVAL pragma to override this error, but only if you're VERY sure your data contains no injection attacks) at <tmp>:1 ------> 3ll your base… |
||
timotimo | we do hvae a few perl6 plugins for atom, but nothing that'll put it onto the same level as PyCharm | 16:29 | |
IOninja | lichtkind: it exists to prevent programmers from adding exploits to their code ^ | ||
lichtkind | ah like sledge hammer: trust me im know hwat i do | ||
thank you | |||
araraloren | It's not recommend use EVAL ~ | ||
IOninja | lichtkind: it's handier when you're doing a regex and some token you're interpolating is evaled as a code. Such uses might be hard to spot even if you *do* know what you're doing. | ||
DrForr | "Trust me, I know what I'm doing." Rarely have more dangerous words been uttered. | 16:30 | |
lichtkind | IOninja yes but currently just reading code of an module i try to understand | ||
timotimo | hmm. when i run it without the harness it doesn't seem to fail | ||
IOninja | m: my $token = ".+"; "" ~~ /<$token>/ | ||
camelia | ( no output ) | ||
IOninja | m: my $token = q/.+ {say q|all your base are belong to us|}/; "" ~~ /<$token>/ | 16:31 | |
camelia | 5===SORRY!5=== Error while compiling /home/camelia/EVAL_0 Prohibited regex interpolation (use the MONKEY-SEE-NO-EVAL pragma to override this error, but only if you're VERY sure your data contains no injection attacks) at /home/camelia/EVAL_0:1… |
||
IOninja | ^ example | ||
...here goes nothing.... | 16:35 | ||
Geth | modules.perl6.org: zoffixznet++ created pull request #67: Implement support for META tags |
||
modules.perl6.org: f864e5358f | (Zoffix Znet)++ | 5 files Start sketching out tags support |
16:36 | ||
modules.perl6.org: d01a07b730 | (Zoffix Znet)++ | 8 files Fully working tags handling implementation |
|||
modules.perl6.org: 099958e80a | (Zoffix Znet)++ | 9 files Merge pull request #67 from perl6/tags Implement support for META tags |
|||
IOninja | uh-oh | ||
timotimo | when is it back up? :) | 16:37 | |
IOninja | I don't know why it's down... I was planning on a hot swap | 16:38 | |
timotimo | :D | ||
technology is always like this | |||
bwahaha | 16:40 | ||
that feel when modules.perl6.org presents an error in a line of code preceded with # TODO XXX: there gotta be a less stupid way to do this? | 16:41 | ||
yes, this is the programming i remember! | |||
IOninja | Oh, I found the problem. | ||
timotimo | cool | ||
16:42
curan left
|
|||
IOninja | timotimo: nah, nothing wrong with code. | 16:42 | |
16:42
domidumont left
|
|||
timotimo | yeah, but it's beautiful to look at | 16:43 | |
IOninja | I changed the schema layout, so need to rebuild the database from scratch... Not a problem, just cloned the repo on my other server and sat waiting for it to build everything for an hour.... Problem is, I forgot to switch to my TAGS BRANCH DAMMIT! | ||
:) | |||
timotimo | oooh! | 16:44 | |
araraloren | .. | ||
timotimo | yeah, that'd cause a table to be missing | ||
man, we have quite a few modules | |||
IOninja | k, so modules.perl6.org is now back up on a previous commit; and updates are currently turned off. Gonna rebuild the db off the proper branch now and fix it. Gonna take like an hour to build it tho -_- | ||
lichtkind | hurray its back | ||
timotimo | oh, does it have to make a bajillion http requests? | ||
IOninja | There's like 3 per module | 16:45 | |
timotimo | fair enough :S | ||
IOninja | And we space them out a bit to not hit GitHub limits | ||
naxieAlDle | .oO( github limits? ) |
||
naxieAlDle looks at 2247 gists uploaded by *ables | 16:47 | ||
16:47
risou_awy is now known as risou,
eroux joined
|
|||
IOninja | You're surprised GitHub is not OK with people raping their services with bajillion requests? | 16:48 | |
:) | |||
Hm, per --help on build script "Pause for "N" seconds after building each dist (value of zero is acceptable). Defaults to 5 seconds, which is just enough to prevent going over GitHub's rate-limit of 5,000 requests per hour, when script is running continuously." | |||
Gonna set it to 0 | |||
Zoffix++ # documenting features | |||
naxieAlDle also remembers that he was told by github support to delete one of his accounts, which he avoided by simply not replying back… | |||
16:49
firestarter left
|
|||
cale2 | What are the conditions that you can pass `:my-boolean` as an argument to a sub? | 16:50 | |
it's weird that it doesn't require a sigil on it | 16:51 | ||
IOninja | cale2: that it expects a Bool or wider named argument | ||
moritz | :my-boolean is just named argument my-boolean => True | ||
IOninja | m: sub foo (:$my-boolean) { dd $my-boolean }( :my-boolean ) | ||
camelia | Bool $my-boolean = Bool::True | ||
IOninja | m: sub foo (:$my-boolean) { dd $my-boolean }( :!my-boolean ) | ||
camelia | Bool $my-boolean = Bool::False | ||
ilmari | cale2: it's equivalent to :mo-boolean(True) or my-boolean => True | ||
s/mo/my/ | |||
IOninja | camelia: see also: twitter.com/zoffix/status/839807414211854337 | ||
raschipi | Or Pair.new('key', 'value'); | 16:52 | |
naxieAlDle | IOninja: :o | ||
IOninja | raschipi: nope. That'd get passed as a positional, not named argument. | ||
naxieAlDle | IOninja: you are starting to talk with bots… I wonder if that's a sign of anything :) | ||
raschipi | I see. | ||
moritz | it's a sign of self actualization | 16:53 | |
IOninja | I meant.. | ||
cale2: see also: twitter.com/zoffix/status/839807414211854337 | |||
naxieAlDle | camelia: you don't really care when people talk to you, right? | ||
IOninja | naxieAlDle: also... "starting"? You clearly aren't aware of my years long friendship with GumbyBRAIN | ||
naxieAlDle | evalable6: hey! Feel like chatting? | 16:54 | |
evalable6 | naxieAlDle, Full output: gist.github.com/30dc984776701cdb0f...5bbde2cfc2 | ||
(exit code 1) 04===SORRY!04=== Error while compiling /tmp/5hSb8lY5nG Negatio… |
|||
IOninja | I even engraved an urn for him when he got banned in freenode/#perl :) | ||
16:54
labster joined
|
|||
IOninja | zoffix.com/new/GumbyBRAIN-perl-urn-engraving/ | 16:54 | |
naxieAlDle | IOninja: … wow… | 16:55 | |
IOninja | Hah, amusing to see which quote I chose to go on the urn :P | ||
16:58
eroux left
|
|||
Geth | ecosystem: melezhik++ created pull request #307: Sparrowdo module to run goss scenarios |
17:00 | |
ecosystem: 533761b504 | (Alexey Melezhik)++ | META.list Sparrowdo module to run goss scenarios (#307) github.com/melezhik/sparrowdo-goss |
17:01 | ||
IOninja | alright... take #2 | 17:02 | |
17:04
risou is now known as risou_awy
|
|||
IOninja | oh shoot | 17:05 | |
Well, the good news—it works! | |||
But I didn't realize we had that many damn tags :o | |||
17:06
xzhao left
|
|||
moritz | how many do we have? two? | 17:07 | |
IOninja | moritz: modules.perl6.org/ | ||
naxieAlDle | cool | 17:08 | |
IOninja | Well, I'm gonna leave it like that for now. And will sort out something more usable in ~7-8 hours. | ||
17:08
xzhao joined
17:09
Cabanossi left
17:12
Cabanossi joined
17:14
robertle left
|
|||
cale2 | So when you use these colon-pairs, what is the type of the colon part? Is it always a Bool? | 17:15 | |
or it's always just an Any Scalar? | |||
17:16
MilkmanDan left
|
|||
b2gills | :foo is short for :foo(True) but can also be written as foo => True | 17:16 | |
:!foo is short for :foo(False) | |||
IOninja | cale2: Str => whatever | ||
cale2: and colonpair itself is a Pair | 17:17 | ||
17:18
MilkmanDan joined
|
|||
IOninja | m: dd [.^name, .key.^name, .value.^name ] for :foo, :42bar, :meow[<a b c>] | 17:18 | |
timotimo | IOninja: is gumbybrain a bot that used to tell people to move perl6 chat to a different channel? | ||
camelia | ["Pair", "Str", "Bool"] ["Pair", "Str", "Int"] ["Pair", "Str", "Array"] |
||
IOninja | timotimo: it's a Markov chain bot | ||
17:18
xzhao left
|
|||
timotimo | OK | 17:18 | |
17:18
xzhao joined
17:20
Ven left
17:21
raschipi left,
eroux joined
17:22
labster left
|
|||
cale2 | so there is no such thing as keywords in Perl 6 | 17:22 | |
they just kind of spoof a keyword | |||
It's actually a string underneath the :word | 17:23 | ||
17:23
Ven joined
|
|||
SmokeMachine | naxieAlDle: it's not finding Uniprops... neither does zen... | 17:24 | |
*zef | |||
IOninja | cale2: heh, not sure there's much relation between colonpairs and keywords... | 17:25 | |
cale2: :word is more or less just an alternate way to write |Pair.new: "word", True | |||
17:26
zakharyas joined
|
|||
IOninja | cale2: and you can use whatever type you want for the key | 17:26 | |
17:26
xzhao left
17:28
itaipu left,
itaipu joined
|
|||
IOninja | perl6.party/post/Tag-Your-Dists | 17:29 | |
17:29
xzhao joined
|
|||
IOninja | I mean.. | 17:29 | |
New post: "Camelia wants YOU to tag your dists": perl6.party/post/Tag-Your-Dists | |||
cale2 | That issue I had with splitting lines is back again. glot.io/snippets/env5vqftj7 I can't recall why/how this is working this way | 17:31 | |
lizmat | cale2: the first line doesn't have a " - ", could that be an issue ? | 17:32 | |
ah no, you shift that | |||
IOninja | cale2: what issue? | 17:34 | |
oh there comments | |||
[Coke] | What do you expect @lines.split(" - ") to do? | 17:35 | |
timotimo | hah | ||
17:35
girafe joined
|
|||
[Coke] | split works on a Str, not an Array | 17:35 | |
timotimo | split is a Str method, it'll call @lines.Str for you before it .split s | ||
IOninja | cale2: @lines.split(" - ") treats your array as one bigass string | ||
17:36
Ven left
|
|||
lizmat | cale2: how about: my %h = @lines.map( { |.split(" - ") } ) | 17:37 | |
cale2 | Even when I tried @lines>>.split it did the same thing | ||
IOninja | cale2: say @lines».split(" - ").flat.flat.Hash; | ||
lizmat | cale2: how about: my %h = @lines.map( { |.split(" - ") } ) | ||
IOninja | cale2: right, 'cause you're still .Hashing a list of lines (a list of lists)... not a list of splits | ||
17:38
Ven joined
|
|||
[Coke] | wonder if we could write a diagnostic module that would warn you when something got coerced. | 17:38 | |
cale2 | What I want to understand is how the first method is different from the others | ||
[Coke] | (via a sig.) | ||
IOninja | cale2: the first method you're processing each line one-by-one. In the others you're processing all of them in one statement | ||
[Coke] | in the first one, you're iterating over lines workingon the elements. in the latter, you're converting the arrya intoa single string and workign on that | 17:39 | |
[Coke] taps out and lets IOninja handle this. ) | |||
cale2 | .split(" - ").Hash.say for @lines; @lines>>.split(" - ").Hash.say; | ||
those two should be the same. Just a difference of where @lines goes | 17:40 | ||
[Coke] | none of your code has >>. , btw. | ||
IOninja | They're not the same | ||
timotimo | very different, actually | ||
lizmat | my %h = @lines.map( { |.split(" - ") } ) # loop over all lines, map each line to its split, and slip that: the result is a sequence of key,value,key,value that can serve as the initialization of a hash | ||
IOninja | cale2: in first one, you're calling .Hash on result of split. In second one you're calling it on @lines | ||
cale2: on lines from @lines, now split. | |||
cale2: the ». applies only to that one method calls, further method calls are called on the list | 17:41 | ||
lizmat feels like she is talking to a well and decides to shut up about this | |||
timotimo | IOninja: calling .Hash on *results* of .split ;) | ||
IOninja | lizmat: I tried your method and it works FWIW :) | ||
17:41
khw joined
|
|||
moritz | The Lizmat Method works! | 17:42 | |
naxieAlDle | SmokeMachine: join #whateverable :) | 17:43 | |
cale2 | ahhh | ||
so this should work: @lines>>.split(" - ")>>.Hash.say; | |||
and it does :) | |||
IOninja | timotimo: on a list with those results... | ||
lizmat | cale2: but it doesn't create a single hash | 17:44 | |
it creates a hash for each line | |||
timotimo | IOninja: in the first one, the one with a "for @lines" at the end, you're calling .Hash for every line, rather than once | ||
i wanted to make that clear, so i thought i'd suggest "results" instead of "result" | |||
cale2 | this works though | 17:45 | |
my %data = @lines>>.split(" - ")>>.Hash; say %data; | |||
IOninja | timotimo: but there's only one result -_- exactly because it's called everyba vsdf/t.ljka;;' | ||
cale2 | The question is now which version is more intelligible. I like lizmat's, but the flat operator is confusing there | ||
timotimo | now you're putting a list of hashes into %data; does that give you what you want? | ||
IOninja: okay! | 17:46 | ||
Geth | whateverable: 86d7cf3600 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Uniprops.pm6 Commit forgotten file Needed for unidump experimental feature. |
||
lizmat | my %h = @lines.map( | *.split: " - " ) # better readable ? | ||
IOninja | Does split support junctions? | 17:47 | |
cale2 | lizmat's version produces the same output as my version | 17:48 | |
moritz | m: say 'a|b!c'.split('|' | '!') | ||
camelia | any((a b!c), (a|b c)) | ||
cale2 | @lines>>.split(" - ")>>.Hash | ||
moritz | roughtly what I expected | ||
IOninja | m: my %h = "foo - bar\nmeow - me\nb - z".lines.split: ["\n", " - "]; dd %h | ||
camelia | Hash %h = {:foo("bar meow"), "me b" => "z"} | ||
IOninja | huh | ||
Oh right | |||
m: my %h = "foo - bar\nmeow - me\nb - z".split: ["\n", " - "]; dd %h | 17:49 | ||
camelia | Hash %h = {:b("z"), :foo("bar"), :meow("me")} | ||
IOninja | win | ||
timotimo | m: say "a!b,c!d|e|f|g".split("!" | "|" | ",") == 2 | ||
camelia | any(False, False, True) | ||
17:52
MilkmanDan left
|
|||
cale2 | Is it just me, or does Rakudo not output data shapes consistently? | 17:53 | |
17:53
MilkmanDan joined
|
|||
naxieAlDle | cale2: example? | 17:54 | |
cale2 | m: say ("a is this", "b is that", "c is over there"); | ||
camelia | (a is this b is that c is over there) | ||
17:54
bdmatatu joined
|
|||
cale2 | this is where commas would be VERY helpful | 17:54 | |
17:55
unicodable6_ joined
|
|||
IOninja | Don't use say? | 17:55 | |
timotimo | m: put ("a is this", "b is that", "c is over there"); | ||
camelia | a is this b is that c is over there | ||
timotimo | m: dd ("a is this", "b is that", "c is over there"); | ||
camelia | ("a is this", "b is that", "c is over there") | ||
cale2 | m: say "a is this", "b is that", "c is over there"; | ||
camelia | a is thisb is thatc is over there | ||
timotimo | that's an entirely different beast, though | 17:56 | |
17:56
unicodable6_ left
|
|||
timotimo | that's multiple arguments to say, which is supposed to output each with no space in between | 17:56 | |
cale2 | yeah dd is way better | 17:58 | |
lichtkind | IOninja : you are aware of the issues with module list? | ||
perlpilot | lichtkind: he is. | 17:59 | |
IOninja | lichtkind: possibly. The dubplciation thing? | ||
perlpilot | lichtkind: unless you've got a new issue you'd like to enlighten us with? :) | ||
17:59
unicodable6 left,
unicodable6 joined,
ChanServ sets mode: +v unicodable6
|
|||
lichtkind | i found it starnge that some isnt duplicated and some is quadrupeled | 17:59 | |
strange | 18:00 | ||
IOninja | quadrupled? | ||
lichtkind: which one? | |||
I only see dupes | 18:01 | ||
perlpilot | yeah, I've only seen doubles myself. | ||
18:01
domidumont joined
|
|||
IOninja | Only `Foo` but that one is a test module that has two entrries | 18:02 | |
lichtkind: any other quadrupled? | |||
I need to know, because I was about to try a fix, but if any are quadrupled then it won't help... | |||
lichtkind | i think it was File::find but after reload thats gon | ||
but i check again | |||
IOninja | Well. I may have pushed the update while the ecosystem updater script was running and it inserted a bunch of dupes. This is my assumption. It was running right now. I killed it and copied over the fresh db I built on another server. If I was right with my assumption the dupes are gone. If not, they'll reappear and I'll debug it later in the evening. | 18:05 | |
I hope no potential future employers are reading this log of my making mistakes one after the other :P | 18:06 | ||
18:06
Ven left
|
|||
IOninja | gah, I see the dupes again! | 18:07 | |
18:09
Ven joined
|
|||
perlpilot | IOninja: You should welcome future employers to read this. It gives them an opportunity to ask, "What did you learn from your mistakes?" And if they aren't asking that question, but judging on the mistakes themselves, you don't want to work for such people. | 18:10 | |
18:11
TeamBlast left
|
|||
IOninja | I learned: don't push to production unless your next 2-3 hours are free to debug any problems :P | 18:11 | |
18:12
TeamBlast joined
|
|||
IOninja | aha, I killed the bash updater, but that didn't kill the perl udater the bash script started... there's still hope :P | 18:13 | |
perlpilot | IOninja: do we have a staging area for modules.perl6.org? Maybe we should create one if not. | ||
IOninja | perlpilot: what's a "staging area"? | 18:14 | |
cale2 | a dev environment? | 18:15 | |
perlpilot | Just a place where we can deploy code for testing with a wider audience without affecting modules.perl6.org | ||
IOninja | perlpilot: no, we don't. The current modules.perl6.org is meant to be temporary in the first place. :/ | 18:16 | |
Based on the update log it *was* the build script that was inserting dupes. | |||
perlpilot | IOninja: you know how many "temporary" things have been in place for decades? | ||
IOninja | perlpilot: how many? | 18:17 | |
perlpilot | lots | ||
IOninja | Stupid. | ||
perlpilot | temporary is an intent that isn't always fulfilled. | ||
IOninja | It's somewhat good though. Perl 6 is now more reasonable to use for the ecosystem website than it was 1.5 years ago | 18:18 | |
lichtkind | IOninja found the quad it was Foo | ||
timotimo | ninety million hundred fifty thousand hundred temporary things | ||
lichtkind | literally :) | ||
and its actually repeated 5 times | 18:19 | ||
IOninja | lichtkind: <IOninja> Only `Foo` but that one is a test module that has two entrries | ||
perlpilot | now that *is* weird. | ||
IOninja | I see it in triplicate now :/ | 18:20 | |
18:20
Ven left
|
|||
IOninja | Oh yeah, there *are* three entries with it in meta.list | 18:20 | |
perlpilot | There are 2 Foo that are the same, one that's different, then 2 that are the same again. | ||
IOninja | refresh your page... | 18:21 | |
perlpilot | yay! | ||
lichtkind | yes Fow now thrice | 18:23 | |
18:23
Ven joined
|
|||
IOninja | OK. Updater's running again and not inserting any more dupes. | 18:24 | |
My job here is done. | |||
IOninja flies away | |||
naxieAlDle | .oO( dragon? ) |
||
lichtkind | IOninja++ | ||
18:29
eroux left,
firestarter joined
18:30
itaipu left
18:33
eroux joined
|
|||
japhb | naxieAlDle: Talaria. | 18:36 | |
18:37
itaipu joined
18:38
FROGGS joined
18:40
wamba left,
cdg joined,
Cabanossi left
18:41
bdmatatu left
18:42
Cabanossi joined
18:45
itaipu left
18:46
cdg left,
cdg joined
|
|||
firestarter | m: use MONKEY_TYPING; augment slang Regex { token numish { } }; | 18:47 | |
camelia | ===SORRY!=== Could not find MONKEY_TYPING at line 1 in: /home/camelia/.perl6 /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-inst-2/share/perl6 CompUni… |
||
firestarter | m: augment slang Regex { token numish { } }; | 18:48 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> augment not allowed without 'use MONKEY-TYPING' at <tmp>:1 ------> 3augment slang Regex7⏏5 { token numish { } }; expecting any of: generic role |
||
18:48
risou_awy is now known as risou
|
|||
firestarter | use MONKEY-TYPING; augment slang Regex { token numish { } }; | 18:48 | |
m: use MONKEY-TYPING; augment slang Regex { token numish { } }; | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Null regex not allowed at <tmp>:1 ------> 3G; augment slang Regex { token numish { 7⏏5} }; |
||
18:52
Ven left
18:53
Ven joined
|
|||
IOninja | ... www.youtube.com/watch?v=wmin5WkOuPw | 18:58 | |
Geth | whateverable: FCO++ created pull request #110: More than one char for line |
19:02 | |
19:03
itaipu joined
19:05
risou is now known as risou_awy
19:10
TEttinger joined
19:11
dct joined
19:13
cale2 left,
robinsmidsrod left
19:14
rindolf left
19:19
robinsmidsrod joined
|
|||
Geth | whateverable: f3bad83786 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Whateverable.pm6 Do not upload if there are no files It was needlessly changed in 4200209c50c142edf049fa628e859adf61d9d00e |
19:25 | |
whateverable: 78f51a53f5 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 7 files Test timeouts Basic tests for #12. No tests for Benchable yet, see #99. |
|||
19:25
TeamBlast left
|
|||
Geth | whateverable: f9e7010bff | (Aleks-Daniel Jakimenko-Aleksejev)++ | t/unicodable.t Fix unicodable test Oops! |
19:25 | |
19:27
TeamBlast joined
19:28
dct left
19:29
cdg left,
cdg joined
19:31
itaipu left,
Geth left
19:32
araraloren left
19:33
araraloren joined,
buggable left
19:34
buggable joined,
ChanServ sets mode: +v buggable,
Geth joined,
ChanServ sets mode: +v Geth
19:35
Ven left
19:36
sprocket joined
|
|||
sprocket | hello, #perl6! | 19:36 | |
moritz | \o | ||
sprocket | i’ve got a question about gather/take - i’ve having difficulties getting it to construct a lazy list | ||
that’s assuming it’s able to do that, which i thought it was :) | 19:37 | ||
moritz | it is | ||
sprocket | so it’s likely something i’ve done? | ||
ok | |||
moritz | but you shouldn't assign it to an array in the end, that might be eager | ||
(just guessing here) | |||
sprocket | ah, ok, i’m doing that | ||
would that force non-laziness? | |||
moritz | m: my \result = gather for ^5 { take $_; say $_ }; my $x = result[2] | ||
camelia | 0 1 |
||
moritz | sprocket: yes, unless it can detect it's infinite (if I remember correctly) | 19:38 | |
gfldex | sprocket: see: gfldex.wordpress.com/2016/08/14/it...-way-down/ | ||
IOninja | m: my @result = lazy gather for ^5 { take $_; say $_ }; my $x = result[2]; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: result used at line 1 |
||
IOninja | m: my @result = lazy gather for ^5 { take $_; say $_ }; my $x = @result[2]; | ||
camelia | 0 1 |
||
19:39
Ven joined
|
|||
sprocket | ok, it was indeed the assinging to an array that forced non-laziness | 19:39 | |
that was an easy fix, thanks! | |||
moritz | you're welcome | ||
IOninja | And yes, if .is-lazy is true it'll keep laziness | 19:40 | |
m: my @a = 1…Inf; say @a[^3] | |||
camelia | (1 2 3) | ||
gfldex | does sub lazy mix in a role? | 19:41 | |
19:41
cdg_ joined
|
|||
IOninja | s: &lazy | 19:41 | |
SourceBaby | IOninja, Something's wrong: ERR: ===SORRY!=== Error while compiling -eUndeclared routine: lazy used at line 6 | ||
IOninja | It's a statement prefix IIRC | ||
moritz | m: my @result = lazy gather for ^5 { take $_; say $_ }; my $x = @result[2] | ||
camelia | 0 1 |
||
moritz | that's another option | ||
gfldex: no, it just sets a bit on the result list | |||
jnthn | Think it's just done by delegation | 19:42 | |
moritz | s/list/iterator/ I guess | ||
jnthn | At least, that's how I originally did it :) | ||
IOninja | What's delegation? | ||
gfldex | m: my @result = gather for ^5 { take $_; say $_ } but role :: { method is-lazy { True } }; my $x = @result[2] | 19:43 | |
camelia | 0 1 2 3 4 |
||
jnthn | Yup, github.com/rakudo/rakudo/blob/51b0...ble.pm#L77 | ||
IOninja: Where one object forwards stuff to another | |||
So it just holds the nested iterator and delegates calls to that | |||
IOninja | m: my @a = (gather for ^10 { take $_; say $_ }).lazy-if: 1; @a[2] | 19:44 | |
camelia | 0 1 |
||
IOninja | Thanks. | ||
19:44
cdg left
|
|||
gfldex | docs.perl6.org/routine/lazy-if | 19:45 | |
:-| | |||
IOninja | heh | ||
I always thoughht it were an internal method :) | |||
gfldex | so .is-lazy controls if .lazy is called and I can set force that with .lazy-if(1) | 19:46 | |
i will check roast | |||
IOninja | I'm no experct, but I saw it as: .lazy-if(1) is a way to make .is-lazy === True; and when it isn't, assigning to an array is eager; no .lazy calls involved. | 19:47 | |
19:47
cdg_ left
|
|||
IOninja | And I've no idea what .is-lazy is about :} | 19:47 | |
m: my $s = gather for ^10 { take $_; say $_ }; say $s.is-lazy; $s[2 | 19:48 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in subscript; couldn't find final ']' at <tmp>:1 ------> 3 take $_; say $_ }; say $s.is-lazy; $s[27⏏5<EOL> expecting any of: statement end st… |
||
IOninja | m: my $s = gather for ^10 { take $_; say $_ }; say $s.is-lazy; $s[2] | ||
camelia | False 0 1 |
||
19:48
mindos left
|
|||
IOninja | Like that's lazy, but not is-lazy... vOv | 19:48 | |
Geth | doc: 0fa3fc3b0e | (Wenzel P. P. Peppmeyer)++ | 2 files .lazy-if is internal |
19:49 | |
19:50
Ven left
|
|||
IOninja | m: say (1..6).roll(*).is-lazy | 19:51 | |
camelia | True | ||
IOninja | "Built-in operations that know that they can produce infinitely many values return True here, for example (1..6).roll(*)." | ||
But it won't produce infinitely many! | |||
oh | |||
OK, never mind :) | |||
So many things are lazy, and .is-lazy should really be named .is-infinite | 19:52 | ||
gfldex | things can be lazy but not infinite | 19:53 | |
or better a .is-lazy can throw EndIteration | |||
IOninja | gfldex: what's lazy? | ||
huh | |||
19:54
Ven joined
|
|||
gfldex | lazy just means that the generation/computation/fatching of values happens out-of-order | 19:54 | |
maybe even concurrent | |||
IOninja | huh | ||
moritz | erm, nope | ||
IOninja | What do you mean out of order? | ||
naxieAlDle | yea, this discussion again… | ||
moritz | lazy doesn't do concurrent | ||
gfldex | not by itself | 19:55 | |
naxieAlDle | how many times we had it? And the conclusion has always been that is-lazy is broken anyway :) | ||
gfldex | but I can make it :) | ||
IOninja | naxieAlDle: was it the group's conclusion or your own? | ||
gfldex | IOninja: as soon as there is something lazy about the execution of commands breaks normal control flow. You can't depend on a call tree anymore. | ||
naxieAlDle | IOninja: nobody was ever able to define what it does. The conclusion is my own :P | ||
IOninja | moritz: so why are some things lazy but their .is-lazy is False? | ||
m: my $s = gather for ^10 { take $_; say $_ }; say $s.is-lazy; $s[2] | 19:56 | ||
camelia | False 0 1 |
||
IOninja | moritz: ^ like there. Values are lazily generated... are they not? | ||
gfldex: what's "lazy"? | |||
moritz | IOninja: I don't know in this specific case; I'd have expected gather/take to be always lazy | 19:57 | |
gfldex | IOninja: "lazy" is an abstract concept and as such does not exist | ||
IOninja | gfldex: what do you mean by the word when you used it above? | ||
gfldex | m: Channel.new.is-lazy.say | ||
camelia | False | ||
gfldex | that channel could very well be lazy even if it pretends not to be | 19:58 | |
IOninja | naxieAlDle: I'm starting to share your feelings on the subject. | ||
gfldex | IOninja: the Perl 6 behaviour tied to that concept | ||
IOninja | gfldex: and what is it? | ||
moritz | we mark known infinite lists with is-lazy, and those that the user explicitly requested to be lazy | 19:59 | |
naxieAlDle | IOninja: thing is, once we define what it should do, we will be able to file a couple of bug reports… and eventually it will start making sense | ||
moritz | it's far from perfect, but nobody has yet suggested a better heuristic or solution | ||
IOninja | moritz: so .is-lazy is a misnomer? It should be named .is-infinite? | ||
gfldex | IOninja: the result of continuations provided by gather/take and iterator trickery | ||
IOninja | gfldex: ok, then if gather/take is lazy, why does its .is-lazy is False by default? | 20:00 | |
moritz | IOninja: not really; "lazy gather for ^5 { take _$ }" is not inifnite | ||
but explicitly lazy | |||
IOninja | moritz: but it' | ||
moritz: but it's lazy without explicity. | |||
gfldex | IOninja: i consider .is-lazy a hint to the compiler, not myself | 20:01 | |
moritz | IOninja: it's lazier with it :-) | ||
gfldex | (well the runtime aswell) | ||
moritz | IOninja: like, assignment to an array interprets one case eagerly, and other lazily | ||
IOninja | but why? | ||
moritz | performance | 20:02 | |
lazy lists are rather expensive | |||
so we try to only use laziness when we need it | |||
IOninja | Makes no sense to me to overload term "laziness" this way. | ||
naxieAlDle | m: say (1..99999999999999999999999999999999).is-lazy | 20:03 | |
camelia | False | ||
moritz | we could totally make an assignment like my @a = 1..10; lazy, but accessing @a would be very slow | ||
Geth | doc: 3719d5fab0 | (Wenzel P. P. Peppmeyer)++ | doc/Language/list.pod6 wrong method was wrong |
||
naxieAlDle | m: say (1..∞).is-lazy | ||
camelia | True | ||
gfldex | the whole section is shitty | ||
gfldex takes notes | |||
naxieAlDle | IOninja: maybe we should start a table somewhere | 20:04 | |
IOninja | naxieAlDle: what sort of table? | ||
naxieAlDle | IOninja: with a list of things that are .is-lazy and things that are not | ||
moritz | maybe we'd be better off by making the whole lazy vs. eager thing explicit | ||
IOninja | no | ||
gfldex | naxieAlDle: alcohol is a solvent, not a solution | ||
moritz | but then stuff like my @a = 1..*; would hang | ||
gfldex | ohh, that kind of table | 20:05 | |
IOninja | So far I see it entirely as a terminology problem. | ||
20:05
Ven left
|
|||
IOninja | People using "lazy" to mean both, a thing that makes as many values as was demanded, and a thing that will be evaulated lazily when assigned to mostly-lazy constructs. | 20:05 | |
20:06
firestarter left
|
|||
IOninja | naxieAlDle: sounds good. | 20:06 | |
20:08
Ven joined
|
|||
naxieAlDle | IOninja: like this: github.com/rakudo/rakudo/wiki/is-lazy | 20:09 | |
IOninja | \o/ | ||
huggable: is-lazy :is: github.com/rakudo/rakudo/wiki/is-lazy | 20:10 | ||
huggable | IOninja, Added is-lazy as github.com/rakudo/rakudo/wiki/is-lazy | ||
20:11
labster joined,
captain-adequate joined
|
|||
IOninja | "Someone has edited the wiki since you started. Please reload this page and re-apply your changes." | 20:11 | |
naxieAlDle | if anybody is going to edit it now, don't forget to copy your additions before pressing save. IIRC github was known to throw away changes when conflicts happen | ||
IOninja | yeah... I'll edit it later, I guess :P | ||
m: (-∞..42).is-lazy.say | 20:12 | ||
camelia | True | ||
IOninja | m: (-∞...42).is-lazy.say | 20:13 | |
camelia | False | ||
IOninja | :) | ||
naxieAlDle | good one | ||
IOninja | m: ().roll(*).is-lazy.say | 20:14 | |
camelia | False | ||
IOninja | m: (1).roll(*).is-lazy.say | ||
camelia | True | ||
naxieAlDle | .oO( create a bot that takes a snippet from this list and asks people if it's lazy or not ) |
20:20 | |
lichtkind | is there soething imortant about perl 6 which is recent that you want the worl to know? | ||
naxieAlDle | lichtkind: why do you ask? :) | 20:21 | |
lichtkind | becasue i will give a talk in 2 days and i might overlooked something | 20:22 | |
20:22
domidumont left
|
|||
IOninja | lichtkind: what sort of talk? | 20:23 | |
We've got v6.d.PREVIEW pragma working recently. | |||
lichtkind | mostly perl 6 :) | ||
IOninja | lichtkind: I figured that, but what topic? | ||
lichtkind | i gave the overview last yer thsi time more tlking real code | ||
20:23
sprocket left
|
|||
IOninja | lichtkind: I don't know about "new". I rather people tell more about "same old", as in: the spec is solidified and people should use Perl 6 now instead of waiting for something. | 20:26 | |
Based on some survey I took this morning, seems this fact isn't widely known :/ | |||
lichtkind: and on the opposite spectrum from my previous statement: we gonna do many changes to IO routines. Gonna ninja the crap outta them \o\ -o- /o/ | 20:27 | ||
lichtkind | haha | 20:28 | |
thatswhy your name | |||
IOninja | :) | ||
naxieAlDle | lichtkind: if you want people to go crazy, mention something like this: twitter.com/zoffix/status/838709592364355584 | 20:31 | |
IOninja | :) | ||
20:32
FROGGS left
|
|||
IOninja | m: say rand > ½ ≠ rand < ½ | 20:32 | |
camelia | False | ||
IOninja | m: say rand > ½ ≠ rand < ½ | ||
camelia | False | ||
IOninja | wonder how that's parsed... | 20:34 | |
(rand > ½) && (½ ≠ rand) && (rand < ½) ? | |||
20:35
bjz joined
|
|||
IOninja | yeah, think so... | 20:36 | |
well, with one fewer rand calls | |||
m: my \r1 = rand; my \r2 = rand; say (r1 > ½) && (½ ≠ r2) && (r2 < ½) | 20:37 | ||
camelia | True | ||
IOninja | Oh wait, that's not entirely right either, due to short circuiting :P | 20:38 | |
m: say (rand > ½) && (½ ≠ (my \r = rand)) && (r < ½) | |||
camelia | False | ||
naxieAlDle | and that's why it is useful :) | ||
IOninja | :) | 20:39 | |
20:41
Cabanossi left
|
|||
IOninja | m: my BagHash \b .= new; | 20:42 | |
camelia | ===SORRY!=== Method call node requires at least one child |
||
IOninja | :) | ||
20:42
Cabanossi joined
|
|||
lichtkind | naxieAlDle, thanks for reminding | 20:44 | |
IOninja | what the... gist.github.com/zoffixznet/4f9f926...4aec4a18ac | ||
Wonder how it managed to get 6.2 and 7.3 in the results? | 20:45 | ||
naxieAlDle | hm :D | ||
IOninja | m: my BagHash $b .= new; $b{rand.substr: 0, 3}++ xx 20000; $b{$b.keys.grep: * < 1}:delete; for $b.sort { .say } | 20:46 | |
camelia | 4.1 => 1 7.4 => 1 |
||
IOninja | Getting them on every run :/ | ||
naxieAlDle | m: my BagHash $b .= new; $b{rand.substr: 0, 3}++ xx 20000; $b{$b.keys.grep: * < 1}:delete; say so $b.keys.any > 2 | ||
camelia | True | 20:47 | |
naxieAlDle | 6c: my BagHash $b .= new; $b{rand.substr: 0, 3}++ xx 20000; $b{$b.keys.grep: * < 1}:delete; say so $b.keys.any > 2 | ||
committable6 | naxieAlDle, ¦2015.12,2016.01.1,2016.02,2016.03,2016.04,2016.05,2016.07.1,2016.08.1,2016.09,2016.10,2016.12,2017.02,HEAD(f190f24): «True» ¦2016.06,2016.11,2017.01: «False» | ||
naxieAlDle | 6c: my BagHash $b .= new; $b{rand.substr: 0, 3}++ xx 20000; $b{$b.keys.grep: * < 1}:delete; say so $b.keys.any > 2 | ||
IOninja | The problem goes away if I use rand.round: .1 instead of .substr | ||
BUT | |||
committable6 | naxieAlDle, ¦2015.12,2016.12: «False» ¦2016.01.1,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,2016.09,2016.10,2016.11,2017.01,2017.02,HEAD(f190f24): «True» | ||
IOninja | both 0 and 1 show up. Albeit with 10x fewer apperances | 20:48 | |
somethign's fishy in this code | |||
20:48
xzhao left
|
|||
IOninja | oh, not 10x, but 2x | 20:48 | |
20:49
xzhao joined
|
|||
IOninja | I guess that makes sense? | 20:49 | |
20:49
risou_awy is now known as risou
|
|||
naxieAlDle | aaaaaaaaaaaah | 20:49 | |
2.31045708216635e-05 | |||
that's how you get it | |||
20:50
lichtkind_ joined
|
|||
naxieAlDle | m: my BagHash $b .= new; $b{rand.Str.substr: 0, 3}++ xx 20000; $b{$b.keys.grep: * < 1}:delete; for $b.sort { .say } | 20:50 | |
camelia | 8.3 => 1 | ||
IOninja | Oh, mistery solved. | ||
naxieAlDle++ :) | |||
hehe | |||
IOninja relocates | 20:51 | ||
20:54
lichtkind left
|
|||
Geth | whateverable: f94baf405d | (Fernando Correa)++ | Unicodable.p6 More than one char for line |
20:54 | |
whateverable: ab172eec93 | (Fernando Correa)++ | Unicodable.p6 Bold line with diff values |
|||
whateverable: bacdb1a553 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Unicodable.p6 Merge pull request #110 from FCO/master More than one char for line |
|||
20:58
ggoebel left
20:59
lichtkind_ is now known as lichtkind
|
|||
lichtkind | what is whateverable? | 20:59 | |
even its wiki was not revealing to me | 21:00 | ||
moritz | the repo description is " Different IRC bots that operate on a bunch of prebuilt Rakudo versions" | ||
bisectable6 for example uses git bisect to find which commit broke (or fixed) something | 21:01 | ||
21:03
xzhao left
|
|||
rjbs | /win 7 | 21:04 | |
21:05
risou is now known as risou_awy
|
|||
mst | risou_awy: hey, IRC has an away status so generally it's considered better to use that rather than nick changes | 21:07 | |
skids | Or etymologically, bots whos names end in "able" | ||
21:11
ggoebel joined
21:21
jonas1 left
|
|||
ugexe | muhammadable hasn't been around lately | 21:22 | |
21:32
perlawhirl joined
21:35
Ven left
|
|||
naxieAlDle | except for huggable, it's an exception :) | 21:38 | |
21:38
Ven joined
21:39
Cabanossi left
|
|||
naxieAlDle | lichtkind: let me demonstrate! Let's say rakudo behavior was different some time ago, and you want to run your code on an older version. You can do this: | 21:39 | |
committable6: 2016.05 say ‘hello’ | 21:40 | ||
committable6 | naxieAlDle, ¦2016.05: «hello» | ||
naxieAlDle | and you can do this with almost any version. Feeling nostalgic? Let's try this: | ||
committable6: 2014.01 say 'hello' | |||
committable6 | naxieAlDle, ¦2014.01: «hello» | ||
lichtkind | its evalbot? | 21:41 | |
naxieAlDle | partly, yes | ||
lichtkind | otehr part? | ||
naxieAlDle | the most interesting thing about it is that it has a few thousands of rakudo versions already built for ya! This makes a lot of things much faster | 21:42 | |
21:42
Cabanossi joined
|
|||
naxieAlDle | for example, want to know when ≤ operator was added? Let's bisect: | 21:42 | |
bisect: say 2 ≤ 50 | |||
bisectable6 | naxieAlDle, Bisecting by exit code (old=2015.12 new=f190f24). Old exit code: 1 | ||
naxieAlDle, bisect log: gist.github.com/be204e4408a38a65d1...6c28dd05a3 | |||
naxieAlDle, (2017-03-05) github.com/rakudo/rakudo/commit/d2...45de7a6703 | |||
naxieAlDle | if it had to build rakudo on every step, it would spend many minutes just compiling stuff | 21:43 | |
lichtkind: unicodable, for example, doesn't eval anything. Most of the time | 21:45 | ||
unicodable6: ☺ | |||
unicodable6 | naxieAlDle, U+263A WHITE SMILING FACE [So] (☺) | ||
naxieAlDle | lichtkind: but because it's built on the same code, you can actually give it some code to eval | 21:46 | |
unicodable6: { .uniname eq ‘BUTTERFLY’ } | |||
unicodable6 | naxieAlDle, U+1F98B BUTTERFLY [So] (🦋) | ||
naxieAlDle | and statisfiable doesn't eval anything at all, not even close | ||
but it gathers some stats about rakudo builds | 21:47 | ||
statisfiable6: install | |||
statisfiable6 | naxieAlDle, OK! Working on it… | ||
naxieAlDle | will take a minute to get done, but we should see a nice graph :) | ||
statisfiable6 | naxieAlDle, gist.github.com/008d59c2692ae4f821...27bd240cbc | ||
naxieAlDle | (possibly some broken builds on the graph, but generally the picture is still very useful) | 21:48 | |
lichtkind: if you have any questions or ideas, I'd love to hear ;) | 21:49 | ||
lichtkind | thank you very much this could i even copy into a slide :) | 21:50 | |
naxieAlDle | lichtkind: some time ago I also wrote this: perl6advent.wordpress.com/2016/12/...n-awesome/ | 21:51 | |
lichtkind: it mentions bisectable | |||
lichtkind: (and explains why it is useful) | |||
statisfiable6: core | 21:52 | ||
statisfiable6 | naxieAlDle, OK! Working on it… | ||
lichtkind | thank you | ||
statisfiable6 | naxieAlDle, gist.github.com/224c168cc1f3d0bce1...e5db6c8440 | ||
IOninja | modules.perl6.org is duped again :/ | 21:54 | |
22:00
skids left
22:03
bjz left
22:04
Todd joined
|
|||
Todd | Hi All, I am having trouble converting a system call from the shell method to the run method. The pipe "|" is what is messing me up. I have posed my code at vpaste.net/VpOCc | 22:06 | |
Is there some special method when using a pipe with run? | 22:07 | ||
22:07
Actualeyes left
|
|||
jnthn | Todd: If you're going to use | you need a shell | 22:09 | |
Since | is interpreted by the shell | |||
And run explicitly is not using a shell | |||
moritz | that's what shell is for :-) | 22:10 | |
jnthn | Though looking at what you're doing, it seems it'd perhaps be better to pass :in to run and then write to the stdin of the process, however that's done | ||
Todd | rats. Is there a way to send "standard in" to xclip other than with a pipe? | 22:11 | |
oh! How do I do that? | |||
22:11
mcmillhj left
|
|||
jnthn | Don't know off hand, though should be in the docs | 22:12 | |
gfldex | docs.perl6.org/type/Proc$COLON$COLONAsync | ||
jnthn | I know for Proc::Async you do something like Proc::Async.new('xclip', 'args'..., :w) | 22:13 | |
Geth | whateverable: 86c7cd908e | (Aleks-Daniel Jakimenko-Aleksejev)++ | Unicodable.p6 Make sure that the raw table is aligned correctly I don't think anybody needs the unrendered version, but it does not take much to generate it beautifully. |
||
whateverable: 55107145b6 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Unicodable.p6 Escape | in markdown tables It seems that this is the only way to do it. Meh. |
|||
jnthn | And then you can .print once the process is started | ||
gfldex .oO( Am I one of those bots? ) | 22:14 | ||
Geth | whateverable: d1bc520b4a | (Aleks-Daniel Jakimenko-Aleksejev)++ | Whateverable.pm6 Somehow this has to be boolified Previously changed in f3bad83786a5ed3eef036394f76739154f379546 |
22:15 | |
22:15
unicodable6 left,
unicodable6 joined,
ChanServ sets mode: +v unicodable6
|
|||
Todd | docs.perl6.org/routine/run isn't much help | 22:15 | |
22:16
unicodable6 left,
unicodable6 joined,
ChanServ sets mode: +v unicodable6
|
|||
jnthn | See the Proc::Async docs that gfldex sent | 22:16 | |
naxieAlDle | unidump: 8½ | 22:17 | |
unicodable6 | naxieAlDle, gist.github.com/e2bcd8a316408a14e1...a3229c2295 | ||
naxieAlDle | SmokeMachine++ | ||
timotimo: ↑ ;) | |||
moritz | perlgeek.de/images/rakudo_top_contributors.png # Top contributors to Rakudo, as determined by a Perl 6 program, rendered through Inline::Python with matplotlib | 22:18 | |
naxieAlDle | (note that properties that differ are highlighted with bold text) | ||
SmokeMachine | naxieAlDle: that was great idea! :) naxieAlDle++ | ||
Todd | I am not smart enough to use that link | ||
moritz | Todd: stop telling yourself you're not smart | 22:19 | |
IOninja | wooo \o/ I made the cut! | 22:20 | |
naxieAlDle | moritz++ # beautiful | ||
jnthn | Todd: The example underneath "An example that opens an external program for writing:" is almost exactly what you want | ||
IOninja | Colorblind-unfriendly chart tho :P | ||
jnthn | Todd: Except replace `$prog.write(Buf.new(12, 42))` with `$proc.print($Str)` | 22:21 | |
naxieAlDle | … especially considering that jnthn and IOninja are of the same color… | ||
IOninja | heh | ||
jnthn | Yeah, I noticed that | ||
Geth | doc: ca19bc57b4 | (Wenzel P. P. Peppmeyer)++ | 2 files link to Proc::Async |
||
jnthn | So even though I'm slacking off on Rakudo and doing more MoarVM stuff these days, it still looks like I might be busy :P | ||
22:22
Ven left
|
|||
naxieAlDle | samcv: I think you will like this too ↑ ;) | 22:22 | |
samcv: (unidump) | 22:23 | ||
22:23
Je_ joined,
Ven joined
|
|||
samcv | the docs commit? | 22:23 | |
oh unidump | 22:24 | ||
Je_ | Say 1 | ||
IOninja | m: say 1 | ||
camelia | 1 | ||
IOninja | :) | ||
naxieAlDle | samcv: it highlight properties that differ! How cool is that! | 22:25 | |
s | |||
samcv | oh nice tables naxieAlDle | ||
naxieAlDle | unidump: ¹²³⁴⁵⁶⁷⁸⁹⁰ | ||
Je_ | m: $a//=1 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$a' is not declared at <tmp>:1 ------> 3<BOL>7⏏5$a//=1 |
||
timotimo | naxieAlDle: beautiful | ||
unicodable6 | naxieAlDle, gist.github.com/28de88b1552e6dbe40...c86cbed04a | ||
samcv | wow nice | ||
i approve | |||
Todd | Do I need the `use v6.c;` | 22:26 | |
22:26
RabidGravy left
|
|||
IOninja | Todd: no, but should | 22:26 | |
Todd: without it, it's assumed you want the latest and greatest Perl 6 language version. | |||
(ATM there's only v6.c, but the Future will happen) | |||
Todd | #!/usr/bin/perl6 is at the top of my program | 22:27 | |
IOninja | Sure, that's fine. | ||
Todd: it'll always be perl6; the versions will go v6.d, v6.e, v6.f and so on | |||
naxieAlDle | m: say ‘²’.uniprop(‘East_Asian_Width’); say ‘⁸’.uniprop(‘East_Asian_Width’) | 22:28 | |
camelia | A N |
||
naxieAlDle | I don't even… | ||
samcv | that's odd | ||
that's what unicode says on unicode.org/cldr/utility/properties.html too | 22:29 | ||
oh naxieAlDle the cp's are very different | 22:30 | ||
8 is 2078 2 is 00B2 | |||
22:30
Je_ left,
mcmillhj joined
|
|||
naxieAlDle | heh… looking at that page, not even sure why we need unicodable ×D | 22:30 | |
samcv | nah we need unicodable6 that site is lame sometimes | 22:31 | |
i've found errors | |||
IOninja | :S and now the dupes are gone from modules.perl6.org... and I've done nothing :\ this thing is just messing with me now :/ | 22:33 | |
22:35
mcmillhj left
22:37
TEttinger left,
Ven left
22:38
TEttinger joined
22:39
Ven joined
|
|||
IOninja | gotta 'cause I changed primary key; and the dupes exist while the build script is running, then get dumped at the end. | 22:39 | |
22:40
Voldenet left
|
|||
IOninja | c: $*PERL.compiler.version.say | 22:42 | |
committable6 | IOninja, I cannot recognize this command. See wiki for some examples: github.com/perl6/whateverable/wiki/Committable | ||
IOninja | lolunub | 22:43 | |
timotimo | a machine died on us today :\ | ||
it's a quarter to midnight | |||
IOninja | c: HEAD $*PERL.compiler.version.say | ||
committable6 | IOninja, ¦HEAD(22f00cd): «v2017.02.228.g.22.f.00.cd.72» | ||
22:44
mcmillhj joined
22:45
Voldenet joined,
Voldenet left,
Voldenet joined
|
|||
Todd | 'replace `...` with `$proc.print($Str)`'; prog was misspelled | 22:46 | |
IOninja | Todd: in docs? | ||
Todd | And Yippee! it is working! Thank you guys! | ||
IOninja | \o/ | ||
22:50
risou_awy is now known as risou
|
|||
Todd | no. that was from <jnthn> Todd: Except replace `$prog.write(Buf.new(12, 42))` with `$proc.print($Str)` | 22:52 | |
he misspelled prog | |||
Here is the full module. It is for reading and writing to **both** clipboards. vpaste.net/5bPCL | 22:53 | ||
If you guys like it, feel free to add it to the pile | 22:54 | ||
SmokeMachine | IOninja: what's the frequency the tags are indexed? | ||
Todd | here is a test program for the module: vpaste.net/U2PAv | 22:55 | |
IOninja | SmokeMachine: same as dists... ~1.5hr | ||
22:56
perlawhirl left
|
|||
lichtkind | has anyone clue what XML::PI stand for | 22:56 | |
thanks in advance | |||
SmokeMachine | IOninja: ok! Ill wait to see if my change on my META6.jsons worked... | ||
22:58
zakharyas left,
zakharyas joined
|
|||
lichtkind | found it www.cisco.com/c/en/us/td/docs/ios-x...ml-pi.html | 23:03 | |
23:03
zakharyas left
|
|||
SmokeMachine | IOninja: whats the idea with Camelion? | 23:05 | |
23:05
perlawhirl joined
|
|||
IOninja | SmokeMachine: perl6.party/post/Tag-Your-Dists#ca...gyourdists | 23:06 | |
The rest is classified until 2017.04.15 | |||
SmokeMachine | OK then... :) | 23:07 | |
23:07
Sound joined,
Ven left
23:08
risou is now known as risou_awy
23:09
Ven joined,
bjz joined
|
|||
IOninja | likely will delay fixing tags and duplication for another 14 hours... Too tired to mess with this code tonight. | 23:11 | |
IOninja & | |||
Todd | what am I doing wrong here? I am trying to subsitute all teh line feeds with commas: $Rows ~~ s:global/\n/,/; | 23:14 | |
IOninja | Todd: what makes you think it's wrong? | 23:17 | |
and that's a newline not a line feed, innit? | |||
m: dd "\c[LINE FEED]".ords | |||
camelia | (10,).Seq | ||
Todd | it return, not the reformatted text, but ":global" | ||
IOninja | m: dd "\n".ords | ||
camelia | (10,).Seq | ||
IOninja | Ah OK, nevermind | 23:18 | |
m: my $Rows = "abc\nfoo\nmeow"; $Rows ~~ s:global/\n/,/; say $Rows | |||
camelia | abc,foo,meow | ||
23:18
mcmillhj left
|
|||
IOninja | m: my $Rows = "abc\nfoo\nmeow"; $Rows .= trans: "\n" => ','; say $Rows | 23:19 | |
camelia | abc,foo,meow | ||
IOninja | .oO( .trans-mutate .... ) |
||
Todd | oops, never mind. I had bad data going into the sub | 23:20 | |
naxieAlDle | m: ‘5’.uniprop(‘Numeric_Type’) | ||
camelia | ( no output ) | ||
naxieAlDle | m: ‘5’.uniprop(‘Numeric_Type’).say | ||
camelia | Decimal | ||
naxieAlDle | m: ‘²’.uniprop(‘Numeric_Type’).say | ||
camelia | |||
naxieAlDle | m: ‘②’.uniprop(‘Numeric_Type’).say | 23:21 | |
camelia | |||
23:28
geekosaur left
23:29
geekosaur joined
|
|||
Geth | modules.perl6.org/tag-fixes: febbf164eb | (Zoffix Znet)++ | lib/ModulesPerl6/Model/Dists/Schema/Result/Dist.pm Fix duplication of modules during db update run The tag work changed primary key of Dist table and this made ->update_or_create fail to update existing stuff, since we're not passing it the primary key. So it dupes the modules during build, and at the end of the build the originals get assumed to be old, deleted dists and are tossed. Fix by using meta URL as primary column. |
23:30 | |
23:31
perlawhirl left,
wamba1 joined
23:33
Sound left
|
|||
Todd | In the vpaste.net/Dx11Y code the commented out qx will read until the end, but the run method stops at the first line feed. Is there a was to get run to read the whole thing? I am reading a column of data | 23:34 | |
IOninja | .. | 23:36 | |
Todd: use the same method as you use on qx//? | |||
Todd: .get gets one line. Use .lines in that place and toss $Str.lines | |||
Todd | Thank you! | 23:40 | |
# my $Str = $proc.out.get; my $Str = $proc.out.lines; | 23:46 | ||
readline requires an object with REPR MVMOSHandle | |||
23:48
risou_awy is now known as risou
|
|||
MasterDuke | might need a $proc.start first? | 23:48 | |
Todd | No such method 'start' for invocant of type 'Proc' | 23:49 | |
samcv | hello Todd | 23:50 | |
IOninja | Todd: what perl6 version you got? | ||
samcv | if you're making the proc object with `run` then you don't need to .start | ||
timotimo | if it's a Proc::Async, you need to tap the .out which i sa supply | 23:52 | |
IOninja | FWIW the link to code in question is just a few lines above. | ||
23:53
Ven left
|
|||
IOninja | Todd: what version are you using? | 23:53 | |
Todd | $ rpm -qa rak\* rakudo-star-0.0.2016.11-1.el7.x86_64 | ||
MasterDuke | shouldn't checking the status happen before getting the output? | ||
samcv | it's just a proc object not a procasync timotimo | 23:54 | |
timotimo | OK | ||
anyway, i'm enhancing that error message | |||
Todd | yum says no updates to rakudo-star | ||
timotimo | oh yum | 23:55 | |
IOninja | Todd: just swap it to .out.slurp.lines | ||
timotimo | please give us perl6 --version | ||
Todd | $ perl6 --version This is Rakudo version 2016.11 built on MoarVM version 2016.11 implementing Perl 6.c. | ||
IOninja | Todd: works fine on latest Perl 6 and there were fixes to .lines since your version | ||
Todd: and doing .slurp first will avoid the bug | |||
23:56
Ven joined
|
|||
Todd | No such method 'slurp' for invocant of type 'IO::Pipe' | 23:56 | |
23:56
Cabanossi left
|
|||
IOninja | :S | 23:56 | |
Todd | my $Str = $proc.out.slurp.lines; | ||
IOninja | Oh right | ||
Todd: sorry, it's out.slurp-rest.lines | |||
(inconsistent naming)-- | 23:57 | ||
23:57
Cabanossi joined
|
|||
samcv | Todd, what distro do you have? fedora? | 23:58 | |
Todd | That worked! Thank you! | ||
IOninja | any time | ||
timotimo | moarvm's latest commit will give you the type name and what repr the thing in question had | 23:59 | |
Todd | My primary is Scientific Linux 7.3. The Fedora machine I work on a lot is $ perl6 -version This is Rakudo version 2017.01 built on MoarVM version 2017.01 implementing Perl 6.c. | ||
naxieAlDle | hm, why not out.lines ? | ||
IOninja | -_- | ||
samcv | great that's the newest star |