»ö« 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:01 cpan-p6 left, cpan-p6 joined
cpan-p6 New module released to CPAN! ULID (0.1.0) by 03HANENKAMP 00:02
00:03 pecastro left 00:17 dominix joined
dominix hi perl6 community 00:18
I have a question not directly related to perl6 but I trust this community for this kind of advice.
I need a low level/compiled language for performance reason. I would like this language to be integrated enought with perl6 00:19
I am exploring Nim, crystal and Rust, with of these would you recomend to me 00:20
i am currently learning perl6, and will mainly use perl6 over all 00:22
zachk I think C is kind of integrated with perl6, but not sure, I am kind of new to perl6 00:24
leont It's easy to integrate with anything that links like C
I know Rust can do that (extern "C"), I don't know Nim well and hadn't even heard of crystal, but I suspect they can do the same 00:26
discord6 <Vendethiel> Rust is for « real-time »-ish app where having a gc is something you can’t afford. Crystal is nice but lacks manpower. Nim is nice bug the compiler is bugridden 00:28
dominix what do you mean "lack manpower" ? too small community ? 00:30
btw I do not know any of these community. 00:31
00:39 leont left 00:48 patrickb joined, patrickb left, patrickb joined, patrickb left 00:52 patrickz left
discord6 <Vendethiel> No, I mean people working on the compiler toolchain. 01:01
01:01 MasterDuke joined 01:02 MasterDuke left, MasterDuke joined 01:07 sena_kun left
vrurg m: role R0 { has $.a; }; role R1 does R0 { }; role R2 does R0 { }; class C does R1 does R2 { } 01:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Attribute '$!a' conflicts in role composition
at <tmp>:1
vrurg Is it a known problem? 01:16
AlexDaniel vrurg: but is it a problem? I'm not sure 01:19
01:19 zachk left
vrurg AlexDaniel: imagine you consume roles from different packages which consume same role from a third package. Everything is ok until the third package decides they need an attribute in their role... 01:20
AlexDaniel vrurg: maybe submit a ticket. If that's not supposed to work, then we can at least turn it into a doc ticket and explain what should be done in this case 01:23
vrurg Sure I will. Just wanted to know if this has been considered before. 01:24
01:27 juni joined 01:28 juni left 01:29 sjn_ is now known as sjn 01:30 dominix left 01:44 markoong left 02:08 dominix joined 02:12 w_richard_w left
dominix From my latest question I will go for rust for a side language. 02:15
Nim and crystal my be good language but rust is more disruptive in the innovations 02:16
02:16 reach_satori joined
dominix Still it has good perspective for perfor 02:17
Mance
02:22 dotdotdot left 02:26 dominix left 02:27 dotdotdot joined 02:38 Guest32385 is now known as masak
masak is still a bit confused over "disrupt" taking on positive connotations 02:39
02:41 Actualeyes left 03:00 ofperfection left 03:06 lookatme_q joined 03:14 pyrimidine left, pyrimidine joined 03:36 ferreira left 03:55 cpan-p6 left, cpan-p6 joined 04:13 mowcat joined 04:35 abraxxa joined 04:40 abraxxa left 04:42 abraxxa joined 04:46 abraxxa left 04:49 kurahaupo left 04:50 AlexDani` joined 04:55 AlexDaniel left 05:00 abraxxa joined 05:01 Xliff left 05:21 zacts joined 05:30 zacts left 05:35 w17t left 05:54 curan joined, abraxxa left 05:56 robertle joined 06:07 robertle left
moritz language has disrupted you, masak :D 06:17
06:33 domidumont joined
masak .oO( <archimedes> do not disrupt my circles! ) 06:47
06:51 zacts joined, jaja joined 06:52 kerrhau left 06:53 random_yanek left 06:56 w17t joined 06:57 jmerelo joined 07:08 random_yanek joined 07:11 ravenousmoose joined 07:18 ryn1x left 07:21 domidumont left, domidumont joined 07:28 cpan-p6 left 07:29 cpan-p6 joined 07:38 rindolf joined 07:41 jmerelo left 07:46 ravenousmoose left, ravenousmoose joined 07:50 mindd joined
mindd hi 07:50
07:51 zacts left 07:52 mindd left
discord6 <Vendethiel> People get bitter over Rust because they don’t actually fit too well within the initial use-case, methinks 08:01
<Vendethiel> It certainly has had more researchers writing about it than crystal and nim, though. 08:02
<Vendethiel> However I’m not sure I’d call that « disruptive »...
08:11 ravenousmoose_ joined 08:30 sno left 08:33 zakharyas joined 08:47 ufobat joined 08:54 dustinm` left 08:55 mowcat left 08:58 dustinm` joined 09:04 ryn1x joined 09:06 dustinm` left 09:08 ryn1x left 09:17 dustinm` joined 09:21 ryn1x joined 09:22 dakkar joined 09:32 abraxxa joined 09:38 domidumont1 joined 09:40 domidumont left 09:50 sena_kun joined 09:56 aindilis` left 09:57 aindilis joined 10:17 Actualeyes joined 10:19 domidumont1 left 10:21 kensanata joined, AlexDani` is now known as AlexDaniel 10:22 Geth left, Geth joined, ChanServ sets mode: +v Geth 10:51 cpan-p6 left 10:52 cpan-p6 joined 11:00 Actualeyes left 11:03 scimon joined
SyrupThinker I cannot resolve rakudo.org , does anybody else have that problem? 11:10
sena_kun isup.me says "It's not just you! rakudo.org looks down from here". :| 11:12
jnthn Next question: does anyone know where it should resolve to? :) 11:13
moritz to 213.95.82.53 11:14
jnthn The domain recently transferred ownership and moved registrar as part of that. It left the name server records intact. Unfortunately, the previous registrar seems to have immediately dropped answering resolution requests upon that happening. 11:15
moritz more than that, the resolver time out
jnthn Wow
moritz and 2001:780:101:ff00::80:1 as IPv6 address 11:16
jnthn Thanks; I've pointed it to a new nameserver and put in the A[AAA]? records :) 11:18
Bit annoying that there was no grace period; I checked last night "is the transfer done yet" and the answer was "no".
moritz yes, that's pretty shitty behavior from the old DNS provider 11:19
ok, a dig rakudo.org +trace now works for me
same for AAAA
so now it's just a matter of caches expiring 11:20
at $work, we decrease the zone TTL to 60s or so before migrating a domain, for cases exactly like this
but then we also strive to not be an asshole to people/companies leaving our service :D 11:21
jnthn :)
Thanks for checking/help; moritz++
moritz no problem :D 11:22
11:29 jaja left 12:00 markoong joined 12:01 AlexDaniel left 12:11 cygx joined
El_Che rakudo.org works for me (TM) 12:14
12:14 lucasb joined
lizmat as for me 12:15
jnthn Still waiting on the timeout here, it seems 12:16
12:17 mscha joined
lizmat it might be your router keeping it... 12:17
El_Che jnthn: or your local pc cache
lizmat but if it is just you, don't worry about it :-)
mscha m: for 1,3...99999999 -> int $i { }; say now - INIT now; 12:18
camelia 0.3954962
El_Che lizmat: he probably doesn't even know what rakudo is :)
mscha m: loop (my int $i = 1; $i ≤ 99999999; $i += 2) { }; say now - INIT now;
Geth doc: d0b656b4fd | (JJ Merelo)++ | doc/Language/variables.pod6
Clarifies scope of state closes #2616
synopsebot Link: doc.perl6.org/language/variables
cygx so, no idea about other peple's workflow, but I've found local development with -I and PERL6LIB suboptimal
camelia 8.87235327
cygx hence, I've created a tool that might help: github.com/cygx/6lib
it's literally only a day old, so be warned if yout try it out yourself 12:19
lizmat mscha: the 1,3...9999 case is highly optimised
m: loop (my $i = 1; $i ≤ 99999999; $i += 2) { }; say now - INIT now;
mscha It isn't in my installation of Rakudo Star 2018.10 yet. ;-) (There, 1,3...99999999 is about 25 times slower than loop) 12:20
camelia (timeout)
12:20 robertle joined
mscha But the loop version is a *lot* faster on my machine. 12:20
lizmat m: loop (my int $i = 1; $i ≤ 99999999; $i = $i + 2) { }; say now - INIT now;
camelia 9.4707716
lizmat 0.37937893 vs 2.683154 on mine 12:21
mscha Rakudo Star 2018.10: loop takes half a second, for 1,3... takes 12.5 seconds. 12:22
12:22 ravenousmoose_ left
lizmat oops, actually: 0.37937893 vs 0.322489 for me (I had forgotten the "int" 12:22
mscha So how come the loop one is so slow using the bot? 12:23
lizmat good question
12:27 ravenousmoose is now known as ravenousmoose[aw, ravenousmoose[aw left 12:28 zakharyas left 12:33 ravenousmoose joined 12:36 w17t left 12:47 Xliff joined
Xliff \o 12:47
12:48 ravenousmoose_ joined
Xliff If I have a bunch of subs in a .pm6 file, if I use that pm6 file, can I list those subs? 12:48
sena_kun `use Foo; for MY::.keys -> do stuff` 12:49
Xliff :)
Lemme try
Aaannd.... now I have to wait for precompile hell. 12:50
(Yes, this is GTK stuffs)
12:50 Grauwolf_ is now known as Grauwolf
sena_kun m: use NativeCall; MY::.grep({ $_.value ~~ Sub}).say 12:50
camelia (&postcircumfix:<[ ]> => &postcircumfix:<[ ]> &trait_mod:<is> => &trait_mod:<is> &explicitly-manage => &explicitly-manage &cglobal => &cglobal &nativecast => &nativecast &nativesizeof => &nativesizeof &refresh => &refresh)
sena_kun Xliff, something like ^
Xliff Hmm... not getting the subs 12:51
All subs are NOT listed as export.
sena_kun erm, if they are not, I don't think you can get those. 12:52
Xliff :(
That's what I suspected.
sena_kun I may be wrong, but that'd be too odd, isn't it?
I mean.
You know. :)
Xliff I know. Was hoping I could introspect at the package level. 12:53
Maybe I could make them our scoped?
sena_kun well... That might be possible, but it's just that I don't know how.
moritz if they are 'my' and not exported, that might have a reason
like, possibly nobody designed an API intended for public use
Xliff I am now 'our' scoping the subs. ;) 12:54
OK. Subs now "our" scoped, but not exported. 12:55
I still can't see 'em.
sena_kun well, if you do `use Foo;`, then you can do something with `Foo.HOW`, but tbh I don't remember right now what exactly. 12:57
ah, no, I think the case I know is made with `MY::.kv`, so please ignore me. 12:59
Xliff So is there any way to get our scoped symbols out of a compunit? 13:01
lizmat m: class Foo { our sub a { } }; dd Foo:: # Xliff 13:02
camelia Stash element = {"\&a" => sub a { #`(Sub|62371648) ... }}
lizmat m: class Foo { our sub a { } }; dd Foo::.keys
camelia ("\&a",).Seq
Xliff lizmat: File contains a role def and the sub defs are OUTSIDE of the role. 13:04
Here's the file: github.com/Xliff/p6-GtkPlus/blob/m...eneric.pm6 13:05
Subs at the bottom are "our" scoped in my local copy.
cygx I suspect they end up in GLOBAL:: 13:06
you might want to put them in a module... 13:07
lizmat m: class Foo { sub a { }; method subs() { OUTER::.keys.grep: *.starts-with("&") } }; dd Foo.subs 13:09
camelia ("\&a",).Seq
lizmat afk&
13:14 sno joined
Xliff OK, now exported and STILL can't find them. 13:23
How would I look them up in GLOBAL?
13:25 mscha left
timotimo m: say GLOBAL::.keys 13:28
camelia ()
Xliff Looking familiar, there. ;) 13:29
13:30 rindolf left 13:37 rindolf joined 13:46 cygx left, hsrt^ joined 13:55 domidumont joined 13:56 domidumont left 14:00 domidumont joined 14:01 araraloren joined
cpan-p6 New module released to CPAN! Canoe (0.0.3) by 03ALOREN 14:07
14:10 cpan-p6 left 14:11 cpan-p6 joined, w17t joined 14:18 zakharyas joined
perlbot Eric pasted a new file at perlbot.pl/p/8m9big - 14:25
AlexDaniel` Haha 14:26
Ven`` what creativity. 14:27
14:29 dogbert2_ left 14:32 ravenousmoose_ left
El_Che what a waste of perfectly fine air 14:33
tadzik jokes are art 14:40
but I worry this might be someone seriously thinking this'll work
timotimo how do you sell perlbot.pl? 14:46
Geth ecosystem: 2e82582bd4 | cygx++ (committed using GitHub Web editor) | META.list
Add App::SixLib

See github.com/cygx/6lib
timotimo er, i mean
what do you sell on perlbot.pl?
14:47 curan left
AlexDaniel` That's automated for sure, but I wonder why it liked that form 14:50
timotimo "i am a simple bot. i see a submit button, i click" 14:54
14:56 ravenousmoose_ joined 15:03 chacewells joined 15:04 araraloren left
Ven`` m: use v6e; 15:07
camelia ===SORRY!===
Cannot call method 'typed_panic' on a null object
Ven`` m: use v6.e; 15:08
camelia ===SORRY!===
Cannot call method 'typed_panic' on a null object
Ven`` mh.
discord6 <Rogue> I wonder, how do multiline messages get handled by the bot? This is a new line
sena_kun m: use v6.c;
camelia ( no output )
sena_kun m: use v6.d;
camelia ( no output )
sena_kun m: use v6.e;
camelia ===SORRY!===
Cannot call method 'typed_panic' on a null object
moritz the bot translates ␤ into newlines in the input, and the other way round in the output 15:09
discord6 <Rogue> I meant the bridge bot, sorry 15:10
15:13 saki joined 15:18 Sgeo joined 15:20 mikejw joined, AlexDaniel joined 15:21 Sgeo_ left 15:30 powerbit left 15:31 mowcat joined, chacewells left 15:34 ravenousmoose_ left 15:35 w17t left 15:36 jmerelo joined
timotimo Rogue, it seems to just put a space in between the lines 15:47
15:48 ChoHag left 15:58 discord6 left
jmerelo releasable6: status 15:58
releasable6 jmerelo, Next release in ≈3 days and ≈3 hours. 4 blockers. 174 out of 302 commits logged
timotimo @Rogue - does this make a highlight?
releasable6 jmerelo, Details: gist.github.com/3a123f543a1c6c250b...06496122a0
16:00 tyil left
timotimo oh, the bot left 16:02
that's why it doesn't send messages to discord any more 16:03
16:03 leont joined 16:05 skids joined 16:10 ferreira joined 16:13 discord6 joined 16:14 discord6 left 16:15 mowcat left, mowcat joined 16:18 discord6 joined
kybr Perl6 regex library yet? now that i'm getting to know them, i want'em everywhere. 16:19
16:20 discord6 left
Geth doc: 55a996492b | cfa++ | doc/Language/variables.pod6
Phrasing.
16:20
synopsebot Link: doc.perl6.org/language/variables
sjn kybr: it just means you'll have to use Perl 6 everywhere ;) 16:21
kybr i wish i could. in this case, maybe i can glue somethign together. i find myself using vim search and replace and i'd really like the p6re. 16:23
16:24 discord6 joined 16:25 discord6 left
El_Che kybr: I would appreciate if you would implement :perl6do for vim 16:34
Ven`` do we not have some sort of .map-keys and .map-values? 16:35
16:35 discord6 joined
Ven`` I must misremember. 16:35
jmerelo webstrand: we have .keys.map and .values.map 16:36
16:36 cpan-p6_ joined
Ven`` er, not even the right prefix :P 16:36
I don't want .keys.map and .values.map, I want .map-keys and .map-values
(those keep the other side)
jmerelo Ven``: You want to map keys or values? I don't think I understand what you mean. 16:37
timotimo Ven``: you're probably looking for something with an :as parameter 16:38
anyway, .pairs.map is probably the right thing in your instance 16:39
Ven`` m: sub map-keys(%h, $f) { %h.map(-> $p { $f($p.key) => $p.value }); }; map-keys({:1a, :2b, :3c}, *.succ).say
camelia (c => 2 b => 1 d => 3)
16:40 cpan-p6 left
Ven`` here's what I mean 16:40
jnthn I'm not aware of anything shorter than that.
16:41 ravenousmoose left, ufobat_ joined
El_Che perl 6, got to love it 16:41
Ven`` aw, ok
El_Che in go you know you'll end writing a function
in perl 6 there is some much in core, that you're always in doubt if the functionality isn't already built in
it does not matter how weird it is :) 16:42
16:42 tyil joined
timotimo m: my %h = :1a, :2b, :3c; my %x = %h.keys.map(*.succ) Z=> %h.values; say %x 16:43
camelia {b => 1, c => 2, d => 3}
jnthn El_Che: Not to mention that having such stuff to hand often leads me to solve problems in good ways rather than "eh, I'll cheat a bit" :)
16:44 ufobat left
El_Che jnthn: I alway reason that people that implement that stuff for me are better programmers, so their core stuff will be faster and safer :) 16:44
16:45 discord6 left, discord6 joined, discord6 left 16:46 cpan-p6_ left
jnthn El_Che: I'm not sure it's so much about "better programmers" so much as "more eyes, more tests" 16:46
Ven`` timotimo: not shorter enough to warrant the "weird Z" ;) 16:47
(imho)
16:47 kensanata left
Ven`` (and since I'm writing this code for $work, it'll have to be maintained by others) 16:47
timotimo :) 16:48
16:48 tyil left, mowcat left 16:49 ravenousmoose joined, cpan-p6 joined, discord6 joined 16:50 tyil joined 16:54 lucasb left 16:57 discord6 left 16:59 tyil left 17:01 discord6 joined, cpan-p6_ joined, ravenousmoose left 17:02 ravenousmoose joined 17:03 discord61 joined, discord61 left
Ven`` I'll probably stick a map-keys and map-values into a module and call it a day. Not sure whether as augments or not (I still like the feed operator...) 17:04
17:04 cpan-p6 left, sena_kun left, sena_kun joined, sena_kun left, tyil joined 17:05 molaf joined
scimon I feel a strength of Perl6 is as a language for making shared languages. It's easy to extend and create an ecosystem a team can work in. 17:06
Ven`` I suppose some Common Lispers felt the same..:)
17:06 aindilis` joined
scimon One thing I think we should work on is documenting how to setup a shared local repository. DarkPan for Perl6. 17:07
I keep meaning to do it.
jmerelo scimon: I've also thought about that. 17:09
scimon As far as I can tell the easiest way is for a local group using git would be to mimic the original system
17:09 aindilis left
jmerelo scimon: but it's going to be a hard thing to do. For the time being, the paths to repos are hard-coded in zef. 17:09
scimon zef config.
github.com/ugexe/zef#phases--plugins-settings
jmerelo scimon: I'd do it in a roundabout way, and it's something I would like to do sooner or later: fork zef and do some other stuff.+ 17:10
scimon: no matter what, it's healthy to have several entry points to the ecosystem. Rigth now, zef is the only gate, and gatekeeper.
scimon I think it's a case of having a custom config with your local git repo data in and recreating the Meta json files. 17:11
Hmmm I was looking for a talk to give at LPM in a couple of weeks.
jmerelo scimon: theoretically. But in general, zef is not keen on being used outside its only intended purpose. 17:12
scimon: you might find paths to repo descriptions are hardcoded.
scimon github.com/ugexe/zef/blob/master/r...onfig.json
:D
(Now this is me just poking about.) 17:13
17:13 tyil left
scimon But it looks like having a customer config that added a new Ecosystem from a given URL would be simple enough. 17:14
jmerelo scimon: well, give it a spin and report back. Good luck.
17:15 discord6 left, discord6 joined
scimon Aye. :) 17:15
17:16 zacts joined
ufobat_ is there a "deep clone" method for (simple) objects, or do i need to implement such a ding by hand? 17:28
17:29 mowcat joined
scimon .clone ? 17:31
17:31 vrurg left
ufobat_ it's shallow 17:32
jmerelo ufobat_: what about dumping to JSON and getting it back on the other side? As long as you know the type... 17:33
scimon What kind of objects are we talking about?
m: role Bob { has $.hi };role Sue { has Bob $.bob };my $b = Sue.new( bob => Bob.new( hi => "There" ) );say $b.perl;my $c = $b.clone;say $c.perl 17:34
camelia Sue.new(bob => Bob.new(hi => "There"))
Sue.new(bob => Bob.new(hi => "There"))
scimon Anyway. I need to run away. 17:35
Ciao
17:35 scimon left 17:42 dakkar left 17:43 domidumont1 joined 17:44 domidumont1 left 17:45 ravenousmoose is now known as ravenousmoose[aw 17:47 domidumont left, zachk joined 17:50 domidumont joined 17:51 domidumont left 17:52 domidumont joined 17:53 sena_kun joined, domidumont left, domidumont joined
ufobat_ m: role Bob { has $.hi };role Sue { has Bob $.bob };my $b = Sue.new( bob => Bob.new( hi => "There" ) );say $b.perl;my $c = $b.clone; $b.bob.hi = "foo"; say $c.perl 17:54
camelia Sue.new(bob => Bob.new(hi => "There"))
Cannot modify an immutable Str (There)
in block <unit> at <tmp> line 1
ufobat_ m: role Bob { has $.hi is rw };role Sue { has Bob $.bob };my $b = Sue.new( bob => Bob.new( hi => "There" ) );say $b.perl;my $c = $b.clone; $b.bob.hi = "foo"; say $c.perl 17:55
camelia Sue.new(bob => Bob.new(hi => "There"))
Sue.new(bob => Bob.new(hi => "foo"))
17:55 ravenousmoose_ joined, domidumont left
ufobat_ but in general it are objects as simple as that 17:55
17:56 ravenousmoose[aw is now known as ravenousmoose 18:04 ravenousmoose_ left, mowcat left 18:07 |oLa| joined 18:16 vrurg joined 18:17 ChoHag joined 18:18 mikejw left 18:20 vendethiel- joined 18:26 zacts left, ravenousmoose is now known as ravenousmoose[aw
Xliff m: 1.fmt('%02d').say; 18:30
camelia 01
Xliff m: Version.new('v1.1.1').say 18:35
camelia vv.1.1.1
Xliff m: Version.new('v1.1.1'.substr(1)).say
camelia v1.1.1
18:36 vendethiel- left
Geth doc: 7ff36db5f8 | (JJ Merelo)++ | doc/Type/Mu.pod6
Clarifies example

Thanks to @raiph in
  stackoverflow.com/a/54635282/891440. This (hopefully) closes #2620
18:37
synopsebot Link: doc.perl6.org/type/Mu
18:37 vendethiel- joined 18:42 ravenousmoose[aw is now known as ravenousmoose
b2gills m: Xliff: say v1.1.1 == Version.new('1.1.1') 18:45
camelia True
b2gills m: say Version.new('1.1.1')
camelia v1.1.1
Xliff b2gills: I know. ;) 18:50
I haved a C-lib that I want to build version info for. So the Str output needs to prefix the v. 18:51
I construct the Version output from the Str coz I'm lazy and the Str version was easy to write. :D
18:56 leont left 18:57 zacts joined
Xliff Can you have a package/object with a name that ends in "::Version"? 19:02
Or is that reserved?
19:07 chiyosaki joined 19:10 saki left
timotimo should be fine 19:10
since version modifiers go by :ver rather than ::Version
19:10 zakharyas left 19:22 sauvin left 19:47 jmerelo left 19:52 vendethiel- left 20:00 xinming_ joined 20:02 chiyosaki left 20:03 xinming left 20:04 cpan-p6 joined
cpan-p6 New module released to CPAN! Printing-Jdf (0.1.1) by 03JSTOWE 20:09
rindolf .seen Zoffix 20:12
yoleaux I saw Zoffix 6 Jan 2019 17:41Z in #perl6: <Zoffix> moritz: the project's direction and management style doesn't match my goals and I'll be happier elsewhere.
cpan-p6_ New module released to CPAN! Printing-Jdf (0.1.1) by 03JSTOWE 20:14
20:14 cpan-p6_ left 20:16 ravenousmoose left 20:19 |oLa| left 20:32 vendethiel- joined 20:34 powerbit joined 20:36 zakharyas joined 20:39 pecastro joined 20:54 cpan-p6_ joined 20:55 cpan-p6 left 20:59 ryn1x left 21:04 daxim joined 21:08 cpan-p6 joined 21:09 cpan-p6 left, zacts left 21:10 ravenousmoose joined 21:11 Cabanossi left 21:15 zakharyas left 21:17 Cabanossi joined 21:31 [Sno] joined 21:34 sno left 21:35 ufobat_ left 21:37 ravenousmoose left, molaf left, ravenousmoose joined 21:46 xi left, xi- joined 21:48 ravenousmoose left 21:49 ravenousmoose joined 21:51 drolax joined 21:52 ravenousmoose left 21:56 dominix_ joined, dominix_ is now known as dominix
dominix hi everyone 21:57
I am looking for the short form of div
the short form of multiply is $x *= 2; 21:58
but what is the short form of $x = $x div 2; ?
$x /= 2 ; do not work
Xliff m: multi sub a ($i) { say "I"; }; multi sub a (*@i) { say "II"; }; a(1); 21:59
camelia I
discord6 <Vendethiel> div=
Xliff m: multi sub a ($i) { say "I"; }; multi sub a (*@i) { say "II"; }; a(1, 2);
camelia II
discord6 <Rogue> you can simply do $x div= 2 I believe
<Rogue> = is both a normal operator and a metaoperator
<Vendethiel> $x [Rdiv]= 2 for the other way around 22:00
dominix ok, ... weird but acceptable.
Xliff m: m $x = 4; $x [div]= 2; $x.say;
camelia 5===SORRY!5===
Unrecognized regex metacharacter = (must be quoted to match literally)
at <tmp>:1
------> 3m $x7⏏5 = 4; $x [div]= 2; $x.say;
Couldn't find terminator $ (corresponding $ was at line 1)
at <tmp>:1
------> 3m $x =7…
Xliff m: m $x = 4; $x [&div]= 2; $x.say; 22:01
camelia 5===SORRY!5===
Unrecognized regex metacharacter = (must be quoted to match literally)
at <tmp>:1
------> 3m $x7⏏5 = 4; $x [&div]= 2; $x.say;
Couldn't find terminator $ (corresponding $ was at line 1)
at <tmp>:1
------> 3m $x =7…
Xliff m: my $x = 4; $x [div]= 2; $x.say;
camelia 2
Xliff There you go
22:03 drolax left
dominix m: my $x = 4; $x div= 2; $x.say; 22:03
camelia 2
dominix this works for me. 22:04
22:04 drolax joined
Xliff :) 22:05
22:06 skids left 22:12 mowcat joined 22:17 vendethiel- left 22:27 drolax left 22:33 Sgeo left, petercommand left, petercommand joined, k-man left 22:35 TeamBlast left, k-man joined 22:36 TeamBlast joined, rjbs left, rjbs joined 22:39 discord6 left 22:40 discord6 joined, tyil joined 22:57 dogbert17 left
Xliff If I want to access something like an array, can I just implement method AT-POS? 23:03
23:04 discord6 left, tyil left 23:05 discord6 joined
sena_kun m: class A { has @.a = 1,2,3,4,5; method AT-POS($index) { @!a[$index] } }; say A.new[2]; say A.new[4]; 23:06
camelia 3
5
23:06 rindolf left
Xliff sena_kun++: :) # Thanks! 23:07
sena_kun .oO ( some questions can be easier to check than to ask )
yw
Xliff I was thinking about how I would do that. You think faster. ;p
23:13 discord6 left 23:15 Xliff left, Xliff joined 23:16 cpan-p6_ left 23:17 discord6 joined 23:19 discord61 joined, discord61 left 23:22 tyil joined 23:24 ryn1x joined 23:27 tyil left 23:29 discord61 joined, discord6 left 23:30 discord61 is now known as discord6 23:36 reach_satori left 23:46 tyil joined
timotimo there's a module in the ecosystem meant to make it easier to build custom array-likes 23:51
23:56 discord61 joined 23:57 discord6 left, discord61 is now known as discord6