»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋 Set by Zoffix on 25 July 2018. |
|||
00:00
Manifest0 left
00:01
Sgeo_ joined
00:04
Sgeo left
00:05
Manifest0 joined
00:09
Manifest0 left
00:13
Altai-man_ left
00:14
Manifest0 joined
00:23
Manifest0 left
00:28
Sgeo__ joined
00:29
Manifest0 joined
00:30
kurahaupo_ joined
00:31
kurahaupo left
00:32
Sgeo_ left
00:37
Manifest0 left
00:42
Manifest0 joined
00:44
ribasushi joined
00:46
Sgeo__ left
00:47
Sgeo__ joined
00:55
espadrine_ left
00:58
TreyHarris left
|
|||
cpan-p6 | New module released to CPAN! Podviewer (0.0.1) by 03UZLUISF | 00:59 | |
00:59
Manifest0 left
01:01
kurahaupo_ left
01:02
kurahaupo joined
|
|||
Kaiepi | m: module A { role B { }; class B::C does B { } }; say A::B::C | 01:03 | |
camelia | (C) | ||
Kaiepi | hm | 01:04 | |
01:04
Sgeo__ left,
Sgeo__ joined,
netrino left
|
|||
Kaiepi | m: module A {}; module A { role B { }; class B::C does B { } }; say A::B::C | 01:05 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Redeclaration of symbol 'A' at <tmp>:1 ------> 3module A {}; module A7⏏5 { role B { }; class B::C does B { } }; expecting any of: generic role |
||
01:05
Manifest0 joined
|
|||
Kaiepi | i have a module that's similar to what i'm trying to do here but it's not working hastebin.com/ivuvizebap.rb | 01:05 | |
it claims the symbol Net::Telnet::Subnegotiation::NAWS doesn't exist | |||
why? | 01:07 | ||
Xliff | "Subneotiation::NAWS does Subnegotiation" ... Um ... "Subneotiation" is missing the "g"? | ||
But even so, that's namespace issue. That should still work. | |||
Kaiepi | oh whoops lmao | 01:08 | |
Xliff | :) | ||
Kaiepi | ah there we go it works now | 01:09 | |
thanks | |||
Xliff | LOL! That was it?! | ||
Kaiepi | yes | ||
Xliff | \o/ | ||
Kaiepi | i feel like i should rename the serialize method to Blob so i can pass subnegotiation objects to methods that take Blob() | 01:10 | |
Xliff | Method::Also allows you to do both. | 01:11 | |
use Method::Also | |||
method serialize is also<Blob> { ... } | |||
Options are good. | |||
Also. TIMTWODI | |||
Kaiepi | oh huh didn't know about also | 01:13 | |
btw what does the handles trait mod do? | |||
Xliff | Yeah. I'm using it for p6-GtkPlus | ||
handles? | |||
Ah! Delegation. The docs do not do that explanation justice. | 01:14 | ||
m: class A { method b { say "From B"; }; }; class B { method b { A.new.b }; }; | 01:15 | ||
camelia | ( no output ) | ||
Xliff | ^^ A pattern like that is MADE for delegation. | ||
Which can be written as: | |||
m: class A { method b { say "From B"; }; }; class B { has A $.a handles<b>; }; B.new.b | 01:16 | ||
camelia | From B | ||
Xliff | m: class A { method b { say "From A"; }; }; class B { has A $.a handles<b>; }; B.new.b | ||
camelia | From A | ||
Xliff | For that arbitrary example, it's hard to see the use, but imagine a 4-D Point class being wrapped by a Box class. | ||
s/Box/MetaPoint/ | 01:17 | ||
"class MetaPoint { has Point $p handles<x y z Ⓐ>; }". Prevents you from having to write silly wrapper methods for .x, .y, .z and .Ⓐ | 01:19 | ||
01:19
andrzejku joined
|
|||
Xliff | Push that out to a wrapper class for a large-scale application that handles 4 different kinds of objects for 4 disparate systems. | 01:20 | |
01:20
andrzejku_ left
|
|||
Xliff | And then push that further. | 01:20 | |
So... long story short: the handles trait can be viewed syntactic sugar for methods that stub in methods from other class attributes. | 01:21 | ||
But it's more than that. | |||
Oh.. syntax error in my class explanation... | 01:22 | ||
"class MetaPoint { has Point $!p handles<x y z Ⓐ>; }". Prevents you from having to write silly wrapper methods for .x, .y, .z and .Ⓐ | |||
01:22
Manifest0 left,
Matthew[m] left,
MitarashiDango[m left,
tyil[m]1 left,
unclechu left,
Seance[m] left,
Demos[m] left,
AlexDaniel` left,
mack[m] left
|
|||
Xliff | THAT allows you to still expose $!p.x, $!p.y, $!p.z, $!p.Ⓐ, without exposing $!p | 01:22 | |
01:22
tyil[m] left
|
|||
Xliff | Or writing wrappers. | 01:23 | |
01:23
lance_w[m] left,
rba[m] left,
Garland_g[m] left
01:25
vs^ left,
irdr left
01:26
vs^ joined,
vs^ left,
vs^ joined,
irdr joined
01:27
vs^ left,
Manifest0 joined,
vs^ joined,
vs^ left,
vs^ joined
01:28
vs^ left,
vs^ joined,
vs^ left
01:40
Manifest0 left
01:42
pnu__ left,
pnu__ joined,
b2gills left,
afresh1 left
01:43
peteretep left
01:45
peteretep joined,
Manifest0 joined
01:47
Sharparam_ joined,
gks_ joined
01:48
Kaiepi left,
lichtkind left,
MilkmanDan left,
Geth left,
vxe left,
synopsebot left,
xinming left,
huf left,
agentzh left,
gks left,
Sharparam left,
KotH left,
Grrrr left,
stux|RC left,
nightfrog left,
bobby left,
tyil left,
hahainternet left,
krunen left,
silug_ left,
Ekho left,
kubrat left,
jdv79 left,
revdiablo left,
Woodi left,
Sgeo_ joined,
afresh1 joined
01:50
zacts joined
01:51
Sgeo__ left
01:56
Woodi joined
01:57
molaf left
02:01
b2gills joined,
Manifest0 left
02:05
mack[m] joined
02:09
unclechu joined,
Manifest0 joined
02:10
molaf joined,
lance_w[m] joined
02:11
Matthew[m] joined
02:12
Seance[m] joined,
rba[m] joined
02:13
tyil[m]1 joined
02:14
AlexDaniel` joined,
hythm joined
02:15
MitarashiDango[m joined
02:22
Ekho joined
02:23
Manifest0 left
02:24
Sgeo__ joined
02:25
Demos[m] joined,
Garland_g[m] joined
02:26
tyil[m] joined
02:27
Sgeo_ left
02:28
hythm left
02:29
zacts left
02:31
Manifest0 joined
02:34
zacts joined
02:44
zacts left
02:45
Kaiepi joined,
lichtkind joined,
MilkmanDan joined,
Geth joined,
vxe joined,
synopsebot joined,
xinming joined,
huf joined,
agentzh joined,
KotH joined,
Grrrr joined,
stux|RC joined,
nightfrog joined,
bobby joined,
tyil joined,
hahainternet joined,
krunen joined,
silug_ joined,
kubrat joined,
jdv79 joined,
revdiablo joined
03:11
Manifest0 left
03:16
Manifest0 joined,
ChoHag joined
03:20
mowcat joined
03:23
Manifest0 left
03:24
zacts joined
03:28
Manifest0 joined
|
|||
SmokeMachine | pmurias: it seems not hard to use Red for it... | 03:29 | |
nine: I’ve done something similar on Red... | 03:32 | ||
03:32
ChoHag left
03:35
Manifest0 left
|
|||
SmokeMachine | .tell nine github.com/FCO/Red/tree/master/lib/Red/AST | 03:36 | |
yoleaux | SmokeMachine: I'll pass your message to nine. | ||
03:40
Manifest0 joined
03:45
Manifest0 left,
Sgeo__ left
03:46
Sgeo__ joined
03:49
mowcat left
03:50
Manifest0 joined
03:57
Manifest0 left
03:58
MasterDuke left
04:03
Manifest0 joined,
zacts left
04:14
Manifest0 left
|
|||
Kaiepi | should geth post when new issues are opened on github? i think it might be useful | 04:18 | |
04:19
Manifest0 joined
04:20
adu left
04:31
skids left
|
|||
Kaiepi | alias prove6="PERL6LIB=lib prove -e perl6 -vr $@" | 04:37 | |
ik there's a prove6 package out there but this is useful for people who don't like installing too many packages | 04:38 | ||
04:47
Manifest0 left
04:51
Manifest0 joined
04:56
Manifest0 left
05:01
Manifest0 joined
05:05
Manifest0 left
05:11
Manifest0 joined
05:17
Manifest0 left
05:19
kurahaupo left
05:22
Manifest0 joined
05:31
Manifest0 left
05:36
Manifest0 joined
|
|||
ugexe | I’d be surprised if most people *werent* using some variant of that | 05:38 | |
of course the pure way is prove -v -r -e ‘perl6 -I .’ ... | 05:39 | ||
05:41
Manifest0 left
05:46
ChoHag joined,
Manifest0 joined
05:51
Manifest0 left
05:57
Manifest0 joined
06:02
Manifest0 left,
cpan-p6 left
06:03
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
06:07
Manifest0 joined
06:12
Manifest0 left
06:14
jmerelo joined
|
|||
jmerelo | releasable6: status | 06:15 | |
releasable6 | jmerelo, Next release will happen when it's ready. 1 blocker. 140 out of 317 commits logged (⚠ 2 warnings) | ||
jmerelo, Details: gist.github.com/53983eedc0359f3e5e...f438cb8a44 | |||
06:18
Manifest0 joined
06:22
zacts joined
06:27
Manifest0 left
06:33
andrzejku_ joined,
andrzejku left,
andrzejku_ is now known as andrzejku
06:34
Manifest0 joined
06:38
Manifest0 left
06:44
Manifest0 joined
06:48
zacts left
|
|||
Kaiepi | all my telnet library needs is documentation and examples and it's done! | 06:58 | |
well | |||
"done" | |||
done enough to release on cpan | |||
jmerelo | Kaiepi: all perl6 needs is documentation and it's done! | ||
Kaiepi: anyway, good luck! | 06:59 | ||
06:59
MilkmanDan left
|
|||
Kaiepi | also needs the features i'm adding when i start my grant work next week jmerelo :) | 07:00 | |
07:01
jaldhar joined,
MilkmanDan joined
|
|||
jmerelo | Kaiepi: congrats on your grant work. | 07:01 | |
Maybe you can help with a problem I have now. | |||
How do we get the name of the class we're in within a class? | |||
m: class Foo { say .^mro }; | 07:02 | ||
camelia | ((Any) (Mu)) | ||
jmerelo | m: class Foo { say .^WHICH }; | ||
camelia | Cannot resolve caller WHICH(Perl6::Metamodel::ClassHOW:D: Any:U); none of these signatures match: (Mu:U: *%_ --> ValueObjAt:D) (Mu:D: *%_ --> ObjAt:D) in block <unit> at <tmp> line 1 |
||
jmerelo | m: class Foo { say .^WHo }; | ||
camelia | No such method 'WHo' for invocant of type 'Perl6::Metamodel::ClassHOW'. Did you mean 'WHY'? in block <unit> at <tmp> line 1 |
||
07:02
zacts joined
|
|||
Kaiepi | m: class Foo { say .^name } | 07:03 | |
camelia | Any | ||
Kaiepi | hm | ||
m: class Foo { say ::?CLASS.^name } | |||
camelia | Foo | ||
Kaiepi | there we go | 07:04 | |
jmerelo | Kaiepi: thanks! | ||
xinming | [499280.758321] perl6[1374]: segfault at 78 ip 00007f88dfb21b10 sp 00007f88c6ffc990 error 4 in libmoar.so[7f88df88e000+642000] │· | ||
[499280.761621] Code: 41 5d 41 5e 41 5f c3 0f 1f 00 48 8b 16 48 63 46 14 48 89 54 24 20 83 f8 fe 74 3f 48 8b 92 80 00 00 00 48 8d 04 40 48 c1 e0 04 <48> 03 42 78 4c 8b 68 08 0f b7 40 14 89 4│· | |||
4 24 1c e9 66 fe ff ff 0f | |||
Kaiepi | np | ||
jmerelo | I was about to post it in StackOverflow, so I'll do it anyway | ||
xinming | Is there a way how I can troubleshoot this kind of bug? | ||
jmerelo | Kaiepi: stackoverflow.com/questions/560969...in-a-class | ||
xinming | I got segfault on moar | ||
but no clue how I can repeat it, it's in a large program | 07:05 | ||
timotimo | there are some ways. if the program doesn't run terribly long, "perl6-valgrind-m whatever-your-commandline-was" can give a little hint | ||
by default moarvm isn't compiled with debug symbols, though | |||
if you can, re-run moarvm's Configure.pl with the same flags you can see near the beginning of the "Makefile", and add --debug=3 | 07:06 | ||
xinming | Ok | ||
timotimo | then just "make install -j4" or so, no need to rebuild rakudo or nqp | 07:07 | |
xinming | Will try, it's not a long run, But takes my cro app running 3 minutes, and then fail | 07:09 | |
timotimo | oof | 07:10 | |
cro is multi-threaded and valgrind only supports a single thread, so it'll be a bit slower still | 07:11 | ||
you can also try "perl6-gdb-m" | |||
as soon as it crashes, you can "call MVM_dump_backtrace(tc)" to at least see where in the code it happens | |||
xinming | timotimo: So, I'll use perl6-gdb-m, right? | 07:12 | |
bbl | |||
timotimo | probably | ||
valgrind can get a lot more details out of the crash usually | |||
xinming | timotimo: You'll need to give me hints on how to use gdb to get the context | 07:13 | |
timotimo | no prob | 07:14 | |
xinming | I'm installing gdb | ||
07:14
holyghost joined
|
|||
timotimo | oh, if you're on a mac, you might already have lldb, in that case you can use perl6-lldb-m i think | 07:15 | |
xinming | And thanks, I'm really glad to get into deeper part of the perl6. | ||
I'm in gentoo | |||
I use gentoo | |||
timotimo | OK | ||
07:24
Manifest0 left
|
|||
holyghost | . | 07:26 | |
hello | 07:27 | ||
.tell Xliff you did ,tell instead of .tell yesterday, I sent you some email for the new permanent ip | |||
yoleaux | holyghost: I'll pass your message to Xliff. | ||
07:29
Manifest0 joined
07:32
Kaypie joined,
Kaiepi left
|
|||
holyghost | .tell Xliff kibology :-) | 07:32 | |
yoleaux | holyghost: I'll pass your message to Xliff. | ||
07:43
Sgeo joined
07:45
zacts left,
espadrine_ joined
07:46
Sgeo__ left
07:56
Manifest0 left
08:00
Manifest0 joined
08:09
Manifest0 left
|
|||
xinming | !paste | 08:12 | |
timotimo: paste.scsys.co.uk/584453 | |||
This is where the segfault happen | 08:13 | ||
08:14
Manifest0 joined
|
|||
xinming | in gdb, what I do next? | 08:16 | |
Geth | doc: 73314def1d | (JJ Merelo)++ | doc/Type/Metamodel/ParametricRoleHOW.pod6 Rephrasing |
08:19 | |
doc: 4311d97033 | (JJ Merelo)++ | 3 files Rewrites user example compilation test Now everything is compiled via -c, instead of using EVAL. This is slower, but closes #2764 since apparently the evaluation of so much code was gobbling up memory, and closes #2782 since either the memory itself or the creation of multiple objects was affecting this somehow. It also causes #2789, so some changes are trying to fix that. |
|||
synopsebot | Link: doc.perl6.org/type/Metamodel::ParametricRoleHOW | ||
doc: 490133e6a0 | (JJ Merelo)++ | doc/Type/Test.pod6 Adds preambles closes #2789 |
|||
synopsebot | Link: doc.perl6.org/type/Test | ||
timotimo | xinming: sorry, i was AFK for a little bit | 08:21 | |
a "bt full" could be interesting | |||
probably not quite as interesting is "thread apply all bt full" | |||
most threads will be waiting at that point i assume | 08:22 | ||
08:23
nadim joined
|
|||
timotimo | i can say for sure that the spesh/frame_walker.c shouldn't crash like this :) | 08:24 | |
can you "print f", "print f->spesh_cand"? | |||
xinming | timotimo: paste.scsys.co.uk/584454 | 08:25 | |
timotimo | ok, cand = 0x0 is an interesting output | 08:26 | |
xinming | I'm restart the test, so, I can get "print f" | 08:27 | |
timotimo | oh, right, you may want "--optimize=0" so that "optimized out" goes away | ||
xinming | Do you mean in configure? | 08:28 | |
a minute | |||
re-compiling | |||
timotimo | yeah, in moarvm's configure | 08:30 | |
08:31
imcsk8 left
|
|||
xinming | timotimo: paste.scsys.co.uk/584455 | 08:31 | |
with the --optimize=0 | |||
No symbol "f" in current context. | 08:32 | ||
If I type print f in gdb cli, I got that error. | |||
08:33
imcsk8 joined
|
|||
timotimo | interesting; perhaps you have to first "frame 0" to "go to" the go_to_first_inline frame | 08:34 | |
xinming | timotimo: paste.scsys.co.uk/584456 | 08:35 | |
timotimo | oh, interesting | 08:37 | |
what's your moarvm version? | |||
in my version there's an "if (f->spesh_cand && f->spesh_cand->inlines) {" on line 74 | |||
xinming | This is MoarVM version 2019.03-110-g081823ffc built with JIT support | ||
timotimo | can you give me the output of "list"? that should give the source code from around that place | 08:38 | |
xinming | if (f->spesh_cand && f->spesh_cand->inlines) { | ||
I also have this. | |||
What do you mean the output of "list"? | |||
timotimo | the command "list" gives you source code from where the program currently is | ||
xinming | Do you mean the source code for src/spesh/frame_walker.c | 08:39 | |
ok | |||
timotimo | more like "what does gdb think is there" | ||
xinming | paste.scsys.co.uk/584457 | 08:40 | |
timotimo | huh. so it segfaults on line 75? and f->spesh_cand is null? | ||
xinming | I think so | 08:42 | |
timotimo | wtf how does it get past that check :( | 08:43 | |
xinming | The problem is, it may take a while to run the problem for this to occur. | ||
timotimo | right | ||
08:43
|oLa| left
|
|||
xinming | I think we also need to check f->spesh_cand->jitcode? | 08:44 | |
soemthing like if (f->spesh_cand && f->spesh_cand->inlines && f->spesh_cand->jitcode) .... | |||
timotimo | that check is on the next line, but if f->spesh_cand is already null, how would it even get past that | ||
unless another thread is messing with the data | |||
xinming | I think so. | ||
timotimo | MVMFrame shouldn't be accessed from threads the frame doesn't belong to | 08:45 | |
xinming | we need a lock somewhere :-) | ||
timotimo | if you're okay with a bunch more work, you could install rr, which can record the execution of the whole program and lets you step forwards as well as backwards | 08:46 | |
xinming | If you wish to continue troubleshooting the bug with me, I can install rr | ||
I'm installing rr now | 08:48 | ||
timotimo | worst case you can share the rr recording, but that will leak lots of data from your computer and what the program was doing so that may not be an option actually | ||
xinming | timotimo: It's ok, Not much sensitve data at all. | 08:50 | |
timotimo | anyway, you haven't used rr before, right? | 08:51 | |
xinming | Never used. | ||
timotimo | OK | ||
so with "rr record -n perl6-m blahblah" will do the recording and it'll just segfault like the regular program | |||
xinming | I used gdb for a week, and that's really a long time ago. | ||
Ok | |||
timotimo | then you can "rr replay" and it'll give you a gdb that's connected to the recording | ||
xinming | got it. | ||
Still compiling | 08:52 | ||
timotimo | i'm not sure how you can get the right number to "goto" to, but in theory you don't have to "c" to let it run until it crashes again | ||
or even if goto is the right command | |||
oh, maybe not "goto", but "run" | 08:54 | ||
so try "run 100000" and see if that's too far or too early | |||
08:56
kurahaupo joined
|
|||
timotimo | and retry with progressively larger numbers until it complains i guess :) | 08:59 | |
cpan-p6 | New module released to CPAN! Math::Polygons (0.0.4) by 03PSIXSTEVE | 09:01 | |
09:06
Manifest0 left,
debprav joined
|
|||
xinming | rr: Saving execution to trace directory `/home/xm/.local/share/rr/perl6-gdb-m-0'. | 09:08 | |
[FATAL /tmp/portage/dev-util/rr-5.2.0-r1/work/rr-5.2.0/src/PerfCounters.cc:197:get_cpu_microarch()] AMD CPUs not supported. | |||
For Ryzen, see github.com/mozilla/rr/issues/2034. | |||
>_< | |||
I'll think other way to use rr to debug this | |||
I have many machines | 09:09 | ||
09:15
Manifest0 joined
09:19
Manifest0 left
|
|||
ufobat_ | is this supposted to work? | 09:20 | |
timotimo | nooooooooo | 09:21 | |
ufobat_ | m: Mu.can("something")) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unexpected closing bracket at <tmp>:1 ------> 3Mu.can("something")7⏏5) |
||
ufobat_ | m: Mu.can("something").say | ||
camelia | () | ||
ufobat_ | m: Mu.^can("something").say # thats the only version i would expect to work | ||
camelia | () | ||
09:22
|oLa| joined
|
|||
timotimo | hm, yeah, that's kind of odd that it'd have a can method of its own | 09:23 | |
09:27
Manifest0 joined
09:30
pecastro joined
|
|||
ufobat_ | created a issue for that | 09:35 | |
09:42
Manifest0 left
09:44
Sgeo left,
Sgeo joined
09:45
rindolf joined
09:47
Manifest0 joined
09:51
Manifest0 left
09:58
Manifest0 joined
10:01
andrzejku left
10:03
Sgeo left
10:08
debprav left
10:12
Manifest0 left
10:18
Manifest0 joined
10:20
Sgeo joined
10:24
Sgeo left
10:30
andrzejku joined
10:36
Manifest0 left
10:42
Manifest0 joined
10:46
andrzejku left,
Manifest0 left
10:51
Manifest0 joined
|
|||
nine | Yeah, a little sugar makes all the difference: SQL::Generator.new.generate(select(*, from(subquery(select(*, from('customers')), :as<c>)))).say | 10:58 | |
SELECT * FROM (SELECT * FROM customers) AS c | |||
With the option to go deeper at every level if needed of course | 10:59 | ||
11:04
Manifest0 left
|
|||
timotimo | a teaspoon of sugar helps the SQL go down | 11:08 | |
11:12
Manifest0 joined
11:18
Manifest0 left
11:19
sena_kun joined
11:23
Manifest0 joined
11:26
pmurias joined
|
|||
pmurias | SmokeMachine: using Red would introduce an OO layer, if I understood what nine wants he just wants to build SQL programatically without extra OO abstraction | 11:27 | |
yoleaux | 11 May 2019 19:23Z <MasterDuke> pmurias: have you seen news.ycombinator.com/item?id=19875335 ? seems like something you might be interested in | ||
11:28
Manifest0 left
|
|||
pmurias | xinming: importing a perl6 module into nodejs is not implemented yet, it's definitely in reach so I'll look into it when I get back to rakudo.js soonish | 11:31 | |
11:32
netrino joined
11:33
Manifest0 joined
11:35
llfourn left
|
|||
nine | Getting there: select(*, from('customers'), where(boolean_test(comparison(|<id = 1>)))) | 11:39 | |
pmurias: it's not mutually exclusive. In fact I think the SQL AST will lend itself to integration into ORMs quite nicely. | |||
11:40
Manifest0 left
11:41
llfourn joined
|
|||
nine | I think the mistake all ORMs so far made is to start with objects representing roles and simple CRUD features and add additional SQL features on top. This must inevitably become harder and harder as the implemented features become more complex. I'm for example not aware of an ORM that still shines in the face of common table expressions or window functions. | 11:43 | |
SmokeMachine | pmurias: yes, but for doing that, Red uses a AST internally... it is planned to write a way to direct manipulate this AST... | ||
nine | s/roles/rows/ | ||
11:44
Manifest0 joined
11:46
holyghost left,
MasterDuke joined,
MasterDuke left,
MasterDuke joined
|
|||
SmokeMachine | nine: I think Red is different from that... once the idea of it isn’t map SQL to object, but map perl6 to SQL... | 11:47 | |
11:56
molaf left
|
|||
Geth | doc: 098f2c456f | (JJ Merelo)++ | doc/Language/variables.pod6 Deindent |
11:56 | |
doc: a7c52cdf76 | (JJ Merelo)++ | doc/Language/variables.pod6 Clarification about @*ARGS closes #2790 |
|||
synopsebot | Link: doc.perl6.org/language/variables | ||
nine | Who came up with names like "nonparenthesized value expression primary"? | 12:02 | |
12:03
Manifest0 left
|
|||
lizmat | a committee ? | 12:04 | |
nine | Probably :) Though to be fair, they needed to come up with hunderts of names for the different syntax elements | 12:05 | |
12:09
Manifest0 joined
|
|||
pmurias | nine: sql {select * from customers where id = 1} seems like a lot nicer syntax | 12:11 | |
nine: sql {select * from customers where id = $id and {{generate-condition()}}}} in a more complex case | 12:12 | ||
nine | pmurias: absolutely! And once I have the SQL::Grammar going, we can have that. The sugar I mentioned is mostly for making writing of tests easier. Though I have to admit, that I'd already like to use it for $work... | ||
pmurias | to be honest {{{ }}} is beyond ugly tho | 12:13 | |
nine | pmurias: do you know this? niner.name/talks/DBIC%20in%20Perl%2...revisited/ | ||
pmurias | haven't seen that before | ||
nine: that creates a DSL to build SQL::Abstract objects? | 12:15 | ||
nine | It's exploration of different ways to do that. One of them makes sql{"name=$name and active=$active"} actually safe, just like you proposed | 12:16 | |
12:23
Manifest0 left
12:26
ChoHag left
12:29
Manifest0 joined
12:35
Manifest0 left
|
|||
nine | Composing queries: my ($query, $subquery) = select(*, from(table('customers'))) xx 2; $query .= where(eq(column('id'), scalar_subquery($subquery))); # SELECT * FROM customers WHERE id = (SELECT * FROM customers) | 12:38 | |
pmurias | nine: LTA compared to a grammar integrated solution, but seems very workable | 12:40 | |
12:40
Manifest0 joined
|
|||
nine | To a _hypothetical_ grammar integrated solution ;) But year, will invest some time in that after getting my exercise | 12:41 | |
12:44
jmerelo left
|
|||
timotimo | m: my @foo; with @foo[4] { say "entry 4 is already there!" } else { $_ = 99 }; dd @foo | 12:45 | |
camelia | Array @foo = [Any, Any, Any, Any, 99] | ||
timotimo | i wonder what i did wrong in my local code | ||
m: my @foo; with "hello" { with @foo[4] { say "entry 4 is already there!" } else { $_ = 99 }; dd @foo } | |||
camelia | Array @foo = [Any, Any, Any, Any, 99] | ||
timotimo | oh, native int array | 12:46 | |
m: my uint8 @foo; with "hello" { with @foo[4] { say "entry 4 is already there!" } else { $_ = 99 }; dd @foo } | |||
camelia | entry 4 is already there! array[uint8].new() |
||
timotimo | even more interesting though: | 12:47 | |
m: class testclass { has uint8 @.foo; method doit { with "hello" { with @.foo[4] { say "entry 4 is already there!" } else { $_ = 99 }; dd @foo } } }; testclass.new.doit | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '@foo' is not declared. Did you mean '@!foo'? at <tmp>:1 ------> 3 already there!" } else { $_ = 99 }; dd 7⏏5@foo } } }; testclass.new.doit |
||
timotimo | m: class testclass { has uint8 @.foo; method doit { with "hello" { with @.foo[4] { say "entry 4 is already there!" } else { $_ = 99 }; dd @.foo } } }; testclass.new.doit | ||
camelia | assign requires a concrete object (got a Nil type object instead) in block at <tmp> line 1 in method doit at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
timotimo | is my expectation unreasonable? | 12:48 | |
this easily golfs to a shorter thing: | 12:53 | ||
nine | SmokeMachine: to be clear: I think it's fantastic what you've done so far with Red! | ||
timotimo | m: class testclass { has uint8 @.foo; method doit { my $thing := @.foo[4]; $thing = 9; dd @!foo} }; testclass.new.doit | ||
camelia | assign requires a concrete object (got a Nil type object instead) in method doit at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
13:03
Manifest0 left
13:09
Manifest0 joined
|
|||
Geth | doc: 518d24b8fc | (Jonathan Worthington)++ | 2 files Improve Lock and Lock::Async documentation * Better explain what Lock::Async is * Provide a more complete and accurate introduction to Lock, moving general information of the mechanism out of the description of the lock method * Improve the lock, unlock, and protect descriptions for both ... (5 more lines) |
13:12 | |
13:19
lucasb joined
13:22
pmurias left
13:38
Manifest0 left
13:43
reach_satori left,
reach_satori joined
13:44
Manifest0 joined
|
|||
Voldenet | I wish github.com/perl6/roast/blob/master...truction.t worked, locks would be a lot easier to use | 13:47 | |
13:48
Manifest0 left
13:55
Manifest0 joined
|
|||
timotimo | in what way does it not work? | 13:56 | |
oh, undefine | |||
that's not a thing any more, is it? | |||
m: my $foo; undefine $foo | |||
camelia | Saw 1 occurrence of deprecated code. ================================================================================ undefine seen at: <tmp>, line 1 Will be removed with release v6.e! Please use another way: assign a Nil; for Arrays/Hashe… |
||
timotimo | oh, it is still a thing, wow | ||
though i don't think DESTROYALL is a thing? | |||
at least i've never heard of that | 13:57 | ||
or is that just what calls every applicable DESTROY submethod? | |||
the number 100 is not high enough to actually cause a GC run | 14:00 | ||
but parent and child do run backwards | 14:01 | ||
is there no ticket for this? | 14:02 | ||
if not, one should be made. if there is one, it should be put in the test file for the fudge :) | |||
Voldenet: what exact problem do you have? you need the order to be "child first" and get the opposite? | 14:03 | ||
Voldenet | well, there's no destructors :) | 14:04 | |
/at all/ | |||
14:05
ChoHag joined
|
|||
Voldenet | it's not a big deal though - hardly any language has working destructors | 14:07 | |
14:07
ChoHag left
|
|||
timotimo | um | 14:07 | |
there is destructors | 14:08 | ||
m: class bloop { submethod DESTROY { say "CARNAGE!" } }; for ^100_000 { bloop.new } | |||
camelia | ( no output ) | ||
timotimo | m: class bloop { submethod DESTROY { say "CARNAGE!" } }; my $a = bloop.new; for ^100_000 { $a = bloop.new } | ||
camelia | ( no output ) | ||
timotimo | m: class bloop { submethod DESTROY { say "CARNAGE!" } }; my $a = bloop.new; for ^1_000_000 { $a = bloop.new } | ||
camelia | ( no output ) | ||
timotimo | um, what. | ||
Voldenet | :P | ||
timotimo | works locally | 14:09 | |
m: use nqp; class bloop { submethod DESTROY { say "CARNAGE!" } }; my $a = bloop.new; for ^1_000_000 { $a = bloop.new; nqp::force_gc } | |||
oh, one million gc runs is gonna be a bit slow | |||
camelia | (timeout) | ||
Voldenet | m: sub { class :: { submethod DESTROY { "beep".say }}.new() }(); use nqp; nqp::force_gc | 14:10 | |
camelia | ( no output ) | ||
timotimo | m: use nqp; class bloop { submethod DESTROY { say "CARNAGE!" } }; my $a = bloop.new; for ^1000 { $a = bloop.new; nqp::force_gc } | ||
camelia | ( no output ) | ||
timotimo | wtf camelia | ||
14:10
debprav joined
|
|||
Voldenet | doesn't work for me either | 14:10 | |
timotimo | hm. for 1000 i get only three carnage outputs | ||
Voldenet | for 100 i get none | 14:11 | |
timotimo | i thought perhaps the optimizer threw out the entire bloop creation and destruction | ||
Voldenet | for 1000 i get 999 ಠ_ಠ | ||
timotimo | but MVM_SPESH_DISABLE=yes doesn't give me carnage | ||
without force_gc it works, too | |||
anyway, destruction isn't guaranteed to happen timely, or at all (if the program exits before the object needs to be destroyed, say) | 14:12 | ||
14:13
atweiden-air joined
|
|||
timotimo | but destructors definitely do exist | 14:13 | |
Voldenet | Yeah, but with their behaviour it's kind of java-ish - you do have them | ||
but relying on them for things like locks is a terrible idea | |||
timotimo | ah, yeah | 14:14 | |
if you're waiting on a lock that's supposed to be destroyed by GC, you won't be generating objects, nor GC pressure | |||
$lock.protect: { blah } is probably good enough for a whole lot of cases though | 14:15 | ||
14:16
namibj_ is now known as namibj
|
|||
nine | Voldenet: what would destructors give you that you can't do with $lock.protect or LEAVE $lock.unlock? | 14:18 | |
14:18
debprav left
|
|||
atweiden-air | i just released an awesome perl 6 arch and void linux installer for btrfs fde if anyone's interested | 14:18 | |
github.com/atweiden/archvault | 14:19 | ||
github.com/atweiden/voidvault | |||
Voldenet | nine: with($logger.Scope) { $logger.Log("Something"); } - if destructors worked, $logger could synchronize accesses to a file with this | 14:21 | |
but currently, it's just more feasible to queue the log requests and dispatch saving to file in a thread | |||
nine | Voldenet: why not just $logger.Scope: { $logger.Log("Something"); }? | 14:22 | |
Voldenet | it works with this code, but then you're forced to create a lot of lambdas | 14:24 | |
14:26
atweiden-air left
|
|||
nine | Which is downright trivial and not different from a with statement | 14:27 | |
Voldenet | it is going to lead to deeper stack traces | 14:30 | |
nine | Are you worried about performance or about readability of those stack traces there? | 14:31 | |
Voldenet | both :) | ||
imagine composing a lot of objects with tracked lifetime | |||
14:32
ChoHag joined
|
|||
nine | For performance it's not that bad. It may as well happen that the block is inlined into a $logger.Scope method that's again inlined into the caller. There'd be no stack frames or code objects anywhere in that case. | 14:32 | |
timotimo | put an "is-hidden-from-backtrace" somewhere :D | ||
nine | Perl 6 actually relies on the runtime to be smart like that. Think for example about negative array indexing. That's a lambda right there: @a[*-1] | ||
And for loops are actually compiled to calls to .map | 14:33 | ||
timotimo | except sometimes we compile them into a while loop with .pull-one on the .iterator | 14:34 | |
Voldenet | + to use object with its lifetime, you need to know to track its lifetime | 14:35 | |
you can't just { my $log = $logger.Scope; $log.Log("…"); } without a care in the world | 14:36 | ||
timotimo | if you "will leave .close" you can though | ||
Voldenet | you actually need: { my $log = $logger.Scope; LEAVE $log.dispose; $log.Log("…"); } | 14:37 | |
timotimo | i guess that's your point | ||
no, that's more than you need | |||
m: { my Str $foo will leave .say; $foo = 99 }; say "yo" | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing block at <tmp>:1 ------> 3{ my Str $foo will leave7⏏5 .say; $foo = 99 }; say "yo" expecting any of: block or pointy block |
||
timotimo | m: { my Str $foo will leave { .say }; $foo = 99 }; say "yo" | ||
camelia | (Str) Type check failed in assignment to $foo; expected Str but got Int (99) in block <unit> at <tmp> line 1 |
||
nine | Voldenet: or: $logger.Scope: { $log.Log("...") } | ||
timotimo | m: { my Str $foo will leave { .say }; $foo = 100000 }; say "yo" | ||
camelia | (Str) Type check failed in assignment to $foo; expected Str but got Int (100000) in block <unit> at <tmp> line 1 |
||
timotimo | m: { my Str $foo will leave { .say }; $foo = "100000" }; say "yo" | ||
camelia | 100000 yo |
||
timotimo | no, timo, 100000 isn't a Str either | ||
nine | As to performance: the lambda trick actually gives the runtime more opportunity to optimize. The runtime would hardly be able to optimize the Scope object away in the destructor case | 14:40 | |
timotimo | nine: actually, with our escape analysis we might be able to do that, if the destructor behaves at least :) | 14:42 | |
14:44
pmurias joined
|
|||
Voldenet | actually, with destructors you could return a scope with some object | 14:45 | |
so object could have opened logger for its lifetime | |||
timotimo | if you have that kind of lifetime stuff then you can just do that | 14:54 | |
Voldenet | Well, currently I'm just passing the scope object with on-end triggers | ||
timotimo | with something not not called "Scope" | ||
so one method for getting one with a destructor and one for "will leave" or using the $log.Scope: { blah } thing or whatevs | |||
Voldenet | m: class Lifetime { has @!s; method LEAVE(&m) { @!s.push(&m) }; method end { .() for @!s } }; sub req { my $s = Lifetime.new; LEAVE $s.end; $s.LEAVE: { say "bye" } }; req; req | ||
camelia | bye bye |
||
Voldenet | it's terrible, but it works | ||
in fact, I attach it to the thread with $*THREAD.id so I don't have to pass it around, but it's still a terrible hack | 14:58 | ||
I'd gladly see some better method - the one I'm using now looks bad and feels bad to use | 15:02 | ||
15:04
Manifest0 left
|
|||
ugexe | $*THREAD.id doesn't identify only a specific thread over the lifetime of a program | 15:04 | |
Voldenet | Whoa, it doesn't? | 15:05 | |
ugexe | when i needed to do this i ended up doing %cache{$*THREAD} = ... instead of %cache{$*THREAD.id} | 15:06 | |
Voldenet | thanks ugexe, I'll change it then | ||
15:11
Manifest0 joined
15:19
zakharyas joined
15:20
Manifest0 left
15:25
Manifest0 joined
15:31
Sgeo joined,
jmerelo joined,
cpan-p6 left
15:32
Manifest0 left,
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
15:37
Manifest0 joined
16:06
Manifest0 left
16:11
Manifest0 joined
16:16
nebuchadnezzar joined,
vrurg left
16:22
Manifest0 left
16:28
Manifest0 joined
16:34
Manifest0 left
16:38
molaf joined
16:39
Manifest0 joined
16:48
Kaypie is now known as Kaiepi
|
|||
xinming | timotimo: ping | 16:51 | |
timotimo: When you are at computer, Please ping me, I got intel computer now, and will try with rr | 16:55 | ||
though, it's a 3930 machine, which is really slow | |||
timotimo | xinming: i'm here now, but i'll be AFK for maybe an hour | 16:56 | |
xinming | Ok | ||
timotimo | i mean, i'm here for a few seconds before being AFK | ||
Voldenet | m: use MONKEY-SEE-NO-EVAL; my $fn = EVAL("sub { print 42 }"); $fn(); | ||
camelia | 425===SORRY!5=== Error while compiling /home/camelia/EVAL_0 Missing block at /home/camelia/EVAL_0:1 ------> 3sub True7⏏5<EOL> expecting any of: new name to be defined |
||
16:57
Manifest0 left
|
|||
xinming | timotimo: Ok, I'll setup the test environment. | 16:57 | |
Kaiepi | +1 jnthn on the Lock/Lock::Async docs rewrite | 16:58 | |
16:58
zakharyas left
|
|||
Kaiepi | much better now :) | 16:58 | |
Voldenet | How to do something similar to: `my $fn = eval("sub { print 42; }"); $fn->();` in perl 5? I'm trying, but I probably don't know how to use eval | 17:01 | |
17:01
sena_kun left
17:02
Manifest0 joined
|
|||
Voldenet | m: use MONKEY-SEE-NO-EVAL; my $str = q`sub { print 42; }`; EVAL($str)() | 17:03 | |
camelia | 42 | ||
Voldenet | Eh, Nevermind | ||
17:09
Manifest0 left,
ayerhart left
|
|||
xinming | Anyone here knows, for rr utility, What if we need network support? For now, I found that when I start the app with rr, It doens't start the cro service | 17:12 | |
17:13
Manifest0 joined,
ayerhart joined
17:14
ayerhart left,
ayerhart joined
17:22
Manifest0 left
|
|||
Geth | doc: af2115cc0e | (Daniel Green)++ | 2 files Some typo fixes |
17:24 | |
xinming | I'm wrong to use perl6-m-dbg with rr | ||
17:26
vrurg joined
17:27
Manifest0 joined
|
|||
Kaiepi | i'm having an issue with blobs | 17:29 | |
lizmat | weekly: blogs.perl.org/users/laurent_r/2019...dders.html | ||
notable6 | lizmat, Noted! | ||
Kaiepi | can someone take a look at hastebin.com/azepasogup.rb and tell me what i need to do to get the output i want? | ||
17:31
sena_kun joined
|
|||
lizmat | dd | 17:33 | |
Kaiepi: what does `dd $!data` say ? | |||
Kaiepi | Buf $!data = Buf.new(195,191,195,186,195,191,195,176) | 17:34 | |
it's supposed to be latin1 but it looks like it's utf8 instead | |||
not sure why | |||
xinming | timotimo: What do we do if this bug appear on AMD ryzen 2700, But when I try with G3930 from intel, It works fine. | 17:36 | |
timotimo: I'm not sure wether it's a cpu problem on SMT in ryzen, or a problem kernel deals with SMT in ryzen | 17:37 | ||
hmm, I'll recompile the linux kernel without optimization. | 17:38 | ||
Kaiepi | ok i figured out why | 17:42 | |
IO::Socket::Async.Supply ignores :enc if :bin is also passed (???) | 17:43 | ||
ugexe | well, the only other sane option there would be to throw an exception | 17:44 | |
lizmat | Kaiepi: yeah, it does, also with IO::Handle afaik | 17:46 | |
Kaiepi | i tried without :bin and it's still ignoring the encoding? | 17:47 | |
also tried with IO::Socket::Async.connect(:enc<latin1>) | |||
lizmat | then maybe we haz a bug ? | 17:48 | |
causal glance at the code, it looks like it doesn't even check for a :bin ? | 17:49 | ||
*casual | |||
17:50
TreyHarris joined
|
|||
lizmat | docs.perl6.org/type/IO::Socket::As...od_connect doesn't even mention an :enc parameter | 17:51 | |
fo looks like it is also a doc issue | |||
jmerelo hears doc | 17:52 | ||
Kaiepi | wait hold on i forget to set the encoding of the server to latin1 as well | ||
jmerelo | There are a few issues: github.com/rakudo/rakudo/issues/2039 | 17:53 | |
Anyway, you find anything missing, please raise an issue. That might be part of the 6.d unfinished update, but it might hide something deeper. An issue will help anyway | 17:55 | ||
Kaiepi | yeah, that was the issue | ||
i got it working properly now | 17:56 | ||
jmerelo | Kaiepi: great! | 17:57 | |
18:00
adu joined
|
|||
Xliff | m: ('Line' «~» ^6).join("\n").say | 18:04 | |
yoleaux | 07:27Z <holyghost> Xliff: you did ,tell instead of .tell yesterday, I sent you some email for the new permanent ip | ||
camelia | Line0 Line1 Line2 Line3 Line4 Line5 |
||
yoleaux | 07:32Z <holyghost> Xliff: kibology :-) | ||
Xliff | m: sub a ($a) { $a.say }; a(1|3) | 18:06 | |
camelia | 1 3 |
||
Xliff | m: sub a ($a) { $a.say }; |a(1|3) | ||
camelia | 1 3 |
||
Xliff | m: sub a ($a) { $a }; a(1|3) | ||
camelia | ( no output ) | ||
Xliff | m: sub a ($a) { $a }; a(1|3).gist.say | ||
camelia | any(1, 3) | ||
Xliff | m: sub a ($a) { $a }; |a(1|3).say | ||
camelia | any(1, 3) | ||
Xliff | m: sub a ($a) { $a }; |a(1|3).flat | ||
camelia | ( no output ) | ||
Xliff | m: sub a ($a) { $a }; |a(1|3).flat.say | 18:07 | |
camelia | any((1), (3)) | ||
xinming | also occur on G3930, So, I'll use rr to record it | ||
Xliff | How do I turn a junction into a list? | ||
m: sub a ($a) { $a }; |a(1|3).List | |||
camelia | ( no output ) | ||
Xliff | m: sub a ($a) { $a }; a(1|3).List.say | ||
camelia | any((1), (3)) | ||
Xliff | m: sub a ($a) { $a }; a(1|3).Array.say | ||
camelia | any([1], [3]) | ||
jmerelo finds that Perl questions in StackOverflow reached a new minimun last month, since early 2009 data.stackexchange.com/stackoverfl...0977#graph | 18:09 | ||
Xliff | m: sub a ($a) { $a }; .say for a(1|3); | ||
camelia | (Mu) | ||
jmerelo | m: say (1^3).iterator.pull-one | 18:10 | |
camelia | (Mu) | ||
jmerelo | Xliff: ^^^ Does that help? | 18:11 | |
Xliff | Nope! ;) | ||
jmerelo | Xliff: what do you wanna do? | ||
Xliff | I think I found the answer here: perlgeek.de/blog-en/perl-5-to-6/08...tions.html | ||
See "Word of Warning" at the end. | |||
MasterDuke | m: sub a($b) { take $b }; my @c = gather a(1|2); dd @c | ||
camelia | Array @c = [1, 2] | ||
Xliff | "If you try to extact items from a junction, you are doing it wrong" | 18:12 | |
Which is sad. Because that's what I was trying to do. | |||
jmerelo | Ah, OK, right. | ||
Xliff: you were doing it wrong! | |||
Xliff | I was trying to do: | ||
m: ($v1, $v2) = $obj.method(1|3) | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$v1' is not declared at <tmp>:1 ------> 3(7⏏5$v1, $v2) = $obj.method(1|3) |
||
Xliff | "($v1, $v2) = $obj.method(1|3)" | ||
jmerelo | Xliff: you kinda wanted to do autothreading in a method by using Junctions | 18:13 | |
Xliff | Just so I wouldn't have to do "($v1, $v2) = ($obj.method(1), $obj.method(3)) | ||
jmerelo | Xliff: In parallel! In constant time! | ||
Xliff: you can still do >> | |||
Xliff | ?? | 18:14 | |
Example, pls? | |||
jmerelo | Xliff: let me see | ||
m: class Foo { has $.bar; method zape { $!bar*2 }; my $foo = Foo.new(bar=> 3); my $bar = Foo.new(bar => 5 ); say ($foo,$bar)».zape | 18:15 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing block at <tmp>:1 ------> 3oo.new(bar => 5 ); say ($foo,$bar)».zape7⏏5<EOL> expecting any of: postfix statement end statement modifier sta… |
||
jmerelo | m: class Foo { has $.bar; method zape { $!bar*2 }; my $foo = Foo.new(bar=> 3)}; my $bar = Foo.new(bar => 5 ); say ($foo,$bar)».zape | 18:16 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$foo' is not declared. Did you mean 'Foo'? at <tmp>:1 ------> 033)}; my $bar = Foo.new(bar => 5 ); say (7⏏5$foo,$bar)».zape |
||
jmerelo | m: class Foo { has $.bar; method zape { $!bar*2 }}; my $foo = Foo.new(bar=> 3); my $bar = Foo.new(bar => 5 ); say ($foo,$bar)».zape | ||
camelia | (6 10) | ||
jmerelo | Xliff: ^^^ that | ||
Xliff | Hmm... | ||
No. That's the wrong way! :) | 18:17 | ||
jmerelo | OK, because you want the arguments, right? | ||
Xliff | "($v1, $v2) = ( $obj.method(1), $obj.method(3) )" | ||
jmerelo | right | ||
Let me see | |||
Xliff | $obj doesn't vary. | ||
jmerelo | m: class Foo { has $.bar; method zape( $zipi) { $!bar*$zipi }}; my $foo = Foo.new(bar=> 3); say $foo.zape».()» (3,6) | 18:19 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing postfix at <tmp>:1 ------> 3o = Foo.new(bar=> 3); say $foo.zape».()»7⏏5 (3,6) expecting any of: argument list postfix |
||
18:20
pmurias left
|
|||
jmerelo | m: class Foo { has $.bar; method zape( $zipi) { $!bar*$zipi }}; my $foo = Foo.new(bar=> 3); say $foo.zape().» (3,6) | 18:21 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing postfix at <tmp>:1 ------> 3oo = Foo.new(bar=> 3); say $foo.zape().»7⏏5 (3,6) expecting any of: argument list postfix |
||
jmerelo | m: class Foo { has $.bar; method zape( $zipi) { $!bar*$zipi }}; my $foo = Foo.new(bar=> 3); say $foo.zape.» (3,6) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing postfix at <tmp>:1 ------> 3$foo = Foo.new(bar=> 3); say $foo.zape.»7⏏5 (3,6) expecting any of: method arguments postfix |
||
Kaiepi | Net::Telnet is almost complete! i just need to write more documentation and some example code and release 0.0.1 will be ready | 18:22 | |
Xliff | m: class A { method($a) { $a² }; }; my $obj = A.new; ($v1, $v2) « a() « (1, 3) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$a' is not declared at <tmp>:1 ------> 3class A { method(7⏏5$a) { $a² }; }; my $obj = A.new; ($v1, $ |
||
Kaiepi | well | ||
"complete" | |||
18:22
pmurias joined
|
|||
Kaiepi | it will never be complete with how many options telnet has | 18:22 | |
Xliff | m: class A { method a ($a) { $a² }; }; my $obj = A.new; ($v1, $v2) « a() « (1, 3) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$v1' is not declared at <tmp>:1 ------> 3od a ($a) { $a² }; }; my $obj = A.new; (7⏏5$v1, $v2) « a() « (1, 3) |
||
Xliff | m: class A { method a ($a) { $a² }; }; my $obj = A.new; my ($v1, $v2) « a() « (1, 3) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing infix inside hyper at <tmp>:1 ------> 3² }; }; my $obj = A.new; my ($v1, $v2) «7⏏5 a() « (1, 3) expecting any of: infix infix stopper |
||
jmerelo | Xliff: I'm pretty sure there's some trickery to do that... | ||
Xliff | m: class A { method a ($a) { $a² }; }; my $obj = A.new; my ($v1, $v2) « $a.a() « (1, 3) | 18:23 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing infix inside hyper at <tmp>:1 ------> 3² }; }; my $obj = A.new; my ($v1, $v2) «7⏏5 $a.a() « (1, 3) expecting any of: infix infix stopper |
||
jmerelo | m: class Foo { has $.bar; method zape( $zipi) { $!bar*$zipi }}; my $foo = Foo.new(bar=> 3); say $foo.zape.(3) | ||
camelia | Too few positionals passed; expected 2 arguments but got 1 in method zape at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
jmerelo | m: class Foo { has $.bar; method zape( $zipi) { $!bar*$zipi }}; my $foo = Foo.new(bar=> 3); say $foo.zape.($foo,3) | ||
camelia | Too few positionals passed; expected 2 arguments but got 1 in method zape at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Xliff | m: class A { method a ($a) { $a² }; }; my $obj = A.new; my ($v1, $v2) = $a.a .« (1, 3) | 18:24 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$a' is not declared at <tmp>:1 ------> 3}; }; my $obj = A.new; my ($v1, $v2) = 7⏏5$a.a .« (1, 3) |
||
Xliff | m: class A { method a ($a) { $a² }; }; my $obj = A.new; my ($v1, $v2) = $obj.a .« (1, 3) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed postfix call (only alphabetic methods may be detached) at <tmp>:1 ------> 3 $obj = A.new; my ($v1, $v2) = $obj.a .7⏏5« (1, 3) |
||
Xliff | m: class A { method a ($a) { $a² }; }; my $obj = A.new; my ($v1, $v2) = $obj.a .» (1, 3) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed postfix call (only alphabetic methods may be detached) at <tmp>:1 ------> 3 $obj = A.new; my ($v1, $v2) = $obj.a .7⏏5» (1, 3) |
||
Xliff | m: class A { method a ($a) { $a² }; }; my $obj = A.new; my ($v1, $v2) = $obj.a().» (1, 3) | 18:25 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing postfix at <tmp>:1 ------> 3obj = A.new; my ($v1, $v2) = $obj.a().»7⏏5 (1, 3) expecting any of: argument list postfix |
||
Xliff | Ah well. Thanks for trying, jmerelo | ||
jmerelo | Xliff: Only alphabetic methods might be detached? | ||
Xliff: maybe try StackOverflow? | |||
Xliff: github.com/rakudo/rakudo/issues/2092 | 18:26 | ||
timotimo | are you looking for <== instead of hyperops? | 18:27 | |
Xliff | Maybe. | ||
timotimo | not sure it works with method calls though | ||
Xliff | timotimo: "($v1, $v2) = ( $obj.method(1), $obj.method(3) )" | ||
Is there a shortcut so that I can just specify (1, 3) in some way? | |||
MasterDuke | .map over them? | ||
jmerelo | m: 42 .&abs | 18:28 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed postfix call (only alphabetic methods may be detached) at <tmp>:1 ------> 0342 .7⏏5&abs |
||
timotimo | m: class Bloop { method a($a) { $a² } }; my ($v1, $v2) = (1, 3)».&[Bloop.a($_)} | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing infix inside [] at <tmp>:1 ------> 3a) { $a² } }; my ($v1, $v2) = (1, 3)».&[7⏏5Bloop.a($_)} expecting any of: dotty method or postfix infix infix … |
||
timotimo | m: class Bloop { method a($a) { $a² } }; my ($v1, $v2) = (1, 3)».&[Bloop.a($_)] | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing infix inside [] at <tmp>:1 ------> 3a) { $a² } }; my ($v1, $v2) = (1, 3)».&[7⏏5Bloop.a($_)] expecting any of: dotty method or postfix infix infix … |
||
jnthn | ($v1, $v2) = ($obj.method($_) for 1, 3) | ||
timotimo | m: class Bloop { method a($a) { $a² } }; my ($v1, $v2) = (1, 3)».&[{Bloop.a($_)}] | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing infix inside [] at <tmp>:1 ------> 3a) { $a² } }; my ($v1, $v2) = (1, 3)».&[7⏏5{Bloop.a($_)}] expecting any of: dotty method or postfix infix infi… |
||
timotimo | yeah the postfix for loop is surely the easiest | ||
Xliff | MasterDuke++ # /o\.... yeah.. that works. | 18:29 | |
jmerelo | Xliff: but I thought you didn't like map for some reason. If you use map, you can also use the (badly named) feed operator ==> (I like rocket) | 18:30 | |
MasterDuke | m: sub a($b) { take $b }; my $c = a(1); dd $c # is there some reason take without gather couldn't just act like return? | 18:31 | |
camelia | take without gather in sub a at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
jmerelo | m: class Bloop { method a($a) { $a² } }; say (1,3) ==> map: Bloop.a( * ) | 18:32 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Confused at <tmp>:1 ------> 3thod a($a) { $a² } }; say (1,3) ==> map:7⏏5 Bloop.a( * ) expecting any of: colon pair |
||
jmerelo | m: class Bloop { method a($a) { $a² } }; say (1,3) ==> map( { Bloop.a( $_ ) } ) | ||
camelia | (1 3) | ||
Xliff | m: class Bloop { method a($a) { $a² } }; my ($a, $b) <== map: Bloop.a( * ) <== (1, 3); ($a, $b).say | 18:33 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Only routine calls or variables that can '.push' may appear on either side of feed operators. at <tmp>:1 ------> 3class Bloop { method a($a) { $a² } }; 7⏏5my ($a, $b) <== map: Bloop.a( * ) <==… |
||
Xliff | m: class Bloop { method a($a) { $a² } }; my ($a, $b) = (1, 3).map: Bloop.a( * ) | ||
camelia | Cannot resolve caller Numeric(Whatever:D: ); none of these signatures match: (Mu:U \v: *%_) in method a at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
ugexe | feed operator is going to be slower for most use cases. | ||
Xliff | m: class Bloop { method a($a) { $a² } }; my ($a, $b) = (1, 3).map( Bloop.a( * ) ) | ||
camelia | Cannot resolve caller Numeric(Whatever:D: ); none of these signatures match: (Mu:U \v: *%_) in method a at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Xliff | m: class Bloop { method a($a) { $a² } }; my ($a, $b) = (1, 3).map({ Bloop.a( $_ ) }) | 18:34 | |
camelia | ( no output ) | ||
ugexe | significantly slower is many cases even | ||
Xliff | m: class Bloop { method a($a) { $a² } }; my ($a, $b) = (1, 3).map({ Bloop.a( $_ ) }); ($a, $b).say | ||
camelia | (1 9) | ||
moritz | sometimes I just love Python's easy way to get a bound method. With python, you could just map over Bloop.a | 18:36 | |
18:38
netrino_ joined,
netrino left
18:40
domidumont joined
|
|||
nadim | evening, what's the difference between "class.new() but some_role " and "class.new() but some_role.new()"? | 18:53 | |
In my dumper I see that the first object also does the role but the second one doesn't | 18:54 | ||
ugexe | .new on a role creates a class | 18:57 | |
nadim | so what does "class.new but created_class" do? | 19:02 | |
m: class C {} ; role R { has $.x} ; dd C.new() but R ; dd C.new but R.new/) | 19:04 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing required term after infix at <tmp>:1 ------> 3; dd C.new() but R ; dd C.new but R.new/7⏏5) expecting any of: prefix term |
||
nadim | m: class C {} ; role R { has $.x} ; dd C.new() but R ; dd C.new but R.new() | ||
camelia | C+{R}.new(x => Any) C+{<anon|1>}.new |
||
nadim | it's 'annon' that's making me curious | 19:05 | |
ugexe | github.com/rakudo/rakudo/blob/b2e7...rs.pm6#L65 | ||
i dunno what its doing | |||
seems like it shold throw X::Mixin::NotComposable but isnt | 19:06 | ||
nadim | shall I report this somewhere? | 19:08 | |
19:09
jmerelo left
|
|||
MasterDuke | m: my $a = 2 but Str; say $a.indent(3) | 19:10 | |
camelia | Cannot mix in non-composable type Str into object of type Int in block <unit> at <tmp> line 1 |
||
MasterDuke | m: my $a = 2 but Str.new; say $a.indent(3) | ||
camelia | No such method 'indent' for invocant of type 'Int+{<anon|1>}'. Did you mean any of these? index invert in block <unit> at <tmp> line 1 |
||
ugexe | probably. im failing to think of a reason the current behavior could be useful | ||
nadim | I had no other to try than to see if it would generate an exception that I catch when dumping it but it simply worked! | 19:12 | |
19:15
domidumont left
19:16
antoniogamiz joined
|
|||
antoniogamiz | mm should the result of use cmp always return true? O.o | 19:16 | |
m: if (1 cmp 2) {say 2;} | |||
camelia | 2 | ||
antoniogamiz | if (2 cmp 1) {say 2;} | ||
evalable6 | 2 | ||
antoniogamiz | ah if they are equal it returns false, sorry | 19:17 | |
MasterDuke | cmp returns an Order | 19:18 | |
docs.perl6.org/type/Order | |||
antoniogamiz | ty | 19:19 | |
MasterDuke | np | ||
antoniogamiz | mmm methods throwing exceptions should be documented? | 19:28 | |
I mean: say (1..2) cmp 3 # OUTPUT: «Less» | |||
ups, I meant github.com/rakudo/rakudo/blob/d904...e.pm6#L594 | 19:29 | ||
19:39
vrurg left
19:44
molaf left
|
|||
Geth | doc: 0899a013fa | Antonio++ | doc/Type/Range.pod6 document Range infixs #2739 |
19:53 | |
doc: 2729ed3a47 | Antonio++ | doc/Type/Range.pod6 document the rest of the methods, closes #2739 |
|||
synopsebot | Link: doc.perl6.org/type/Range | ||
19:53
cpan-p6 left
19:54
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
|
|||
Kaiepi | i never thought i'd ever need to use a supplier that emits more supplies | 19:56 | |
but i found myself doing just that | |||
i'm adding support for receiving multiple binary transmissions over a single connection to Net::Telnet | 19:57 | ||
originally i had it so whenever binary data was received, it'd emit chunks received to a supplier, but that's not good enough for if multiple binary transmissions occur | 19:58 | ||
so now when a binary transmission starts i emit a supply to a supplier and emit chunks received to that supply's supplier | 19:59 | ||
20:03
Xliff left
20:08
ufobat__ joined
20:12
ufobat_ left
20:13
Manifest0 left,
antoniogamiz left
20:16
jaldhar left,
jaldhar joined
20:19
Manifest0 joined
20:34
zacts joined
20:35
molaf joined
20:44
Manifest0 left
20:51
Manifest0 joined
20:52
zacts left
20:58
Manifest0 left
21:03
Manifest0 joined,
pmurias left
|
|||
cpan-p6 | New module released to CPAN! FindBin::Dirs (0.1.0) by 03LEMBARK | 21:04 | |
21:10
pmurias joined
21:15
Manifest0 left
21:21
Manifest0 joined
21:25
zacts joined
21:31
Manifest0 left
21:38
Manifest0 joined
21:49
zacts left
21:52
pmurias left
21:53
mowcat joined,
mowcat left
21:54
mowcat joined
21:59
Manifest0 left
22:01
adu left
22:02
zacts joined,
zacts left
22:04
Manifest0 joined
22:09
Manifest0 left
22:15
Manifest0 joined
22:20
Manifest0 left
22:22
pecastro left
22:26
Manifest0 joined
22:31
Cabanossi left
22:33
Cabanossi joined,
rindolf left
22:42
netrino_ left,
mowcat left
22:52
mowcat joined,
Manifest0 left
22:57
mowcat left
22:58
Manifest0 joined,
Yary joined
|
|||
Geth | ecosystem: da2dee9246 | (Ben Davies)++ (committed using GitHub Web editor) | META.list Add Net::Telnet to ecosystem |
22:59 | |
Kaiepi | \o/ | ||
Yary | m: sub MAIN(Int(IntStr) $value where $value ∈ (1,2,4,8,16)) {say "\$value.perl = ",$value.perl } | 23:00 | |
camelia | Usage: <tmp> <value> |
||
23:01
MasterDuke left
23:02
nadim left
|
|||
Yary | m: perl6 -e 'BEGIN @*ARGS=IntStr.new(4,"4"),;sub MAIN(Int(IntStr) $value where $value ∈ (1,2,4,8,16)) {say "\$value.perl = ",$value.perl }' | 23:05 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3perl6 -e7⏏5 'BEGIN @*ARGS=IntStr.new(4,"4"),;sub MA expecting any of: infix infix stopper postfix statement… |
||
23:05
mowcat joined
|
|||
Yary | m: BEGIN @*ARGS=IntStr.new(4,"4"),;sub MAIN(Int(IntStr) $value where $value ∈ (1,2,4,8,16)) {say "\$value.perl = ",$value.perl } | 23:05 | |
camelia | Usage: <tmp> <value> |
||
cpan-p6 | New module released to CPAN! Net::Telnet (0.0.1) by 03KAIEPI | 23:06 | |
Yary | m: BEGIN @*ARGS=<4>;sub MAIN(Int(IntStr) $value where $value ∈ <1 2 4 8 16>) {say "\$value.perl = ",$value.perl } | 23:09 | |
camelia | $value.perl = IntStr.new(4, "4") | ||
23:09
veesh left,
zacts joined
|
|||
Kaiepi | m: Begin @*ARGS=<1,2,3,4>; sub MAIN(Int @foo) { .say for @foo } | 23:11 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared name: Begin used at line 1 |
||
Kaiepi | m: BEGIN @*ARGS=<1,2,3,4>; sub MAIN(Int @foo) { .say for @foo } | ||
camelia | Usage: <tmp> <foo> |
||
Yary | - looks like recent Rakudo has better MAIN error than 6.c, I had seen messages like "Type check failed in binding to parameter '<anon>'; expected Any but got Mu (Mu) in block <unit> at main.p6 line 1" which is now showing as the better "Usage: <tmp> <value>" | 23:12 | |
Kaiepi | m: BEGIN @*ARGS=<1 2 3 4>; sub MAIN(*@foo) { .say for @foo } | ||
camelia | 1 2 3 4 |
||
Yary | m: BEGIN @*ARGS=<1 2 3 4>; sub MAIN(*@foo) { .perl.say for @foo } | 23:13 | |
camelia | IntStr.new(1, "1") IntStr.new(2, "2") IntStr.new(3, "3") IntStr.new(4, "4") |
||
Kaiepi | m: BEGIN @*ARGS=<--a=1 --a=2 --a=3>; sub MAIN(Int :@a) { .say for @a } | ||
camelia | Usage: <tmp> [-a=<Any> ...] |
||
Kaiepi | m: BEGIN @*ARGS=<-a=1 -a=2 -a=3>; sub MAIN(Int :@a) { .say for @a } | ||
camelia | Usage: <tmp> [-a=<Any> ...] |
||
Yary | m: BEGIN @*ARGS=<-a=1 -a=2 -a=3>; sub MAIN(:@a) { .say for @a } | 23:14 | |
camelia | 1 2 3 |
||
Yary | m: BEGIN @*ARGS=<-a=1 -a=2 -a=3>; sub MAIN(:@a) { .perl.say for @a } | ||
camelia | IntStr.new(1, "1") IntStr.new(2, "2") IntStr.new(3, "3") |
||
Yary | m: BEGIN @*ARGS=<--a=1 --a=2 --a=3>; sub MAIN(Array[Int] :@a) { .perl.say for @a } | 23:17 | |
camelia | Usage: <tmp> [-a=<Any> ...] |
||
Yary | m: BEGIN @*ARGS=<--a=1 --a=2 --a=3>; sub MAIN(Array[IntStr] :@a) { .perl.say for @a } | ||
camelia | Usage: <tmp> [-a=<Any> ...] |
||
23:20
veesh joined
|
|||
Yary | m: BEGIN @*ARGS=<--a=1 --a=2 --a=3>; sub MAIN(:@a where {.all ~~ Int}) { .perl.say for @a } | 23:23 | |
camelia | IntStr.new(1, "1") IntStr.new(2, "2") IntStr.new(3, "3") |
||
Yary | m: BEGIN @*ARGS=<--a=1 --a=2 --a=foo>; sub MAIN(:@a where {.all ~~ Int}) { .perl.say for @a } | ||
camelia | Usage: <tmp> [-a=<Positional where { ... }> ...] |
||
23:27
reach_satori_ joined,
reach_satori left
|
|||
timotimo | Yary: Int(IntStr) will not coerce because IntStr is already an Int; coercions will only fire if the type doesn't match, like with Array and Hash for example | 23:28 | |
23:30
zacts left
|
|||
Yary | Thanks for the coercion explanation, I'll follow up in the email thread I started on it. This MAIN issue that Kaiepi hinted at is prompting me to file an issue on constraining its slurpy args | 23:32 | |
23:39
sena_kun left
23:45
zacts joined
23:50
Manifest0 left
|
|||
Yary | m: BEGIN @*ARGS=<4>;sub MAIN(Int $value is rw where ($value += 0) ∈ (1,2,4,8,16)) {say "\$value.perl = ",$value.perl } | 23:51 | |
camelia | Usage: <tmp> <value> |
||
23:52
MasterDuke joined,
MasterDuke left,
MasterDuke joined
|
|||
Yary | m: BEGIN @*ARGS=<4>;sub MAIN(Int $value is rw where Int($value) ∈ (1,2,4,8,16)) {say "\$value.perl = ",$value.perl } | 23:52 | |
camelia | Usage: <tmp> <value> |
||
Yary | m: BEGIN @*ARGS=<4>;sub MAIN(Int $value where Int($value) ∈ (1,2,4,8,16)) {say "\$value.perl = ",$value.perl } | ||
camelia | $value.perl = IntStr.new(4, "4") | ||
Yary | Hmm, the "is rw" version doesn't match, but removing "is rw" allows matching. Why would that be? | 23:53 | |
23:54
zacts left,
espadrine_ left
|