»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:04
mcmillhj left
00:09
mcmillhj joined
00:12
scott joined
|
|||
scott | when does || differ from //? | 00:12 | |
00:12
tushar joined,
scott is now known as Guest73996
00:14
itaipu joined,
mcmillhj left
|
|||
avuserow_ | m: say 0 // -1; say 0 || -1; say Int // -1; # scott: // prints the left side if it's defined, || requires it to be true | 00:19 | |
camelia | rakudo-moar fc3160: OUTPUT«0-1-1» | ||
avuserow_ | Guest73996: ^^ | ||
00:24
avuserow_ is now known as avuserow,
cbk_ left
00:26
mcmillhj joined
00:31
mcmillhj left,
cbk_ joined
00:39
canopus left,
perlawhirl joined
00:41
mcmillhj joined,
ribasushi left
00:42
zoosha joined
00:45
jonadab joined,
luis` joined
00:46
mcmillhj left
00:47
f3ew joined,
ribasushi joined
00:48
canopus joined,
pierre_ joined
00:49
cgfbee left
00:50
cgfbee joined
00:51
cbk1090 joined,
Guest73996 left,
Guest73996 joined,
Guest73996 left,
Guest73996 joined,
Guest73996 is now known as scott
|
|||
scott | avuserow_: thanks! | 00:52 | |
my mistake was only checking cases where the LHS is undefined, not where it's defined but falsey | 00:53 | ||
00:57
mcmillhj joined
00:58
canopus left
01:01
mcmillhj left
01:03
canopus joined
01:15
mcmillhj joined
01:21
mcmillhj left
01:30
cbk_ left,
cbk1090 left
01:31
mcmillhj joined
01:34
tushar left
01:35
_slade_ joined
01:37
mcmillhj left,
perlawhirl left
01:44
Matthew[m] joined
01:46
cognominal joined
01:47
ilbot3 joined,
mcmillhj joined
01:48
Matias[m] joined
01:53
mcmillhj left
01:55
ilmari[m] joined
01:58
mcmillhj joined
01:59
pierre_ left
02:02
pierre_ joined
02:03
itaipu left,
mcmillhj left
02:04
beatdown left
02:05
nbrown joined
02:08
noganex joined
02:14
nbrown left
02:15
user9 left,
cognominal left,
mcmillhj joined
02:17
cdg joined
02:18
perlawhirl joined
02:20
cdg left,
Guest87807 is now known as ponbiki,
mcmillhj left
02:21
cdg joined
02:24
cognominal joined
02:29
mcmillhj joined
02:34
mcmillhj left
02:41
pierre_ left
02:42
mcmillhj joined,
Joeperl joined
02:43
Joeperl left
02:46
mcmillhj left,
pierre_ joined
02:51
pierre_ left
02:53
pierre_ joined
02:56
cognominal left
03:05
obfusk_ joined
03:08
mcmillhj joined
03:13
mcmillhj left
03:25
aries_liuxueyang left
03:26
aries_liuxueyang joined
03:30
kurahaupo joined
03:33
labster left
03:35
cdg left,
cdg joined
03:36
kurahaupo_ joined,
dayangkun joined
03:37
mcmillhj joined,
dayangkun left,
dayangkun joined,
kurahaupo` joined
03:39
dayangkun left,
kurahaupo left
03:41
mcmillhj left,
dayangkun joined,
kurahaupo_ left
03:43
kurahaupo` left
03:58
cdg_ joined
04:00
cdg left
04:09
dayangkun left,
nebuchadnezzar joined
04:18
ka joined,
pierre_ left
04:20
BenGoldberg left
04:24
mcmillhj joined
04:27
pierre_ joined,
zakharyas joined
04:29
mcmillhj left,
khw left
04:31
pierre_ left
04:32
holyghost joined
04:35
skids left
04:36
mcmillhj joined
04:40
mcmillhj left
04:52
cdg_ left,
cdg joined
04:55
labster joined
05:00
Cabanossi left
05:03
Khisanth left
05:04
Cabanossi joined
05:06
rgrinberg left
05:07
mcmillhj joined
05:12
mcmillhj left
05:17
dayangkun joined
05:18
cdg left
05:23
Khisanth joined
05:28
pierre_ joined
05:32
pierre_ left
05:33
AlexDaniel left
05:34
pierre_ joined
05:46
wamba joined
05:49
domidumont joined
05:51
domidumont left
05:52
cognominal joined,
domidumont joined
06:06
vv joined
06:09
mcmillhj joined
06:11
vv left
06:14
mcmillhj left
06:16
cognominal left
06:22
bjz joined,
bjz left
06:29
darutoko joined
06:30
salva joined
06:33
mcmillhj joined
06:34
firstdayonthejob joined
06:36
RabidGravy joined
06:37
mcmillhj left
06:40
bjz joined
|
|||
perlawhirl | bisectable6: dd ((1,2,3),(4,5,6)).map(&join) | 06:43 | |
bisect: old=2015.10 ((1,2,3),(4,5,6)).map(&join).say | 06:44 | ||
ok bisectable is not around | 06:45 | ||
m: my @a = ((1,2,3),(4,5,6)); say @a.map(&join); say @a.map(*.join); # <-- is this a bug? &join should work, right? | |||
camelia | rakudo-moar fc3160: OUTPUT«( )(123 456)» | 06:46 | |
perlawhirl | confirmed it's the same in 2015.09, so it's not a regression | 06:48 | |
06:49
mcmillhj joined
06:52
nadim joined
06:53
woolfy left
06:54
mcmillhj left
06:57
woolfy joined
|
|||
TimToady | not a bug, I think, since function join has a first arg saying what to join with, and that's all you're supplying | 06:57 | |
so it joins nothing together with '1 2 3' | |||
07:01
xinming joined
07:03
ka left
07:04
mcmillhj joined
|
|||
perlawhirl | right, so only method form has a default $separator... got it | 07:05 | |
07:07
bjz left
07:09
mcmillhj left
07:10
aries_liuxueyang left
07:11
aries_liuxueyang joined
07:15
dayangkun left,
ka joined
07:16
dayangkun joined
07:27
pecastro left
07:28
labster left
07:31
labster joined
07:37
perlawhirl left
|
|||
masak | good morning, #perl6 | 07:44 | |
RabidGravy | marning | ||
El_Che | Hi Dr. Nick^W^Wmasak | 07:46 | |
arnsholt | Good morning, from a SSH and bash on Windows (without cygwin \o/) | ||
The new WSL thingy is pretty neat | |||
07:47
firstdayonthejob left
|
|||
stmuk_ | and it even tells Microsoft what you typed! | 07:49 | |
El_Che | arnsholt: is the terminal emulator ok? | ||
arnsholt | El_Che: It renders text =) | ||
And it can be full-screened (unlike the old cmd one) | |||
moritz | does it support ANSI control sequences? | 07:50 | |
curses programs? | |||
arnsholt | No problems with irssi AFAICT, nor vim | ||
I haven't tested either extensively yet, but so far so good | |||
Even renders the UTF-8 Camelia in the /topic fine | 07:51 | ||
moritz | that's all < 255 codepoints | ||
anyway, that does sound decent | |||
07:52
mcmillhj joined,
_slade_ left
07:54
g4 joined,
g4 left,
g4 joined
07:57
mcmillhj left,
pierre_ left
08:01
user9 joined
08:05
ocbtec joined,
Matias[m] left,
scott left,
tadzik left,
ilmari[m] left,
Matthew[m] left,
M-Illandan left,
dayangkun left
08:06
dakkar joined
08:08
mcmillhj joined
|
|||
El_Che | arnsholt: when on Windows and I don't have the time to install a LInux VM, I use ssh on cygwin. A lot better than it used to be | 08:08 | |
08:09
pierre_ joined
08:13
mcmillhj left
08:16
telex joined
|
|||
arnsholt | El_Che: Yeah, it's been a long time since I used cygwin TBH | 08:16 | |
Except the occasional use with the git bash | 08:17 | ||
08:17
ilmari[m] joined
08:26
CIAvash joined
08:27
dayangkun joined
08:43
mcmillhj joined
08:46
bjz joined,
larion joined,
larion left,
larion joined
08:47
mcmillhj left
08:59
ilmari[m] left
09:07
eliasr joined
09:11
cognominal joined
09:19
pierre_ left
09:27
ilmari[m] joined
09:28
pierre_ joined
09:31
mcmillhj joined
09:32
pierre_ left
09:34
pierre_ joined
09:35
cognominal left
09:36
mcmillhj left
09:37
bjz left
09:39
rindolf joined
09:42
TEttinger left
09:43
mcmillhj joined
09:46
gregf_ joined
09:48
mcmillhj left
09:49
bjz joined
10:00
zakharyas left,
zakharyas joined
10:05
zakharyas left
10:14
ka left
10:26
pierre_ left
10:28
dayangkun left
10:30
llfourn joined,
kaare_ joined
10:48
ka joined
10:50
labster left
11:01
wamba left
11:05
obfusk_ left,
obfusk joined
11:06
wamba joined
|
|||
RabidGravy | Oooh the HTTP header returned by github is longer than 2048 bytes, hence LWP::Simple crapping out when it tries to parse the response | 11:07 | |
11:09
mcmillhj joined
|
|||
dalek | c: 3a2609a | (Tom Browder)++ | doc/Type/Signature.pod6: fix typo |
11:11 | |
timotimo | RabidGravy: ouch, bad idea to have such a hard limit in there | 11:13 | |
11:14
mcmillhj left
|
|||
RabidGravy | indeed, just looking at the best way to fix it | 11:15 | |
11:16
frankD2 joined,
frankD2 left
|
|||
timotimo | turn it up to 4196, clearly! :) :) | 11:16 | |
arnsholt | 4196 bytes should be anough for everyone! \o/ | 11:17 | |
timotimo | clearly with brötli compression that'll be much less of an issue! | 11:18 | |
RabidGravy | eugh, just seen a PHP gig a mile away | 11:37 | |
anyway, just fixed that by getting more blob until there's some header | |||
11:43
pierre_ joined
|
|||
masak | lol, I blogg'd! strangelyconsistent.org/blog/the-cu...aring-test | 11:43 | |
11:46
pierre_ left
11:48
Dunearhp joined
11:50
cognominal joined
11:52
skids joined
11:55
mcmillhj joined
|
|||
dalek | osystem: 41f52c8 | (Kamil Kułaga)++ | META.list: removing lacuna-cookbook The library is useless since 1 October 2016 (the game Lacuna Expanse gets shutdown) |
11:56 | |
11:57
CIAvash left
12:00
mcmillhj left
|
|||
Dunearhp | How do I build rakudo so that moar has debugging symbols? | 12:02 | |
12:03
skids left
|
|||
Dunearhp | I'm trying to get a useful core dump backtrace for moar | 12:05 | |
hackedNODE | Dunearhp: cd nqp/MoarVM; perl Configure.pl --debug=3 --prefix=../../install/bin/; make; make install; cd ../.. | ||
(that's from rakudo's checkout | 12:06 | ||
The Configure.pl also takes --help that lists all of the options | |||
12:06
kurahaupo joined
|
|||
hackedNODE | ) | 12:06 | |
RabidGravy | there appears to be something wrong with rakudo.org | 12:10 | |
oh, not anymore | 12:11 | ||
it's hit in the tests of LWP::Simple and was taking a long time and then 500ing | 12:12 | ||
Dunearhp | thanks. forgot to set the prefix | 12:16 | |
hackedNODE | m: $?TABSTOP | 12:22 | |
camelia | rakudo-moar c01fc3: OUTPUT«WARNINGS for <tmp>:Useless use of $?TABSTOP in sink context (line 1)» | ||
hackedNODE | m: say $?TABSTOP | ||
camelia | rakudo-moar c01fc3: OUTPUT«8» | ||
hackedNODE | TIL that's a thing :P | ||
"How many spaces is a tab in a heredoc or virtual margin" | |||
Clearly that's a bug! It should be 4 :P | |||
12:25
bioduds joined
|
|||
bioduds | hello all :) | 12:25 | |
hackedNODE | \o | 12:26 | |
12:27
ufobat left
|
|||
masak | hackedNODE: 4 is the "new standard", what I see most Python programs etc be written in. 8 is the old convention, and what tabs do in terminal emulators etc. | 12:31 | |
tab characters, I mean. | |||
sjn thought for a second masak was talking about π | 12:32 | ||
12:32
atacama joined
|
|||
masak | well, if π is 4 then you're either in a space with positive curvature, or in Indiana. | 12:32 | |
sjn | fortunally, the next sentence fixed that impression. :) | ||
hackedNODE | m: say 2×π == τ | 12:33 | |
camelia | rakudo-moar c01fc3: OUTPUT«True» | ||
masak | hackedNODE: generally not a good idea to use exact equality on floaty things, though. | ||
hackedNODE | m: say 2×π ≅ τ | ||
camelia | rakudo-moar c01fc3: OUTPUT«True» | 12:34 | |
hackedNODE | m: say ୨×π ≅ τ | ||
camelia | rakudo-moar c01fc3: OUTPUT«True» | ||
hackedNODE | :D | ||
12:34
ufobat joined
12:35
itaipu joined
|
|||
sjn thinks perl6 should have the option to warn when confusing homographs are used | 12:37 | ||
hackedNODE strongly disagrees | 12:38 | ||
sjn | rly? | ||
why? | |||
bioduds | I got the server calls to work! what was happening is that I was using asynchronous calls | ||
hackedNODE | Options to warn means extra processing and slower language. And what's the usefulness of that warning? | ||
bioduds | so they gave results before they were actually ready | 12:39 | |
:) | |||
sjn | m: say ୨ == 9; | ||
camelia | rakudo-moar c01fc3: OUTPUT«False» | ||
bioduds | now, I got a synchronous method and it is working greatly | ||
moritz | warnings are the worst of the both worlds; ideally either a construct is illegal, or legal | ||
hackedNODE | sjn: and? That's not a real program | ||
12:39
user9 left
|
|||
moritz | if, as the language designer, you can't decide which way it is, you neither generate a proper error, nor is the feature really usuable due to the warnings | 12:40 | |
hackedNODE nods | |||
sjn | moritz: fair enough. I was more thinking of the optionality being important | 12:41 | |
12:42
itaipu left
|
|||
sjn | something one can turn on as get an answer to "is this sane in $some_certain_aspect?" | 12:42 | |
moritz | use ascii; | ||
sjn | mm | ||
12:43
user9 joined,
Actualeyes left
|
|||
sjn | hackedNODE: maybe I'm a little paranoid these days, but I'm thinking that if someone wants to introduce horrible bugs that are really difficult to spot, then homonyms can be used for that | 12:44 | |
m: say 2.1 + 0.୨ | |||
camelia | rakudo-moar c01fc3: OUTPUT«2.3» | ||
hackedNODE | sjn: I'd say paranoid is right. I don't need homonyms to introduce bugs on purpose. I can just write shitty code. | 12:45 | |
Why would someone write the above on purpose? | |||
12:45
user9 left
|
|||
sjn has lately been working in the financial sector, where code reviews and such are mandatory | 12:45 | ||
hackedNODE: disgruntled employees? | |||
sadly, they exist | |||
hackedNODE | And that's the best they can think of? :) | 12:46 | |
hackedNODE would go for perl6.party/post/Anguish--Invisible...Data-Theft | |||
sjn | hey, it's the tiny subtle bugs that can hurt a lot | ||
they still have to pass a code review, right? | |||
hackedNODE | If I ran a shop and found out a someone added that for no good reason, they'd be fired on the spot. | 12:47 | |
12:47
user9 joined
|
|||
sjn | hackedNODE: yeah, I agree | 12:47 | |
still, the damage can happen | |||
and a well placed bug like that can cost a lot, especially in a financial setting | |||
hackedNODE | Seems an awfully hypothetical scenario to warrant an introduction of a warning. Especially since you have to look not just for ୨, but for its use in close proximity with other digits | ||
sjn | hackedNODE: nah, a "use ascii" test would be sufficient | 12:48 | |
the warning idea I get is a bad idea | |||
hackedNODE | for English-centric countries that write programs with no intentions of internationalizing them... I guess | ||
sjn | but having the possibility to check for bugs like that, would still be interesting in some settings | ||
hackedNODE | I'm sure there's a grep incantation that can do it :P | 12:49 | |
hackedNODE &' | |||
sjn | how would one programatically check for something like that? | ||
perlpilot | "Oh, here's a bit of code that looks like it does what I want; I'll just cut and paste ..." Oops. :-) | ||
12:49
robertle joined
12:50
wamba left
12:52
mcmillhj joined
12:57
user9 left
|
|||
melezhik | Hi! | 12:57 | |
yoleaux | 15 Sep 2016 00:09Z <Zoffix> melezhik: your attempt to gather captures may be hindered with what I think is a bug: irclog.perlgeek.de/perl6/2016-09-15#i_13212176 | ||
12:57
user9 joined
|
|||
melezhik | have not spoken here for awhile )) | 12:57 | |
hackedNODE | that wasn't a bug actually. | 12:58 | |
melezhik | yolexaus - I guess I have finished a complete working code, at least for me | ||
it is here - github.com/melezhik/outhentix-dsl/...#L274-L282 | 12:59 | ||
this is exactly what I needed, thanks to Zoffix and others for help! | 13:00 | ||
so as for me, I am completely satisfied with answers I got ... and I have my working code, I also gained some Perl6 / regex knowledges by the road ... yeah | 13:02 | ||
13:02
domidumont left
13:03
domidumont joined
|
|||
melezhik | I have a different question concerning Perl6 objects and code eval ... | 13:03 | |
13:04
bjz left
13:05
bjz joined,
canopus left
|
|||
melezhik | if it possible to eval a Perl6 code "in a context" of object; let me provide a useful example first ... | 13:06 | |
class Foo { method !hello { say "hello" } }; my $foo = Foo.new; | 13:08 | ||
and I want to eval "self!hello" for instance $foo; | |||
I know such a things are possible in ruby | 13:09 | ||
RabidGravy | is there a way of getting the modules for a single author that I have missed? | ||
melezhik | so this is my question ... - if it possible to eval a Perl6 code "in a context" of object; | 13:10 | |
13:10
cdg joined
|
|||
RabidGravy | melezhik, if I understand correctly, no | 13:10 | |
moritz | melezhik: in Perl 6, you'd use the MOP for that | ||
melezhik: my $method = $foo.^privat_method_table(){'hello}; $method($foo) | 13:11 | ||
something along those lines | |||
melezhik | moritz: thanks, will try ... do you know any doc links on Perl6 MOP ? | 13:12 | |
RabidGravy | or even "$foo.$method" | ||
13:12
rgrinberg joined
|
|||
RabidGravy | $foo.$method() rather | 13:12 | |
moritz | melezhik: docs.perl6.org/language/mop | ||
and in docs.perl6.org/type.html search for Metamodel | 13:13 | ||
melezhik | actually, I need not only a private method invocation, it was just an example, I want to eval a piece of Perl6 code, given by string and eval it "as if it would executed inside obect's class' | ||
13:13
canopus joined
|
|||
moritz | melezhik: why? | 13:13 | |
that's a very ruby-ish approach, not a very perlish approach :-) | 13:14 | ||
melezhik | moritz: sure, this is why I said I saw it in ruby | ||
"why" ... good question, let me think abit to answer you | 13:15 | ||
moritz | it might be possible with augment class TheClass { EVAL "string here }, but using the MOP is likely cleaner and more robust | 13:16 | |
melezhik | to answer on why - , let me try ... in simple words . Well end user _interact _with some DSL ( not Perl6 code ) which make it possible to eval some Perl6 code, but I want to eval this code a "context" of some existed instance, not just a main program | 13:18 | |
gfldex | m: use MONKEY-SEE-NO-EVAL; class A { has $.a }; my $a = A.new: :a(42); ($a but role :: { method eval ($c) { EVAL $c } }).eval('say $a'); | 13:19 | |
camelia | rakudo-moar f6524e: OUTPUT«A.new(a => 42)» | ||
gfldex | melezhik: ^^^ there you go | ||
melezhik | gfldex: thanks ... | ||
gfldex | m: use MONKEY-SEE-NO-EVAL; class A { has $.a }; my $a = A.new: :a(42); ($a but role :: { method eval ($c) { EVAL $c; self } }).eval('say $a'); | ||
camelia | rakudo-moar f6524e: OUTPUT«A.new(a => 42)» | ||
gfldex | maybe better to return self | 13:20 | |
not sure what happens if you mutate inside eval, but with a returned self you can assign back to $a | |||
13:21
sammers left
|
|||
gfldex | also Perl 6++ | 13:21 | |
melezhik | if your approach could be generalized on evaling ANY perl6 code? | ||
gfldex | ANY Perl 6 code is to bit a target for me to comprehend | 13:22 | |
RabidGravy | what have I been doing with Perl 6 in the last year or so? | ||
gfldex | s/bit/big/ | 13:23 | |
melezhik | gfldex: probably I had my question wrong, sorry, I will take a look at your example ... thanks ... | ||
13:24
carbonscott joined,
carbonscott left
13:25
wamba joined
13:29
perlawhirl joined
|
|||
gfldex | m: use MONKEY-SEE-NO-EVAL; class A { has $!a; method set-a($a){$!a = $a} }; my $a = A.new.set-a(42); ($a but role :: { method eval ($c) { EVAL $c; self } }).eval('say $!a'); | 13:29 | |
camelia | rakudo-moar f6524e: OUTPUT«P6opaque: no such attribute '$!a' in type Int+{<anon|72521424>} when trying to get a value in block <unit> at EVAL_0 line 1 in method eval at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
13:30
tadzik joined,
Matias[m] joined,
M-Illandan joined,
Guest80831 joined,
Matthew[m] joined
|
|||
melezhik | gfldex: your way works for me, a quick question, does "($a but role :: { method eval ($c) { EVAL $c; self } })" redefine eval method for the _copy_ of $a instance? so that eval work "in context" of instance? | 13:39 | |
I have read this - docs.perl6.org/routine/but | 13:40 | ||
psch | m: my $a = 1; my $b = $a but "foo"; say $a.WHAT; say $b.WHAT | 13:43 | |
camelia | rakudo-moar f6524e: OUTPUT«(Int)(Int+{<anon|67245152>})» | ||
moritz | it says it copies the object before modifying it, no? | ||
melezhik | moritz: if you ask me, I think so, I just say HOW I understand a gfldex: 's code so that I could understand it completely , not just "copy and paste " it ... | 13:45 | |
13:46
skids joined
13:48
Actualeyes joined
|
|||
psch | melezhik: well, the example uses the $a with mixin as invocant of a method | 13:48 | |
m: sub f { "foo" }; say (&f()).substr(1) # essentially like this vOv | 13:49 | ||
camelia | rakudo-moar f6524e: OUTPUT«oo» | ||
jkramer | What's the most efficient way in P6 to read from one file descriptor and write to another (ie. read a file and write to a socket)? Is there support for sendfile(2) or something? | ||
I particularly want to avoid a buffer in between | |||
13:54
eliasr left
13:59
pmurias joined
|
|||
hackedNODE | shell 'cat foo > bar' XD | 14:00 | |
pmurias | sjn: re "how would one programatically check for something like that", I would imagine 'use mandatory-company-coding-standard' should ban such things | 14:01 | |
hackedNODE | jkramer: sendfile is standard C lib, right? Just use it via NativeCAll | ||
RabidGravy | $out.spurt: $in.slurp-rest; | 14:02 | |
hackedNODE | RabidGravy: and that won't have a buffer in between? | 14:03 | |
pmurias | sjn: I can't really imagine a good reason to use anything besides ascii 0-9 in number literals | 14:04 | |
RabidGravy | I'm sure it has in there somewhere | ||
hackedNODE | m: use NativeCall; sub sendfile (int32, int32, size_t, size_t --> size_t) is native {}; | ||
camelia | ( no output ) | ||
14:05
dj_goku joined
|
|||
hackedNODE | jkramer: ^ something or other. and you can use .native-descriptor on opened file handles to get the desc riptiors to give to the sub | 14:05 | |
14:16
sammers joined,
robertle left
14:22
acrussell joined
14:27
ka left
14:29
ka joined
14:32
khw joined
|
|||
jkramer | hackedNODE: The second arg should be a pointer. Will try with NativeCall, never used that before | 14:38 | |
hackedNODE | jkramer, there's likely a way to do pointers too (/me isn't familiar with NativeCall). The docs are here: docs.perl6.org/language/nativecall | 14:41 | |
jkramer | There's Pointer thing, but I don't really need that functionality. I guess I can just pass Nil and it'll translate it to NULL? | 14:43 | |
hackedNODE | I think so | 14:44 | |
14:45
mcmillhj left
|
|||
moritz | if the signature of the nativecall sub has a type constraint, you can pass a type object of that type to generate a NULL pointer | 14:48 | |
so if it's a sub foo(Str) is nativecall(...), calling it with foo(Str) (instead of foo("some string")) passes a NULL pointer | |||
14:50
mcmillhj joined
14:54
tushar joined
|
|||
jkramer | Thanks, already got it working, just making it pretty now. You think there's an interest for IO::SendFile? | 14:55 | |
14:55
sufrostico left
|
|||
skids | m: my $p = Promise.new; my $v = $p.vow; $v.WHAT.say; say so $v ~~ Promise::Vow; | 14:57 | |
camelia | rakudo-moar 5f9103: OUTPUT«(Vow)Could not find symbol '&Vow' in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
skids | m: my $p = Promise.new; my $v = $p.vow; $v.WHAT.say; | ||
camelia | rakudo-moar 5f9103: OUTPUT«(Vow)» | ||
skids | m: my $p = Promise.new; my $v = $p.vow; $v.WHAT.say; say so $v ~~ Vow; | 14:58 | |
camelia | rakudo-moar 5f9103: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared name: Vow used at line 1» | ||
hackedNODE | m: my $p = Promise.new; my $v = $p.vow; $v.^name.say | ||
camelia | rakudo-moar 5f9103: OUTPUT«Promise::Vow» | ||
skids | Yeah, that's what I did, but... | ||
hmm. | |||
hackedNODE | Probably just not exported | 14:59 | |
s: Promise, 'vow' | |||
skids | m: my $p = Promise.new; my $v = $p.vow; my $p2 = Promise.new; my $v2 = $p2.vow; say so $v ~~ $v2.WHAT; | ||
camelia | rakudo-moar 5f9103: OUTPUT«True» | ||
skids | \o/ | ||
Now at least it's not an "eq" | |||
hackedNODE | huh, found a weird bug | 15:03 | |
oh... s/weird//; | 15:04 | ||
moritz | s/bug/feature/; # :-) | ||
hackedNODE | nah, infinihang | ||
m: my $p = Promise.new; my $v = $p.vow; say $p ~~ Planned | |||
camelia | rakudo-moar 5f9103: OUTPUT«(timeout)» | ||
hackedNODE | s: Planned, 'ACCEPTS' | 15:05 | |
jnthn | Planned is just an enum member | ||
hackedNODE | I see the robots are on strike.. | ||
jnthn | But it shouldn't time out | ||
moritz | you want $s.status or so, right? | ||
hackedNODE | Right | ||
moritz | m: say Promise.^methods(:local) | ||
camelia | rakudo-moar 5f9103: OUTPUT«(BUILD vow keep break result cause then start in at anyof allof Supply Str Numeric Bool scheduler status)» | ||
jnthn | Right, but why on earth would that hang? | ||
moritz | good question | 15:06 | |
jnthn | m: my $p = Promise.new; say $p ~~ Planned | ||
m: say Promise.new ~~ Planned | |||
moritz | m: say Promise ~~ Planned | ||
moritz predicts at least two timeouts | |||
hackedNODE | m: enum Foo <bar ber>; my $p = Promise.new; say $p ~~ ber | ||
jnthn | poor bot :) | ||
hackedNODE | :) | 15:07 | |
hackedNODE & lunch | |||
15:07
robertle joined
|
|||
camelia | rakudo-moar 5f9103: OUTPUT«(timeout)» | 15:07 | |
rakudo-moar 5f9103: OUTPUT«Invocant requires an instance of type Promise, but a type object was passed. Did you forget a .new? in block <unit> at <tmp> line 1» | |||
rakudo-moar 5f9103: OUTPUT«(timeout)» | |||
jnthn | m: say Promise.new == Planned | ||
m: say Promise.new == 42 | |||
camelia | rakudo-moar 5f9103: OUTPUT«(timeout)» | 15:08 | |
jnthn | m: say Supply.new == 42 | ||
camelia | rakudo-moar 5f9103: OUTPUT«Cannot directly create a Supply. You might want: - To use a Supplier in order to get a live supply - To use Supply.on-demand to create an on-demand supply - To create a Supply using a supply block in block <unit> at <tmp> line 1» | ||
jnthn | m: say Supply.from-list(1..10) == 42 | ||
camelia | rakudo-moar 5f9103: OUTPUT«Cannot resolve caller Numeric(Supply: ); none of these signatures match: (Mu:U \v: *%_) in block <unit> at <tmp> line 1» | ||
jnthn | Why on earth doesn't Promise say that when =='d? | ||
RabidGravy | boo | 15:09 | |
moritz | method Numeric(Promise:D:) { self.result.Numeric } | ||
from class Promise | |||
jnthn | omfg | ||
# experimental | |||
method Str(Promise:D:) { self.result.Str } | |||
method Numeric(Promise:D:) { self.result.Numeric } | |||
Yeah, the experiment failed | |||
moritz | and I guess smart-matching against a numeric enum numifies? | ||
jnthn | Yup | 15:10 | |
*sigh* | |||
15:10
sammers left
|
|||
jnthn | Will spectest with them gone | 15:10 | |
And then toss them | |||
Well, commit | |||
Already tossed 'em locally :) | |||
15:15
g4 left
|
|||
robertle | is there something like FindBin in perl6? | 15:16 | |
ilmari | m: say $*PROGRAM | 15:17 | |
camelia | rakudo-moar 5f9103: OUTPUT«"<tmp>".IO» | ||
15:17
ZoffixMobile joined
|
|||
ZoffixMobile | huggable, FindBin | 15:17 | |
huggable | ZoffixMobile, use lib $*PROGRAM.dirname.IO.parent.child("lib").Str; # finds lib/ for scripts in bin/ or t/ | ||
15:17
ka left
|
|||
ZoffixMobile | robertle, ^ | 15:18 | |
robertle | awesome | ||
thanks | |||
ugexe | should should .parent instead of .dirname | ||
otherwise you lose the volume on windows | |||
ZoffixMobile | oh | ||
robertle | windows my ass ;) | 15:19 | |
but will do anyway! | |||
nine | VM::platform-library-name uses dirname | ||
jnthn | hackedNODE: Will you RT or add a "doesn't hang" test for those? | 15:20 | |
15:21
andrzejku joined,
sammers joined
|
|||
ZoffixMobile | jnthn, I'm traveling for the next ~1 hour but can do that then :) | 15:21 | |
jnthn | Cool :) | 15:22 | |
Will push provided it passes spectest | |||
ugexe | nine: i fixed that with some other stuff in an unmerged PR github.com/rakudo/rakudo/pull/730/...2eefc15L56 | ||
nine | ugexe: oh, should have a look at it then | 15:24 | |
ugexe | nine: the PR was not mergable because it changes VM.platform-library-name's interface to always return IO::Path instead of IO::path when given a relative path argument and Str when given an absolute path argument | ||
which is all i really wanted to fix, but that meant changing stuff in lib/NativeCall.pm6:guess_library_name too which is a mess | 15:26 | ||
nine | oh yes, both are not prime examples of good engineering | 15:27 | |
jnthn | ZoffixMobile: Pushed. | ||
ZoffixMobile | cool | ||
15:28
mcmillhj left
|
|||
ugexe | `perl6 -MInline::Perl5 -e 'my $db = class :: { use DBIx::Class::Schema::Loader:from<Perl5>; also is DBIx::Class::Schema::Loader; }.connect("dbi:SQLite:dbname=db/development.db"); say $db.resultset("Sessions").first.id` # I like that I can do this without writing any Perl5 at all | 15:33 | |
15:33
darutoko- joined
|
|||
timotimo | you don't even have to -MInline::Perl5 for that | 15:34 | |
the :from<Perl5> pulls it in for you | |||
ugexe | ah cool | ||
15:34
mcmillhj joined,
Actualeyes left
15:36
darutoko left
15:37
darutoko joined
|
|||
jkramer | I made this: gist.github.com/jkramer/273e56bb24...4d786dc306 | 15:37 | |
15:38
darutoko- left
|
|||
ilmari | ugexe: do you need the class :: { ... also is } dance? can't you just do: use DBICSL:from<Perl5>; DBICSL.connect(..)? | 15:40 | |
15:42
AlexDaniel joined
|
|||
AlexDaniel | m: say ‘🦋’.uniname | 15:42 | |
camelia | rakudo-moar 2673ca: OUTPUT«BUTTERFLY» | ||
AlexDaniel | \o/ | ||
ugexe | ilmari: correct - although im actually using additional sugar in there | 15:44 | |
nine | ugexe: I always just do perl6 -e 'use DBIx::Class::Schema::Loader:from<Perl5>; DBIx::Class::Schema::Loader.connect("dbi:SQLite:dbname=db/development.db"); ...' | ||
jkramer | Is this a good idea or rather terrible? IO:D $input where *.can('native-descriptor') | 15:49 | |
timotimo | it won't give a very good error message if it fails | ||
but otherwise it's probably fine | |||
jkramer | Problem is I want to support IO::handle and IO::Socket and they don't inherit from a common class as it seems | 15:50 | |
timotimo | ah | ||
15:50
robertle left,
domidumont left
|
|||
skids | m: my $a = Channel.new; start react { whenever $a { $_.say; $_.poll.say } }; sleep 0.1; $a.send($_) for 1..10; sleep 0.3 | 15:50 | |
camelia | rakudo-moar 2673ca: OUTPUT«12Unhandled exception in code scheduled on thread 4Access denied to keep/break this Promise; already vowed in any at /home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm line 1 in block at <tmp> line 1 in any at /ho…» | ||
jkramer | Aaargh goddamn it, IO::Socket::Async doesn't have .native-descriptor as it seems :( | 15:52 | |
Hmm, although it does IO::Socket | |||
Ok might still work :) | |||
jnthn | skids: I think the .poll there is the issue; $_ is a value sent on the channel, not the channel. | 15:54 | |
skids | ergh. | ||
jnthn | skids: I think the concurrent failure in different threads is then causing it to try and .break the react Promise twice... | ||
(There's an RT about a similar race) | 15:55 | ||
skids | And I thought I had golfedthat correctly. | ||
oops. | |||
Back to hole 4 | |||
jkramer | According to the docs IO::Socket::Async does IO::Socket just like IO::Socket::INET, however IO::Socket::INET does have .native-descriptor from IO::Socket while *::Async doesn't | 15:56 | |
15:58
dgl is now known as dg
16:04
acrussell left,
Ven_ joined
16:05
MilkmanDan joined
16:10
Ven_ left,
Ven_ joined
16:17
ZoffixMobile left,
SourceBaby joined
16:18
Undercover joined
|
|||
hackedNODE | s: IO::Socket::Async, 'native-descriptor' | 16:18 | |
SourceBaby | hackedNODE, Something's wrong: ERR: Type check failed in binding to &code; expected Callable but got Nil (Nil) in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42 in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33 in block <unit> at -e line 6 | ||
hackedNODE | s: IO::Socket::INET, 'native-descriptor' | ||
SourceBaby | hackedNODE, Sauce is at github.com/rakudo/rakudo/blob/5f91...ket.pm#L93 | ||
16:20
itaipu joined
16:21
dakkar left
|
|||
dalek | c: 02bb8dd | (Zoffix Znet)++ | doc/Type/IO/Socket/Async.pod6: IO::Socket::Async doesn't IO::Socket |
16:23 | |
hackedNODE | jkramer: it never did. The docs were wrong. | 16:24 | |
dalek | href="https://perl6.org:">perl6.org: 82aaa1f | (Angelo Compagnucci)++ | source/index.html: move perl.org link on homepage Fixes #49 |
16:25 | |
href="https://perl6.org:">perl6.org: 2ec6600 | (Zoffix Znet)++ | source/index.html: Merge pull request #54 from angeloc/master move perl.org link on homepage |
|||
timotimo | i imagine synopsebot6 could learn to recognize dalek .* repositoryname .* Fixes #\d+ | 16:26 | |
hackedNODE | and it could avoid giving a link to RT when the link is already present, when it was *just* mentioned, or when the same ticket is mentioned twice :) | 16:27 | |
#12345 #12345 | |||
timotimo | *shrugs* :) | ||
hackedNODE | :) | ||
timotimo | you know, i can't actually program. i can just harass people who can into doing my bidding | ||
jkramer | hackedNODE: That's sad, is there a reason for that or was it just forgotten or something? | 16:31 | |
s: IO::Socket::Async | 16:32 | ||
SourceBaby | jkramer, Something's wrong: ERR: Cannot resolve caller sourcery(IO::Socket::Async); none of these signatures match: ($thing, Str:D $method, Capture $c) ($thing, Str:D $method) (&code) (&code, Capture $c) in block <unit> at -e line 6 | ||
jkramer | Hmm, how does this work? I was looking for the IO::Socket::Async source earlier :) | ||
Anyway found it | 16:33 | ||
hackedNODE | jkramer: I'm unsure. I see as opposed to the role, it uses async nqp ops, so maybe there is a reason. But the very first commit for it did not have a `does` so the docs were wrong | ||
Why are so many people ask how the bot works but never bother to ask the bot for help? :) | 16:34 | ||
s/are/do/; | |||
SourceBaby: help | |||
SourceBaby | hackedNODE, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See modules.perl6.org/dist/CoreHackers::Sourcery | ||
jkramer | s: IO::Socket::Async, 'new' | 16:35 | |
SourceBaby | jkramer, Sauce is at github.com/rakudo/rakudo/blob/2673...sync.pm#L7 | ||
jkramer | \o/ | ||
hackedNODE | that will rarely work, as you'd usually get the Mu's new | ||
In fact, it would've failed as recently as 24 hours ago :) | 16:36 | ||
jkramer | :D | ||
16:37
araujo joined
16:38
itaipu left
16:39
itaipu joined
|
|||
hackedNODE | timotimo: so where's the sauce? I can do the bidding | 16:39 | |
geekosaur | synopsebot6, help | 16:40 | |
hmf | |||
timotimo | that could also be implemented ;) | ||
it just lives on hack | 16:41 | ||
geekosaur | well, that was actually at least half a response to [28 16:34:11] <hackedNODE> Why are so many people ask how the bot works but never bother to ask the bot for help? :) | ||
timotimo | i think there's a git repository; it might not have some changes upstream that i made perhaps? | ||
geekosaur | :p | ||
jkramer | Hmm, I augmented .native-descriptor into IO::Socket::Async but it still doesn't match where *.can('native-descriptor') | ||
hackedNODE | geekosaur: I've tried help with it :P | 16:42 | |
timotimo | github.com/tadzik/synopsebot - we're using synopsebot.p6 for synopsebot6 | ||
gist.github.com/timo/58996f10e6334...6b510b8fc2 - this is the local diff i have on top of that | |||
hackedNODE | jkramer: it's .^can | 16:43 | |
timotimo | yes we .^can |