»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:06 raschipi joined 00:25 Actualeyes left 00:35 markong left
ingy I'm setting up travis for a multilang project and using perl6 as an addon, but it doesn't install zef 00:45
I see this works: github.com/perl6-community-modules...travis.yml
but mine fails: github.com/testml-lang/testml/blob...is.yml#L12
timotimo not sure what the perl6 apt package gets you on those ubuntu versions the yhave 00:46
ingy sudo: zef: command not found travis-ci.org/testml-lang/testml/b.../382958845
timotimo potentially a version far too old to run zef
ingy right, so open to suggestions :) 00:47
raschipi You need to manually install it. Those comands in the first one aren't using zef, they are installing it.
timotimo Get:21 us-central1.gce.archive.ubuntu.com/ubuntu trusty/universe amd64 rakudo amd64 2013.12-1 [2,448 kB]
yeah, no.
huggable: deb
huggable timotimo, Alpine, CentOS, Debian, Fedora, OpenSUSE and Ubuntu Rakudo packages: github.com/nxadm/rakudo-pkg#rakudo-pkg
timotimo ingy: there's an apt repository there
ingy ok
00:50 lain0n joined
ingy timotimo: is that supposed to install perl6 and zef bins? 00:53
zef still not found
timotimo there's more info about that topic in the readme of that repository
there's a command you need to run
00:54 HaraldJoerg left, lain0n left
ingy I see 00:55
00:57 stmuk_ joined 00:59 stmuk left
ingy there's a travis section: github.com/nxadm/rakudo-pkg#using-...-on-travis 01:01
hopefully that just works, testing now
01:04 raschipi left 01:08 kurahaupo_ joined
ingy it's not 01:12
01:12 enheh left
ingy trying one more thing 01:12
01:12 enheh joined, kurahaupo left
timotimo looks like ou forgot the important part 01:13
oh, huh?
01:13 wamba left
ingy what's that? 01:13
timotimo no, that should really have been everything
i misremembered the install-zef-as-user shell script
ingy do I need that? 01:14
timotimo no
of course
sudo won't take the PATH from your environment
so it won't find zef when you sudo it
however, it tells you to "zef install" rather than "sudo zef install" in the rakudo-pkg readme 01:15
it'd surely be good to have an explicit mention of that there
in the readme of rakudo-pkg i mean
until then, just leave out the sudo for zef and perl6 invocations and i think that should make things work
ingy aye
timotimo well, that looks better 01:19
ingy one error at a time! 01:20
timotimo rome wasn't continuously integrated from day one 01:21
ingy that's how we'll fix the world!
01:22 aindilis joined
ingy timotimo: since the testml-compiler is JS and JS is one of the runtime langs I made this interactive demo site testml-lang.github.io/testml/?type...p;view=tap 01:23
it has all the testml and testml-compiler and yaml-test-suite tests built-in
and totally interactive 01:24
and the location url permalinks any state you choose 01:25
01:25 mcmillhj joined
timotimo i don't know coffeescript :) 01:25
other than that it looks neat 01:26
ingy coffeescript is the most straightforward syntax of any lang I have come in contact with
it just js minus a ton of syntax :) 01:27
testml-lang.github.io/testml/?type...view=mocha is pretty cool
01:27 MasterDuke joined
ingy I had to make the compiler API take an Import callback to do imports in the brower 01:29
p6 tests all work except haven't seen this before: travis-ci.org/testml-lang/testml/b...69421#L787 01:30
don't get that locally :\ 01:31
timotimo m: sub it-fails { fail "oh no" }; my $a = it-fails; use nqp; for ^100 { nqp::force_gc } 01:33
camelia ( no output )
timotimo er, of course
m: sub it-fails { fail "oh no" }; my $a = it-fails; $a = Nil; use nqp; for ^100 { nqp::force_gc }
camelia ( no output )
timotimo ...
not helpful
oh, i really need to go, sorry; that looks like it comes from the periphery of run-time loading of modules 01:34
ingy thanks for your help! 01:35
01:47 ilbot3 left 01:50 notostraca is now known as TEttinger 01:57 ilbot3 joined, ChanServ sets mode: +v ilbot3 01:58 Qwerasd joined 01:59 mcmillhj left
ingy timotimo: ironically I didn't get those p6 warns on a subsequent run 02:00
P6 CAN HAZ GHOZTZ!!! 02:01
02:03 Qwerasd left 02:05 comborico1611 left 02:32 Qwerasd_ joined 02:43 ChoHag left 02:50 pilne left 02:53 aborazmeh joined, aborazmeh left, aborazmeh joined 02:58 ChoHag joined 03:24 kurahaupo_ is now known as kurahaupo 03:26 Qwerasd_ left
ingy does perl6 look for Foo.pm6 before Foo.pm? 03:29
03:29 ChoHag left
MasterDuke looks like yeah 03:31
03:32 molaf joined
MasterDuke github.com/rakudo/rakudo/blob/mast...tem.pm6#L9 and github.com/rakudo/rakudo/blob/mast...m6#L45-L49 03:33
ktown raschipi: github.com/ktown007/perl6-terminal-asciisketch 03:36
ingy MasterDuke: thx 03:38
MasterDuke np 03:39
03:51 xtreak joined 03:53 mcmillhj joined
ingy timotimo: got it all working: travis-ci.org/testml-lang/testml/b.../383004625 (Passing 5 languages including perl6) 03:53
03:55 Qwerasd joined 04:00 MasterDuke left 04:01 eliasr left 04:05 n0tjack joined 04:08 Qwerasd_ joined, Qwerasd_ left 04:09 Qwerasd_ joined 04:12 Qwerasd left, Qwerasd_ left, Qwerasd joined
Qwerasd How do I add a catch for errors in a thread so I can get a stacktrace? 04:26
04:26 psychoslave joined
Qwerasd An error is occurring but all it says is "No exception handler located for catch" and then a stacktrace that points to a bunch of internals 04:26
04:30 mcmillhj left
ktown Qwerasd: try --ll-exception 04:34
Qwerasd I wrapped it in a try/catch and found the error.
04:36 n0tjack left 04:37 aborazmeh left 04:40 curan joined 04:41 molaf left 04:45 Actualeyes joined 05:05 jmerelo joined 05:06 n0tjack joined 05:08 Qwerasd left 05:10 sauvin joined 05:15 Qwerasd joined
Geth doc: 8cd8ed0dfc | (JJ Merelo)++ | doc/Language/5to6-nutshell.pod6
Finish rewriting of ref/deref section closes #1081
synopsebot Link: doc.perl6.org/language/5to6-nutshell
05:20 sno left 05:21 xtreak left 05:24 xtreak joined, shareable6 left
Geth doc: 8a90a8f9ed | (JJ Merelo)++ | doc/Language/operators.pod6
Reviews relationship between ~~ and ACCEPTS.

Right now there is only a short definition in the first, and a pointer to the last. It's nice to have the docs for ~~, since it's a single point of entry; `ACCEPTS` page is generated from many pages. So I would say it's better to close #1913, since it's not indexed and looks like a sufficiently good reference.
synopsebot Link: doc.perl6.org/language/operators
05:39 skids left
Geth doc: a82a2d89f3 | (JJ Merelo)++ | assets/sass/style.scss
Makes no-toc body wider closes #2000
05:50 Qwerasd left 05:52 n0tjack left 05:53 psychoslave left 05:57 wamba joined 06:07 john_parr left 06:20 ChoHag joined, shareable6 joined
Geth doc: JJ self-unassigned Roadmap for our language/ docs github.com/perl6/doc/issues/114
JJ self-assigned Roadmap for our language/ docs github.com/perl6/doc/issues/114

Adds data structures
jmerelo That was done only to draw your attention towards The 1000 Days Old Issue.
06:30 sno joined 06:32 darutoko joined
doc: 001cbdd9ad | (JJ Merelo)++ | doc/Language/structures.pod6
Laying out the general structure
synopsebot Link: doc.perl6.org/language/structures
doc: a553b88e95 | (JJ Merelo)++ | doc/Language/structures.pod6
Inserts TBD
06:42 wamba left
Geth doc: 1def611870 | (JJ Merelo)++ | doc/Language/iterating.pod6
Creates the iterating language page
doc: bba739df25 | (JJ Merelo)++ | doc/Language/iterating.pod6
Refines general structure

This (and the previous commits) refer to #114. This one takes a hint from perl6advent.wordpress.com/2009/12/...nd-profit/
synopsebot Link: doc.perl6.org/language/iterating
06:51 robertle_ joined 06:52 shareable6 left 06:57 domidumont joined 07:01 psychoslave joined 07:03 domidumont left, dominix joined 07:04 domidumont joined 07:13 domidumont left 07:26 john_parr joined
dominix do domeone know of a permutation method of a list ? 07:28
something inspired by docstore.mik.ua/orelly/perl4/cook/ch04_21.htm
lookatme m: (1, 2, 3).permutation.say 07:29
camelia No such method 'permutation' for invocant of type 'List'. Did you mean 'permutations'?
in block <unit> at <tmp> line 1
lookatme m: (1, 2, 3).permutations.say
camelia ((1 2 3) (1 3 2) (2 1 3) (2 3 1) (3 1 2) (3 2 1))
lookatme dominix, permutation is a built-in method
dominix nice, thanks, I am amazed everytime I look at this langage 07:31
lookatme welcome :) 07:32
07:32 wamba joined
jmerelo On overriding method calls and creating your very own NYI exception stackoverflow.com/questions/505035...-resolutio 07:34
lookatme dominix, anyway, if you can, implement that permutation algorithm in Perl 6 is a good practice 07:35
07:41 ChoHag_ joined, ChoHag left
lizmat jmerelo: answered :-) 07:44
yoleaux 23 May 2018 12:56Z <brrt> lizmat: can you do a bechmark with moarvm branch 'jit-stack-walker'
07:44 xtreak left 07:46 araujo left 07:47 xtreak joined
jmerelo lizmat: you're amazing. Thanks! 07:47
07:47 xtreak left 07:48 shareable6 joined, ChanServ sets mode: +v shareable6, HaraldJoerg joined
Geth doc: b7245599c3 | (JJ Merelo)++ | doc/Language/nativetypes.pod6
Creates native types page refs #114
doc: 74a0051dd2 | (JJ Merelo)++ | 2 files
Drafts general structure of nativetypes page

And improves a bit the other data structures page. Refs #114, but also #2051
synopsebot Link: doc.perl6.org/language/nativetypes
doc: 8e6753b138 | (JJ Merelo)++ | doc/Type/X/NYI.pod6
Documents X::NYI constructor and methods

Closes #2052
synopsebot Link: doc.perl6.org/type/X::NYI
doc: 79fb35e76e | (JJ Merelo)++ | assets/sass/style.scss
Disables max-width for no-toc pages closes #2000
08:06 shareable6 left 08:08 scimon joined 08:28 domidumont joined
Geth doc: cce30bc145 | (JJ Merelo)++ | doc/Language/hashmap.pod6
Creates hashmap page refs #114

Also refs #1682, which will be the fallback issue when #114 is closed.
synopsebot Link: doc.perl6.org/language/hashmap
Geth doc: 07bd8264bb | (JJ Merelo)++ | doc/Language/system.pod6
Stub for system page

that could be very helpful. Refs #114
synopsebot Link: doc.perl6.org/language/system
doc: 4f146f5d50 | (JJ Merelo)++ | assets/sass/style.scss
Not so !important, closes #2000
doc: a88d50da61 | (JJ Merelo)++ | doc/Language/math.pod6
Creates last of the pages for #114, on math

Now let's do what needs TBD
synopsebot Link: doc.perl6.org/language/math
08:37 xtreak joined 08:41 HaraldJoerg left
jmerelo briandfoy wants us to update the answer to this question in SO stackoverflow.com/questions/266642...-of-perl-6 08:46
I would do it, but I still have to unlock the "Answer something without being voted down by briandfoy" badge. :-) 08:47
08:48 eliasr joined
donpdonp first comment: read planet6! curl: (6) Could not resolve host: planetsix.perlfoundation.org. doh! 08:48
08:59 dominix left, rindolf joined
jmerelo donpdonp: you can probably edit the answers too... 09:01
donpdonp: although I wonder if the best course of action would not be to just close it and make a 2018 edition of same...
09:02 shareable6 joined, ChanServ sets mode: +v shareable6 09:06 enheh_ joined, enheh left, dpk left, camelia left 09:07 cpage_ joined, bartolin left, Bucciarati left, S007 left 09:08 nine left, avar left, obfusk left, yoleaux left, xiaomiao left, esh left 09:09 cpage left, cpage_ is now known as cpage 09:10 w_richard_w left 09:13 xiaomiao joined, dpk joined 09:14 grumble left 09:15 Grauwolf joined 09:16 bartolin joined, obfusk joined 09:17 domm joined, S007 joined 09:23 Zoffix joined
Zoffix m: sub it-fails { my $z = Failure.new; Nil }; use nqp; for ^100 { it-fails; }; nqp::force_gc; sleep 1 09:23
evalable6 WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was:
in block <unit> at /tmp/266xO6t_wU line 1
Zoffix ingy: ^ normally you get those when an unhandled Failure object gets GCed ('cause often that's an indication your program ignores some failure mode accidentally). Though in your case it looks like it might be R#1515 09:25
synopsebot R#1515 [open]: github.com/rakudo/rakudo/issues/1515 Erroneous unhandled failures for runtime module loading
Zoffix Qwerasd, you don't need to wrap into `try` and can just stick a CATCH { default { .... } } at the outer most scope of a threaded block 09:26
Summertime pardon me for saying, but thanks for making? the perl6 alerts site btw, its something that every language should have 09:27
Zoffix Thanks. Glad someone finds it useful.
09:30 esh joined, torbjorn left 09:35 literal joined 09:36 avar joined, avar left, avar joined 09:41 grumble joined
AlexDaniel Summertime: speaking of which, do you expect alerts to posted before the release or after? For example, 2018.05 will come with this change: 09:44
m: say %<a 1 b 2 c 3>.keys
evalable6 Use of Nil in string context
in block <unit> at /tmp/8NHUWY7um5 line 1
Use of Nil in string context
in block <unit> at /tmp/8NHUWY7um5 line 1
Use of Nil in string context
in block <unit> at /tmp/8NHUWY7um5 line 1
AlexDaniel m: say (%<a 1 b 2 c 3>).keys
evalable6 Use of Nil in string context
in block <unit> at /tmp/qcnRS3Mp5H line 1
Use of Nil in string context
in block <unit> at /tmp/qcnRS3Mp5H line 1
Use of Nil in string context
in block <unit> at /tmp/qcnRS3Mp5H line 1
AlexDaniel gah…
not that
Summertime :thinking:
I think, don't make a promise 09:45
AlexDaniel m: say %(<a 1 b 2 c 3>).keys
evalable6 (b a c)
AlexDaniel m: say %(<a 1 b 2 c 3>).keys
evalable6 (c a b)
AlexDaniel ↑ this is now random
the order I mean
09:45 wamba left
AlexDaniel IMO that's alert-worthy, just to make it easier for people 09:45
Summertime there are some things which are going to be obvious to alert about, some things are going to be someone coming in with their project on fire (because why not run latest without testing!) and you'll go "oh that should of been alerted too" 09:46
AlexDaniel if I post the alert now, it's somewhat useless as you'd need to build blead rakudo to test it out…
if I post after the release, then someone can say that we could've alerted earlier, so why didn't we
Summertime but an alert now will also act as an appetizer! 09:47
it seems silly to wait for news to go through all the blogs like hash randomizing has done now, and then have an alert pop up, so I'd say as soon as you think of it would be best 09:48
09:48 broquaint joined, Bucciarati joined
Summertime as long as its searchable by version affected, it shouldn't be a problem, updating a project -> go to alerts -> search for $upgrading-from <= $alert-version <= $upgrading-to, would probably be the most common use 09:51
hmm, the alerts api documentation page seems to be outputting blank though, might be my browser though 09:56
AlexDaniel Summertime: I don't think it's documentation 09:59
but: alerts.perl6.org/api/v1/all
Summertime hmm, I wonder how much of a pain it would be to hook that up with twilio or something 10:02
10:04 grumblr joined 10:11 markong joined
Zoffix looks like documentation page gives a 500 10:12
Type check failed in binding to parameter '$raw'; expected Str but got WhateverCode ({ ... }) 10:13
in sub escape-html at /home/p6lert/rakudo/install/share/perl6/site/sources/3925AABD73F7CAF1F00A31AD4FD3D188A496C03E (HTML::Escape) line 4
10:14 grumble left, grumblr is now known as grumble
Zoffix ah, it's from the time when I messed up currying 10:16
*upgrades rakudo for p6lert service*
c: 2018.03 sub foo (Str $x){ dd $x }; (*.[0].Str.&foo)([42])
committable6 Zoffix, ¦2018.03: «Type check failed in binding to parameter '$x'; expected Str but got WhateverCode ({ ... })␤ in sub foo at /tmp/9IRR65HhZv line 1␤ in block <unit> at /tmp/9IRR65HhZv line 1␤␤ «exit code = 1»»
10:18 p6lert left 10:21 nine joined 10:22 camelia joined 10:24 ChanServ sets mode: +v camelia 10:28 p6lert joined
Zoffix p6lert: help 10:32
p6lert Zoffix, github.com/perl6/alerts P6lert commands: [insta]?add ALERT, update ID ALERT, delete ID; ALERT format: ['severity:'\S+]? ['affects:['<-[\]]>+']']? ALERT_TEXT
Zoffix Summertime: it's working now: alerts.perl6.org/api
Summertime \o/
lizmat afk for a few hours&
Zoffix Summertime: as for hooking up stuff... Well, the code's here: github.com/perl6/alerts 10:33
10:34 zakharyas joined 10:37 Zoffix left
jmerelo Another question in SO, about declaration and assignment of variables stackoverflow.com/questions/505076...ned-values 11:02
I've been doing several tests on the #whateverable channel about this, just in case you wan to check them out. 11:03
11:04 yoleaux joined, ChanServ sets mode: +v yoleaux 11:06 Actualeyes left
Geth doc: 29f856f7d4 | (JJ Merelo)++ | doc/Language/math.pod6
Adds set algebra laws
doc: 717f9bda19 | (JJ Merelo)++ | 2 files
Adds set algebra to the Math page

Which might or might not be what someone 1000 days ago had in mind, but it's at least what I would like to find if I go looking for math stuff in Perl 6. This refs #114, but still a lot TBD.
synopsebot Link: doc.perl6.org/language/math
11:18 domidumont left 11:20 raynold left, domidumont joined 11:24 wamba joined 11:26 ChoHag_ left, ChoHag joined 11:38 itaipu joined 11:42 wamba left 11:44 n0tjack joined 12:01 mahafyi joined 12:12 raschipi joined, lalitmee joined 12:14 xtreak left 12:18 stmuk joined 12:19 raschipi left, domidumont1 joined 12:20 n0tjack left, stmuk_ left 12:22 domidumont left 12:24 wamba joined 12:28 jferrero joined 12:29 raschipi joined 12:34 scimon left, scimon joined
Geth doc: 4be7e50cb0 | (Luca Ferrari)++ | doc/Type/Junction.pod6
Introduce junction infix ~ example.

See issue #2053
synopsebot Link: doc.perl6.org/type/Junction
12:41 shareable6 left 12:43 domidumont joined 12:44 enheh_ left 12:45 enheh_ joined, domidumont1 left 12:46 scimon left, scimon joined, robertle left 12:49 torbjorn joined 12:53 robertle joined 12:54 pmurias joined 12:57 scimon left 13:01 HaraldJoerg joined 13:05 MilkmanDan left, athenot joined 13:06 MilkmanDan joined 13:10 lizmat left 13:12 enheh__ joined 13:13 jmerelo left 13:14 enheh_ left 13:15 Actualeyes joined
mahafyi Hello. I am trying to do this -> pastebin.com/VN2wviF8 with File::Find. Can someone tell what eagerly vs lazily create list means please? 13:24
moritz mahafyi: a lazy list is one that is created as you consume it
13:24 Actualeyes left
moritz mahafyi: and an eager list is one that is created fully even before you start to use it 13:25
13:25 lizmat joined
mahafyi moritz : thanks. 13:25
13:31 skids joined 13:33 itaipu_ joined 13:35 lucasb joined 13:36 lalitmee left, shareable6 joined, molaf joined 13:37 itaipu left, curan left 13:38 skids left
mahafyi i simply cannot understand lazy list, lol. Can't get how it works at all..anyways, what i am looking at first is: (see earlier pastebin) if i need to use multiple regexes in the File::Find arg 'name', is it possible at all 13:39
raschipi mahafyi: Can't it be a regex with an alternation? 13:41
mahafyi i guess in this specific case, i can think like this: can we ouse an OR condition in regex (probably, it is not the correct way to epxress the question)
raschipi, thanks, i guess i have the term to google for now, lol
raschipi alternation means OR
Just another way to say what you said right after me. 13:42
Can't you use multiple File::Find instances?
13:42 itaipu_ left 13:43 itaipu joined
mahafyi yes, thats what i have in a pseudocode now, run it twice one after another 13:43
raschipi Then put the two lists togheter. 13:44
mahafyi it may not be needed, i just need to concatenate all the files in each list into two separate files, one for each list
each file will have headers, what is the equivalent of sed, in order to do -> (I need to delete the header lines - along with the carriage return) 13:46
raschipi You could also try to give it a junction, something like (/regex1/, /regex2/).any
or /regex1/|/regex2/ 13:47
mahafyi in which case, i will need to recurse the list elements with a IF condition i guess 13:48
there is such a tremendous knowledge base inside any one thing! its very dense, if that is the correct word. I guess one can eventually reach a point when the thing needed will come like a reflex. but now its reading 90% working 10% lol. 13:54
timotimo i'd rather read a thousand lines of documentation and write one line of code than reading just one line of documentation and have to write a thousand lines of code for the same result :D
mahafyi sure, i cannot remember which , i will find it, i wrote some several dozen lines for a rosetta code problem, and find a one liner in answer, 13:57
timotimo yeah, especially when it comes to not having to write out loops, perl6 is very strong
not as strong as languages like APL or J, though
13:57 MilkmanDan left
mahafyi good to know. I have never heard of APL or J until now... 13:58
13:59 MilkmanDan joined 14:07 eater left
benjikun J is a weird language 14:11
I looked at it years ago
interesting for sure 14:12
Pretty crazy with what you can do with one line of J 14:13
raschipi very terse, moreso than APL, despite using multiple symbols 14:16
benjikun terse? 14:20
moritz compact 14:21
short programs
14:22 rindolf left, eater joined
benjikun ah 14:22
14:26 itaipu_ joined 14:28 stmuk_ joined 14:29 stmuk left, itaipu left 14:31 domidumont1 joined 14:34 domidumont left 14:35 lucasb left 14:37 domidumont1 left 14:39 domidumont joined 14:44 rindolf joined
mahafyi what do i do for: find and delete all lines that matches a regex, but ignore the first. do i need to recurse the whole file or is there a better way to do ? the file may be over a million lines. 14:47
raschipi Are you doing it with a loop? 14:48
14:48 lucasb joined
mahafyi i havent yet written ? i am planning what to write before i write. Lets say two csv files with headers are concatanated, i need to delete the header lines after. 14:49
raschipi m: for ^10 {once next; .say}
camelia 1
mahafyi so , i can go thru in a looop, line by line, or i can do something like, what i'd do with sed from command line.
raschipi either are possible 14:50
timotimo don't forget you'll likely have to output the first line back so it doesn't disappear
mahafyi timotimo, right, delete all the headers, except the first..
raschipi m: (^10).tail(*-1).say 14:51
camelia (1 2 3 4 5 6 7 8 9)
raschipi tail(*-1) skips the first item in a list.
mahafyi which means each line in the file has to be in a list? 14:52
timotimo m: <foo bor baz quux boot shoot bleep>.grep({ not $++ or /o/ }).say
camelia (foo bor boot shoot)
timotimo m: <foo bor baz quux boot shoot bleep>.grep({ not $++ or /<-[o]>/ }).say
camelia (foo bor baz quux boot shoot bleep)
timotimo hold on ..
m: <foo bor baz quux boot shoot bleep>.grep({ not $++ or m/<-[o]>/ }).say
camelia (foo bor baz quux boot shoot bleep)
timotimo m: <foo bor baz quux boot shoot bleep>.grep({ (not $++) || m/<-[o]>/ }).say
camelia (foo bor baz quux boot shoot bleep)
timotimo ah, of course
m: <foo bor baz quux boot shoot bleep>.grep({ (not $++) || !m/o/ }).say 14:53
camelia (foo baz quux bleep)
timotimo ^- remove all entries that have an o in them, except the very first
demorgan's law lets you make it less strange 14:54
mahafyi timotimo : ok great.
timotimo m: <foo bor baz quux boot shoot bleep>.grep({ not ($++ && m/o/) }).say
camelia (foo baz quux bleep)
timotimo but you'll probably want map, not grep
i.e. do changes to lines, not just throw lines out
m: <foo bor baz quux boot shoot bleep>.map({ $++ ?? S/o/AAAAA/ !! $_ }).say 14:55
camelia (foo bAAAAAr baz quux bAAAAAot shAAAAAot bleep)
timotimo replace the first o with AAAAA except if it's the very first line
well, entry, not line. you'll have to do line-splitting yourself
raschipi .lines isn't enough? 14:56
timotimo it is enough
i just meant my code doesn't do anything regarding lines 14:57
it relies on the list that comes in to already be whatever you need
raschipi right
mahafyi wow, ok let me go thru this
timotimo $++ is just a cute little trick for "false one time, then true every other itme"
or you can split the list up front into "first element" and "all other elements" and only .map on the "all other elements" list 14:59
but that's probably also awkward
15:00 enheh__ left
mahafyi I suppose we can use sed from inside a program? 15:00
15:00 enheh__ joined
timotimo you can if you want to 15:01
lucasb m: for \(1,2,3,:a,:b).item { .say } # why? 15:02
camelia 1
tbrowder_ question: why are backticks used in markdown and other text files? are they re 15:04
lucasb it's code markup 15:05
tbrowder_ are they treated differently than single right quotes? 15:06
timotimo yes, they are
tbrowder_ what is their effect in, say, markdown?
i understand the effect in shell... 15:07
timotimo markdown turns `foo` into <code>foo</code> or something like that 15:08
tbrowder_ treatment in pod 6, perl 6?
raschipi in markdow it renders the text in monospace font and also keeps spaces intact (markdown usually supresses multiple spcaes)
tbrowder_ ah, right, i forgot, thinking of three backticks for a code block
15:09 zakharyas left
timotimo m: say `foo bar` 15:09
camelia 5===SORRY!5===
Argument to "say" seems to be malformed
at <tmp>:1
------> 3say7⏏5 `foo bar`
Bogus postfix
at <tmp>:1
------> 3say 7⏏5`foo bar`
expecting any of:
infix stopper
15:10 skids joined
timotimo perl6 doesn't let you use ` as quoting without q 15:10
tbrowder_ ok, keeping multiple spaces in md
timotimo m: q`backticks are cool`
camelia WARNINGS for <tmp>:
Useless use of constant string "backticks are cool" in sink context (line 1)
timotimo m: say q`backticks are cool`
camelia backticks are cool
timotimo m: say "foo bar" ~~ s:g`o`i`
camelia Cannot modify an immutable Str (foo bar)
in block <unit> at <tmp> line 1
timotimo m: say "foo bar" ~~ S:g`o`i`
camelia Potential difficulties:
Smartmatch with S/// is not useful. You can use given instead: S/// given $foo
at <tmp>:1
------> 3say "foo bar" ~~ 7⏏5S:g`o`i`
timotimo i'm no good at example code today
m: $_ = "foo bar"; s:g`o`i`; .say 15:11
camelia fii bar
tbrowder_ they may be cool, but: xtra typing and backticks are hard to use on typical apple virutual keyboards
s/virutual/virtual/ 15:12
timotimo: thnx 15:13
raschipi: thnx 15:14
15:20 domidumont left, wamba left
raschipi lucasb: why did you add an .item there? 15:23
m: .say for \(1,2,3,:a,:b) 15:24
camelia 1
timotimo m: .say for $(\(1,2,3,:a,:b)) 15:25
camelia 1
timotimo m: .say for (my $ = \(1,2,3,:a,:b))
camelia \(1, 2, 3, :a, :b)
lucasb to show that even with a .item it gets iterated over, while (1,2,3).item and [1,2,3].item doesn't
raschipi m: .say for $(1,2,3) 15:26
camelia (1 2 3)
raschipi I see. It is indeed strange.
lucasb raschipi: thanks for agreeing :)
raschipi m: .say for $(\(1,2,3))
camelia 1
15:27 robertle_ left
raschipi m: .say for \(1,2,3), 15:30
camelia \(1, 2, 3)
raschipi m: .say for \(1,2,3, :a, :b), 15:31
camelia \(1, 2, 3, :a, :b)
15:39 jmerelo joined 15:44 enheh_ joined 15:46 rindolf left, enheh__ left 15:47 athenot left 15:54 rindolf joined, Zoffix joined
Zoffix lucasb: that's 'cause () and [] are already Iterable, but \() ain't, so it gets made into an Iterable by calling .list, which returns positionals from the capture in non-conted List 15:55
m: .say for (\(1, 2, 3) but Iterable) 15:56
camelia 1
Zoffix m: .say for $(\(1, 2, 3) but Iterable)
camelia Capture+{Iterable}.new(list => (1, 2, 3,))
lucasb ok. but .item alone wasn't supposed to make it itemized?
Zoffix lucasb: it did. But a Capture, even an itemized one, isn't an Iterable 15:58
15:58 psychoslave left
lucasb m: class C { method list { 1,2,3 } }; for C.item { .say } 16:00
camelia 1
lucasb is confused
timotimo s: (1, 2, 3), "item", \() 16:01
SourceBaby timotimo, Sauce is at github.com/rakudo/rakudo/blob/154d...le.pm6#L16
timotimo so the default implementation literally just creates a Scalar and puts the object on it, and returns the scalar
raschipi So it's the Iterable role that interacts with the $() and for receives something different then?
Zoffix I think it's the Iterable role that makes `for` decide how to loop over it 16:02
s: \(), 'map', \(*.say)
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/154d...ds.pm6#L17
lucasb for the record, things changed here:
c: 71160596,71160596^ for \(1,2,3,:a,:b).item { .say }
committable6 lucasb, ¦7116059: «1␤2␤3␤» ¦71160596^: «\(1, 2, 3, :a, :b)␤»
lucasb github.com/rakudo/rakudo/commit/71...64399c883c
(well, for the Capture thing) 16:03
Zoffix lucasb: you're calling "item" BEFORE giving `for` a non-Iterable thing.
lucasb not the general class C { method list {...} } case 16:04
Zoffix It doesn't have any effect on what happens after `for` converts your thing to an Iterable thing
16:05 troys joined
lucasb ok, I'll get it after a while :) 16:05
I just think is strange that 'for' tries to make a non-Iterable thing into a Iterable a thing, while (1,2,3).item and [1,2,3].item are really iterable things and 'for' treats as itemized 16:06
Zoffix You put bunch of oranges into a box. Then you put them into a bag and hand it to me, saying "here, eat this". It doesn't look like food, so I have to open up both the bag and the box to get to the oranges and by that time they're not in any boxes, so I eat them one by one. 16:07
Geth doc: 09767255d5 | (JJ Merelo)++ | doc/Type/Junction.pod6
Moving @fluca1978's explanation to a method subsection

So that it can be indexed properly. Also added other two multis that use ~ in a rather more natural way. Closes #2053.
synopsebot Link: doc.perl6.org/type/Junction
16:08 sno left
Zoffix With (1, 2, 3).item.... You take a bunch of oranges and put them in a cake and hand it to me, saying "here, eat this". It looks like food, so I eat it without having to get to individual oranges. 16:08
s: \(), 'map', \(*.so, :item) 16:10
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/154d...ds.pm6#L17
lucasb Ok, so when someone says they eat a box of chocolates, the haven't literally eated a box :D
thanks Zoffix for the patience. I'll eventually get it
Zoffix oh, whoops replied in the wrong channel 16:15
Zoffixlucasb: actually my explanation was likely inaccurate
Zoffix │ Looking at p6for desugar, it don't care about Iterable at all: github.com/rakudo/rakudo/blob/mast...#L561-L578
Zoffix │ But, Iterable provides the `.item` method that shoves things into container:
Zoffix │ While \Mu's version is a no-op: github.com/rakudo/rakudo/blob/154d...u.pm6#L574
m: .say for $ = \(1, 2, 3)
camelia \(1, 2, 3)
Zoffix At least now I know I'm good at making shit up in a way that makes sense :D 16:16
Ah, now I what I confused it with. It's nodemap/deepmap that care about iterables: github.com/rakudo/rakudo/blob/mast....pm6#L1500 16:18
16:20 mahafyi left 16:22 andrzejku joined 16:24 andrzejku_ left 16:26 andrzejku_ joined 16:29 andrzejku left
Zoffix R#1862 16:34
synopsebot R#1862 [open]: github.com/rakudo/rakudo/issues/1862 [@LARRY] Some objects don't .item'ize even though they probably should
Zoffix lucasb: ^ FYI
raschipi "zoffixznet opened this Issue 17 seconds from now" 16:39
Zoffix: can I lend your time-travel machine/device?
Zoffix I must now kill you. You know too much.
raschipi I would already be dead if you were to actually kill me. 16:41
lucasb Zoffix++ thanks for the issue 16:43
Zoffix And R#1863 for a potential fix 16:46
synopsebot R#1863 [open]: