»ö« 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. |
|||
timotimo | worst case i'd create a throw-away scalar and find its .VAR.type or .VAR.of or what it's called | 00:00 | |
00:00
cpage_ joined
00:05
Juerd joined
|
|||
timotimo | hmm | 00:07 | |
m: my Mu $foo := Metamodel::CoercionHOW.new_type(Str, Any); say $foo | 00:09 | ||
camelia | rakudo-moar be4e43: OUTPUT«(Str(Any))» | ||
timotimo | well, that looks good enough. may want to have that stashed away somewhere for re-use, though | 00:10 | |
00:12
KotH left
00:13
KotH joined
00:16
BenGoldberg joined
00:19
BenGoldberg left
00:24
BenGoldberg joined
00:27
Skarsnik_ joined
00:28
Skarsnik_ left
00:31
Skarsnik left
00:32
huggable left
00:45
BenGoldberg left
00:49
colomon left
00:50
colomon joined
00:52
BenGoldberg joined
00:57
BenGoldberg left,
colomon left
00:58
colomon joined
01:01
ssotka left
01:05
colomon left
01:14
erdic left,
BenGoldberg joined
01:15
erdic joined,
esh joined
01:17
KotH left,
KotH joined
01:19
BenGoldberg left
01:21
ggoebel114 left
|
|||
raydiak | .u ▶ | 01:24 | |
yoleaux | U+25B6 BLACK RIGHT-POINTING TRIANGLE [So] (▶) | ||
01:24
BenGoldberg joined
01:27
cpage_ left
01:31
BenGoldberg left
01:32
kalkin- joined
01:34
cpage_ joined
01:36
molaf left
01:37
kalkin-_ left
01:45
BenGoldberg joined
01:47
kid51 left
01:48
molaf joined
01:51
BenGoldberg left
01:52
pierre joined
01:53
Zoffix joined
01:54
jberger joined
|
|||
jberger | Zoffix: o/ | 01:54 | |
01:54
BenGoldberg joined,
BenGoldberg left
|
|||
Zoffix | Hey all. jberger is trying to calculate pi using monte carlo method. I tried to write it with .race, but it was slower than single-thread way. Now, I rewrote it with Promises, but it *still* doesn't offer any speed improvement on my 4-core box. Any idea why? Is my code wrong: gist.github.com/zoffixznet/ae7bcf0...917238ff1a | 01:55 | |
m: gist.github.com/zoffixznet/ae7bcf0...917238ff1a | |||
camelia | rakudo-moar be4e43: OUTPUT«3.13798» | ||
jberger | for anyone interested in the actual math (not that its really that hard if you think about it) here is a link I found mathfaculty.fullerton.edu/mathews/n...pimod.html | 01:56 | |
01:57
cpage_ left
|
|||
Zoffix | Oh, HAHAHA. | 01:58 | |
jberger, try it out. I set my VM I'm running this on to use just one core :P | |||
jberger | hahahaha | ||
Zoffix | To that point, .race probably works too :P | 01:59 | |
01:59
pierre left
02:00
BenGoldberg joined
|
|||
jberger | yeah | 02:02 | |
it does | |||
or at least I see the cores all spinning | |||
02:03
cpage_ joined
|
|||
Zoffix | I think it's still buggy though. | 02:03 | |
m: sleep 1 for ^4 .race: :1batch; say now - INIT now; | |||
jberger | well we are going to hit the amount of good randomness in the computer at some point | ||
camelia | rakudo-moar be4e43: OUTPUT«1.008283» | ||
Zoffix | What about my code? Does it offer speed increase when you set CORES to 4 vs 1? I'm not seeing any difference when I run it on Windows 10 | 02:04 | |
jberger | yeah | 02:06 | |
Zoffix | m: await ^4 .map: { start sleep 1}; say now - INIT now | ||
camelia | rakudo-moar be4e43: OUTPUT«1.0044573» | ||
jberger | I get 11.5s with my original | ||
6.5 for yours (race) | |||
just the one liners | |||
Zoffix | I meant this one: gist.github.com/zoffixznet/ae7bcf0...917238ff1a | 02:07 | |
jberger | on TIMES=800_000 | ||
argh, you actually want me to download it .... :p | |||
Zoffix | Well, I can use camelia, I guess | 02:08 | |
m: gist.github.com/zoffixznet/ae7bcf0...917238ff1a | 02:09 | ||
camelia | rakudo-moar be4e43: OUTPUT«3.13907215.3952821» | ||
Zoffix | m: gist.github.com/zoffixznet/4e0b776...019736dbf7 | ||
camelia | rakudo-moar be4e43: OUTPUT«3.139717.11032489» | 02:10 | |
jberger | no I'm running it now | ||
mspo | camelia needs , stats=true to give timings :) | ||
jberger | when I set CORES=1 I still see my cores jump up | ||
Zoffix | oh | ||
jberger | I think to be a real test CORES=1 shouldn't try to thread it | 02:11 | |
Zoffix: that one doesn't nearly scale though | 02:12 | ||
an it doesn't actually utilize the cores well either | |||
the race one does much better at showing up in htop | |||
02:18
BenGoldberg left
|
|||
Zoffix | I found the problem. | 02:18 | |
m: gist.github.com/zoffixznet/cd814df...935e71ad52 | |||
camelia | rakudo-moar be4e43: OUTPUT«3.143722.19685761» | ||
Zoffix | m: gist.github.com/zoffixznet/be7b404...7e17b82910 | ||
camelia | rakudo-moar be4e43: OUTPUT«3.142521.6769645» | ||
Zoffix | The promises were returning a lazy list and it's only when I attempted to get at the results did all the calculations were happening. | ||
Doesn't explain why all 4 cores were spinning up though, before I made it eager | 02:19 | ||
02:19
skink left
|
|||
Zoffix | ¯\_(ツ)_/¯ a puzzle for another day | 02:19 | |
02:20
BenGoldberg joined
|
|||
jberger | ah | 02:21 | |
well thanks anyway | |||
and if you like the example you are welcome to post about it, it was why I asked you in the first place | 02:22 | ||
or don't, either way | |||
02:22
BenGoldberg left
02:28
BenGoldberg joined
02:31
vendethiel joined
02:35
BenGoldberg left
02:37
BenGoldberg joined
02:38
zacts left
02:43
BenGoldberg left
02:45
BenGoldberg joined
02:47
Zoffix left
02:48
noganex joined
02:51
noganex_ left
02:53
zacts joined
02:54
cpage_ left
02:56
colomon joined
03:01
jberger left
03:05
BenGoldberg left
03:06
BenGoldberg joined
03:18
BenGoldberg left
03:19
labster left
03:20
BenGoldberg joined
03:24
labster joined
03:25
BenGoldberg left
03:26
BenGoldberg joined
03:33
Zoffix joined
|
|||
Zoffix | ugexe, ah, I was using unspace wrong. I was doing .foo \.bar and that extra space before the backslash was giving trouble (RE: stackoverflow.com/questions/3742354...x/37425772 ) | 03:34 | |
03:46
bjz joined
03:51
vendethiel left
|
|||
dalek | osystem: 0b6c611 | (Richard Hainsworth)++ | META.list: Adding Algorithm::Tarjan to ecosystem Provides a method for finding cycles in a directed graph. See hhtps://github.com/finanalyst/p6-Algorithm-Tarjan |
04:00 | |
04:01
finanalyst joined
|
|||
finanalyst | just tried adding a module to ecosystem 'Algorithm::Tarjan'. Not sure if I have done this correctly. | 04:01 | |
I may have added directly to the Meta list without going through the pull request process. | 04:03 | ||
I'm still trying to figure out the git process | |||
04:08
finanalyst left
|
|||
Zoffix | Looks fine to me. | 04:11 | |
04:13
kaare_ joined
|
|||
diakopter | .u :smile_cat: | 04:22 | |
yoleaux | U+003A COLON [Po] (:) | ||
U+005F LOW LINE [Pc] (_) | |||
U+0061 LATIN SMALL LETTER A [Ll] (a) | |||
Zoffix | .u 😿 | ||
yoleaux | U+1F63F CRYING CAT FACE [So] (😿) | ||
Zoffix | .u cat face | ||
yoleaux | U+1F431 CAT FACE [So] (🐱) | ||
diakopter | heh | ||
04:26
cpage_ joined
04:33
Cabanossi left
04:34
khw left
04:35
Cabanossi joined
04:43
CIAvash joined
04:56
jack_rabbit joined
05:01
wamba joined
05:11
AlexDaniel left
05:18
cpage_ left
05:23
mohae left
05:34
wamba left
05:35
bjz_ joined,
cpage_ joined,
xfix left
05:36
bjz left
05:37
xfix joined
05:39
ssotka joined
05:44
kurahaupo left
05:55
bjz joined
05:56
wamba joined,
bjz_ left,
jack_rabbit left
06:02
buharin joined
06:07
ssotka left
06:26
ssotka joined
06:34
wamba left
06:46
Ven joined
06:48
RabidGravy joined
07:00
buharin left,
pierre joined
07:02
bjz_ joined
07:04
bjz left
07:06
jjido joined
07:15
jjido left
|
|||
RabidGravy | boom | 07:21 | |
07:22
domidumont joined
07:23
rindolf joined
07:25
buharin joined
07:26
domidumont left,
ssotka left
07:27
domidumont joined
07:37
wbill joined
07:45
domidumont left
07:46
buharin left
07:49
pierre left
07:52
cpage_ left
07:56
cpage_ joined,
firstdayonthejob joined
08:01
domidumont joined,
domidumont left,
domidumont joined
08:03
Emeric joined
08:06
Emeric1 joined,
pierre joined
08:09
Emeric left,
Emeric1 is now known as Emeric
08:11
pierre left
08:12
darutoko joined
|
|||
RabidGravy | why *does* github call the generated LICENSE file that? I'd never thought about it before, but in english that is the verb rather than the noun | 08:16 | |
08:16
BenGoldberg left
08:19
BenGoldberg joined
|
|||
huf | no, license is also the noun | 08:20 | |
Juerd | RabidGravy: US English uses the spelling 'license', sometimes 'licence', for both the noun and the verb, unlike advice/advise which is noun/verb in both UK and US English. | 08:23 | |
RabidGravy | huf, only in certain dictionaries | ||
Juerd | But, why would having a verb in a file name be an issue? README is neither, but does have a verb. | 08:24 | |
huf | RabidGravy: so? presumably whoever named the file was using one of those dictionaries | 08:25 | |
everyone gets to pick and choose :) | |||
Juerd | And sometimes it's called COPYING instead of LICENSE | ||
dalek | osystem: 1c0a6fb | palapitta++ | META.list: Movieinfo to get movie info from omdb |
||
osystem: 041e4df | RabidGravy++ | META.list: Merge pull request #211 from palapitta/patch-3 Movieinfo |
|||
huf | Juerd: but COP isnt a verb! | ||
(it is...) | 08:26 | ||
Juerd | huf: Makes me wonder what ying is. | ||
huf | yin + yang finally combined | ||
08:27
BenGoldberg left
|
|||
Juerd | That sounds slightly apocalyptical... | 08:27 | |
huf | yep | ||
the world *is* ending, it's just taking its sweet time about it | 08:28 | ||
Juerd | END { fork } | ||
Oh, hm, the fork will end just as well | |||
08:28
bjz_ left
|
|||
Juerd | Does Perl 6 has a way to restart your program? The ultimate 'goto 10'? | 08:29 | |
08:29
BenGoldberg joined
|
|||
Juerd | In Perl 5 I'd probably cheat with "exec $0" and hope both parts dwim. | 08:29 | |
RabidGravy | I think Zoffix was playing with something like that | ||
github.com/zoffixznet/perl6-Bailad...oRestarter | 08:31 | ||
08:32
hjst joined
|
|||
Juerd | That's managed externally with kill | 08:33 | |
08:36
Ven left,
vendethiel joined
08:41
wbill left
08:43
cpage_ left
08:47
spider-mario joined
08:52
zero-one left
08:53
wbill joined
08:55
wbill left
08:58
bjz joined
08:59
domidumont left
09:08
pierre_ joined
09:12
pierre_ left
09:13
finanalyst joined
09:22
BenGoldberg left
09:24
BenGoldberg joined
|
|||
finanalyst | module question: I put a 32x32 png in library logotype, but the logo did not show up in the module directory. Is meta info needed? | 09:27 | |
09:27
cibs joined
|
|||
finanalyst | s/library/directory/ | 09:28 | |
RabidGravy | don't think so | ||
09:29
pierre_ joined
|
|||
RabidGravy | ah logo_32x32.png apparently | 09:29 | |
(having just examined one where it does show) | |||
09:31
ab6tract joined
|
|||
ab6tract | o/ #perl6 | 09:32 | |
09:32
TEttinger left
|
|||
ab6tract | i'm happy to report some great progress has been made on the Sereal port! | 09:32 | |
i'd like to make it available both with a C backend and a PP one | 09:34 | ||
09:36
iH2O joined
|
|||
lizmat | timotimo: thanks for the tip, but for some reason I get locally: | 09:36 | |
$ 6 'my Mu $foo := Metamodel::CoercionHOW.new_type(Str, Any); say $foo' | |||
Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CoercionHOW' | |||
in block <unit> at -e line 1 | |||
09:37
iH2O left
|
|||
lizmat | The same I get with: | 09:37 | |
$ 6 'my Mu $a = Str(Any); say $a' | |||
Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CoercionHOW' | |||
in block <unit> at -e line 1 | |||
09:37
vendethiel left
|
|||
lizmat | it was that error that made me revert the patch | 09:38 | |
ab6tract | but I'm running into some confusion around how to reference subroutines in one role that will later get defined in a different role | 09:43 | |
i thought stubbing them in role A and defining them in role B and mixing them in 'does A does B' order would resolve it, but at run-time the stubs still get run | 09:44 | ||
09:44
Ven joined
09:45
RabidGravy left
09:48
BenGoldberg left
09:50
BenGoldberg joined,
cibs left
09:52
llfourn joined,
cibs joined
09:56
BenGoldberg left
09:58
BenGoldberg joined
|
|||
llfourn | .tell nine hoelzro++ has been able to trigger the precomp bug on the first run through with the right dependency tree (in case you missed it) RT #128268 | 10:00 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128268 | ||
yoleaux | llfourn: I'll pass your message to nine. | ||
ab6tract | there is always the EVAL option, but i was hoping for something less dirty | 10:04 | |
lizmat | timotimo: ah, missed a commit :-) | 10:14 | |
10:25
firstdayonthejob left
|
|||
masak | good afternoon, #perl6 | 10:26 | |
Ven | o/ masak | ||
10:27
cibs left
|
|||
lizmat | masak o/ | 10:29 | |
10:30
cibs joined,
pierre_ left
10:34
buharin joined
10:35
buharin left
10:38
Ven left
10:40
grondilu left
10:41
labster left
10:43
grondilu joined,
BenGoldberg left
|
|||
timotimo | Zoffix: currently, invocation requires two mallocs; one for the lexical environment, one for the space where all the register contents go. malloc will serialize access with locking. if you have an invocation-heavy thing inside your race (things not very well inlined, calls that are in there to make race work, ...) it'll spend most of its time spinning trying to acquire that lock | 10:44 | |
ab6tract | ive decided to make the backend distinction an environment setting, so i can punt it all to compile time and use needs/import :D | 10:45 | |
10:47
edehont joined
11:03
BenGoldberg joined
|
|||
Zoffix | timotimo, invocation is what? method calls? | 11:11 | |
lizmat | anything with () or a method call (which is () under the hood) | 11:13 | |
timotimo | Zoffix: anything that creates a call frame, really | 11:14 | |
if things go bad, even a pair of curlies inside a code body can cause an invocation to happen | |||
it's something jnthn is very much looking into making faster right now | |||
Zoffix | :S that makes .race kinda not very racy, considering most of the things would have () in them :/ | ||
At least it explains why I had 2x speed increase when I was using 4x the cores. | |||
timotimo | of course. that resource contention is going to go away | 11:15 | |
11:15
kid51 joined
11:17
iH2O joined
|
|||
Zoffix | Ah, palapitta reminds me of a young me. Ill-designed, untested code released for fun rather than utility. | 11:27 | |
Considering their first module was an implementation of the weather API I'm discussing in my workshop, I guess I'm at least partially responsible 😿 | 11:28 | ||
11:29
cibs left
11:30
iH2O left
11:31
cibs joined,
Emeric left
11:36
Emeric joined,
buharin joined
11:37
edehont left,
|meta joined
11:39
BenGoldberg left,
BenGoldberg joined
|
|||
masak | remind me -- does Perl 6 have something like Python's math.hypot ? | 11:40 | |
math.hypot(x, y) gives back math.sqrt(x * x + y * y) | |||
Zoffix | use NativeCall ... :P | 11:41 | |
BenGoldberg | I don't think there is one. | 11:42 | |
11:43
jjido joined
|
|||
Zoffix | m: use NativeCall; sub hypot(num64, num64 --> num64) is native {}; say hypot 3e0, 4e0 | 11:43 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5» | ||
Zoffix | m: sub hypot {sqrt $^a²+$^b²}(3, 4).say | 11:45 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5» | ||
dogbert17 | (x+yi).abs # perhaps | 11:49 | |
11:50
BenGoldberg left,
Zoffix is now known as anonymous
|
|||
dogbert17 | m: say (3+4i).abs | 11:50 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5» | ||
masak | heh :) | ||
anonymous | :o what sorcery is that | ||
11:50
anonymous is now known as Zoffix
|
|||
masak | the magic of complex arithmetic | 11:50 | |
Zoffix | m: say (25+666i).abs | 11:51 | |
camelia | rakudo-moar c5dfd7: OUTPUT«666.469054045272» | ||
masak | "abs($real)" can be seen as "the distance from 0 to the number $real" | ||
Zoffix | m: sub hypot {sqrt $^a²+$^b²}(25, 666).say | ||
camelia | rakudo-moar c5dfd7: OUTPUT«666.469054045272» | ||
Zoffix | m: say 3+4i | ||
camelia | rakudo-moar c5dfd7: OUTPUT«3+4i» | ||
masak | this notion can be extended to the complex numbers, which pulls in the Pythagorean Theroem as a side effect | ||
Zoffix: you're familiar with complex numbers? | 11:52 | ||
Zoffix | only that i is sqrt(-1) | ||
masak | heh :) | ||
it is, yes | |||
m: sqrt(-1 + 0i) | |||
camelia | rakudo-moar c5dfd7: OUTPUT«WARNINGS for /tmp/oHWXGCvXH4:Useless use of "sqrt(-1 + 0i)" in expression "sqrt(-1 + 0i)" in sink context (line 1)» | ||
masak | m: say sqrt(-1 + 0i) | ||
camelia | rakudo-moar c5dfd7: OUTPUT«0+1i» | ||
dogbert17 | a recent addition to the docs: doc.perl6.org/type/Complex#method_abs | 11:53 | |
masak | Zoffix: I think the best way to think about the complex numbers is that they "fix" the fundamental theorem of algebra | 11:54 | |
11:54
kurahaupo joined
|
|||
masak | Zoffix: with only the real numbers, a degree-2 polynomial can have *up to* 2 roots, a degree-5 polynomial can have *up to* 5 roots, etc | 11:54 | |
Zoffix: with the complex numbers, a degree-N polynomial has *exactly* N roots | 11:55 | ||
11:55
BenGoldberg joined
|
|||
masak | which, needless to say, is very neat and pretty | 11:55 | |
Zoffix | Oh, coolk | ||
masak | and when you put it like that, it's a minor miracle that setting `i := sqrt(-1)` fixes all that | 11:56 | |
it fixes it for *all* the polynomials. all the possible ones. | |||
11:56
kid51 left
|
|||
Zoffix | Ohhh, k, now I get why (3+4i).abs works :D | 11:56 | |
masak | what made it click? :) | 11:57 | |
Zoffix | hehe, neat :D dogbert17++ | ||
11:57
ab6tract left
|
|||
dogbert17 | glad to be able to help | 11:57 | |
Zoffix | I was thinking of it as "3" plus some other number. What made it click is realizing it's 3 with 4 on the imaginary plane and then you can see the distance to it would by a hypotenuse of a right triangle | ||
masak | I'm not a huge fan of abusing complex numbers as mere Cartesian coordinates | 11:58 | |
Zoffix | That's what made it click :) | ||
11:59
kid51 joined
|
|||
dogbert17 | .seen lizamt | 12:00 | |
yoleaux | I haven't seen lizamt around. | ||
dogbert17 | .seen lizmat | ||
yoleaux | I saw lizmat 11:13Z in #perl6: <lizmat> anything with () or a method call (which is () under the hood) | ||
lizmat is still here | 12:01 | ||
but about to get some fresh air | |||
dogbert17 | lizmat: I have some draft documentation for Hash.keyof. is it in touch with reality? gist.github.com/dogbert17/447575b4...0bb754fadd | ||
masak | lizmat: go go go! fresh air is important! :) | 12:02 | |
lizmat | say %h1.keyof; # (Any) # Str(Any) ?? | ||
jnthn | m: say Str(Any) | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(Str(Any))» | ||
jnthn | lizmat: I fixed ^^ last night... :) | ||
lizmat | yeah, noticed this moarn | ||
jnthn | :) | 12:03 | |
pochi | m: sub foo() returns Str, Int { return "hello", 42 } | ||
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/hn3Banv5ecMissing blockat /tmp/hn3Banv5ec:1------> 3sub foo() returns Str7⏏5, Int { return "hello", 42 } expecting any of: new name to be defined» | ||
pochi | is there a way to specify a mixed return type? | 12:04 | |
jnthn | pochi: One way is to declare a `subset StrOrInt where Str | Int;` and then use it as the return type | ||
psch | m: sub f { return "hello", 42 }; f().WHAT.say | 12:05 | |
camelia | rakudo-moar c5dfd7: OUTPUT«(List)» | ||
psch | pochi: you don't seem to be returning something mixed? | ||
lizmat | pochi: in p6 you only ever return one thing | ||
and if it has comma's in it, it's a List | |||
afk& | |||
pochi | hm, ok, but can I put constraints on the contents of List then? | ||
lizmat | I think that's specced, but not implemented yet | 12:06 | |
jnthn? | |||
llfourn | a junction? | ||
lizmat | really afk& | ||
12:06
AlexDaniel joined
|
|||
llfourn | m: sub foo() returns Str|Int { return "hello", 42 }; foo(); | 12:06 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/V63DQbH1yrMissing blockat /tmp/V63DQbH1yr:1------> 3sub foo() returns Str7⏏5|Int { return "hello", 42 }; foo(); expecting any of: new name to be defined» | ||
jnthn | Oh, you want to pattern match what's in a list... | ||
pochi | yes | ||
llfourn | m: sub foo() returns :(Str,Int) { return "hello", 42 }; foo(); | 12:07 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/cdu_zP1NBFMalformed traitat /tmp/cdu_zP1NBF:1------> 3sub foo() returns7⏏5 :(Str,Int) { return "hello", 42 }; foo(» | ||
llfourn | m: sub foo() returns List where { $_ ~~ :(Str,Int) } { return "hello", 42 }; foo(); | ||
dogbert17 | lizmat++ thx for the feedback | ||
jnthn | m: subset IS where :(Int, Str); sub foo() returns IS { (4.2, 'hi') }; say foo | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Type check failed for return value; expected IS but got List ($(4.2, "hi")) in sub foo at /tmp/MTaWmxTvNo line 1 in block <unit> at /tmp/MTaWmxTvNo line 1» | ||
jnthn | m: subset IS where :(Int, Str); sub foo() returns IS { (4, 'hi') }; say foo | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(4 hi)» | ||
llfourn | is my last message flashing for anyone else? | 12:08 | |
pochi | it's flashing :-) | ||
Zoffix | No, but I see a null char | ||
jnthn | llfourn: No, white text on grey background for me :) | ||
llfourn | o.o | ||
pochi | what the 'where :()' syntax? | 12:09 | |
*what's | |||
jnthn | :(...) is a signature literal | ||
pochi | ah | ||
thank you :-) | |||
jnthn | And subest Foo where <conditon here>; is a refinement type | ||
Zoffix | FWIW, I opened a ticket a few days about vis-a-vis returning Int|Str and ther like: rt.perl.org/Ticket/Display.html?id=128262 | ||
12:09
CIAvash left
|
|||
jnthn | Zoffix: Yeah, confusing error... :) | 12:09 | |
Compiler's trying to be helpful and ends up being the opposite. :) | 12:10 | ||
m: sub foo() returns Itn { } | |||
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DbnqYz0xveInvalid typename 'Itn'. Did you mean 'Int'?at /tmp/DbnqYz0xve:1------> 3sub foo() returns Itn7⏏5 { }» | ||
jnthn | m: sub foo() returns Int|Str { } | ||
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/nZq9Zg2VRWMissing blockat /tmp/nZq9Zg2VRW:1------> 3sub foo() returns Int7⏏5|Str { } expecting any of: new name to be defined» | ||
jnthn | Oh, it wasn't that one? | 12:11 | |
Zoffix | m: sub foo(--> Int|Str) { } | ||
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/hicSjxwiOMType 'Int' is not declared. Did you mean 'int'?at /tmp/hicSjxwiOM:1------> 3sub foo(--> Int7⏏5|Str) { }» | ||
jnthn | Oh, with --> | ||
Yeah, agree that wants some atention | |||
*attention | |||
llfourn | m: sub (Int|Str $var) { }; # I also try and do this sometimes | ||
camelia | rakudo-moar c5dfd7: OUTPUT«===SORRY!===No compile-time value for Str» | ||
jnthn | o.O | 12:12 | |
llfourn | also I even try regex literals :P | ||
12:12
bjz_ joined
|
|||
jnthn | Trouble with that one is that |foo is capture syntax inside a signature :) | 12:12 | |
12:13
bjz left
|
|||
llfourn | m: multi regex-dispatch(/fo+/) { }; multi regex-dispatch(/ba+/) {}; regex-dispatch("foo"); #something like | 12:13 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/go3EVCCVwdCalling regex-dispatch(Str) will never work with any of these multi signatures: (Int $ where { ... })  (Int $ where { ... })at /tmp/go3EVCCVwd:1------> 3) { }; multi regex-dispat…» | ||
jnthn | oh hah, I bet I can guess... It sees "(Int |Str" and declares a symbol Str that the capture will be bound in to. This in turn clobbers the Str symbol needed to produce the parse error that follows :P | ||
llfourn | ahh | 12:14 | |
psch | m: sub f($a, ::($a) $b) { }; f(Int|Str, "foo") # /o\ | ||
camelia | ( no output ) | ||
jnthn | That's pretty amusing. But yeah, if it's not already RT'd please do; the current error helps nobody.. | ||
llfourn | okie doke | ||
my last RT (5 mins ago) didn't go so well. Lets see if I can get it done in one email this time. | 12:15 | ||
12:16
jjido left
|
|||
jnthn | :) | 12:18 | |
lunch & | |||
dogbert17 | m: sub foo() returns IntStr { return IntStr.new(42, "hello") }; say foo().perl | 12:19 | |
camelia | rakudo-moar c5dfd7: OUTPUT«IntStr.new(42, "hello")» | ||
12:25
pierre joined
12:27
jjido joined
12:32
huggable joined
|
|||
dalek | c: 32541e4 | (Jan-Olof Hendig)++ | doc/Type/Hash.pod: Added docs for method keyof in class Hash. lizmat++, jnthn++ |
12:35 | |
12:36
iH2O joined
12:37
BenGoldberg left
12:39
pierre left,
BenGoldberg joined
12:41
pierre joined
12:42
jjido left
12:43
iH2O left
12:44
pierre left
12:47
jjido joined
12:48
buharin left
12:49
setty1 joined
|
|||
dalek | c: 49f7f34 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod: get `where` into the index |
12:58 | |
c: 3948b65 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod: get `where` into the index |
|||
12:59
BenGoldberg left
13:00
BenGoldberg joined
13:07
pierre joined
13:10
jjido left,
pierre left
13:13
kaare_ left
|
|||
grondilu | m: say (my $).VAR.name; | 13:16 | |
camelia | rakudo-moar c5dfd7: OUTPUT«$» | ||
grondilu | m: say class { has $.x }.VAR.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class '<anon|57888480>' in block <unit> at /tmp/IRkz3SpHWR line 1» | ||
13:16
pierre joined
|
|||
grondilu | m: say class { has $.x }.x.VAR.name | 13:16 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Cannot look up attributes in a type object in block <unit> at /tmp/aqDkPFY7Nf line 1» | ||
pochi | $.x is a method that operates on $!x | 13:19 | |
psch | m: say class { has $.x }.new(:2x)x.VAR.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5\$_' (indicated by ⏏) in block <unit> at /tmp/9lF534opPv line 1Actually thrown at: in block <unit> at /tmp/9lF534opPv line 1» | ||
psch | m: say class { has $.x }.new(:2x).x.VAR.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int' in block <unit> at /tmp/egiKpG4qqE line 1» | ||
13:20
BenGoldberg left
|
|||
Zoffix | m: say class { has $.x }.new(:2x).x.VAR.^name | 13:20 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Int» | ||
psch | m: say class { has $.x }.new(:2x).x.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int' in block <unit> at /tmp/jR7xM3jJzE line 1» | ||
psch | m: say class { has $.x }.new(:2x).x.VAR.VAR.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int' in block <unit> at /tmp/XmYzWLUUwC line 1» | ||
psch | vOv | ||
not even sure what's being looked for :) | |||
jnthn | m: say class { has $.x is rw }.new(:2x).x.name | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int' in block <unit> at /tmp/gjscsjLZXL line 1» | ||
jnthn | m: say class { has $.x is rw }.new(:2x).x.VAR.name | 13:21 | |
camelia | rakudo-moar c5dfd7: OUTPUT«$!x» | ||
jnthn | Maybe that? :) | ||
Zoffix | :o | ||
psch | oh, right, no rw means no container there i suppose | ||
jnthn | Yeah, we take the thing out of its container | ||
When no "is rw" | |||
grondilu | what's :2x? | 13:23 | |
m: say :2x | |||
camelia | rakudo-moar c5dfd7: OUTPUT«Unexpected named parameter 'x' passed in block <unit> at /tmp/Ba1CO326bj line 1» | ||
pochi | :x(2) | ||
psch | m: say (:2x).WHAT | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(Pair)» | ||
psch | m: say (:2x).perl | ||
camelia | rakudo-moar c5dfd7: OUTPUT«:x(2)» | ||
grondilu | oh, that's a thing? Ok. | ||
jnthn | Most often shows up as things like :1st | ||
psch | m: $_ = "foo foo"; s:2nd/foo/bar/; .say | ||
camelia | rakudo-moar c5dfd7: OUTPUT«foo bar» | ||
Zoffix | or :42days :) | ||
Zoffix uses it for everything | 13:24 | ||
grondilu | can be useful for physical units and stuff | ||
dalek | c: fffe595 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod: link to definition of where |
13:26 | |
Zoffix | If anyone has a penchant for long technical documents and has interest in the new IRC::Client, I welcome feedback for my new design: github.com/zoffixznet/perl6-IRC-Cl...01-main.md | 13:27 | |
AlexDaniel, ^ you had some interest in it awhile back. | |||
13:27
aries_liuxueyang left
|
|||
AlexDaniel | yaaay | 13:28 | |
Zoffix: by the way, what's up with the memory leaks and stuff? | |||
Zoffix: have you found any way to localize it? | |||
Zoffix | No, I chose to go with "ignore it for now and hope someone fixes it" route. | ||
And they were before jnthn++'s frame work, so *shrug* they may not be there any more for all I know. | 13:29 | ||
AlexDaniel | because, you know… your module can be 100% gold but nobody is going to start using it because of such problems :( | ||
Zoffix: OK I'll read that and let you know what I think | 13:30 | ||
jnthn | Were they before or after the big gen2 leak fix in Moar also? | 13:31 | |
That was likely to blame for a lot of leakage in longer-running things. | |||
Zoffix | I'm 85% they were in this version: This is Rakudo version 2016.04-117-g7db7b46 built on MoarVM version 2016.04 | ||
*85% sure | 13:32 | ||
AlexDaniel | Zoffix: “provide a programmatic interface to IRC” it sound like a bot, why not say that it is for creating bots? Or are you hoping that people will create IRC clients on top of that? | 13:33 | |
s | |||
jnthn | Zoffix: 7f2a6fa8416 was the fix in question | ||
Zoffix: Which git describes itself as 2016.03-96-g7f2a6fa, so it's maybe not that | |||
Zoffix | AlexDaniel, they can if they want to. I might create one if I get bored enough :P | 13:34 | |
call it 6IRC | 13:35 | ||
13:35
RabidGravy joined
|
|||
Zoffix | with a stylzed logo of half a butterfly seen behind IRC :P | 13:35 | |
jnthn | Zoffix: If it still leaks, please do file a report though. I've spent quite some effort on fixing/building stuff that makes it easier to hunt leaks down. :) | ||
13:35
BenGoldberg joined
|
|||
Zoffix | jnthn, k :) | 13:35 | |
timotimo is sitting outside on a little (actually, big) picnic blanket :3 | 13:36 | ||
jnthn | timotimo: nice :) | ||
Hope you don't have thunderstorms forecast to start imminently like here ;-) | |||
AlexDaniel | Zoffix: “A program may have multiple Client Objects, but each of them can be connected only to one IRC server.” why? | 13:37 | |
dalek | osystem: 771c2a4 | yowcow++ | META.list: add Digest::MurmurHash3 |
||
osystem: 08c8b73 | titsuki++ | META.list: Merge pull request #212 from yowcow/add-digest-murmurhash3 Add Digest::MurmurHash3 |
|||
timotimo | AlexDaniel: because clients have state, like what channels they have been joined to, what flags they have, realname nickname, ... | 13:38 | |
Zoffix | AlexDaniel, simpler to implement. | ||
gfldex | m: sub f(&c where :(Int, Str)) { say c(10, 'ten') }; sub g(Int $i, Str $s){ $s ~ $i }; f(&g); | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Constraint type check failed for parameter '&c' in sub f at /tmp/rkBIxNJdUa line 1 in block <unit> at /tmp/rkBIxNJdUa line 1» | ||
timotimo | makes sense to have that per Client object | ||
Zoffix | AlexDaniel, also, you have nicks and usernames that likely are different on different servers | ||
psch | m: sub f(&c:(Int, Str)) { say c(10, 'ten') }; sub g(Int $i, Str $s){ $s ~ $i }; f(&g); | 13:39 | |
camelia | rakudo-moar c5dfd7: OUTPUT«ten10» | ||
AlexDaniel | yeah but if I wanted to create a bot that will connect to multiple servers at the same time, things will become seriously hard for me | ||
Zoffix | Like what? | 13:40 | |
As in, what is a specific area of hardness? | 13:41 | ||
start IRC::Client.new(:server<foo.net>).run; start IRC::Client.new(:server<bar.net>).run; | |||
timotimo | seriously hard seems like a really big overstatement here | 13:42 | |
AlexDaniel | unnecessarily hard is probably a better way to describe it | ||
Zoffix | my $stuff-that-does-things = IRC::Client::Plugin::Whatever.new; start { IRC::Client.new(:server($_), :plugins($stuff-that-does-thigns)).run } for <foo.net bar.net>; | ||
AlexDaniel | Zoffix: then what? I want to have the same state between several servers, but as far as I can see each plugin is probably going to be on its own | 13:43 | |
e.g. if it's a factoid, for example | |||
and also want no code duplication, because you know… | |||
my proposed solution was to just add a server:channel to the list of channels to join, and that's it. You handle everything else | 13:44 | ||
Zoffix | AlexDaniel, in the example above, you have just one plugin object. If it's a factoid, it'd be using the same DB. | ||
BenGoldberg | This isn't python, people. It's allowable to have more than one solution to a problem. | 13:45 | |
Zoffix | AlexDaniel, I don't see how such a solution would handle, say, using different nicks on different servers | 13:46 | |
timotimo | especially since you don't actually have full control over your nickname, or what channels you're in | ||
AlexDaniel | Zoffix: $.irc.nick: 'ZofBot', 'ZofBot_', 'ZofBot__'; changes the nickname on all servers | ||
Zoffix: $.irc.nick: 'ZofBot', 'ZofBot_', 'ZofBot__', :server(‘XXX’); changes the nickname on some particular server | |||
Zoffix | AlexDaniel, what about $.irc.send: where => '#perl6', what => 'Hello'? What about $.irc.channel('#perl6').has: 'Zoffix'? | 13:47 | |
You can add :server() to all of them sure, but that just adds complexity to the implementation and the docs, which I don't see justified when the alternative is the code example above. | |||
AlexDaniel | Zoffix: there are several possible solutions to this one. For example, if you're on the same channel on several servers, then it may turn into something like ‘#perl6<freenode>’ | 13:48 | |
Zoffix | And you can determine which server you're on by calling $.irc.server (I didn't spec it, but all the attributes will be available) | ||
AlexDaniel | Zoffix: otherwise it's just ‘#perl6’ and it DWIMs | ||
Zoffix: I'm not sure why the implementation has to be easy for you and not for the user | 13:49 | ||
Zoffix | AlexDaniel, I don't see your proposal as easier than start { IRC::Client.new(:server($_), :plugins($stuff-that-does-thigns)).run } for <foo.net bar.net>; | 13:50 | |
AlexDaniel | Zoffix: supplying :server(…) when you need it is not a rocket science | ||
Zoffix | AlexDaniel, but it's data duplication. | ||
Especially within a plugin, that doesn't need to know what server it's on. | |||
dalek | c: 5b29667 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod: show how to constrain function references |
||
pochi | m: enum Days ( Sat => 6, Sun => 7 ); my %t = (Sat => "Saturday", Sun => "Sunday"); say %t.keys>>.Int | 13:51 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5Sat' (indicated by ⏏) in block <unit> at /tmp/U3YbVb8nzI line 1Actually thrown at: in block <unit> at /tmp/U3YbVb8nzI line 1» | ||
timotimo | what about servers that allow < > in their channel names? | ||
AlexDaniel | if it doesn't need to know, then there's no :server stuff in the code. | ||
timotimo: turn it into an object if that's the case, not a big deal | |||
make it a pair or something | |||
pochi | how do I used enums as has keys? | 13:53 | |
*use even | 13:54 | ||
psch | m: enum Foo < bar baz >; my %h{Any}; %h{bar} = 1; say %h.perl; say %h.keys[0].WHAT | 13:55 | |
camelia | rakudo-moar c5dfd7: OUTPUT«(my Any %{Any} = Foo::bar => 1)(Foo)» | ||
gfldex | m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = (Sat => "Saturday", Sun => "Sunday"); say %t.keys>>.Int | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Type check failed in binding key; expected Days but got Str ("Sat") in block <unit> at /tmp/KbAoNGnygb line 1» | ||
psch | m: enum Foo < bar baz >; my %h{Any}; %h{bar} = 1; say %h.perl; say %h.keys[0].value | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(my Any %{Any} = Foo::bar => 1)0» | ||
psch | m: enum Foo < bar baz >; my %h{Any}; %h{bar} = 1; say %h.perl; say %h.keys[0].Int | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(my Any %{Any} = Foo::bar => 1)0» | ||
Zoffix | AlexDaniel, what I mean is if I have a plugin that does, say, irc-privmsg-me ($msg) { $.irc.send: where => '#perl6', what => "$msg.nick() is messaging me!" }; That plugin will be inherently broken the moment your client connects to multiple servers. The correct way to write it might be irc-privmsg-me ($msg) { $.irc.send: where => '#perl6', server => $msg.server, what => "$msg.nick() is messaging me!" }; Which (a) is unneccesarry complexity (b) will | ||
result in some plugins being broken because users didn't/forgot to add the essentially-mandatory `server` argument. | |||
gfldex | m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = (Sat, "Saturday", Sun, "Sunday"); say %t.keys>>.Int | 13:57 | |
camelia | rakudo-moar c5dfd7: OUTPUT«(6 7)» | ||
gfldex | m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = (Sat, "Saturday", Sun, "Sunday"); say %t.keys | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(Sat Sun)» | ||
Zoffix | And, say, $.irc.channel('#perl6').topic; would require a mandatory server argument too, except it won't be available just anywhere. You have to fetch from some $msg or pass it hardcoded. | ||
13:58
setty1 left
|
|||
gfldex | m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = (Pair.new(Sat, "Saturday"), Pair.new(Sun, "Sunday")); say %t.keys | 13:58 | |
camelia | rakudo-moar c5dfd7: OUTPUT«(Sat Sun)» | ||
gfldex | pochi: ^^^ | ||
pochi | so it's => that ruins it? :-) | ||
Zoffix | It quotes it | ||
gfldex | m: dd 6 => "foo" | ||
camelia | rakudo-moar c5dfd7: OUTPUT«6 => "foo"» | ||
AlexDaniel | Zoffix: so basically what you're saying is that if at some point I decide to add a channel on another server to the list of channels to join, I have to create another Client object, configure it the same way, then wrap all commands with for-s, start using a database so that plugins inside different Client objects have the same data… I'm pretty sure that the list does not stop here. Not that you're wrong, a lot of irc modules do exactly | ||
the same thing, but I'm not sure why your new one cannot be better in that respect. | |||
13:59
setty1 joined
|
|||
pochi | right | 13:59 | |
psch | m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = Sat, "Saturday", Sun, "Sunday"; say %t.keys | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(Sat Sun)» | ||
tailgate | Can a perl6 class be a singleton? i.e. instantiated once and only holding static members? | ||
psch | tailgate: i'd rather make .new die and only use class variables instead of instance variables | 14:00 | |
tailgate: although that's more a fully static class than a singleton | |||
well, not quite in the Java sense of "static" :) | |||
14:02
johnchalekson left
|
|||
tailgate | psch: fully static works for me. Is there an example? | 14:02 | |
dalek | osystem: b347748 | (Shoichi Kaji)++ | META.list: Add IO::TailFile to ecosystem See github.com/skaji/perl6-tail |
||
gfldex | m: dd 1/2 => "foo" | ||
camelia | rakudo-moar c5dfd7: OUTPUT«0.5 => "foo"» | ||
gfldex | I take it the fat arrow doesn't autoquote if the LHS is a Numeric? | 14:03 | |
psch | m: class A { my $foo; method foo is rw { $foo }; method new { die "can't instantiate this" }; }; A.foo = "bar"; say A.foo | ||
camelia | rakudo-moar c5dfd7: OUTPUT«bar» | ||
psch | tailgate: ^^^ something like that, probably. you can of course also use getter/setter instead of an rw method | ||
and, well, you don't really need the &die in .new either | 14:04 | ||
because all "my" declarations are shared between instances as well | 14:05 | ||
AlexDaniel | Zoffix: I don't think that your example is very realistic. How often do you want to send a message to some specific channel on some specific server, and you want it to be hardcoded? That's a bit weird. Like, look at camelia or any other bot, that's a rare thing to have. And if you want to do that – sure, it is “potentially” broken, which means that if you join the same channel on two different servers then your module will probably | ||
throw a warning and that's it. If you don't, then you wont even notice it | |||
psch | so if you eventually discover that you do need un-shared state between instances you could also do that... vOv | ||
14:05
keix joined
|
|||
AlexDaniel | Zoffix: and again, adding one parameter is easy. Reworking your whole code base is hard. | 14:06 | |
gfldex | m: my $signle = Any but role :: { has $.foo; method new(){die 'nope'}}; dd $signle; $single.new; | 14:07 | |
camelia | rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ZYVwgAxdYHVariable '$single' is not declared. Did you mean '$signle'?at /tmp/ZYVwgAxdYH:1------> 3 method new(){die 'nope'}}; dd $signle; 7⏏5$single.new;» | ||
dalek | k-simple: 1f7c486 | finanalyst++ | / (3 files): get-active method to combobox |
||
k-simple: 30ec795 | RabidGravy++ | / (3 files): Merge pull request #39 from finanalyst/master get-active method to combobox |
|||
gfldex | tailgate: if you don't want to introduce a type name for your singleton ^^^ | ||
m: my $single = Any but role :: { has $.foo; method new(){die 'nope'}}; dd $single; $single.new; | 14:08 | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Any+{<anon|81365312>} $single = Any+{<anon|81365312>}nope in method new at /tmp/kZswVNFiZh line 1 in block <unit> at /tmp/kZswVNFiZh line 1» | ||
Zoffix | AlexDaniel, the hardcoded channel is irrelevant. The issue is the mandatory requirement to include :server | ||
gfldex | works better without typos ofc | ||
Zoffix | Include it everywhere | ||
I'm not sure how that qualifies as making things easy. | 14:09 | ||
AlexDaniel | Zoffix: it's not mandatory if you are not joining the same channel on multiple servers | ||
and if you do, then you just add one parameter instead of reworking your whole code | |||
Zoffix | Then whether your plugin is broken depends entirely on which channels you care to join? What about plugins that are released into the ecosystem. It become mandatory for them | 14:10 | |
AlexDaniel | only if they're trying to send messages to some specific channels | ||
Zoffix | There's only one for-s wrap involved: the instantiation of the IRC::Client objects. The plugins are single objects used by all the clients. I'm not sure what you mean by having to add a database | 14:11 | |
AlexDaniel | replying to the same channel works everywhere | ||
14:14
pmurias joined
|
|||
pmurias | hi | 14:14 | |
Zoffix | The only issue I can see is ensuring your plugin is operating in a threadsafe way, since you now have several clients in several threads | ||
\o | |||
AlexDaniel | Zoffix: OK so you're saying that using the same plugin object in several clients is supposed to work better? | 14:15 | |
you may be right, but it sounds a little bit weird | |||
14:17
mohae joined
|
|||
Zoffix | It just seems more robust and much easier to use. I don't need to worry about shoving a server everywhere in my code and I don't have to worry that author Joseph Smith forgot to add a server argument in their plugin. | 14:18 | |
The $.irc.channel('...') stuff would have to to require a mandatory server argument, for example | |||
AlexDaniel | yeah sure you don't have to care about stuff that you don't support, I'm not arguing that | ||
… but to me it feels like using more than one server should be supported, at least in some sense | 14:19 | ||
14:19
BenGoldberg left
|
|||
Zoffix | It is 😜 just instantiate multiple IRC::Clients | 14:20 | |
AlexDaniel | Zoffix: sounds like torturing myself and not the implementor of IRC::Client and its plugins | 14:21 | |
it's fine, I guess. It's just that I am expecting a bit more from it than from a typical irc module | |||
Zoffix | Not to me. I rather put a single `for @servers` than use :server($whatever) every time I use a command from the Client Object. Providing I have the server available in the first place. | 14:22 | |
Zoffix takes a break to play Assasin's Creed Rogue | 14:23 | ||
tailgate | thanks | ||
AlexDaniel | Zoffix: you can easily throw an awesome warning if the client is connected to multiple servers. “on line X you're trying to send a message, but no server is specified. However, you're connected to two servers. Use :server(…) to make it work” ¯\_(ツ)_/¯ | 14:24 | |
Zoffix | AlexDaniel, but I don't *want* to use :server(...) all over the place | ||
And I can avoid it with for @servers when I instantiate the clients | 14:25 | ||
AlexDaniel | Zoffix: if you're not connected to multiple servers then you don't have to ¯\_(ツ)_/¯ | ||
Zoffix | Then my plugin is not robust and will break the first time I or anyone else connects to multiple servers. | ||
AlexDaniel | but you may be right, I don't know | ||
Zoffix | And I can't release it into the ecosystem. And if I do, I become the Joseph Smith who forgot to add the server :P | 14:26 | |
AlexDaniel | someone will probably submit a pull request. Especially if the error message is good enough. Or use IRC::Client :strict; :) | 14:27 | |
but okay, whatever | |||
14:28
ggoebel114 joined
14:29
rindolf left
14:31
rindolf joined
14:34
sufrostico joined,
k-man joined
14:37
pierre left
14:40
khw joined
|
|||
pochi | m: sub foo() returns Str { return Nil }; foo() | 14:42 | |
camelia | ( no output ) | ||
pochi | m: subset StrStr where :(Str,Str); sub foo() returns StrStr { return Nil, Nil }; foo() | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Type check failed for return value; expected StrStr but got List ($(Nil, Nil)) in sub foo at /tmp/b4KcIDtBdo line 1 in block <unit> at /tmp/b4KcIDtBdo line 1» | ||
pochi | why does Str match Nil, but my StrStr doesn't match Nil,Nil? | 14:43 | |
14:48
buharin joined
14:51
|meta left
|
|||
dogbert17 | does anyone have time to review yet another doc snippet, method 'of' in class Hash? gist.github.com/dogbert17/ac2e3781...4cfdad324a | 14:52 | |
14:53
CIAvash joined
|
|||
rindolf | dogbert17: looks fine. | 14:56 | |
dogbert17 | rindolf: thx | 14:57 | |
pochi | m: my Array of Int @a; @a[0] = [1,2,3] | 15:01 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Type check failed in assignment to @a; expected Array[Int] but got Array ($[1, 2, 3]) in block <unit> at /tmp/e2pBx_HZAh line 1» | ||
pochi | how do I stuff things into @a? | 15:02 | |
ugexe | thats an array of array [int] | ||
assigning an array to a specific item in an array like that | |||
dalek | c: 7e63db0 | (Jan-Olof Hendig)++ | doc/Type/Hash.pod: Added docs for method of in class Hash and removed som trailing spaces. rindolf++ |
15:03 | |
pmurias | Zoffix: have you considered using a server/channel pair object instead of strings for channels? | ||
CIAvash | m: my Array of Int @a; @a[0] = Array[Int].new: 1,2,3 | 15:04 | |
camelia | ( no output ) | ||
gfldex | m: my @a if Int; @a = 1,2,3; dd @a; | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Array @a = [1, 2, 3]» | ||
pochi | so it doesn't understand that [1,2,3] is an Int array? | 15:05 | |
gfldex | m: my Array of Int @a; my @b of Int = 1,2,3; @a[0] = @b; dd @a; | 15:06 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Array[Array[Int]] @a = Array[Array[Int]].new(Array[Int].new(1, 2, 3))» | ||
gfldex | there is no literal to express Array of type X. | ||
pochi | ok | ||
gfldex | m: my Array of Int @a; @a[0] = Array[Int].new(1,2,3); dd @a; | 15:07 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Array[Array[Int]] @a = Array[Array[Int]].new(Array[Int].new(1, 2, 3))» | ||
15:08
ttyl joined
|
|||
gfldex | pochi: ^^^ that's the illiteral way | 15:08 | |
pochi | thanks | 15:09 | |
gfldex wonders if that's doced | |||
ugexe | m: my Int @a = 1, 2, 3; say @a.perl; # you were doing an array of array of int | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Array[Int].new(1, 2, 3)» | ||
ugexe | not the same thing as array of int | ||
assigning a literal array to an Array[Int] slot would obviously never work | 15:11 | ||
pochi | Doesn't Array of Int @a specify a structure such as @a = ( [1,2,3], [2,3,4], ... )? | ||
15:11
ttyl left,
espadrine joined
|
|||
ugexe | maybe *goes back to drinking caffeine* | 15:13 | |
gfldex | no, it constructs a nominally type constraint. | ||
m: my Array[Array[Int]] $a; | 15:14 | ||
camelia | ( no output ) | ||
gfldex | that's a Array of Arrays of Int. | ||
([1,2,3], [2,3,4]) is a List of Arrays who happen to have Ints inside. | 15:15 | ||
Zoffix | pmurias, to what end? | 15:16 | |
It won't solve the issue of having to specify a server all over the place. | 15:20 | ||
(if you're referring to the earlier conversation about having multiple servers per client instance) | |||
gfldex | m: my Array of Int @a; @a[0] = my Int @ = 1,2,3; dd @a; | 15:24 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Array[Array[Int]] @a = Array[Array[Int]].new(Array[Int].new(1, 2, 3))» | ||
gfldex | m: my Array of Int @a; @a[0] = (1,2,3).Array[Int]; dd @a; | 15:25 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Use of Nil in string context in block <unit> at /tmp/EfPI1Idc84 line 1Indexing requires an instance, tried to do: [ (Int) ] in block <unit> at /tmp/EfPI1Idc84 line 1» | ||
gfldex | how would I coerce to a parametric type? | 15:26 | |
15:27
iH2O joined
|
|||
CIAvash | m: my Array of Int @a; @a[0] = Array[Int](1,2,3); say @a; | 15:31 | |
camelia | rakudo-moar c5dfd7: OUTPUT«[[1 2 3]]» | ||
15:36
firstdayonthejob joined,
iH2O left
15:42
sQuEE left
15:45
anomie__ joined
|
|||
anomie__ | Is there a way to install perl6 without using git? My internet is 16KB/s, and I just can't keep a connection for that long (and git cloning can not continue after it's been interrupted). | 15:46 | |
lizmat | anomie__ : rakudo.org/downloads/rakudo/ contains tarballs for download | 15:48 | |
perhaps you can find a downloader with resume function | |||
15:48
sQuEE joined
|
|||
anomie__ | Ah, thanks. | 15:49 | |
Can't believe i didn't notice. | |||
lizmat | that's why we also have an IRC channel :-) | ||
anomie__ | So like, should I build rakudo, then nqp, then star? | 15:51 | |
psch | anomie__: i think the tarballs work in one step, probably Configure.pl as usual | ||
lizmat | perl Configure.pl --gen-moar --gen-nqp --backends=moar # is what I usually do | ||
problem is, that will try to use git to download moar and nqp :-( | 15:52 | ||
and that brings us back to the 16KB/s issue | |||
www.moarvm.org/releases/MoarVM-2016.05.tar.gz # latest MoarVM tarball | 15:53 | ||
anomie__ | Eh, I'll try to figure it out. Hopefully there's some --nqp-dir flag or something. | ||
lizmat | anomie__: there is | ||
anomie__ | Good. | ||
psch | the star tarballs has nqp and moar bundled, and if those are already there it doesn't download anything | 15:54 | |
lizmat | psch: good point | ||
psch | so it's really just 'perl Configure.pl --gen-moar --backends=moar --prefix=$PREFIX' | ||
lizmat | seems that would be the easiest way | ||
psch | well, and --make-install maybe :) | ||
lizmat | there's --make-install ? | ||
psch | yeah | ||
lizmat learned a thing today | 15:55 | ||
anomie__ | So star tarballs are updated less frequently though, so I'll do it the hard way. | ||
psch | anomie__: but star also has a bunch of modules | ||
anomie__: which you otherwise would have to download with a module manager (via git, usually) or manually | 15:56 | ||
gfldex | anomie__: do you think a git pull will work after you got the clone done? | ||
anomie__ | gfldex: Yeah. | ||
gfldex | i may be able to help you | ||
psch | could probably just download the zip (or whatever) from github? or do those not carry the .git folder? | 15:57 | |
anomie__ | psch: Those don't carry the .git folder. | 15:58 | |
psch | ah, shame :/ | ||
anomie__ | anomie__: Yeah. | 15:59 | |
Err, Yes, i do I have xz installed. | |||
lizmat | wouldn't it be just a matter of git create in that folder, and then tweaking the files in .git? | 16:01 | |
16:01
vendethiel joined,
zakharyas joined
|
|||
psch | no idea if git works like that | 16:01 | |
i mean, i'd guess doing a 'git init', setting the remote, and the pulling *could* work... | |||
lizmat | psch: yeah, git init I meant | ||
16:02
Ven joined
|
|||
lizmat | you wouldn't have any history, but I'm pretty sure it will allow you to git pull etc from there | 16:02 | |
16:02
smls joined
|
|||
smls | What is the expected behavior when two .pm modules `use` each other? | 16:03 | |
mst | ideally, a small gnome exits the back of the monitor and hits the developer with a mallet | ||
smls | I would have probably expected an error, but right now it hangs and keeps eating RAM | ||
(this is regarding rt.perl.org/Ticket/Display.html?id...xn-1403059 ) | 16:04 | ||
16:04
Deep_Thought joined
|
|||
psch | smls: we did have circular module loading detection at some point... probably got clobbered with all CUR work though :/ | 16:05 | |
+the | |||
smls | ok, I'll rename the RT accordingly. | ||
lizmat | psch: before, the detection lived in the nqp code, if I recall | ||
now, it is the responsibility of the CUR to detect circularities | 16:06 | ||
a start would be writing a test :-) | |||
dalek | c: ff5caf0 | (Jan-Olof Hendig)++ | / (3 files): Added docs for X::Caller::NotDynamic and fixed a broken link relating to that |
16:09 | |
dogbert17 | stupid question time :) | 16:11 | |
lizmat is working through the twisty maze that is the List reifier code | |||
dogbert17 | on doc.perl6.org/type/Proc::Async there is an example where some bytes are written through hexdump | ||
it works but if I change that program name to e.g. hexdump2 it just dies, I expected it not to work but there is no error message at all. Is it supposed to be like that? | 16:13 | ||
psch | m: my $promise = start { die "blerg" }; await $promise | ||
camelia | rakudo-moar c5dfd7: OUTPUT«blerg in block <unit> at /tmp/GV1rJr0SlU line 1» | ||
psch | m: my $promise = start { die "blerg" }; try await $promise | ||
camelia | ( no output ) | ||
psch | dogbert17: the example doesn't have code that handles the failure in any meaningful way | 16:14 | |
dogbert17: i'm assuming it dies with something along the lines of "no such file: hexdump2"? | |||
dogbert17 | psch: shouldn't there be any output on STDERR? | 16:15 | |
psch | oh, *no* error message at all | ||
that's curious, actually | |||
psch is really good at only paying half attention :) | 16:16 | ||
dogbert17 | ususally the error messages from perl6 are very good but here there's nothing. It's a bit odd so I thought I should ask | 16:17 | |
gfldex | $prog.start should return a bottled up exception that tells you about the lack of executable and it's name | 16:18 | |
Zoffix | Seems calling .write "defuses" the broken promise | 16:20 | |
dogbert17 | if I put a say 'can I see this' after the await line no text is shown when running the code | 16:23 | |
psch | dogbert17: yeah, that's what i saw too just now | ||
anomie__ | Really though, the git clones wouldn't be nearly as problematic if there was a way to pass a --depth=1 option. Can I do that? | ||
Zoffix | Oh, actually .write exits the program | 16:24 | |
dogbert17 | that seem a bit harsh no? | ||
gfldex | anomie__: maybe www.perforce.com/blog/141218/git-b...low-clones | ||
Zoffix | dogbert17, well, I mean that's the apparent behaviour not that it's actually calling exit :P | 16:25 | |
dogbert17 | Zoffix: aha, I jumped to conclusions :) | 16:26 | |
psch | :/ | ||
spooky async bugs | |||
16:26
profan joined
|
|||
Zoffix | m: $*SCHEDULER.WHAT.say | 16:26 | |
camelia | rakudo-moar c5dfd7: OUTPUT«(ThreadPoolScheduler)» | ||
psch | perl6-gdb-m correctly errors out, with "no such file or directory" | 16:27 | |
16:28
smls left
|
|||
dogbert17 | psch: on the plus side, if it's a bug we have a good testcase | 16:29 | |
lizmat | afk for some X-Apocalypse | ||
psch | dogbert17: oh, it's most definitely a bug, but it disappearing under gdb is just annoying | ||
ugexe | i like how running without `:w` or passing .write a Str gets an exception but still runs the process after exiting the initial perl6 process | 16:31 | |
16:32
huggable left,
huggable joined
|
|||
ugexe | perl6 -e 'my $p = Proc::Async.new("hexdump", "-C"); my $promise = $p.start; await $p.write("asdf"); say $promise; $p.close-stdin; await $promise;' # then press `Enter` after the exception exits the process | 16:34 | |
dogbert17 | I haven't tried perl6-gdb-m before but I had to try, got 'Program received signal SIGPIPE, Broken pipe.' and then a gdb prompt | ||
psch | dogbert17: that's a bit weird, are you on HEAD? | 16:37 | |
m: say 1 | |||
camelia | rakudo-moar c5dfd7: OUTPUT«1» | ||
psch | ah, i'm behind anyway | ||
hm, but it's only the Hash.keyof commit that i'm missing | |||
16:38
ggoebel114 left,
ggoebel114 joined
|
|||
dogbert17 | psch: running what Camelia is running i.e. c5dfd7 | 16:38 | |
psch | yeah, that's HEAD... | 16:39 | |
Zoffix | m: class Plug { has $.irc is rw }; my $p = Plug.new; class IRC { has @.plugs; method run { $_.irc = rand for @.plugs; }; method meow { say .irc for @.plugs} }; await ^2 .map: {start {.run,.meow given IRC.new(:plugs($p))}}; | ||
camelia | rakudo-moar c5dfd7: OUTPUT«0.892403708693780.730070228046375» | ||
Zoffix | AlexDaniel++ thanks for bring up the multi-server thing. My current design is flawed. Can't re-use the same plugin in multiple clients ^ | 16:40 | |
because $.irc object will be the same one :/ | |||
psch | oh | ||
i got the SIGPIPE before, too | |||
16:40
domidumont joined
|
|||
psch | running 'cont' is what gave the NSFOD | 16:40 | |
AlexDaniel | Zoffix: glad to help | 16:41 | |
psch | no idea what's behind that :/ | ||
dogbert17 | it's definitely strange | 16:42 | |
anomie__ | failed to load library 'dynext/libperl6_ops_moar.so' | 16:45 | |
Eh? I got that error after running `perl Configure.pl --prefix=/tmp/prefix' | |||
Actually, after running make -j3 | |||
I installed moarvm and nqp into that prefix. | 16:46 | ||
16:49
Deep_Thought left
16:50
itaipu joined
|
|||
Zoffix | "P6 in production thread": perlmonks.org/index.pl?node_id=1163803 | 16:57 | |
If anyone with an account cares to reply to cavac that our github system is only temporary, I'll appreciate it :) | 16:58 | ||
16:58
Deep_Thought joined,
vendethiel left
|
|||
Zoffix | Oh, never mind, there's already an answer to that point | 16:58 | |
17:01
itaipu left,
mr-foobar joined
|
|||
AlexDaniel | by the way, what's the status on perl 6 cpan equivalent? | 17:04 | |
17:05
zakharyas left
|
|||
grondilu | "but p6 still has a perl-esque feel." what an euphemism | 17:06 | |
Zoffix | AlexDaniel, haven't heard anything ever since I wrote this: docs.perl6.org/language/modules#The..._Ecosystem and the metacpan fork has no commits this year | ||
mst | AlexDaniel: the status is "nobody's working on it at all except a couple perl5 people, and one of them is me and currently sucking at writing a blog post" | 17:07 | |
17:08
sQuEE left
|
|||
Zoffix | mst, you don't have access to perlmonks.org accounts, by any chance, do you? I have an account, but I've no idea what email address I used for it or what my pass is | 17:08 | |
mst | no | 17:09 | |
17:10
itaipu joined
17:12
sQuEE joined
17:16
CIAvash left
|
|||
grondilu | I have an perlmonks account, but I'm not sure saying the current ecosystem system being temporary is such a great thing to say about it. | 17:21 | |
I mean that will go in the sense that Perl 6 is not ready for production. | 17:22 | ||
Zoffix | Why not? It's the truth. | ||
Hiding the truth doesn't magically make things better. | |||
grondilu | it's not higing the truth not to say what you don't want to be known. (well, I think it's not) | ||
damned I phrased that poorly | 17:23 | ||
mst | you have two possibilities here | ||
(1) admit the current ecosystem is a giant janky hack that will likely be replaced by somethingsuitable for real usage | |||
Zoffix | The alternative is to let them keep thinking our *permanent* system is based on github and accepting their critique on such a system | ||
mst | (2) present perl6 as a language that thinks the giant janky hack is actually a good and worthy thing | ||
if (2) is true, then, frankly, I might as well cancel my YAPC::NA talk and /part now | 17:24 | ||
but I really don't think it is | |||
or, "what Zoffix said" | |||
geekosaur | perl's often gotten a lot of mileage out of janky hacks (see: references, p5 "objects")... but this doesn't strike me as one of those | 17:25 | |
grondilu | I'm unaware of this github hate anyway, is that a serious thing? | ||
mst | what | ||
not 'github hate' | |||
nobody said 'github hate' | |||
17:26
mr-foobar left
|
|||
grondilu | haters rarely say "I hate" | 17:26 | |
Zoffix | It's not github hate. It's having your shit break just because author of XYZ decided to push a new commit :P | 17:27 | |
mst | right | ||
I dunno how you think github is relevant here | |||
tadzik | if your shit relies on git HEAD... | ||
mst | it'd be a janky hack with a different backend | ||
tadzik | . o O ( then you're a shit-HEAD ) | ||
geekosaur | sadly, that is increasingly common in certain ecosystems | ||
(go, node, ...) | |||
mst | grondilu: let me put this another way: for perl6 to go into production for me, either the current ecosystem stuff needs replacing or I need to replace it myself :) | ||
mostly because the various sysadmins involved would frigging murder me otherwise | 17:28 | ||
ugexe | nobody should be using "use XXX::YYY" in production without :ver<>:auth<> anyway | 17:32 | |
17:32
mohae_ joined
|
|||
Zoffix | The problem is there's ambiguity of what :ver<whatever> actually is. I can release version 1.001001 and then break it by pushing a few commits without changing the version number | 17:34 | |
17:34
pmurias left
17:35
mohae left
|
|||
ugexe | a Distribution is meant to be immutable | 17:35 | |
17:36
pmurias joined
|
|||
mst | right, and the current implementation of the ecosystem doesn't get that quite right | 17:37 | |
I guess moving it to tags will help | |||
ugexe | the metacpan instance jdv runs handles it | 17:38 | |
this is why ive left my versions at "*" on github, because thats the only version that should be mutable | 17:40 | ||
mst | right | 17:41 | |
17:41
Actualeyes left
|
|||
ugexe | and regarding the perlmonk comments: jdv's (alpha?) metacpan can be used with zef, and the modules `use`d with their full identity. so an example of such a non-github ecosystem for perl6 can already be demonstrated | 17:45 | |
mst | and we should be able to slot cpan itself in underneath as storage soon enough | ||
pmurias | a version of metacpan works for Perl 6? | 17:48 | |
ugexe | hack.p6c.org:5001/ | 17:49 | |
hack.p6c.org:5000/v0/release/_searc...ion:DBIish | |||
17:52
|meta joined
17:53
kurahaupo left
17:56
Xliff_ joined
17:57
patrickz joined
|
|||
dalek | c: a526f32 | titsuki++ | doc/Type/IO.pod: Fix the example of the open method |
17:57 | |
c: 5ea48f4 | (Zoffix Znet)++ | doc/Type/IO.pod: Merge pull request #555 from titsuki/fix-open Fix the example of the open method |
|||
17:59
Xliff left
18:02
CIAvash joined,
kurahaupo joined
18:05
RabidGravy left
|
|||
b2gills | anomie__: I think you should be able to call git pull to finish off an interrupted git clone | 18:05 | |
anomie__ | b2gills: Nope. When a git clone is interrupted, there is no .git. | 18:06 | |
Unless it's changed since I last tried. | 18:07 | ||
18:09
mohae joined
18:12
mohae__ joined,
mohae_ left,
labster joined
|
|||
geekosaur | it hasn't | 18:14 | |
18:14
mohae left
18:15
BenGoldberg joined
18:18
Ven left
18:19
RabidGravy joined
18:21
Ven joined
18:24
patrickz left
18:26
grondilu left
18:28
grondilu joined
|
|||
gnull | Hello everyone | 18:28 | |
I've been reading perl6 tutorial at learnxinyminutes.com/docs/perl6/ | 18:29 | ||
DrForr | Yay, how do you like it so far? | ||
tadzik | welcome gnull :) | ||
gnull | It is awesome. Never been so happy to learn new language since Haskell | 18:30 | |
gfldex | :o | ||
gnull | The question is: how up-to-date is it? It states that some of the features are not implemented, like `lazy` or `quietly`. Is it still so? | 18:32 | |
psch | m: /a b/; | 18:33 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at /tmp/QVRSwULc5g:1 ------> 3/a7⏏5 b/;» | ||
psch | m: quietly /a b/ | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at /tmp/W0N6qRewyL:1 ------> 3quietly /a7⏏5 b/» | ||
psch | m: my @a = lazy 1..*; say @a[^10] | 18:34 | |
camelia | rakudo-moar c5dfd7: OUTPUT«(1 2 3 4 5 6 7 8 9 10)» | ||
ugexe | m: quietly { /a b/ } | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at /tmp/ITLVsuHjHt:1 ------> 3quietly { /a7⏏5 b/ }» | ||
jnthn | m: warn "foo" | ||
camelia | rakudo-moar c5dfd7: OUTPUT«foo in block <unit> at /tmp/wTRav7ZPSx line 1» | ||
ugexe | hmm i thought quietly worked some way | ||
jnthn | m: quietly warn "foo" | ||
camelia | ( no output ) | ||
psch | that looks like it should be quiet | ||
jnthn | It's for *runtime* warnings | ||
psch | ahh, so no | ||
jnthn | "Potential difficulties" is a compile time thing :) | ||
gfldex | gnull: expect it to be outdated in some spots. You will be closer to $now with perl6intro.com/ | 18:35 | |
18:35
buharin left
|
|||
AlexDaniel | gnull: I don't think that it is outdated at all | 18:39 | |
gnull: look at the history: github.com/adambard/learnxinyminut...l.markdown | 18:41 | ||
not too bad | |||
18:41
buharin joined
|
|||
AlexDaniel | gnull: if you stumble upon something that doesn't work, then just open an issue | 18:41 | |
18:42
buharin left
|
|||
gnull | Thank you. | 18:42 | |
18:43
CIAvash left
|
|||
gnull | I see that `quietly` works. How about `lazy`? perl6intro.com/ doesn't tell abything about it. Any usage examples? | 18:43 | |
anything* | |||
psch | m: my @a = 1..*; | ||
camelia | ( no output ) | ||
psch | m: my @a = 1..*; say @a[^10] | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(1 2 3 4 5 6 7 8 9 10)» | ||
18:43
anomie__ left
|
|||
psch | meh vOv | 18:43 | |
gnull | These are lazy lists I guess | 18:44 | |
18:44
Deep_Thought left
|
|||
psch | m: my @a = (1..*).map({ ++$_ }); | 18:44 | |
camelia | ( no output ) | ||
gnull | I thought that I could do something like: $a = lazy 1 + 2 | ||
and 1 + 2 won't be evaluated until i access the value of $a | 18:45 | ||
The statement prefix `lazy` is what I'm interested in | |||
ugexe | m: my @a = lazy 1..100; say @a.elems | ||
camelia | rakudo-moar c5dfd7: OUTPUT«Cannot .elems a lazy list in block <unit> at /tmp/8F8jSutE9d line 1Actually thrown at: in block <unit> at /tmp/8F8jSutE9d line 1» | ||
18:45
Deep_Thought joined
|
|||
psch | gnull: it's only for iterators, not subs in general | 18:46 | |
...or Iterables? i'm not quite sure there | |||
m: my $a = lazy 1..* X+ 1..*; say $a[^5] | 18:48 | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(2 3 4 5 6)» | ||
psch | m: my $a = 1..* X+ 1..*; say $a[^5] # timeout | ||
camelia | rakudo-moar c5dfd7: OUTPUT«(timeout)» | ||
AlexDaniel | m: say now; my $a = { sleep 3; 4 + 8 }; say now; say $a(); say now | 18:49 | |
camelia | rakudo-moar c5dfd7: OUTPUT«Instant:1464461392.946288Instant:1464461392.94961212Instant:1464461395.950710» | ||
AlexDaniel | gnull: perhaps you want something like this? | ||
gnull: ↑ | |||
m: say now - BEGIN now; my $a = { sleep 3; 4 + 8 }; say now - BEGIN now; say $a(); say now - BEGIN now | 18:50 | ||
camelia | rakudo-moar c5dfd7: OUTPUT«0.08844930.0524130123.0159767» | ||
18:51
qwe_ joined
|
|||
gnull | Yes exactly. Are these `{}` code blocks always lazily evaluated? | 18:52 | |
18:53
itaipu left
|
|||
psch | any Callable is only evaluated when you invoke it | 18:53 | |
18:53
ggoebel114 left
|
|||
AlexDaniel | but it is evaluated each time you invoke it, so it's not exactly what you wanted | 18:54 | |
is there any way to make a cached block? | |||
ugexe | use a Proxy | ||
gnull | psch: What do you mean by invocation? Why `$a = { sleep 3; 4 + 8 }` isn't invocation? | 18:56 | |
psch | m: my $a = { sleep 10; 4 + 8 }; say $a | 18:57 | |
camelia | rakudo-moar c5dfd7: OUTPUT«-> ;; $_? is raw { #`(Block|70246464) ... }» | ||
psch | m: my $a = { sleep 10; 4 + 8 }; say $a() | ||
ugexe | its a callable code block unless you `do` it | ||
psch | gnull: it isn't because it's a declaration :) | ||
camelia | rakudo-moar c5dfd7: OUTPUT«12» | ||
gnull | m: sub a {say 'hooah'}; my $b = a; | ||
camelia | rakudo-moar c5dfd7: OUTPUT«hooah» | ||
psch | m: sub a {say 'hooah'}; my $b = &a; | 18:58 | |
camelia | ( no output ) | ||
18:58
Ven left
|
|||
gnull | m: my $b = {say 'hooah'; 1}; $b | 18:59 | |
camelia | rakudo-moar c5dfd7: OUTPUT«WARNINGS for /tmp/OPVadx_MZ6:Useless use of $b in sink context (line 1)» | ||
gnull | m: my $b = {say 'hooah'; 1}; say $b; | ||
camelia | rakudo-moar c5dfd7: OUTPUT«-> ;; $_? is raw { #`(Block|74992952) ... }» | ||
18:59
buharin joined
|
|||
ugexe | m: my $b = do {say 'hooah'; 1 }; say $b | 18:59 | |
camelia | rakudo-moar c5dfd7: OUTPUT«hooah1» | ||
gnull | Ok, when i do `$b = {say 'hooah'; 1};` the perl remebmers that to get the value of $b it must evaluate the code block | 19:00 | |
ugexe | do executes the statement immediately. it doesnt remember anything | 19:01 | |
oops i misread do `$b` as `do $b` | 19:02 | ||
gnull | I don't understand the case without `do` | ||
then I try to `say $b`, I expect it to evaluate the block and `say 'hooah'` | |||
ugexe | its callable, you have to call it | ||
psch | m: my &b = {say 'hooah'; 1}; b | ||
camelia | rakudo-moar c5dfd7: OUTPUT«hooah» | ||
ugexe | by `say $b` you are just calling .gist on it | ||
m: say sub foo { 1 + 1 } | 19:03 | ||
camelia | rakudo-moar c5dfd7: OUTPUT«sub foo () { #`(Sub|68445288) ... }» | ||
gnull | Ok, now it's clear | 19:04 | |
Thanks you very much | |||
19:11
TEttinger joined
|
|||
AlexDaniel | gnull: if you have any other questions we would love to answer them :) | 19:11 | |
gnull | AlexDaniel: love this community) | 19:13 | |
grondilu | raydiak: Math::Symbolic dies on invocation with: | ||
===SORRY!=== | |||
No such method 'key' for invocant of type 'Array' | |||
AlexDaniel | huggable: hug gnull | ||
huggable hugs gnull | |||
psch | m: say Array.^can('key') | 19:14 | |
camelia | rakudo-moar c5dfd7: OUTPUT«()» | ||
grondilu | lately I've been looking for a solution for a multivariate polynomials arithmetics. Not quite happy with what I've found. There's a Perl 5 library and I've considered translating it but meh I'm too lazy. | 19:15 | |
19:15
s_kilk joined
19:17
sufrostico left
|
|||
grondilu | it'd be nice to be able to multiply and add undefined numeric variables and get polynomials as a result. | 19:17 | |
AlexDaniel | grondilu: you want that to be built in? :o | 19:18 | |
grondilu | nah, not built-in. I often have unreasonable desires for the core, but not that one. | 19:19 | |
anyway if raydiak wants some encouragement to keep on working on Math::Symbolic, here it is. | |||
using undefined variables may not be the best interface for it on second thought, but I'm not sure using a string is the best either. | 19:20 | ||
I mean something like Polynomial.new('2*x + 1') would be kind of lame. | 19:22 | ||
FYI I was considering something like that for my Clifford module. I may make it crazy efficient. | 19:23 | ||
19:24
_28_ria left,
s_kilk left
|
|||
mst | grondilu: basically you need multiple whatever stars | 19:24 | |
grondilu: %*{'x'} # ISAGN | |||
grondilu | "ISAGN"? | 19:25 | |
mst | I See A Great Need | ||
19:25
domidumont left
|
|||
mst | usenet-ism, usually at least slightly tongue in cheek | 19:25 | |
19:26
_28_ria joined,
ssotka joined
|
|||
grondilu | seriously though, I've thought a bit about what would be the best interface to a multivariate polynomials module, could not quite decide on something. | 19:26 | |
at first I thought of: use Polynomials; my Real $X; say $X**2 - 1 == ($X + 1)*($X - 1) # that would say "True", amazingly enough. | 19:27 | ||
^if someone can make this work, I'd be amazed. | 19:28 | ||
19:28
wamba joined
|
|||
grondilu | notice how $X is undefined here. | 19:28 | |
aynway for various reasons I was not entirely conviced by such method anyway. | 19:29 | ||
AlexDaniel | m: my $X; say quietly $X**2 - 1 == ($X + 1)*($X - 1) | 19:33 | |
camelia | rakudo-moar c5dfd7: OUTPUT«True» | ||
AlexDaniel | grondilu: ↑ there you go, where's my cookie? | ||
19:36
Deep_Thought left
19:37
Deep_Thought joined
19:38
qwe_ left
19:40
Deep_Thought left
19:41
hankache joined
|
|||
RabidGravy | boom I win! threads lose | 19:43 | |
hankache | good evening #perl6 | ||
grondilu never saw "quietly" before | 19:44 | ||
19:44
ssotka left
|
|||
grondilu | m: my $X; say quietly $X**2 + 1 == ($X + 1)*($X - 1) | 19:45 | |
camelia | rakudo-moar c5dfd7: OUTPUT«False» | ||
jnthn | grondilu: Just hacked together gist.github.com/jnthn/75321e83b415...df8d6f0d18 which may be a pointer in a useful direction :) | ||
grondilu | binary tree, huh? I thought about doing this like that too, but got discouraged in the end. | 19:49 | |
it's also not quite how people seem to do it | |||
jnthn | I'm a compiler writer, I see everything as a tree or a graph :P | 19:56 | |
Or a string waiting to be turned into one :P | |||
You can build whatever data structure you want, though | |||
My point was more that with care you can overload operators and use .VAR in a way that lets you find the symbol names | 19:57 | ||
19:57
cpage_ joined
20:02
TakinOver joined
20:10
Tonik left
|
|||
RabidGravy | my problem of yesterday appears to be something in the region of promise and react contending over a single resource in closing a channel and thus keeping a promise :-\ | 20:10 | |
replace the react with a $channel.list and it's all fine | 20:11 | ||
20:13
darutoko left
|
|||
jnthn | RabidGravy: If you've got a golf of it, I can take a look next week. | 20:14 | |
RabidGravy | I couldn't get a degenerate case to do it | ||
jnthn | Ah, hm | ||
RabidGravy | there may be a funny timing issue with libshout too | 20:15 | |
jnthn | Does the case it occurs it depend on anything that's hard to run (native libs and stuff)? | ||
RabidGravy | yeah, libshout and icecast required :-\ | 20:16 | |
jnthn | Gotta go now, but I'll have some bug hunting time next week, so if I can reproduce it... :) | ||
Ah | |||
Hm | |||
Though maybe those are easily apt-get-able or so? | |||
Anyways, time for me to go relax for now... bbt | 20:17 | ||
20:17
sufrostico joined
20:20
TakinOver left
|
|||
masak | m: sub foo { sub bar { state $x; $x++; say $x }; bar; bar }; foo; foo | 20:29 | |
camelia | rakudo-moar 7500ea: OUTPUT«1212» | ||
masak | :) | ||
20:32
huggable left,
huggable joined
20:34
patrickz joined,
buharin left
20:51
cpage_ left
20:57
rindolf left
21:02
mr-foobar joined
21:09
sufrostico left,
sufrostico joined
21:23
AlexDaniel left
21:26
wamba left
21:33
sufrostico left
|
|||
masak | 'night, #perl6 | 21:36 | |
hankache | night masak | ||
grondilu | m: my $X; say quietly $X**2 + $_ == ($X + 1)*($X - 1) for -1, 1 | 21:37 | |
camelia | rakudo-moar 7500ea: OUTPUT«(True False)» | ||
grondilu | ^that baffles me | ||
m: say ((my $)**2).WHAT | |||
camelia | rakudo-moar 7500ea: OUTPUT«Use of uninitialized value of type Any in numeric context in block <unit> at /tmp/EWTPIh_Kwx line 1(Int)» | ||
grondilu | m: say quietly ((my $)**2).WHAT | ||
camelia | rakudo-moar 7500ea: OUTPUT«(Int)» | ||
psch | m: say Int + -1 | 21:38 | |
camelia | rakudo-moar 7500ea: OUTPUT«Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new? in block <unit> at /tmp/0w9EO_nM_m line 1» | ||
psch | m: say Int + 1 | ||
camelia | rakudo-moar 7500ea: OUTPUT«Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new? in block <unit> at /tmp/cIhsWygYSu line 1» | ||
grondilu | I guess it takes it as 0. | ||
m: say quietly 0 == my $ | |||
camelia | rakudo-moar 7500ea: OUTPUT«True» | ||
grondilu | m: say quietly 1 == my $ | ||
camelia | rakudo-moar 7500ea: OUTPUT«False» | ||
psch | m: my $X; my $a = quietly $X**2 + $_; my $b = quietly ($X + 1)*($X - 1) for -1, 1; say $a.WHAT; say $b.WHAT | ||
camelia | rakudo-moar 7500ea: OUTPUT«(Int)(List)» | ||
grondilu | ok, mystery solved | 21:39 | |
psch | m: my $X; my $a = quietly $X**2 + $_; my $b = quietly ($X + 1)*($X - 1); say $a.WHAT; say $b.WHAT | ||
camelia | rakudo-moar 7500ea: OUTPUT«(Int)(Int)» | ||
psch | m: my $X; my $a = quietly $X**2 + $_; my $b = quietly ($X + 1)*($X - 1); say $a; say $b | ||
camelia | rakudo-moar 7500ea: OUTPUT«0-1» | ||
psch | eh, i'm not even being helpful there anyway | ||
psch better goes to bed as well | |||
hankache | night psch | 21:40 | |
DrForr | Heading to bed myself. Incidentally one of the talk evaluations I got read "A great introduction to perl 6 for someone who has never even used perl 5 before." | 21:41 | |
21:48
yqt joined
22:00
sufrostico joined
22:01
|meta left
|
|||
Emeric | my @list = (0, 1, 3, 4); | 22:08 | |
Can I an add a value between the 1 and the 2 ? | |||
is there a method to do that ? | |||
22:13
Zoffix left
|
|||
b2gills | splice | 22:14 | |
m: my @list = (0, 1, 3, 4);@list.splice(1,0,32); say @list | 22:15 | ||
camelia | rakudo-moar 7500ea: OUTPUT«[0 32 1 3 4]» | ||
22:22
setty1 left
22:27
patrickz left
22:28
gorgonzola joined
22:37
ssotka joined
22:40
wbill joined
22:51
kurahaupo left
22:53
firstdayonthejob left
22:57
Emeric left
23:02
pmurias left,
gorgonzola left
23:09
jack_rabbit joined
23:17
RabidGravy left
23:21
ssotka left
23:23
buharin_ left
23:29
sufrostico left
23:37
kalkin- left
23:40
buharin_ joined
23:41
jack_rabbit left
23:44
sufrostico joined
23:45
spider-mario left
23:46
wbill left
23:47
hankache left
23:56
itaipu joined
|