Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-05-26

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:13 pierre_ joined #perl6
00:24 finanalyst_ joined #perl6
00:53 jrusso joined #perl6
00:54 MadcapJake phew, finally back to a desktop after botching a distro ugprade
00:55 * geekosaur can
00:56 * geekosaur can't wait for his turn at that
00:56 geekosaur (been putting off mint 17.3 upgrade on desktop)
00:56 geekosaur (laptop will probably be worse, though, as I'd been using secure boot and ubuntu dropped it so it's gone in mint 17.3)
00:57 MadcapJake luckily i put my /home in a separate partition
00:57 geekosaur I do have backups, but.
00:58 MadcapJake not me, I like to live on the edge :P
01:00 AlexDaniel .tell TimToady qww<foo „hello world” bar> – no quote protection here. Was it supposed to be this way or is it a bug?
01:00 yoleaux AlexDaniel: I'll pass your message to TimToady.
01:01 sufrosti1o joined #perl6
01:05 jrusso joined #perl6
01:22 ggoebel114 joined #perl6
01:35 roy__ joined #perl6
01:37 BenGoldberg joined #perl6
01:46 BenGoldberg joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:50 molaf joined #perl6
01:51 BenGoldberg joined #perl6
01:57 BenGoldberg joined #perl6
02:21 Zoffix left #perl6
02:22 tbrowder_ joined #perl6
02:24 BenGoldberg joined #perl6
02:37 BenGoldberg joined #perl6
02:47 BenGoldberg joined #perl6
02:51 noganex joined #perl6
02:55 BenGoldberg joined #perl6
03:07 Tonik joined #perl6
03:08 Ben_Goldberg joined #perl6
03:34 pierre_ joined #perl6
03:35 cpage_ joined #perl6
03:50 boegel joined #perl6
03:55 pierre_ joined #perl6
03:57 cpage_ joined #perl6
03:59 zakharyas joined #perl6
04:14 ssotka joined #perl6
04:21 jrusso joined #perl6
04:26 pierrot Good night.
04:27 BenGoldberg joined #perl6
04:30 pierrot if I have an array of strings and want to build a regular expression for the first string of the array followed by some text followed by the second string of the array and so on.. how could I do that in p6?
04:32 pierrot in perl 5, I would do something like $pattern = join ".*", map{quotemeta} @keywords and then qr/$pattern/..
04:32 huggable joined #perl6
04:33 BenGoldberg joined #perl6
04:34 pierre_ joined #perl6
05:09 mohae_ joined #perl6
05:22 jrusso joined #perl6
05:25 CIAvash joined #perl6
05:37 cgfbee joined #perl6
05:47 MadcapJake_ joined #perl6
05:54 domidumont joined #perl6
05:58 buharin joined #perl6
05:59 CIAvash pierrot: I think this should work: $text ~~ /<{@keywords.join: '.*'}>/
05:59 domidumont joined #perl6
06:00 CIAvash or my $pattern = @keyworkds.join: '.*'; /<$pattern>/
06:23 pierre_ joined #perl6
06:30 firstdayonthejob joined #perl6
06:34 RabidGravy joined #perl6
06:35 CIAvash That's without the quotemeta part though
06:44 wamba joined #perl6
06:46 mr-foobar joined #perl6
07:03 brrt joined #perl6
07:05 jack_rabbit joined #perl6
07:20 RabidGravy badoom!
07:35 as joined #perl6
07:46 darutoko joined #perl6
07:47 _28_ria joined #perl6
07:49 g4 joined #perl6
07:50 pierre_ joined #perl6
08:01 dakkar joined #perl6
08:02 _28_ria joined #perl6
08:03 azawawi joined #perl6
08:03 azawawi .
08:04 azawawi RabidGravy: ping
08:04 RabidGravy bloop!
08:05 azawawi RabidGravy: good morning :)
08:05 azawawi RabidGravy: strange output after adding provides on 2016.05 https://gist.github.com/azawawi/72729d6b5a0480e9e727d58bc0dbe5f5
08:05 azawawi RabidGravy: did you encounter such a problem?
08:06 RabidGravy nope
08:06 RabidGravy that's odd
08:08 RabidGravy something is doing "fail()" without a message
08:09 azawawi Build.pm without 'use LWP::Simple' works btw...
08:09 azawawi strange
08:09 azawawi tried adding "build-depends":  [ "panda", "Shell::Command", "LWP::Simple" ]
08:09 azawawi same problem
08:11 * RabidGravy looks at the Build.pm
08:11 azawawi actually to be exact even 'use NativeCall' causes that
08:11 azawawi with a bare class Build is Panda::Builder { ... }
08:12 rindolf joined #perl6
08:13 nadim joined #perl6
08:13 * azawawi nukes 2016.05 and rebuilds it
08:25 vike joined #perl6
08:32 huggable joined #perl6
08:46 azawawi RabidGravy: `zef install .` exhibits the same problem btw
08:47 azawawi RabidGravy: im suspecting that the first `panda install GTK::Simple` which fails somehow corrupts installation metadata
08:47 azawawi RabidGravy: even zef uninstall GTK::Simple does not fix it
08:57 RabidGravy :_O
09:01 cpage_ joined #perl6
09:16 RabidGravy azawawi, I've just made a reset branch without that stuff at https://github.com/perl6/gtk-simple/tree/before-split
09:16 RabidGravy a get out of jail free card
09:18 azawawi RabidGravy: confirmed a fresh 2016.05 'panda install .' without doing a failed `panda install GTK::Simple` worked. It is a metadata corruption bug.
09:18 azawawi RabidGravy: sending a PR to fix the issue
09:18 RabidGravy if nothing else it will allow for a bisect to determine which part breaks it
09:19 RabidGravy cool
09:19 ab6tract joined #perl6
09:19 ab6tract o/ #perl6
09:20 ab6tract i noticed that this section is still TBD in the docs on NativeCall: http://docs.perl6.org/language/nativecall#Buffers_and_Blobs
09:20 ab6tract i was wondering if anyone knows of any ecosystem examples?
09:23 ab6tract also, the zavolaj-for-examples section of this doc feels a bit out of date
09:23 tadzik wow, metadata corruption is something new indeed
09:24 RabidGravy Yeah, I think it needs some love
09:24 sftp joined #perl6
09:25 RabidGravy tadzik, there was a change at some point in the last few weeks that got rid of some of the locking I think
09:26 tadzik huh
09:26 ab6tract RabidGravy: do you have any experience with NC blobby/buffy interop?
09:26 ab6tract i'll gladly write the section, once i've put it to some use
09:27 RabidGravy I'm not sure (too many modules)
09:27 RabidGravy I do know that it works however
09:27 dalek doc: 501dd46 | ab5tract++ | doc/Language/nativecall.pod:
09:27 dalek doc: Remove tiny typo
09:27 dalek doc: review: https://github.com/perl6/doc/commit/501dd46606
09:28 ab6tract cool, i'll poke around your github :)
09:29 cognominal joined #perl6
09:29 azawawi RabidGravy: https://travis-ci.org/azawawi/gtk-simple/builds/133062628 and https://ci.appveyor.com/project/azawawi/gtk-simple/build/1.0.2
09:33 RabidGravy ab6tract, I can short cut that for you, I don't think that I have any modules that pass a Buf to a native sub directly (or any that return one)
09:33 RabidGravy azawawi, yeah, the tests won't run because no DISPLAY
09:34 RabidGravy (just grepped all my modules)
09:36 azawawi https://github.com/perl6/gtk-simple/pull/35
09:36 Emeric1 joined #perl6
09:40 RabidGravy I'm just going to merge that without testing ;-)
09:40 dalek gtk-simple: ebaf0b1 | azawawi++ | META6.json:
09:40 dalek gtk-simple: Add missing provides. Bump version to 0.1.2
09:40 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/ebaf0b14c6
09:40 dalek gtk-simple: e929c3c | azawawi++ | / (3 files):
09:40 dalek gtk-simple: Test on Linux/MacOSX (Travis CI, latest and 2016.05) and windows (AppVeyor, 2016.05). Add badges for AppVeyor
09:40 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/e929c3c065
09:40 dalek gtk-simple: b69c6aa | RabidGravy++ | / (4 files):
09:40 dalek gtk-simple: Merge pull request #35 from azawawi/master
09:40 dalek gtk-simple:
09:40 ab6tract RabidGravy: actually, your Audio::PortMIDI does do, for an error message
09:40 dalek gtk-simple: Fix #34 and add mac os x and windows testing
09:40 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/b69c6aa981
09:40 RabidGravy yeah I thought it was familiar
09:41 timotimo so, can we get an x server, like Xvnc or something running on travis-ci to have actual tests?
09:41 timotimo also the %*ENV<DISPLAY> is only sensible for linux, obviously
09:43 ab6tract m: class A does Positional { has @.a handles Positional; method gist { "i'm all like aaaaaa {@!a}" } }; my $a = A.new; say $a.push: 42
09:43 camelia rakudo-moar a5c46b: OUTPUT«Cannot call push(A: Int); none of these signatures match:␤    (Any:U \SELF: |values is raw)␤  in block <unit> at /tmp/u_eMfQ4Mj6 line 1␤␤»
09:44 ab6tract i'm clearly holding it wrong, but i thought something like the above used to work
09:44 ab6tract no results for 'handles' on docs.perl6
09:46 RabidGravy the way handles works it doesn't over-ridge the one it gets from 'Any'
09:46 RabidGravy so I don't think it ever worked
09:46 RabidGravy m: class A does Positional { has @.a handles <push>; method gist { "i'm all like aaaaaa {@!a}" } }; my $a = A.new; say $a.push: 42
09:46 camelia rakudo-moar a5c46b: OUTPUT«[42]␤»
09:47 azawawi RabidGravy: thx
09:48 RabidGravy I do have a completely separate problem with GTK::Siimple as it is, it hangs "forever" precompiling
09:49 RabidGravy which is almost certainly something wrong with some repository
09:50 lizmat joined #perl6
09:51 azawawi RabidGravy: it takes a white
09:51 azawawi RabidGravy: s/white/while
09:52 * lizmat waves from NLUUG Conference where [Tux] will give a presentation about Text::CSV in Perl 6: https://www.nluug.nl/activiteiten/events/vj16/abstracts/ab06.html
09:52 RabidGravy no, this is "forever" (like twenty minutes before I kill it,)
09:54 RabidGravy :)
09:54 RabidGravy anyway off out shopping
09:58 lizmat hmmm... RT #126391
09:58 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=126391
10:07 donaldh joined #perl6
10:10 donaldh joined #perl6
10:12 ab6tract RabidGravy: i could have sworn that at some point i was able to do  `has %.hash handles Associative` but maybe it was only a dream...
10:13 ab6tract but it's easy enough to get the semantics via handles <AT-KEY EXISTS-KEY ASSIGN-KEY>
10:17 ab6tract of course, then you need to remember <keys kv values> as well
10:18 azawawi 172 wallclock seconds after GTK::Simple refactor (classes/roles out) on 2016.05
10:20 lizmat ab6tract: not sure about that
10:20 * jnthn doesn't recall that ever being something that would work
10:20 timotimo i think keys kv values happens via Any, which your class likely already derives from
10:21 donaldh joined #perl6
10:21 jnthn You'd still need to delegate 'em to the right place though
10:21 lizmat as long you have a .pairs, I think all will derive ok
10:23 timotimo oh, right, you need to have the source of "what keys exist at all" in the original handles
10:24 timotimo we don't have a single underlying thing for that
10:24 timotimo like, no LOUD-KEBAB
10:25 DrForr Or -LOUD-ARROW-> :)
10:26 ab6tract jnthn, lizmat: okay, conceded that the memory is not based on reality. it was a good dream, though...
10:28 ab6tract m: class B { has %!f handles <AT-KEY EXISTS-KEY ASSIGN-KEY pairs> }; my $b = B.new; $b<foo> = 42; say $b.keys
10:28 camelia rakudo-moar a5c46b: OUTPUT«0..0␤»
10:32 brrt joined #perl6
10:37 pierre_ joined #perl6
10:41 grondilu joined #perl6
11:06 dalek gtk-simple: ff396b5 | finanalyst++ | README.md:
11:06 dalek gtk-simple: Improve README
11:06 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/ff396b59db
11:06 dalek gtk-simple: 585f611 | azawawi++ | README.md:
11:06 dalek gtk-simple: Merge pull request #36 from finanalyst/master
11:06 dalek gtk-simple:
11:06 dalek gtk-simple: Improve README
11:06 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/585f61118b
11:09 ocbtec joined #perl6
11:19 donaldh joined #perl6
11:22 kid51 joined #perl6
11:24 azawawi https://dzone.com/articles/four-reasons-why-python-is-a-good-programming-lang   # Perl 6 is mentioned in comments
11:37 cpage_ joined #perl6
11:38 iH2O joined #perl6
11:38 donaldh joined #perl6
11:38 chris2 joined #perl6
11:38 pmurias joined #perl6
11:43 perlawhirl joined #perl6
11:44 grondilu frankly I'm not sure Python is that easy to learn.  Sure, for basic stuff it *looks* easy, but the devil is in the details and things gets messy quite quick.  I remember learning about its OO model and all the __method__ syntax for stuff and it seemed pretty complicated to me.
11:45 perlawhirl funny conversation to walk into... i was just discussing perl5 v. python to a guy at work
11:45 cosimo what is the __method__ syntax?
11:46 perlawhirl i'm comfortable with python, but some things would be downright difficult for a biginner... eg. var = sys.argc[1]... if you don't supply an arg it gives you one of pythons trademark ugly stack traces... followed by "Index Error", which for a beginner is very unhelpful
11:46 DrForr And I just had someone on FB ask me yesterday because I'm on "the Perl group" if I had any advice on how to learn Python.
11:46 perlawhirl i meant... argv, but my point stands
11:48 perlawhirl also! try re.compile('[') and look at the very unhelpful wall of garbled stack trace. whereas perl will tell you "Unmatched '[' in regex HERE<---"
11:49 grondilu cosimo: I hope I remember well but IIRC it's a special syntax for meta-method names
11:49 grondilu like __new__, __init__ and so on.
11:50 perlawhirl __repr__ and __str__, which are kinda like Perl 6's Str and gist methods
11:51 grondilu I used to be excited about python.  It lasted about a month.  Now I hate it.  It's dull and verbose.  To me it's the new Fortran.
11:54 iH2O left #perl6
11:56 azawawi https://github.com/azawawi/gtk-simple/blob/master/README.md  # finanalyst++
11:56 cosimo it's not that bad
12:00 brrt joined #perl6
12:02 brrt what kind of article is that, even
12:03 brrt i mean
12:03 psch "agile methodology is scalable" made me stumble
12:04 brrt "python is highly efficient" made me
12:04 brrt and i /like/ python...
12:04 brrt hmm, question
12:05 brrt if we were to put out articles of *ahem* similar quality, but with similar ferocity, would it work?
12:05 brrt does this work, for python, to compete for mindshare?
12:05 psch it probably would invite the same quality of comments, but more and more contrarian
12:06 psch i'm not really sure what "work" means here, though.  will people talk about it?  probably
12:07 psch but it probably won't motivate people to honestly examine what Perl 6 brings - or rather, only very few
12:07 psch but i guess that's true regardless, and putting out this kind of content definitely would increase exposure
12:08 brrt exposure is usually a good thing
12:09 DrForr WTH does "Python even uses real-time wordings" mean? It's written in that Indian English dialect that makes me want to facepalm.
12:11 nadim joined #perl6
12:14 psch i understood it as "words that programmers use conversationally" or somesuch
12:14 psch although i don't quite know how "def" fits in there :)
12:15 pmurias grondilu: dull is kind of an advantage compared to some other things
12:18 DrForr Every section of that article uses circular reasoning.
12:33 donaldh joined #perl6
12:46 |2701 joined #perl6
12:47 pmurias_ joined #perl6
12:54 moritz ... and we all know that circular reasoning is the best, because it's circular!
12:54 El_Che_ moritz: don't be a square!
13:01 woolfy joined #perl6
13:02 sufrostico joined #perl6
13:03 woolfy Tux++ now does a presentation at NLUUG conference about Text::CSV in Perl 6.  :-)    https://www.nluug.nl/activiteiten/events/vj16/abstracts/ab06.html
13:05 pmurias joined #perl6
13:12 DrForr I've got 4 proposals in for OSCON London. If I'd known last year's was in Amsterdam...
13:13 pmurias_ joined #perl6
13:13 RabidGravy Oooh that's a bit special, "RAKUDO_MODULE_DEBUG=1 perl6 -Ilib -MGTK::Simple -e1' seems to hang forever on attempt to write to STDOUT
13:14 DrForr (and that I thought I'd stand a chance of getting in the door...)
13:15 smls joined #perl6
13:17 brrt joined #perl6
13:19 pmurias joined #perl6
13:24 woolfy left #perl6
13:24 pmurias_ joined #perl6
13:26 rindolf joined #perl6
13:26 awwaiid joined #perl6
13:26 gregf_ i guess the point azawawi was trying to make was ....'Perl6 is getting mentioned somewhere.. by some silly blogger'.. rather than ..'hey.. heres 4 reasons out of a million to make you feel good about python' ;)
13:28 cognominal joined #perl6
13:28 [Coke] alexdaniel: please don't "bombard" any of our backend support staff.
13:29 pmurias joined #perl6
13:34 pmurias_ joined #perl6
13:41 skids joined #perl6
13:45 pmurias joined #perl6
13:49 * [Coke] thanks everyone getting Perl 6 out on the conf. circuit.
13:50 * DrForr bows. And likewise to the others.
14:03 _4d47 joined #perl6
14:04 pmurias joined #perl6
14:05 RabidGravy I can't remember the last time I even went to a conference
14:05 acrussell joined #perl6
14:07 _4d47 p6: my @tens = 0, 10, 20, 30; @tens[2]:delete; dd @tens;
14:07 camelia rakudo-moar 498d0a: OUTPUT«Array @tens = [0, 10, Any, 30]␤»
14:08 azawawi RabidGravy: what's a conference? :)
14:08 RabidGravy :)
14:09 DrForr A way to get your company to pay for your beer?
14:09 gregf_ we have conferences every morning....er... standups i mean ;)
14:10 azawawi RabidGravy: seems that use-ing ::NativeLib is causing the slowness in the refactor in GTK::Simple. im testing it to improve performance atm
14:11 pmurias_ joined #perl6
14:11 tony-o DrForr: if you find a way for that outside of travel expenses please let me know
14:12 azawawi RabidGravy: https://travis-ci.org/azawawi/gtk-simple/builds/133113522
14:14 zakharyas joined #perl6
14:15 RabidGravy nicie!  I'm wondering if the nqp and NativeCall can go from the main GTK::Simple if they are in all the other places they are needed
14:15 azawawi RabidGravy: im doing it :)
14:15 RabidGravy cool
14:16 azawawi but .precomp is certainly a problem in 2016.05
14:16 pmurias joined #perl6
14:16 azawawi everytime i move subs from one class/module with atom open and run a prove... .precomp corruption
14:17 RabidGravy that's not good
14:17 llfourn azawawi: does it look like RT #128156 ?
14:17 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=128156
14:19 azawawi yup same error message
14:19 woodruffw joined #perl6
14:19 llfourn yeah nine++ is looking into it
14:24 khw joined #perl6
14:24 azawawi nine++ # cool
14:24 kent\n joined #perl6
14:34 mohae joined #perl6
14:36 cdg joined #perl6
14:39 lizmat joined #perl6
14:41 _4d47 p6: my @tens = 0, 10, 20, 30, 40; @tens[3]:delete; dd @tens
14:41 camelia rakudo-moar 498d0a: OUTPUT«Array @tens = [0, 10, 20, Any, 40]␤»
14:41 _4d47 p6: my @tens = 0, 10, 20, 30, 40; @tens[4]:delete; dd @tens
14:41 camelia rakudo-moar 498d0a: OUTPUT«Array @tens = [0, 10, 20, 30]␤»
14:42 llfourn if you wanna remove it completely use splice I think
14:42 grondilu m: say 0, 10 ... 40
14:42 camelia rakudo-moar 498d0a: OUTPUT«(0 10 20 30 40)␤»
14:42 _4d47 looks like it change .elems but only for the last elems
14:43 llfourn mmm I think that's intended
14:43 donaldh joined #perl6
14:44 gfldex m: my @tens = 0, 10, 20, 30, 40; @tens[3]:delete; .say for @tens;
14:44 camelia rakudo-moar 498d0a: OUTPUT«0␤10␤20␤(Any)␤40␤»
14:44 llfourn m: my @tens = 0,10 ... 40; say @tens.splice(2,1); say @tens;
14:44 camelia rakudo-moar 498d0a: OUTPUT«[20]␤[0 10 30 40]␤»
14:44 pmurias_ joined #perl6
14:46 ugexe m: my @a = 1,2,3,4,5; @a[1]:delete; .say for @a[0..*]; # >:)
14:46 camelia rakudo-moar 498d0a: OUTPUT«1␤»
14:46 psch ugexe++
14:46 psch that's pretty similar to what i was trying to hack together :)
14:47 ugexe m: my @a = 1,2,3,4,5; @a[1]:delete; .say for @a[0..4]
14:47 camelia rakudo-moar 498d0a: OUTPUT«1␤(Any)␤3␤4␤5␤»
14:48 ugexe .splice(0) follows example 1, .splice follows example 2
14:48 ugexe RT 127573
14:48 pierrot Good morning. I had asked something yesterday and CIAvash gave me an answer but without considering quoting. Which is the p6 equivalent to p5's quotemeta?
14:48 llfourn RT #127573
14:48 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127573
14:49 psch pierrot: we don't have quotemeta.  interpolation of variables inside a regex depends on how you put the variable into the regex
14:49 geekosaur pierrot, in general quotemeta isn't needed (for its intended purpose at least) because the default for interpolation is to interpolate as literal string match instead of regex. (there's an alternative interpolation syntax if you want it to be treated as a regex)
14:50 gfldex i somehow feel that representing a hole in an array with Any is wrong. Nil would fit better. Nothing is more hole-like and any possible value.
14:50 pierrot geekosaur and psch : yes, I learnt that yesterday. interpolation is enabled with <$var>
14:50 gfldex s/and/then/
14:50 psch m: my $x = '\w'; say '\w' ~~ /$x/; say 'a' ~~ /<$x>/
14:50 camelia rakudo-moar 498d0a: OUTPUT«「\w」␤「a」␤»
14:50 psch ah, yeah
14:52 psch m: my @a is default(10) = ^10; @a[1] = Nil; @a[2]:delete; .say for @a
14:52 camelia rakudo-moar 498d0a: OUTPUT«0␤10␤(Any)␤3␤4␤5␤6␤7␤8␤9␤»
14:52 psch that surprised me.  i had thought :delete respects the default
14:52 ugexe Nil seems like it would muck up `is default`
14:52 ugexe this time i was beaten
14:54 lizmat psch: this feels like a bug to me
14:54 lizmat but it all depends on the semantics of :delete
14:55 lizmat m: my %h is default(10); say %h<a>
14:55 camelia rakudo-moar 498d0a: OUTPUT«10␤»
14:55 itaipu joined #perl6
14:55 lizmat hmmm
14:55 ugexe i would not expect :delete to set a default value
14:55 _4d47 find weird .elems respond differently when :delete on last item
14:55 moritz if you want that, there's an undefine() function for that
14:56 wamba joined #perl6
14:56 gfldex if you revert to the default, the Array loses his ability to have a hole. Unless you define Arrays with defaults to be hole-less.
14:56 moritz _4d47: if you want it to keep the element alive, you can always just set it to Nil
14:56 lizmat moritz: undefine is just another way to say = Nil
14:56 moritz right
14:56 lizmat multi sub undefine(Mu \x) is raw { x = Nil }
14:56 moritz and if you want to remove an element from the middle of the list, making the higher indexes change, you can use splice
14:57 moritz so, whatever behavior you want, there are ways to get it :-)
14:57 moritz there simply isn't a way to make every way behave in ways that don't surprise anybody
14:59 lizmat m: my @a is default(10) = ^10; @a[1] = Nil; @a[2]:delete; say @a[2]
14:59 camelia rakudo-moar 498d0a: OUTPUT«10␤»
14:59 _4d47 moritz: ok thanks, will use splice
14:59 gfldex m: my @a = 1,2,3; @a[1]:delete; say @a[1]; say @a[100]
14:59 camelia rakudo-moar 498d0a: OUTPUT«(Any)␤(Any)␤»
14:59 lizmat ok, so the Iterator is wrong
15:00 ugexe if your array ends with Anys they get cleaned up
15:00 psch with i, personally, find completely reasonable.  otherwise .elems should always report Inf (at least on default(Any) arrays)
15:00 psch s/with/which/
15:01 ptolemarch joined #perl6
15:02 ugexe its just combined with rt 127573 can produce the type of .elems results that seem to match _4d47's confusion
15:04 pierrot geekosaur: I'd like to do something similar to: my $pattern=join ".*", map{quotemeta} @keywords;if ($text =~ m/$pattern/) { } In p6, CIAvash suggested: my $pattern = @keyworkds.join: '.*'; if $text ~~ /<$pattern>/ { } but would fail with quoting issues.
15:04 pierrot I'd like each individual element of @keywords to be treated as literal, but the whole string (with ".*" separating each element) to be treated as a regexp and I'm not sure how to do it.
15:05 rindolf joined #perl6
15:06 psch m: my @keywords = '\wfoo', "bar"; my $pat = "'" ~ @keywords.join("' .* '") ~ "'"; say '\wfoo and eventually bar' ~~ /<$pat>/
15:06 camelia rakudo-moar 498d0a: OUTPUT«「\wfoo and eventually bar」␤»
15:07 psch pierrot: does that ^^^ help?
15:07 gfldex http://doc.perl6.org/language/subscripts#%3Adelete doesn't explain that holes are filled with Any. We seam not to explain (anywhere) what happens when Nil is assigned.
15:08 pierrot psch: Yes, it does. Thanks :)
15:08 gfldex m: my @a = 1,2,3; @a[1]:delete; say @a[1]:exists;
15:08 camelia rakudo-moar 498d0a: OUTPUT«False␤»
15:10 gfldex m: my @a = 1,2,3,Any; @a[1]:delete; say @a[1]:exists; say @a[3]:exists;
15:10 camelia rakudo-moar 498d0a: OUTPUT«False␤True␤»
15:11 gfldex m: my @a = 1,2,3,Any; @a[1]:delete; say @a[1]:exists; say @a[3]:exists; say .defined for @a;
15:11 camelia rakudo-moar 1ab1fb: OUTPUT«False␤True␤True␤False␤True␤False␤»
15:11 gfldex Interation turns holes into undefineness.
15:12 pmurias joined #perl6
15:21 psch m: my @a = 1,2,3,Any; @a[1]:delete; say @a[1]:exists; say @a[3]:exists; say ""; say .defined for @a; say @a[1]:exists; say ""; say @a[3]:exists
15:21 camelia rakudo-moar 1ab1fb: OUTPUT«False␤True␤␤True␤False␤True␤False␤False␤␤True␤»
15:22 psch eh, one of the extra says for clarity is actually at the wrong spot :|
15:22 psch anyway, i don't think iteration changes anything
15:22 psch Any is just undefined
15:23 lizmat not for .defined
15:23 lizmat but it does for just the for
15:23 psch right, there was the other WAT previously
15:23 pochi m: $?USAGE
15:23 camelia rakudo-moar 1ab1fb: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YzfhVNKYiS␤Variable '$?USAGE' is not declared␤at /tmp/YzfhVNKYiS:1␤------> 3<BOL>7⏏5$?USAGE␤»
15:24 lizmat m: my @a is default(42) = ^5; @a[2]:delete; .say for @a; for @a.keys -> { say @a[$_] }
15:24 camelia rakudo-moar 1ab1fb: OUTPUT«0␤1␤(Any)␤3␤4␤Too many positionals passed; expected 0 arguments but got 1␤  in block <unit> at /tmp/Ma0GoNIFCk line 1␤␤»
15:24 patrickz joined #perl6
15:24 sufrostico joined #perl6
15:24 lizmat m: my @a is default(42) = ^5; @a[2]:delete; .say for @a; for @a.keys { say @a[$_] }
15:24 camelia rakudo-moar 1ab1fb: OUTPUT«0␤1␤(Any)␤3␤4␤0␤1␤42␤3␤4␤»
15:24 psch yeah, that is definitely weird
15:25 cognominal joined #perl6
15:25 psch m: my @a is default(42) = ^5; @a[2]:delete; @a[$_].say for @a.keys;
15:25 camelia rakudo-moar 1ab1fb: OUTPUT«0␤1␤42␤3␤4␤»
15:26 psch m: my @a is default(Mu) = ^5; @a[2]:delete; @a[$_].say for @a.keys;
15:26 camelia rakudo-moar 1ab1fb: OUTPUT«0␤1␤(Mu)␤3␤4␤»
15:27 dalek doc: 5049338 | (Wenzel P. P. Peppmeyer)++ | doc/Language/subscripts.pod:
15:27 dalek doc: clarify that :delete can create holes that are bit skipped by iteration
15:27 dalek doc: review: https://github.com/perl6/doc/commit/50493383b1
15:27 gfldex looks like i need more tea
15:28 Azry_mobile joined #perl6
15:30 lizmat m: my Mu @a = ^5; @a[2]:delete; .say for @a; say @a[2]  # seems it's always Any
15:30 camelia rakudo-moar 1ab1fb: OUTPUT«0␤1␤(Any)␤3␤4␤(Mu)␤»
15:32 gfldex m: my @a = 1,Nil,3; say @a[1]:exists; .say for @a;
15:32 camelia rakudo-moar 1ab1fb: OUTPUT«True␤1␤(Any)␤3␤»
15:32 gfldex So the value that indicates the absense of a value is present?
15:32 lizmat m: my Int @a = 1,Nil,3; say @a[1]:exists; .say for @a;
15:32 camelia rakudo-moar 1ab1fb: OUTPUT«True␤1␤(Int)␤3␤»
15:33 psch gfldex: assigning Nil always means "reset to default"
15:33 lizmat yes, if it exists, there's a container for it which has the default value
15:33 lizmat m: my Int @a is default(42) = 1,Nil,3; say @a[1]:exists; .say for @a;
15:33 camelia rakudo-moar 1ab1fb: OUTPUT«True␤1␤42␤3␤»
15:35 gfldex That means that :exists doens't test for the existence of a value but for a container that could contain the value or it's default.
15:37 psch fwiw, :exists and :delete (especially on arrays) are something i am staying clear of and don't want to argue for or against :)
15:37 lizmat well, in a case of a hash, it's clear what exists means
15:37 lizmat in the case of an array, less so
15:37 gfldex Nothing is hard. :-|
15:38 gregf_ coding is :|
15:39 ugexe only 1 thing is universally accepted as not easy
15:43 CIAvash joined #perl6
15:47 sjn ugexe: cache validation and off-by-one errors? ;)
15:48 dalek doc: 892e14f | titsuki++ | doc/Language/glossary.pod:
15:48 dalek doc: Fix a typo "gitub" to "github"
15:48 dalek doc: review: https://github.com/perl6/doc/commit/892e14fed4
15:48 dalek doc: fd8f366 | RabidGravy++ | doc/Language/glossary.pod:
15:48 dalek doc: Merge pull request #549 from titsuki/fix-typo
15:48 dalek doc:
15:48 dalek doc: Fix a typo "gitub" to "github"
15:48 dalek doc: review: https://github.com/perl6/doc/commit/fd8f36651c
15:48 MadcapJake oh man, the "Python is Highly Scalable" paragraph in that article is completely bonkers
15:50 MadcapJake "When a client requires a large amount of development for a software application that does not require for the project to be complete, the application can be moved to live at any moment of the development process by completing a certain amount of modules of the application" O_O
15:50 DrForr The article just made up reasons.
15:50 Actualeyes joined #perl6
15:51 MadcapJake seriously that one sentence is just complete gobbledygook
15:51 tadzik wat
15:51 DrForr You could s/Python/ = 'Ruby' # and noone would notice.
15:51 RabidGravy read it four times to see if there was any sense to be extracted, failed
15:51 tadzik "when a client requires for a large building to be completed, you can just ship a standalone bathroom and call it a day"
15:52 huf i think it means that if the client wants something complicated, release some half-baked shit and they wont notice
15:52 huf most likely
15:52 MadcapJake every read makes me go from "WHAT?" to shear laughter, it's so completely nonsense
15:52 stmuk maybe its a Markov chain
15:52 huf it's a sortof depressive, nihilist twist on "release early, release often" :D
15:52 MadcapJake stmuk: I wouldn't doubt it, it's at that level of incomprehension
15:52 MadcapJake huf: lol that is hilarious
15:53 huf yeah but it's kinda real
15:54 huf client wants a bunch of undefined crap, you complete what you were able to figure out, the client sends incomprehensible feedback, you react by doing *something*
15:54 MadcapJake I like dark comedy so the more real, the more I'll laugh :)
15:54 RabidGravy yeah, it's aiming at rapid application development and continuous integration but somehow missing explaining either of those things
15:54 huf eventually the client just quiets down and goes away
15:54 psch "no bug reports means no bugs, right?"
15:54 MadcapJake RabidGravy: I think there's an element of modularity that the author is trying to describe too
15:54 huf psch: correction. no comprehensible bug report = no bug report
15:55 psch huf: that sounds more like corollary :)
15:56 MadcapJake I could seriously start a tumblr of some of the crazy nonsense people throw around in these "X reasons that X language is the BEST!" articles
15:56 * psch .oO( Perl 6 reasons that Perl 6 language is the BEST )
15:57 MadcapJake lol
15:58 MadcapJake "Almost all of the syntax is very similar to "real-life" words." Oh. My. God. This article is a gold mine.
15:58 huf :D
15:58 huf when i ()()()() this morning i ()() ==
15:59 MadcapJake Ok, I seriously can't handle it. I'm starting a tumblr. Someone else has got to get as much joy out of this as I do.
16:01 RabidGravy :)
16:02 ssotka joined #perl6
16:03 gorgonzola joined #perl6
16:06 skids glfdex: Maybe link to http://docs.perl6.org/type/Nil when explaining :delete?
16:08 lizmat +1 from me
16:09 gfldex it's one sentence to tell the difference between assigning Nil and :delete
16:11 lizmat gfldex: but the only difference *should* be that :delete will make :exists for that element False
16:12 domidumont joined #perl6
16:12 lizmat it's only the iterator on Array that seems wrong (and I'm looking into fixing that)
16:12 azawawi RabidGravy: re GTK using only ::App, ::VBox and ::Button in 01-hello-world.pl6 => ~36 second  (down from ~170 sec) parse time, ~3 second runtime (second time)
16:13 tadzik that's still a crazy parsetime
16:14 azawawi so moving classes/roles out of ::Simple
16:14 azawawi shows a big performance bug in rakudo
16:15 dalek doc: 3d247b7 | (Wenzel P. P. Peppmeyer)++ | doc/Language/subscripts.pod:
16:15 dalek doc: clarify interaction between assignment of Nil and subscripts
16:15 dalek doc: review: https://github.com/perl6/doc/commit/3d247b7cd4
16:16 azawawi i will try switching to moar-nom to verify whether it is fixed or not
16:17 RabidGravy azawawi, all good stuff though
16:17 gfldex lizmat: i'm not sure anymore of iteration of holes is wrong right now. If autoviv for elemets addressed with a subscript returns the default value, a hole in an Array should do so too. They are Arrays not linked lists.
16:19 RabidGravy azawawi, it could probably be shrunk a little by removing all of the unused native subs too
16:20 azawawi RabidGravy: im working on it https://github.com/azawawi/gtk-simple/commits/master :)
16:22 RabidGravy looks good
16:25 araujo_ joined #perl6
16:28 smls_ joined #perl6
16:31 Amnez777 joined #perl6
16:32 huggable joined #perl6
16:38 araujo joined #perl6
16:38 araujo joined #perl6
16:44 kaare_ joined #perl6
16:45 cognominal joined #perl6
16:48 silug joined #perl6
16:54 _4d47 left #perl6
16:57 labster joined #perl6
17:04 cognominal joined #perl6
17:05 kurahaupo joined #perl6
17:05 tharkun joined #perl6
17:06 brrt joined #perl6
17:08 jrusso joined #perl6
17:21 ZoffixW joined #perl6
17:22 ZoffixW RabidGravy, which RPi did you install Perl 6 on? I'm wondering whether it'll work at all with Pi Zero
17:22 azawawi is there any performance advantage to using need or require over use?
17:22 * ZoffixW wants to make his A/C Internet Connected :P
17:23 ZoffixW azawawi, highly doubt it, since you're loading the module at runtime
17:23 RabidGravy ZoffixW, I've got it installed on both a Rev. B and Pi 2, the former is way slow
17:24 azawawi ZoffixW: so we cant use 'require' to lazily load a module anymore, right?
17:25 ZoffixW azawawi, oh, I think that'll work just fine. And yeah, in that case it'll probably be a performance advantage, since you don't have to load the module when you don't need it
17:25 vike joined #perl6
17:26 psch conditional loading isn't quite lazy loading, is it?
17:26 RabidGravy "but" any symbols defined in the module won't be known at compile time, so you may have to jump through hoops
17:26 ZoffixW Then I don't know what lazy loading is :)
17:26 * psch might just be overly picky there
17:27 azawawi so https://github.com/azawawi/gtk-simple/blob/master/lib/GTK/Simple.pm6 is a bad practice
17:27 psch i admit that "lazy loading" as "runtime loading" is probably usually used for what i called "conditional loading" just now
17:27 psch e.g. "when we need it, we load it"
17:27 ugexe lazy loading (like what was attempted at one time) would load the symbols and everything still
17:27 psch ...that doesn't really clarify i think
17:27 psch more like "when we know we are going to use it, we load it explicitly"
17:28 psch whereas lazy loading to me reads more as "we know we will use it eventually, but until we do we don't load it"
17:28 psch which isn't what <use> currently does
17:28 psch mostly because of RabidGravy++'s point above
17:28 Juerd I find 'lazy loading' quite vague as a term. "On-demand loading" is much clearer but I never see that used.
17:28 Juerd Maybe it's just me
17:28 psch Juerd: no, i do agree.  i think that's a good alternative
17:29 psch the distinction of "the language user does it manually" vs "the runtime does it automagically" is what i'd but between on-demand loading and conditional loading
17:29 psch ...that's chiastic btw :)
17:30 * azawawi compares performance with https://github.com/perl6/gtk-simple/tree/before-split
17:30 ugexe i just hide all the hoop jumping inside a (caching) service locator
17:36 pmurias what would be a good way in JavaScript to make a method call on a Scalar be passed on to it's value?
17:38 pmurias a Proxy would work although I read somewhere it has performance issues on v8
17:40 jnthn pmurias: A method call on a Scalar is a call on the Scalar itself; it's that a bunch of ops imply a decont on a certain argument that makes it happen on the underlying value
17:40 jnthn pmurias: So they'd compile into a decont then a method call on the value
17:40 jnthn Or at least, that's how it happens elsewhere :)
17:42 Tonik joined #perl6
17:43 azawawi RabidGravy: Before split => 24s startup, 3s runtime. After split => 2m52s startup, 11s runtime, Optimized => 1m57s startup, 11s runtime for 01-hello-world
17:44 sena_kun joined #perl6
17:45 RabidGravy if nothing else it has increased the amount of i/o involved
17:45 azawawi SSD here
17:48 azawawi https://github.com/perl6/gtk-simple/pull/37
17:49 * azawawi movie night &
17:55 sufrostico joined #perl6
17:59 pmurias jnthn: thanks, got confused and what I planned would have made it impossible to call methods on the container itself
18:00 dalek gtk-simple: 6e69610 | azawawi++ | .travis.yml:
18:00 dalek gtk-simple: Install gtk3 on MacOS X Travis CI
18:00 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/6e69610557
18:00 dalek gtk-simple: e48a477 | azawawi++ | README.md:
18:00 dalek gtk-simple: More documentation in README
18:00 dalek joined #perl6
18:03 sena_kun hi, #perl6. Is it achievable to pass a hash with arguments to a class constructor to create object? Class has many fields and pass them all to bless sub will be ugly, really ugly.
18:03 perlpilot sena_kun: Thingy.new(|%stuff)
18:04 sena_kun perlpilot, thanks!
18:09 pmurias_ joined #perl6
18:11 smls_ sena_kun: Be careful with that though. If the Hash contains Array value, they will not initialize an `@.array` attribute the way you'd expect.
18:12 smls_ The `@.array` attribute will end up with a single element, which is in turn the Array value from the Hash.
18:13 smls_ And unfortunate consequence of the facts that Hashes containerize their arguments, and `bless` uses assignment rather than binding to attributes.
18:13 smls_ *An
18:19 spider-mario joined #perl6
18:23 psch m: class A { has @.a }; say A.new(:a[1,2,3]).perl
18:23 camelia rakudo-moar 1ab1fb: OUTPUT«A.new(a => [1, 2, 3])␤»
18:24 psch m: class A { has @.a }; say A.new(:a[1,2,3]).a.perl
18:24 camelia rakudo-moar 1ab1fb: OUTPUT«[1, 2, 3]␤»
18:24 psch m: class A { has @.a }; say A.new(:a[1,2,3]).a[1].perl
18:24 camelia rakudo-moar 1ab1fb: OUTPUT«2␤»
18:24 psch m: class A { has @.a }; say A.new(my % = a => [1,2,3]).a[1].perl
18:24 camelia rakudo-moar 1ab1fb: OUTPUT«Default constructor for 'A' only takes named arguments␤  in block <unit> at /tmp/Os6iMZ_WlK line 1␤␤»
18:24 psch m: class A { has @.a }; say A.new(|(my % = a => [1,2,3])).a[1].perl
18:24 camelia rakudo-moar 1ab1fb: OUTPUT«Any␤»
18:24 psch smls_++
18:32 psch m: class A { has @.a }; say A.new(|(my % = a => |[1,2,3])).a[1].perl
18:32 camelia rakudo-moar 1ab1fb: OUTPUT«Any␤»
18:32 psch yeah, there's probably no trickery possible there
18:32 psch well, aside from a custom BUILD probably
18:32 psch or new, or whichever vOv
18:35 xue_ joined #perl6
18:35 xue_ left #perl6
18:37 maybekoo2 joined #perl6
18:40 maybekoo2 joined #perl6
18:43 araujo_ joined #perl6
18:45 ugexe i flatten inside a BUILDALL :/
18:53 telex joined #perl6
18:55 labster joined #perl6
18:58 lizmat joined #perl6
19:00 cognominal joined #perl6
19:01 nicqbot joined #perl6
19:09 azawawi RabidGravy: ping
19:09 RabidGravy erp
19:10 azawawi RabidGravy: best optimization so far is 'use GTK::NeededModule' instead of 'GTK::Simple'
19:10 azawawi RabidGravy: 2s when using the modules needed
19:11 RabidGravy yeah, I figure that would
19:16 azawawi builder pattern for the rescue? :)
19:21 AlexDaniel joined #perl6
19:22 cpage_ joined #perl6
19:23 AlexDaniel [Coke]: perhaps you are right and I shouldn't've said that. However, there is a problem that is not going anywhere, what's your solution?
19:25 Cabanossi joined #perl6
19:32 dogbert17 o/ #perl6
19:33 dogbert17 is anyone interested in taking a look at an, admittedly feeble, attempt document the 'default' method in the Hash class?
19:34 dogbert17 it's here https://gist.github.com/dogbert17/206507725af16451cd100033d5df0f91
19:39 nicqbot It seems ok, for the 'Defined' part I would put "... returns Any or initalized value/object". Something like that.
19:40 kent\n joined #perl6
19:40 kent\n joined #perl6
19:41 dogbert17 nicqbot: thx
19:43 Azry_ joined #perl6
19:59 kent\n joined #perl6
20:12 firstdayonthejob joined #perl6
20:13 AlexDaniel m: my %h; %h.default = 42; say %h<abc>
20:13 camelia rakudo-moar 1ab1fb: OUTPUT«Cannot modify an immutable Any␤  in block <unit> at /tmp/m4nXmIulAJ line 1␤␤»
20:17 Emeric1 Are the Data::Dump tests broken ? I can't install it with panda
20:18 _dolmen_ joined #perl6
20:18 Emeric1 Is there a way to avoid erros durings the tests with panda ?
20:21 brrt joined #perl6
20:28 [Coke] AlexDaniel: what's the problem?
20:28 [Coke] Emeric1: there's a force option, IIRC.
20:33 cdg joined #perl6
20:34 nadim joined #perl6
20:34 grondilu just received an email from Jeff Bezos
20:35 grondilu oops sorry wrong chan
20:37 * [Coke] backlogs.
20:38 tbrowder bye
20:38 [Coke] .tell AlexDaniel so, if this happens again, have that person send an email, but be sure to reference that it's happened before (with ticket ids or account names if possible) and point out that it might be a trend.
20:38 yoleaux [Coke]: I'll pass your message to AlexDaniel.
20:38 pochi m: sub foo() returns Array of Int { return 1,2,3 }; foo()
20:38 camelia rakudo-moar 1ab1fb: OUTPUT«Type check failed for return value; expected Array[Int] but got List ($(1, 2, 3))␤  in sub foo at /tmp/61nLnD08VA line 1␤  in block <unit> at /tmp/61nLnD08VA line 1␤␤»
20:39 pochi is it possible to add a return signature for listy things?
20:39 pochi something that catches both return 1,2,3 and return @x
20:42 ugexe m: sub foo(--> Array) { @ = 1,2,3 }; foo() # might work for you
20:42 camelia rakudo-moar 1ab1fb: ( no output )
20:43 pochi I'd like to constrain it to a type though
20:46 ugexe m: my List of Int $list = 1,2,3
20:46 camelia rakudo-moar 1ab1fb: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TgWDraLGuB␤List cannot be parameterized␤at /tmp/TgWDraLGuB:1␤------> 3my List of Int7⏏5 $list = 1,2,3␤»
20:47 ugexe otherwise wrap/multi-dispatch to check the return value and do any neccesary transformation into a single return type
20:55 Xliff roles can't inherit from a base class, correct?
20:56 dalek doc: fda109d | (Jan-Olof Hendig)++ | doc/Type/Hash.pod:
20:56 dalek doc: Added docs for method default in class Hash
20:56 dalek doc: review: https://github.com/perl6/doc/commit/fda109dd95
20:57 ugexe m: class Foo { method x { 1 }; }; role Bar { method xx { $.x; }; }; class Foo2 does Bar { }; say Foo2.new.xx
20:57 camelia rakudo-moar 1ab1fb: OUTPUT«Method 'x' not found for invocant of class 'Foo2'␤  in method xx at /tmp/5sEwBHTCqJ line 1␤  in block <unit> at /tmp/5sEwBHTCqJ line 1␤␤»
20:58 ugexe m: class Foo { method x { 1 }; }; role Bar { method xx { $.x; }; }; class Foo2 is Foo does Bar { }; say Foo2.new.xx
20:58 camelia rakudo-moar 1ab1fb: OUTPUT«1␤»
20:59 Xliff ugexe: Hrm. I might need to go into the long explanation, here. However, this is still half baked stuff.
21:00 Xliff Maybe later. I need to give this more thought.
21:01 ugexe for the most part a role body is simply pasted into the class body
21:04 Xliff Right. OK. I have a class A::Base, A::A and A::B. A::A and A::B are functionally unrelated, but both inherit from A::Base
21:04 Xliff However A::B is more complex than A::A and has several "sections" I want to split into roles.
21:04 Xliff However the roles still need methods from A::Base.
21:04 Xliff What's the best way to handle that? Role parameterization?
21:08 ugexe because A::B is A::Base you should just be able to compose the roles into A::B as expected. you may ask yourself why you want to compose the parts into A::B at all if they aren't otherwise reusable or if A::B will always use the same parts
21:08 AlexDaniel [Coke]: I think that it's not just a trend, but any new account has this problem
21:08 yoleaux 20:38Z <[Coke]> AlexDaniel: so, if this happens again, have that person send an email, but be sure to reference that it's happened before (with ticket ids or account names if possible) and point out that it might be a trend.
21:08 AlexDaniel [Coke]: I'll create a new account to prove that…
21:08 Xliff ugexe, A::B will always use the same parts, but I'm hoping I don't have to maintain a large, monolithic file for A::B.
21:09 Xliff And I get the reusable part. However if I have to put all of the A::B methods into a single file, it will get really large.
21:09 araujo_ joined #perl6
21:10 Xliff I was hoping to split it into related, manegable chunks.
21:10 ugexe im not sure splitting a single functional class into multiple files helps with maintenance. it certainly makes grepping the code path more dificult
21:10 Xliff You have a point, there.
21:10 ugexe but if you want to it should work the way i think you want it to
21:10 Xliff OK. Another way, then.
21:12 Xliff If I split A::B into different classes. A::B::A … A::B::<n>, can I still have a class A::B that wraps the A::B::x classes in an a-la-carte manner? Kinda like the perl5 "use Module qw(<list>)"
21:12 ugexe the managable chunks are typically subroutines/methods themselves
21:13 AlexDaniel [Coke]: created a new account, problem not reproduced :/
21:13 ugexe im not sure i follow. you can `class Foo is Foo::A is Foo::B { }`
21:13 AlexDaniel [Coke]: dunno then… alright, sorry for your time
21:13 ugexe you can also `does Foo::A does Foo::B`
21:14 Xliff Right.
21:15 Xliff However I'm trying to see if I can do A::B without having it pull in all of the classes in the A::B::* space. Just the ones I need to use for a particular purpose.
21:15 Xliff I'm probably mixing metaphors.
21:15 ugexe https://github.com/ugexe/Perl6-Grammar--HTTP/blob/master/lib/Grammar/HTTP.pm6#L14 # this is split up into parts with roles, but i can also attest its hard to follow the code path around
21:17 ugexe you are talking about dependency injection/inversion type stuff
21:17 Xliff OK, thanks. I think I at least have something to start from.
21:17 Xliff ugexe, I guess. Yeah.
21:17 ugexe you'd need to use a service locator pattern type deal to call .^add_role(whatever)
21:17 Xliff Is there .^add_class()?
21:18 ugexe ^add_parent maybe
21:20 Xliff That works. Thanks!
21:30 Zoffix joined #perl6
21:31 Zoffix Worth mentioning in the Weekly (cc lizmat). Damian Conway will be doing two days of Perl 6 talks at Toronto Perl Mongers on June 27 and June 28: https://www.meetup.com/Toronto-Perl-Mongers/events/231418224/ https://www.meetup.com/Toronto-Perl-Mongers/events/231418278/
21:32 |2701 joined #perl6
21:34 Xliff next question: How do you pass parameters to superclass constructor?
21:36 Xliff YAY! https://perl6advent.wordpress.com/2010/12/14/day-14-nextsame-and-its-cousins/
21:40 drforr1 joined #perl6
21:40 retup__ joined #perl6
21:40 dylanwh_ joined #perl6
21:43 edenc joined #perl6
21:46 ggoebel115 joined #perl6
21:49 Zoffix left #perl6
21:50 matiaslina joined #perl6
22:01 lizmat .tell Zoffix noted
22:01 yoleaux lizmat: I'll pass your message to Zoffix.
22:08 Sgeo joined #perl6
22:10 zzzzzzzzz joined #perl6
22:18 Xliff ARGH!
22:18 Xliff No https support for HTTP::Client, yet.
22:24 kid51 joined #perl6
22:40 zzzzzzzzz joined #perl6
22:43 AlexDaniel Xliff: do you want to just download some page?
22:46 AlexDaniel Xliff: perhaps try HTTP::UserAgent
22:47 Xliff AlexDaniel++
22:47 Xliff Thanks!
22:48 AlexDaniel Xliff: I've also mentioned LWP::Simple here: https://github.com/supernovus/perl6-http-client/issues/11
22:48 AlexDaniel Xliff: but I don't think that I ever used it. I think HTTP::UserAgent always worked for me
22:58 Xliff Thanks. I was using HTTP::Client, before.
22:59 sortiz joined #perl6
23:10 cpage_ joined #perl6
23:22 gudahtt joined #perl6
23:23 gudahtt left #perl6
23:24 dalek DBIish: 2bacdf9 | (Salvador Ortiz)++ | t/36-pg-native.t:
23:24 dalek DBIish: Keep a column-info example
23:24 dalek DBIish: review: https://github.com/perl6/DBIish/commit/2bacdf9458
23:24 dalek DBIish: 2d273a2 | (Salvador Ortiz)++ | / (3 files):
23:24 dalek DBIish: mysql: Fix old typo in $dbh.quote-identifier
23:24 dalek DBIish:
23:24 dalek DBIish: kuerbis++ for spot that.
23:24 dalek DBIish: Anyway the Connection role implementation is not robust enough,
23:24 dalek DBIish: so add a native supported .quote(:$as-id) following the Pg approach.
23:24 dalek DBIish: Closes #66
23:24 dalek DBIish: review: https://github.com/perl6/DBIish/commit/2d273a2b87
23:24 dalek DBIish: cf198ad | (Salvador Ortiz)++ | / (2 files):
23:24 dalek DBIish: For panda's/zef's users, now v0.5.8
23:24 dalek DBIish: review: https://github.com/perl6/DBIish/commit/cf198ad86a
23:28 kurahaupo joined #perl6
23:37 kalkin- joined #perl6
23:37 kalkin- hi
23:37 kalkin- is there some clever way to detect if a string consists of only unique characters?
23:41 kalkin- m: "CasdfghjkC234" ~~ /.*(.).*$0.*/
23:41 camelia rakudo-moar 1ab1fb: ( no output )
23:41 geekosaur you probably want to prefix that with `say so`
23:42 kalkin- m:say so "CasdfghjkC234" ~~ /.*(.).*$0.*/
23:42 geekosaur m: say so "CasdfghjkC234" ~~ /.*(.).*$0.*/
23:42 AlexDaniel space
23:42 camelia rakudo-moar 1ab1fb: OUTPUT«True␤»
23:42 kalkin- Ahh thanks
23:43 kalkin- so regex is probably the shortest solution for that
23:43 AlexDaniel I don't think so
23:43 sortiz kalkin-, that fails, 'C' isn't unique.
23:44 kalkin- m: say so  "CasdfghjkC234" !~~  /.*(.).*$0.*/
23:44 camelia rakudo-moar 1ab1fb: OUTPUT«False␤»
23:45 kalkin- m: say so  "Casdfghjkc234" !~~  /.*(.).*$0.*/
23:45 camelia rakudo-moar 1ab1fb: OUTPUT«True␤»
23:45 raydiak the leading and trailing .* is unnecessary
23:46 AlexDaniel m: say so ‘abcde’.comb.Bag.values.all == 1
23:46 camelia rakudo-moar 1ab1fb: OUTPUT«True␤»
23:46 AlexDaniel m: say so ‘abcdce’.comb.Bag.values.all == 1
23:46 camelia rakudo-moar 1ab1fb: OUTPUT«False␤»
23:46 AlexDaniel that's it
23:46 kalkin- m: say so  "Casdfghjkc234" !~~  /(.).*$0/
23:46 camelia rakudo-moar 1ab1fb: OUTPUT«True␤»
23:47 kalkin- raydiak: Thanks
23:47 raydiak you're welcome :)
23:47 * kalkin- is going to read the docs to understand what happens in AlexDaniel example
23:47 kalkin- Of course thanks to all :)
23:48 TEttinger joined #perl6
23:49 AlexDaniel it also depends on how efficient you want it to be
23:49 AlexDaniel and whether you are dealing with long strings or not
23:50 kalkin- AlexDaniel: the normal use case should be < 100 chars
23:50 AlexDaniel … and I have a feeling that regex solution is much slower than any other

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo