»ö« 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 Zoffix on 25 May 2018.
00:00 lizmat joined, [particle] joined 00:01 [particle]1 left 00:02 mcmillhj joined 00:04 lizmat left 00:05 [particle] left 00:06 mcmillhj left 00:13 Xliff joined 00:14 mcmillhj joined
Xliff \o 00:14
00:15 Xliff left
lookatme o/ 00:17
00:18 mcmillhj left 00:22 markoong left 00:25 fascinum joined 00:26 mcmillhj joined 00:30 Tison left 00:31 mcmillhj left 00:32 Xliff joined
Xliff \o, again 00:32
Does anyone know if "is DEPRECATED" supports all the options of the old "DEPRECATED" sub? 00:33
"sub DEPRECATED" used 3 arguments. I am trying to find a better way to conver that to "is DEPRECATED" without too much modification.
For example -- How would this convert to the trait version: "DEPRECATED('size-request',Any,'0.3.2')" 00:36
00:42 mcmillhj joined
lookatme Don't know that, better ask on the stackoverflow Xliff 00:44
00:46 mcmillhj left 00:53 mcmillhj joined 00:54 [particle] joined 00:55 raschipi joined
Xliff Nah. I'll leave the question up and wait for a response, here. 00:56
The reason I am asking is because I am trying to add to GTK::Simple.
And that project still uses the old method.
So it's br0ke
lookatme Okay 00:58
00:59 [particle] left 01:09 mcmillhj left, mcmillhj joined 01:14 mcmillhj left 01:25 [particle] joined 01:27 pmmmm left 01:28 mcmillhj joined 01:30 [particle] left 01:33 mcmillhj left 01:36 ChoHag left
Xliff Who is working on GTK::Simple? 01:37
01:41 Xliff left 01:43 mcmillhj joined 01:47 mcmillhj left 01:57 [particle] joined 02:01 molaf left 02:02 [particle] left 02:06 Schepeers left 02:09 Schepeers joined, Schepeers left 02:11 Schepeers joined, Schepeers left, mcmillhj joined 02:14 molaf joined 02:16 Tison joined, mcmillhj left 02:19 raschipi left 02:22 Schepeers joined 02:24 Schepeers left 02:26 mcmillhj joined 02:27 Schepeers joined, Schepeers left 02:31 mcmillhj left 02:34 Schepeers joined 02:48 wamba joined
Geth ecosystem: 279c5a0f4d | (Fernando Correa de Oliveira)++ (committed using GitHub Web editor) | META.list
Add OrderedHash to the ecosystem

  github.com/FCO/OrderedHash
02:49
02:53 [particle] joined 02:59 mcmillhj joined 03:04 mcmillhj left 03:14 Tison left 03:19 mcmillhj joined 03:23 mcmillhj left
skids .tell AlexDaniel yes, anything I say on #perl6-dev or #perl6 may be published with my permission. 03:37
yoleaux skids: I'll pass your message to AlexDaniel.
geekosaur that's not quite the same thing 03:39
logs, not specific snippets
hm, guess that depends on how I understand 'with my permission', to me it sounds like "please check first" 03:40
which is difficult for logs
skids Oh, I meant in the "permission is granted" sense. 03:41
geekosaur this is something it is good to be certain about, since the context is GDPR and our logs going away as a result 03:42
because nobody specifically have permission to be logged
*gave
03:44 w_richard_w left
skids .tell AlexDaniel I mean, you hereby have my permission to publish the logs (it was pointed out that could be taken two ways) 03:44
yoleaux skids: I'll pass your message to AlexDaniel.
03:52 mcmillhj joined 03:57 mcmillhj left 04:08 mcmillhj joined 04:13 mcmillhj left 04:19 fascinum left 04:34 mcmillhj joined 04:39 mcmillhj left 04:44 [Sno] left 04:49 mcmillhj joined 04:51 cognominal left 04:54 psychoslave joined, mcmillhj left 04:57 curan joined 04:58 mahafyi left 04:59 mahafyi joined 05:02 skids left, eliasr left 05:05 skids joined 05:06 xtreak joined, redhands joined 05:08 jmerelo joined 05:14 mcmillhj joined 05:18 mcmillhj left 05:20 troys left 05:25 molaf left 05:29 mcmillhj joined 05:31 domidumont joined 05:33 mcmillhj left 05:35 xtreak left, xtreak joined 05:38 domidumont left 05:39 domidumont joined, [Sno] joined 05:40 xtreak left
Geth doc: cbcf464ae7 | (JJ Merelo)++ | doc/Type/X/IO/Unlink.pod6
defined → denied
05:40
doc: 46e94bce6b | (JJ Merelo)++ | doc/Type/IO/Path.pod6
Revises unlink, closes #2096
synopsebot_ Link: doc.perl6.org/type/X::IO::Unlink
Link: doc.perl6.org/type/IO::Path
ingy anyone know what digest algorithm is used for .precomp file names? 05:48
sha1 seems to be 44 chars long and precomp names are 40 05:49
jmerelo ingy: I guess we would have to look at the source...
ingy nm
jmerelo ingy: it uses nqp::hash...
ingy sha1 is 40, my bad
05:50 xtreak joined
ingy jmerelo: url? 05:51
jmerelo ingy: I was going to say this: github.com/rakudo/rakudo/blob/ec04...em.pm6#L10 05:52
ingy: but I'm realizing that creates a real hash as in hashmap 05:53
so not that.
ingy: but this is the one github.com/rakudo/rakudo/blob/ec04...it.pm6#L17 05:54
ingy: and yes, it uses nqp::sha1
06:02 sauvin joined, mcmillhj joined 06:08 mcmillhj left 06:17 damnlie left 06:18 kybr left, espadrine left 06:20 mcmillhj joined, damnlie joined 06:24 skids left 06:25 mcmillhj left 06:31 domidumont left 06:36 mcmillhj joined
ingy jmerelo: thx 06:39
jmerelo ingy: :-)
06:41 mcmillhj left
ingy I need to do a similar thing for my testml language. Store precompiled code. I'm just using timestamps at the moment, but it won't work for shipping my precomps. 06:42
jmerelo ingy: the expert in precomp, far as I can tell, is ugexe. Using it very extensively in zef. 06:43
ingy: we have a similar intention in perl6/doc github.com/perl6/doc/issues/1952 06:44
ingy do any mechanisms ship the precomp files 06:45
jmerelo ingy: there's an implementation in pod2onepage, just in case you want to look how it works in practice. It's not well documented, though 06:46
ingy: as in packaging them and using them for deployment? No, I don't think so. It's used only locally.
ingy I see. In my case I have this language called testml that you can write tests that run in any language. like they run in perl6. but the compiler is not perl6. so when I ship perl6 modules that have testml tests, I ship the test sources, but also the precompiled versions. 06:48
so the test runner needs to know that the source file is in sync with the precomp file. and was just wondering what kind of hashing would be best for that. 06:49
jmerelo: you going to the perl conf next week, perchance? 06:50
in utah...
jmerelo ingy: No, sorry. 06:51
ingy no worries :)
bed time for old ingy... 06:52
ttul o/
jmerelo ingy: see you tomorrow :-)
06:56 robertle joined
ingy jmerelo: oh... can you tell from that code what values are using to compute the digest? 06:56
06:56 redhands left
ingy is it just file content or what? 06:57
jmerelo ingy: I think it's just in the name. It computes different sha1 depending on the type of thing, if it's in a repo or not, but I don't think it's using the content. 06:58
ingy: let me see
ingy so it would recompile based on timestamp? 07:00
jmerelo ingy: far as I remember from the pod2tonefile, yes 07:01
ingy: but let me see, I'm not so sure now.
ingy: right, it's using the timestamp github.com/perl6/perl6-pod-to-bigp...nepage#L64 At least in this implementation 07:02
ingy: as I say, not too well documented...
ingy thanks for all the help! 07:03
jmerelo ingy: no problem. My pleasure.
07:05 mcmillhj joined 07:06 psychoslave left 07:07 psychoslave joined 07:10 mcmillhj left, lizmat joined, darutoko joined 07:11 wamba left 07:13 psychoslave left 07:14 dakkar joined 07:16 Hotkeys joined 07:19 mcmillhj joined 07:20 HaraldJoerg joined 07:24 ChoHag joined 07:25 mcmillhj left
Geth doc: 9f1f046710 | (JJ Merelo)++ | 2 files
Adds push-exactly refs #1395
07:36
doc: 4a5c96613e | (JJ Merelo)++ | doc/Type/Iterator.pod6
Improves push-at-least refs #1395
synopsebot_ Link: doc.perl6.org/type/Iterator
doc: d6698c4e72 | (JJ Merelo)++ | doc/Type/Iterator.pod6
Includes better examples for .push methods in Iterator docs.

Which then closes #1395
07:40 pecastro joined 07:42 vike left
lizmat clickbaits p6weekly.wordpress.com/2018/06/11/...-redirect/ 07:45
07:47 mcmillhj joined 07:48 domidumont joined 07:50 vike joined 07:51 mcmillhj left 07:55 wamba joined
sjn lizmat: itym "You'll never believe what happened next!" p6weekly.wordpress.com/2018/06/11/...-redirect/ 07:56
07:56 Actualeyes left
lizmat :-) 07:56
sjn "Noone expected how URL would change their life!" 07:57
07:57 Xliff joined
jmerelo :-) 07:58
Xliff \o
sjn o/
Xliff Is anyone working on gtk-simple right now?
I am trying to add gtk_widget_is_focus() and gtk_widget_grab_focus(), but I am running into NativeCall type issues. 08:01
Namely that when I pass any typed widget, I get an error about "expecting a CPointer type but got P6opaque"
Is there any way to force a specific cast to an object type with Perl6? 08:03
jmerelo Xliff: p6Opaque is perl6ish, CPointer is native
Xliff: that means that you will have to work with native objects through and through. 08:04
Xliff I know that. :S
But when I get to the point of using actual GTK::Simple::Widget subclasses, I run into problems.
jmerelo Xliff: so "any typed widget" will have to be natively typed. 08:05
Xliff I just want a way to coerce them to GtkWidget if necessary.
GtkWidget is CPointer.
So if I have a GTK::Simple::VBox, how can I coerce it to GtkWiget if a GtkWidget is called for?
08:05 rindolf joined
jmerelo Xliff: the best thing is probably to raise an issue in the repo. In general, it's not possible to coerce non-native types to native types. Hence the error. 08:06
Xliff Do I need to use MONKEY-TYPING for this?
Or can I just define a "method GtkPointer" and do my conversion there? 08:07
jmerelo Xliff: don't think so. MONKEY-TYPING is used to augment existing classes docs.perl6.org/syntax/augment
Xliff For example: "method GtkPointer { nativecast(GtkPointer, self) }
jmerelo Xliff: conversion might be a better option. Give it a try.
Xliff Er... correction: "method GtkWidget { nativecast(GtkWidget, self) }" ... or would that be +self? 08:08
BTW jmerelo, how are you doing? 08:11
Anything fun?
(I know, I know... I still owe you docs...) 08:12
08:12 aindilis left 08:15 HaraldJoerg left 08:16 xtreak left, robertle left, xtreak joined 08:17 aindilis joined 08:19 Xliff left
jmerelo Xliff: not really now. Filing paperwork for a grant in $dayjob 08:19
Xliff: there are lots of issues still to be done... work on them whenever you feel like :-) 08:20
08:20 aindilis left
jmerelo There's also a squashathon coming up 08:20
squashable6: status
squashable6 jmerelo, Next SQUASHathon in 24 days and ≈1 hour (2018-07-07 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
08:21 xtreak left, HaraldJoerg joined 08:27 mcmillhj joined, HaraldJoerg1 joined 08:29 HaraldJoerg left, psychoslave joined 08:32 mcmillhj left 08:33 scimon joined 08:37 scovit left 08:39 mcmillhj joined 08:43 xtreak joined 08:44 mcmillhj left 08:51 aindilis joined 09:02 scimon left 09:03 scimon joined 09:08 xtreak_ joined 09:10 xtreak left 09:13 lizmat left 09:14 lizmat joined 09:16 xtreak joined 09:17 jmerelo left 09:18 mcmillhj joined 09:20 xtreak_ left 09:23 mcmillhj left
sjn Ooh, I found a confusing error message! \o/ 09:27
echo "foo" | perl6 -ne 'say "${_}"' 09:28
Unsupported use of ${_}; in Perl 6 please use {$_}
(which in this case doesn't do what's expected!)
AlexDaniel sjn: sorry, what is expected? 09:33
m: use isms <Perl5>; say "${_}"
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '${_}' is not declared
at <tmp>:1
------> 3use isms <Perl5>; say "7⏏5${_}"
El_Che sjn: are you fuzzy testing?
sjn El_Che: yeah, playing with some Perl5-isms to see what happens 09:35
09:36 mcmillhj joined
sjn bug report created 09:36
AlexDaniel: in Perl5, ${var} is the same as $var 09:37
AlexDaniel m: $_ = 42; say "{$_}" 09:39
camelia 42
AlexDaniel so why not?
m: $_ = 42; say ${_}
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of ${_}; in Perl 6 please use $_
at <tmp>:1
------> 3$_ = 42; say ${_}7⏏5<EOL>
AlexDaniel the error message is even smart enough to recommend $_ if you're not in a str 09:40
09:40 mcmillhj left
ilmari $ echo "foo" | perl6 -ne 'say "{$_}"' 09:40
Use of uninitialized value $_ of type Any in string context.
it works without the { }
AlexDaniel oh 09:41
09:41 ExtraCrispy joined
AlexDaniel why? 09:41
hmmm 09:42
El_Che it's the quotes 09:43
$ echo "foo" | perl6 -ne 'say ${_}'
Unsupported use of ${_}; in Perl 6 please use $_
sjn {} creates a closure, which resets $_ 09:44
El_Che I did this: echo "foo" | perl6 -ne 'say ${_}'
AlexDaniel sjn: I don't think so 09:45
sjn any variable other than $_ works fine with the example in the error message
AlexDaniel m: $_ = 42; put "{ say $_ }"
camelia 42
True
AlexDaniel m: $_ = 42; put "{$_}"
camelia 42
sjn so something different happens with a perl6 -ne loop? 09:46
09:53 zakharyas joined 09:54 scimon left, robertle joined 09:58 scimon joined 10:00 mahafyi_ joined 10:01 mahafyi left, mahafyi_ is now known as mahafyi 10:04 mcmillhj joined 10:07 Hotkeys left 10:09 mcmillhj left 10:12 xtreak left 10:15 mcmillhj joined 10:20 mcmillhj left 10:29 cognominal joined 10:32 cognominal left 10:37 cognominal joined 10:42 mcmillhj joined 10:43 scimon left 10:44 scimon joined 10:47 mcmillhj left
Geth doc: 3347f71fa4 | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlsyn.pod6
Expand a bit on labels wrt to goto
10:51
synopsebot_ Link: doc.perl6.org/language/5to6-perlsyn
Geth doc: 80a4f64926 | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Add example of an anonymous sub return itself
11:01
doc: ba87ed3068 | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
De-emphasize references vs containerized objects
synopsebot_ Link: doc.perl6.org/language/5to6-perlop
doc: 44a39217bf | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Link to the smartmatch documentation
11:06
11:07 kurahaupo left 11:08 kurahaupo joined
Geth doc: dbdd6aca58 | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Link to actual documentation rather than to synopsis
11:09
11:14 mcmillhj joined 11:15 Actualeyes joined, psychoslave left 11:16 markong joined 11:19 mcmillhj left, gregf_ left
moritz ⟰ always up! 11:24
Geth doc: b1bfd97f5b | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Elaborate on the "my Foo .= new()" idiom
synopsebot_ Link: doc.perl6.org/language/5to6-perlop
moritz (I just love the QUADRUPLE ARROWs in Uincode)
lizmat m: dd "⟰"uninames
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3dd "⟰"7⏏5uninames
expecting any of:
infix
infix stopper
postfix
statement end
statement modifie…
lizmat m: dd "⟰".uninames
camelia ("UPWARDS QUADRUPLE ARROW",).Seq
11:26 mcmillhj joined, markong is now known as markoong 11:31 mcmillhj left
Geth doc: 54365a6c8b | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Elaborate a bit on comma versus parentheses
11:31
doc: 579461622c | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
infix xor *is* now dociumented
11:36
synopsebot_ Link: doc.perl6.org/language/5to6-perlop
11:39 b2gills joined 11:47 zakharyas left 11:49 mcmillhj joined 11:53 mcmillhj left
Geth doc: f6328aeba6 | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Elaborate a bit in array/hash interpolation
11:58
synopsebot_ Link: doc.perl6.org/language/5to6-perlop
Geth doc: d13b36d607 | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Mention that qqw// can also be written as << >>
11:59
12:06 nightfrog joined 12:07 psychoslave joined
Geth doc: ccb4f25322 | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Point to "Nil while foo()" idiom
12:11
synopsebot_ Link: doc.perl6.org/language/5to6-perlop
12:12 xtreak joined 12:16 xtreak left
Geth doc: bdf3baf8ec | (Elizabeth Mattijsen)++ | doc/Language/subscripts.pod6
Change example of sorting multidimmed

Although the syntax "sort(*[1])" is technically correct, I felt it could be confusing to naive readers with the "say @a[*;1]" syntax just two lines before it. Using "sort( { $_[1] } )" is less magic at a place where there's already quite some magic introduced.
12:17
synopsebot_ Link: doc.perl6.org/language/subscripts
12:18 mcmillhj joined, raschipi joined 12:21 zakharyas joined 12:23 mcmillhj left 12:26 psychoslave left 12:28 psychoslave joined 12:29 psychoslave_ joined 12:31 silug joined 12:33 psychoslave left, psychoslave_ is now known as psychoslave 12:35 Hotkeys joined 12:41 noobp6 left 12:45 mcmillhj joined 12:54 mcmillhj left 12:57 mcmillhj joined 13:02 scimon left 13:05 scimon joined, aborazmeh joined, aborazmeh left, aborazmeh joined 13:08 skids joined 13:18 lizmat left 13:25 cosimo joined 13:26 Tison joined 13:27 zakharyas left, zakharyas joined 13:49 aborazmeh left
Tison m: say ("String", Nil, 2).perl 13:52
camelia ("String", Nil, 2)
Tison m: say ["String", Nil, 2].perl
camelia ["String", Any, 2]
Tison it remains me of once lizmat show how `is default` works
docs.perl6.org/type/Nil#index-entr...assignment
b2gills m: my Int @foo is default(42); @foo[3] = Nil; say @foo 13:54
camelia [42 42 42 42]
13:55 lizmat joined 13:57 curan left
Geth doc: 6c60943b1d | (Brad Gilbert)++ (committed using GitHub Web editor) | doc/Language/5to6-perlop.pod6
5to6 `1 while foo()` generates a warning
13:59
synopsebot_ Link: doc.perl6.org/language/5to6-perlop
14:08 scimon left
Geth doc: d57a155c2f | (Will "Coke" Coleda)++ | doc/Language/5to6-perlop.pod6
whitespace
14:08
14:08 scimon joined
Geth doc: 961110ac6c | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlop.pod6
Revert "Mention that qqw// can also be written as << >>"

This reverts commit d13b36d6071ddd12bf797df67ed8f05dbde2cb47.
14:10
synopsebot_ Link: doc.perl6.org/language/5to6-perlop
14:16 AlexDaniel left, AlexDaniel joined 14:17 zakharyas left 14:19 wamba left 14:22 subroot joined 14:29 scovit joined, scimon left, scimon joined 14:33 cono left
Geth doc: dc1ea46cdf | (Elizabeth Mattijsen)++ | doc/Language/5to6-nutshell.pod6
Hopefully clarify that Perl 6 doesn't have references better
14:35
synopsebot_ Link: doc.perl6.org/language/5to6-nutshell
raschipi When everything is a reference, nothing is a reference. 14:39
14:39 rindolf left
lizmat raschipi: indeed, do you have suggestions for improvement? 14:40
raschipi No, I think you did a wonderful job, explaining that p6 has references without saying that p6 has references. 14:41
Perhaps get into binding? I got confused about it's relationship with references a while back. 14:44
14:48 rindolf joined 15:02 n1ge left 15:03 geekosaur joined 15:04 nnunley left 15:09 theathlete joined 15:12 wamba joined 15:13 theathlete left 15:27 troys joined, jmerelo joined 15:33 psychoslave left 15:35 kybr joined 15:36 cognominal left 15:39 [Sno] left, rindolf left 15:48 domidumont left 15:49 xtreak joined, rindolf joined
ingy e: my $a=[];say 'OK' unless $a.elems == 0 16:01
evalable6
ingy e: my $a=[];say 'OK' unless $a.elems
evalable6 OK
ingy e: my $a=[];say $a.elems == 0
evalable6 True
ingy explain please
jmerelo Let's see. 16:02
ingy err
16:02 HaraldJoerg joined
jmerelo m: say ($a.elems == 0).^name 16:02
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3say (7⏏5$a.elems == 0).^name
ingy explanation: ingy is dumb
jmerelo m: my $a=[]; say ($a.elems == 0).^name
camelia Bool
jmerelo ingy: :-) not really. Only we sometimes have to understand how Perl 6 behaves in misterious ways. 16:03
m: my $a=[]; say (so $a.elems == 0).^name
camelia Bool
16:03 kaare_ left
jmerelo ingy: first take into account that, by declaring it using $, it's an Scalar, not a Positional. 16:03
So let's see
16:04 HaraldJoerg1 left, kaare_ joined
jmerelo e: my @a=[];say 'OK' unless @a.elems == 0 16:04
evalable6
ingy I just got my simple logic wrong
jmerelo ingy: right, because of the unless
jmerelo: so it's me who's dumb.
ingy us so dumb it's contagious 16:05
jmerelo As an excuse, I'm kind of dumb-founded by this conversation here github.com/perl6/doc/issues/2096#i...-396585259
But anyway. Positionals better carry a @. 16:06
16:08 lance_w[m] left, unclechu left, AlexDaniel`` left, mienaikage left, Garland_g[m] left, wictory[m] left, CIAvash[m] left, mirlur[m] left, ilmari[m] left, Matthew[m] left
ingy jmerelo: you are JJ? 16:08
I might link to the commit for "I revised the documentation" 16:09
16:10 xtreak left 16:11 evalable6 left, camelia left, greppable6 joined, evalable6 joined, mcmillhj left
jmerelo ingy: will do. 16:12
ingy: but it's right there in the closing notice...
ingy nod, bdfoy is maybe having a bad day :) 16:13
but he's a good guy
16:14 MasterDuke left 16:15 camelia joined 16:17 ChanServ sets mode: +v camelia, mcmillhj joined
raschipi jmerelo: he wants the docs to say what happens when you call unlink in a file that doesn't exist. It doesn't do anything, and returns the name of the file as if it had just deleted it. 16:18
jmerelo raschipi: well, the documents say that it does not return the file name if called as routine, raises an exception if called as a method. That's what it "does" 16:19
raschipi: I mean, it does not return the name of the file if it was not able to delete it, just the names of the files it *was* able to delete. 16:21
robertle to me "the files that were successfully deleted" does not include files that were already gone...
raschipi m: say unlink 'pl6.txt'
camelia unlink is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in sub unlink at src/RESTRICTED.setting line 19
in block <unit> at <tmp> line 1
ingy :)
robertle but it is awefully terse on the subject
raschipi If it was allowed, the line would say '[pl6.txt]'
jmerelo raschipi: it's raising an exception. It does not say anything... 16:22
robertle: What would you add?
raschipi It returns the names of the files that don't exist, not the ones that were deleted.
16:22 mcmillhj left
jmerelo hum 16:22
robertle jmerelo: not sure, but I'll try to phrase something later
jmerelo raschipi: it returns the names of the files that were deleted. If it couldn't delete them *for any reason*, it does not. 16:23
16:23 robertle left
Geth doc: zoffixznet self-assigned unlink doesn't complain if it tries to operate on a file that doesn't exist github.com/perl6/doc/issues/2096
46d35a3526 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Path.pod6

Closes github.com/perl6/doc/issues/2096 D#2096
16:24
raschipi "it returns the names of the files that were deleted", but 'pl6.txt' in my line above doesn't exist and therefore couldn't be deleted, but it's name is reurned anyway.
jmerelo raschipi: do that locally. You can't use unlink with Camelia, It's raising an exception, doing nothing. 16:25
raschipi Yes, I did it locally.
got [pl6.txt] 16:26
jmerelo raschipi: I really don't understand here. Would that be an error in Rakudo? 16:27
raschipi: let me check
raschipi I don't think rakudo should do anything about it, the docs should be clarified to say that's the expected behavior.
If there's no error returned from unlink(2), return the name. unlink(2) succeeds both when the file was deleted and when it didn't exist in the first place. 16:28
16:28 mcmillhj joined
jmerelo raschipi: in subroutine mode, yes. It always succeeds, returns the names of the files deleted. 16:29
raschipi And in method form it returns true even when called in an IO object that points to a file that doesn't exist.
jmerelo raschipi: that's what it says in the docs. What you are saying is that maybe it should fail if it couldn't remove a file? Or that it should fail in different ways depending on why it couldn't delete? If you want that behavior, use it as a method. 16:30
ingy how do I flush stdout and stderr after every write operation?
jmerelo .flush on the filehandle docs.perl6.org/routine/flush Which I guess are $*OUT and $*ERR. 16:31
raschipi No, the docs say "The subroutine form returns the names of the files that were successfully deleted". Which is not complete, it returns the names of the files that were succesfully deleted and the ones that didn't exist in the first place.
synopsebot_ Link: doc.perl6.org/type/IO::Path
D#2096 [closed]: github.com/perl6/doc/issues/2096 unlink doesn't complain if it tries to operate on a file that doesn't exist
16:31 scimon left
raschipi The method form returns True when it succesfully deletes the files and when the file didn't exist. 16:32
jmerelo raschipi: Ah, OK. That's bad. And not documented. I didn't know.
16:32 Matthew[m] joined
jmerelo It's clear now in zoffix's patch 16:33
raschipi It shouldn't be changed.
16:33 mcmillhj left
raschipi Rakudo would have to check if the files exist before deleting them, which would be a problem when trying to delete a lot of them. 16:34
jmerelo raschipi: that wasn't in the issue, however...
El_Che it's weird it returns the list of files, it does not sound very usedful
returning an error seems more practical 16:35
raschipi You cast that to Int to get the number of deleted files, and to Boolean to test for a failed operation.
El_Che yeah, not that useful
casting as an error
jmerelo El_Che: it does so in one form. But anyway it's not our thing to judge that. Just to check that actual behavior is as documented. 16:36
16:37 sunnavy joined
jmerelo raschipi: Or it was, since all the *.txt didn't exist to start with. I tested it with files that *did* exist. I get it now... 16:37
geekosaur this might be more interesting if it instead returned the ones that failed, possibly mixin-d with Failure 16:38
16:40 sunnavy left
raschipi m: say my $n = Any but Failure; 16:40
camelia Cannot mix in non-composable type Failure into object of type Any
in block <unit> at <tmp> line 1
geekosaur guess I should have included "if that's possible" 16:41
my point is you might want to know why a particular file failed, and I don;t see a way to get that currently except to go one by one
and not sure even that since you get back what succeeded 16:42
jmerelo geekosaur: you can always use it as a method, individually in each file. It will throw an exception if it can't do something.
16:42 sunnavy joined
geekosaur that's what I just said 16:42
jmerelo geekosaur: right, sorry. 16:43
16:44 domidumont joined 16:45 mcmillhj joined
ingy jmerelo: I'll try .flush 16:45
I think Test::Builder is not flushing properly 16:46
but I might be able to work around that for today
16:46 psychoslave joined
ingy or I might be able to patch Test::Builder 16:46
16:47 Tison left
Geth doc: 6e17351fdc | (JJ Merelo)++ | doc/Type/IO/Path.pod6
Adds another sentence clarifying behavior of unlink

Also some possible explanation of the rationale of including non-existing files in the output list. Refs #2096, does not close, because it's been closed already. Thanks again @briandfoy for the report, and sorry for not understanding the problem from the beginning.
16:48
synopsebot_ Link: doc.perl6.org/type/IO::Path
jmerelo raschipi: See ↑↑↑↑↑↑↑ 16:49
ingy e: $*OUT.flush; $*ERR.flush
evalable6
16:49 molaf joined, raynold joined
ingy I get: Cannot flush handle: Failed to flush filehandle: Operation not supported 16:50
16:50 mcmillhj left 16:51 domidumont left
ingy on * 2018.04.1 16:51
raschipi "returns the names of the files that C<do not exist> after the operation". jmerelo: it just trusts the operating system, if it doesn't get an error from unlink(2), it returns the name of the file. It doesn't check if the file is really gone if that's what you mean. 16:52
jmerelo raschipi: I guess so. I would have to check the actual code, but it's down in NQP, which goes even further down to the MoarMV. 16:53
raschipi: It makes sense.
jmerelo: I mean, I actually checked the code of the whole thing to answer the issue. It's not as if I just closed it without doing anything. 16:54
17:00 dakkar left
ingy as TimToady once told me, the agreement of semantics in human communication is HARD, and the root of all mankind's problems 17:01
I may have embellished just a bit :)
jmerelo ingy: :-) 17:02
raschipi: I'll change that too.
raschipi Well, I do think it's a serious problem, but I don't agree it causes slavery. Some people are just cunts, it doesn't come from a misunderstanding.
ingy iirc, I told him to shut up at the time only to realize an hour later how brilliantly correct he was... (an hour later 4 people had 4 different ideas of the very simple topic of conversation) 17:03
17:03 mcmillhj joined 17:07 Zoffix joined
Zoffix ingy: what OS is that on? 17:08
17:08 n1ge joined
Zoffix the flush thing 17:08
ingy mac
17:08 shareable6 joined 17:09 undersightable6 joined, ChanServ sets mode: +v undersightable6
ingy Zoffix: ^ 17:09
Zoffix ye 17:10
Geth doc: a6247146bf | (JJ Merelo)++ | doc/Type/IO/Path.pod6
Right another attempt at rephrasing the behavior of unlink refs #2096
17:11
synopsebot_ Link: doc.perl6.org/type/IO::Path
17:12 lance_w[m] joined, CIAvash[m] joined, ilmari[m] joined, wictory[m] joined, unclechu joined, mirlur[m] joined, AlexDaniel`` joined, mienaikage joined, Garland_g[m] joined
jmerelo Anyway, I think we're are trying to do our best. We might be wrong sometimes, but it does not help to thumb-down anyone. 17:13
Zoffix jmerelo: you probably made bdfoy's shitlist and he'll now hate you forever. 17:14
jmerelo It was my mistake, I am sorry for that, I'm trying my best to undo the mistake.
Zoffix passes jmerelo club membership application.
ingy: this gives the same error, right? perl6 -e '$*OUT.flush' 17:15
Like with no redirection or any of that business.
jmerelo ducks under the cover
ingy hmm. no that works
AlexDaniel jmerelo: hello. This cover is actually pretty nice :) 17:16
ingy Zoffix: that gives no error
I'll try to make something that does in a 1-liner 17:17
Zoffix ingy: FWIW, this is the C code that does the flushing: github.com/MoarVM/MoarVM/blob/mast...#L224-L240 and MVM_platform_fsync is just mapped to fsync: github.com/MoarVM/MoarVM/blob/mast...rm/io.h#L8
Geth doc: bbbce35fd5 | (JJ Merelo)++ | doc/Type/IO/Path.pod6
Fixes POD error
raschipi jmerelo: it's clear now. 17:18
jmerelo raschipi: OK :-) 17:19
Zoffix: this stackoverflow.com/questions/508214...2_50821434 will probably make him hate me even more.
17:20 [Sno] joined
ingy bdfoy likes me :) 17:20
I think so anyway, haven't seen him since 2012
jmerelo ingy: everyone using YAML likes you :-) 17:21
ingy definitely not true
Zoffix: do you recall 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: 17:22
No such symbol 'TestML::StdLib'
Zoffix ingy: yeah
jmerelo ingy: well, there's this tribe of JSONers...
ingy Zoffix: what repo is that issue on? 17:23
I forgot how I worked around it
getting it again
Zoffix ingy: github.com/ingydotnet/testml-pm6/tree/0.2.0 based on my brower history.... 17:24
ingy: and the fix is probably somewhere in this convo: colabti.org/irclogger/irclogger_log...05-24#l840 17:25
workaround I mean 17:26
ingy Zoffix: I mean didn't we file a perl6 issue?
I just don't know what github repo to look for it in
Zoffix ingy: it'd be in rakudo/rakudo 17:27
ingy k
Zoffix ingy: R#1515 or R#1865 maybe 17:28
synopsebot_ R#1515 [open]: github.com/rakudo/rakudo/issues/1515 Erroneous unhandled failures for runtime module loading
R#1865 [open]: github.com/rakudo/rakudo/issues/1865 require Foo; does not replace `package` with proper class
ingy Zoffix: btw I can't repro the flush error outside testml yet: perl6 -MTest::Builder -e 'my $t = Test::Builder.new; $t.plan(1); $t.ok(1); $t.diag("hmmm"); $*OUT.flush; $*ERR.flush'
17:29 psychoslave left
ingy Zoffix: R#1502 17:29
synopsebot_ R#1502 [open]: github.com/rakudo/rakudo/issues/1502 Failure.DESTROY warning sometimes warns when Failure was technically handled
Zoffix jmerelo: FWIW, the docs document it as "Support for combinations of modes other than what is listed above is implementation-dependent and should be assumed unsupported" 17:30
jmerelo: and :mode<wo>, :append isn't on the list. 17:31
ingy Zoffix: I thought it was just from using 'unit class'
er, 1502 is not it 17:32
Zoffix ingy: R#1502 doesn't look like your issue. That one is just the case of one failure bailing out before the next on in the same statement has a chance to be examined.
jmerelo Zoffix: right. Should open an issue for :mode<wo>?
Zoffix jmerelo: what sort of issue?
CIAvash[m] Gitlab seems to be down and because "META6.json"s can't be reached, the modules hosted on gitlab are not included in ecosystem-api.p6c.org/projects.json and zef says it cannot find those modules. Is this the intended behaviour? 17:33
jmerelo Zoffix: ":mode<wo>, :append isn't on the list." But I guess one should assume that is implementation independent and should be assumed unsupported, right?
Zoffix jmerelo: I mean, the docs are correct. We only support the listed combinations. All the other dozens of permutations are UB (Undefined Behaviour) 17:34
jmerelo Zoffix: yep, that is what I understood, but from the covers I'm ducking in I have to read stuff twice or thrice to avoid mistakes. 17:35
Zoffix CIAvash[m]: probably could be improved..
CIAvash[m]: this is the relevant repo you could file an Issue in github.com/perl6/ecosystem/ that's where the projects.json generator is. Or you could file in github.com/ugexe/zef 17:36
CIAvash[m]: probably could add a conditional in here that would read use dist's info from previous run if we fail to fetch the new one: github.com/perl6/ecosystem/blob/ma...pl#L14-L19 17:38
ingy: FWIW this works fine for me and doesn't crash perl6 -MTest::Builder -e 'my $t = Test::Builder.new; $t.plan(1); $t.ok(1); $t.diag("hmmm"); $*OUT.flush; $*ERR.flush'
ingy Can someone help me do this right: '$str ~~ s:g/(\d+)/@list[$0 - 1]/'
Zoffix What's wrong with it now? 17:39
ingy Zoffix: yeah for me too,
Missing required term after infix
17:39 wmoxam joined
Zoffix m: my $str = "42 50"; $str ~~ s:g/(\d+)/@list[$0 - 1]/; say $str 17:39
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@list' is not declared. Did you mean any of these?
&list
List
&gist
&last

at <tmp>:1
------> 3my $str = "42 50"; $str ~~ s:g/(\d+)/7⏏5@list[$0 - 1]/; say $s…
Zoffix m: my @list = ^100; my $str = "42 50"; $str ~~ s:g/(\d+)/@list[$0 - 1]/; say $str
camelia 41 49
Zoffix ingy: doesn't look like the error's there. 17:40
ingy Zoffix: re the flush, that works for me too. I can't make flush fail in a 1-liner yet. that's what I was saying...
Zoffix Ah
17:41 psychoslave joined
ingy heh, it was /%.../ I didn't realize % was a sigil in regex's now. I took it out to make the example simpler 17:42
17:45 psychoslave left, MilkmanDan left 17:46 psychoslave joined, AlexDani` joined, AlexDaniel left 17:47 obfusk left, MilkmanDan joined 17:48 obfusk joined
Zoffix jmerelo: also can just be written as `$file.IO.spurt: :append, join "\n", grep *.is-prime, $low .. $high;` and you don't have to worry about open modes and whatever. 17:49
17:49 pmichaud left
Zoffix m: constant constant := constant := constant := constant constant = 'constant'; 17:49
camelia ( no output )
Zoffix magic trick 😘 17:50
17:50 pmichaud joined, lizmat left 17:52 AlexDani` is now known as AlexDaniel
jmerelo Zoffix++ 17:53
Geth doc: ddd101b089 | (JJ Merelo)++ | doc/Language/objects.pod6
Adds example addresses www.nntp.perl.org/group/perl.perl6...g5056.html
17:56
synopsebot_ Link: doc.perl6.org/language/objects
17:58 espadrine joined 18:00 mcmillhj left
Geth doc: f6df30a8fc | (JJ Merelo)++ | doc/Language/objects.pod6
Adds example addresses www.nntp.perl.org/group/perl.perl6...g5056.html with @lizmat's example
18:05
b2gills ingy: Only letters are assumed to match themselves. So all punctuation needs to be quoted or backslashed. 18:09
TimToady well, alphanums 18:12
jmerelo AlexDaniel: the intermitent error keeps coming back: travis-ci.org/perl6/doc/jobs/391391851 We'll have to find a way to isolate it... 18:16
18:16 bjht joined
Zoffix What does `my` and `our` are called? 18:16
moritz scope declarators 18:17
AlexDaniel jmerelo: but that's not an issue on my side?
Zoffix Thanks.
m: constant ::("foo") = 42; 18:19
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing initializer on constant declaration
at <tmp>:1
------> 3constant7⏏5 ::("foo") = 42;
Zoffix Should this work?
With ::(…) evaluated at compile time
moritz I have no idea
Zoffix goes with "no" :)
18:20 psychoslave left 18:23 psychoslave joined 18:24 sauvin left 18:25 psychoslave left, raschipi left 18:26 psychoslave joined 18:32 raschipi joined 18:36 psychoslave left
jmerelo AlexDaniel: nor really. Only we commented it in the past. 18:48
AlexDaniel: I mean, I had to tell *someone*
AlexDaniel :)
18:50 Zoffix left
ingy e: True ~~ Int # *blink* 18:53
evalable6
ingy e: (True ~~ Int).say # *blink*
evalable6 True
jmerelo m: say True ~~ Int # *blink* 18:54
camelia True
jmerelo thinks sink context is calling... (although, as usual, in mysterious ways)
geekosaur True is an enumeration, so it's effectively a subclass of Int
iirc
er, True is a value from an enumeration
m: say True.^mro 18:55
camelia ((Bool) (Int) (Cool) (Any) (Mu))
AlexDaniel yeah
jmerelo m: say True.sink
camelia Nil
jmerelo m: say 3.sink 18:56
camelia Nil
TimToady ~~ doesn't carp about sink context because it might have side effects
ingy wonders who will be at TPC next week 18:59
19:00 japhb joined
jmerelo ingy: it was my original intention. And then I checked flight prices. 19:00
geekosaur "next week" is kinda the wrong time to look at flight prices 19:01
(not as bad as "3 days" which is a situation I've been in once or twice… ugh)
El_Che "mañana, mañana"
jmerelo geekosaur: actually it was like the end of February. They were kinda costly by the beginning of February, but all but impossible by that time. I mean, I buy the ticket as soon as I positively know I'm going to go somewhere 19:07
19:08 Ven`` joined
jmerelo But I guess Granada and Salt Lake City are not exactly well communicated. First time I checked (when I submitted the tutorial) it was ~1200€, and I said, well... But I checked back when the tutorial was accepted and it was 1600€. Really not so well. I had to retire the tutorial. 19:08
El_Che that's expensive
19:10 Ven`` left, Ven`` joined
jmerelo I'm going to Arnhem for the Netherlands workshop, though :-) 19:10
19:11 Ven`` left
ingy jmerelo: when? 19:11
19:11 Ven`` joined
jmerelo ingy: first July weekend. 19:11
19:13 Ven`` left 19:14 Ven`` joined 19:16 Ven`` left, Ven`` joined 19:17 darutoko left 19:18 Ven`` left 19:19 Ven`` joined 19:23 mahafyi_ joined 19:24 mahafyi left, mahafyi_ is now known as mahafyi
ingy too early for me :) 19:25
19:26 Ven`` left 19:27 Ven`` joined, b2gills left 19:28 raynold left 19:31 Ven`` left 19:32 Ven`` joined, cono joined
cono m: Rat.new(1, 0).nude.say 19:32
camelia (1 0)
19:33 Ven` joined
cono m: (1/0).Num.say 19:36
camelia Inf
cono m: (1/0).say
camelia Attempt to divide 1 by zero using div
in block <unit> at <tmp> line 1
19:36 Ven`` left
cono why this dies, I thought its going to call Num 19:36
AlexDaniel cono: (1/0) gives you a Rat, and .say will call a .gist on it 19:37
m: say WHAT (1/0)
camelia (Rat)
AlexDaniel m: say (1/0).gist
camelia Attempt to divide 1 by zero using div
in block <unit> at <tmp> line 1
19:37 lizmat joined
AlexDaniel m: (1/0).gist 19:37
camelia Attempt to divide 1 by zero using div
in block <unit> at <tmp> line 1
19:38 Ven` left
AlexDaniel cono: so perl 6 in most cases will work with Rats by default, so you'll have to .Num explicitly if you want that 19:38
cono I know about Rat, my question why gist not calling .Num 19:39
19:40 zachk joined, zachk left, zachk joined, Ven`` joined 19:41 Ven`` left, Zoffix joined 19:42 b2gills joined
Zoffix cono: because division by zero is a fatal error. It only has a non-explosive value if you explicitly request IEEE semantics by coercing to a Num 19:42
cono: perhaps you meant to call .perl instead of .gist?
m: say <1/0>.perl
camelia <1/0>
19:42 mcmillhj joined
Zoffix cono: some docs on zero-denominator rationals: docs.perl6.org/language/numerics#D...on_By_Zero 19:43
[Coke] ingy: I'll be there. 19:45
cono its not fatal error during calculation, but its fatal error for Stringification, strange
Zoffix cono: the calculation only happens during stringification. `1/0` simply creates a Rat object. No calculation is performed then. 19:46
cono: I mean in that code. There are other cases where the Rat object will divide its numerator and denominator and those are explosive too
cono when I do my calculations I'm expecting that p6 will give me Rat, but I did not expect that stringification will call something different than .Num internally
Zoffix cono: why would it call a Num at all?
[Coke] m: (1/0).Num.say 19:47
camelia Inf
Zoffix cono: Rat has larger precision than Num. They're not exactly interchangeable types.
m: say 1/(2⁶⁴-1) 19:49
camelia 0.000000000000000000054
[Coke] m: (1/3).say
camelia 0.333333
Zoffix m: say (1/(2⁶⁴-1)).Num
camelia 5.421010862427522e-20
cono the calculation only happens during stringification. <- going to disagree with this statement, (1/0 + 2/3).Num.say, making `+` is a calculation, the only difference that we are operationg with Rat's. So it strange that I'm totally sure that I have Rat in my variable getting Exception during stringification..., I would accept if it going to die when I want some real value, instead of Rat
Zoffix cono: "<Zoffix> │ cono: I mean in that code."
[Coke] m: (1/3).Str.say 19:50
camelia 0.333333
19:50 zakharyas joined
[Coke] m: (1/3).Num.say 19:50
camelia 0.3333333333333333
Zoffix cono: and there's no division involved in calculation of the sum of two fraction`1/0 + 2/3`
19:51 jmerelo left
Zoffix It's better viewed as Rat.new(1, 0) + Rat.new(2, 3) 19:53
cono Zoffix: indeed, because we are not working with double's (c type), as we are working with Rat, I'm assuming that there numerator and denominator exists
but if I'm converting it to double (not sure what type in p6 as a c's double type), we are going to have exception 19:54
Zoffix cono: Num is C's double
cono then its twice strange :)
Zoffix cono: no, you gonna get -Inf/NaN/Inf depending on the numerator in C too
$ ccc 'printf("%f\n", 1.0/0.0)' 19:55
inf
cono so the only way to find if result giving me `division by zero` exception is to stringify it ?
Zoffix cono: no, you can just see if the denominator is zero. 19:56
19:56 japhb left
Zoffix m: say .denominator ?? "Will explode" !! "No explode" for <1/0>, <-1/0>, <0/0>, <42/42> 19:56
camelia No explode
No explode
No explode
Will explode
Zoffix m: say .denominator.not ?? "Will explode" !! "No explode" for <1/0>, <-1/0>, <0/0>, <42/42>
camelia Will explode
Will explode
Will explode
No explode
Zoffix For <0/0> you can also use .isNaN method to check 19:57
[Coke]: there's a pending PR #1840 that I believe improves on loss of precision there
R#1840 19:58
synopsebot_ R#1840 [open]: github.com/rakudo/rakudo/pull/1840 Unify Rat and FatRat stringification. Fixes some TODO tests.
cono anyway, looks a bit weird... imho, string representation of Rat is $num/$denom. But Num/double representation - exception
Zoffix m: say .head ~ .tail x 1000 with ⅓.base-repeating 19:59
camelia 0.333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333…
Zoffix cono: using such representation is likely to be problematic as you'd be producing something that other tools might have trouble consuming. 20:00
cono .base-repeating should be Num method, as Rat is Num/Denom
raschipi m: say Inf.isNaN;
camelia False
Zoffix cono: what do you mean "Num/Denom"?
Ah, numerator/denominator 20:01
cono yup
sorry, should be lcfirst
Zoffix cono: how would a Num know which part is repeating?
cono good point 20:02
ok, my last statement goint to take back :D
Zoffix cono: if you got any more suggestions, file them on github.com/rakudo/rakudo/issues/new There's currently a TPF grant in progress that's doing work on Rationals, so things that don't break the spec could be implemented as part of it. 20:03
Zoffix relocates
20:03 Zoffix left
cono but anyway thinking that converting to fractional value should give us exception, but stringification should show that we have numerator/denominator 20:03
raschipi cono: you can keep talking to him, he get's the messages with his name sent to his twitter.
cono haha :) 20:04
sorry, just slow typeing
.tell Zoffix 20:03 < cono> but anyway thinking that converting to fractional value should give us exception, but stringification should show that we have numerator/denominator
yoleaux cono: I'll pass your message to Zoffix.
raschipi Casting to Str gives an error because it tries to actualy perform the division.
cono yeah, I understand this piece 20:05
raschipi no need to use the bot, just put his name in the message and his bot will send it to him.
cono my concern is that in my HUMBLE opinion, it shouldn't :)
raschipi What should it do instead? 20:06
cono show something like: .nude.join("/")
TimToady that's gonna look funny in your company's financial report
cono for my companny's financial report I will convert it to fractional number, as it should be with "." in the middle ;) 20:07
TimToady
.oO(In.f)
20:08
cono oh, I know, tomorrow I will make a quiz between my developers in the team, and ask them to give me an aswer what going to be a result of: $_ = 1/0; .say; .Num.say
haha, not in this way :)
raschipi cono: I think it makes sense to be this way to help with a simple use case: using perl 6 as a calculator. 20:13
moritz m: say 1 / (1/0)
camelia 0
moritz that is... mostly wrong 20:14
m: say 1 / Info
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Info used at line 1
moritz m: say 1 / Inf
camelia 0
moritz but not wronger than this
cono m: (1/0).fmt("financial report %0.2f").say 20:15
camelia financial report Inf
cono m: (1/0).Num.fmt("financial report %0.2f").say
camelia financial report Inf
cono and honestly saying with my initial knoledge about .say I would rather to make .Num and if its going to be financial report, I would really like my program dies, instead of putting Inf in :D 20:16
I mean, when I didn't know truth about string representation of Rat, I would not even try fmt w/o previous conversion to Num 20:17
as rational and fractional are different in my mind, and Rational never dies, as it not making actual division, it consist from numerator/denominator 20:20
20:22 wamba left, wamba joined
ingy e: say [[1,2,3]].elems 20:29
evalable6 3
ingy halp
I just lost an hour to this 20:30
cono m: [$[1,2,3]].elems
moritz m: say [[1, 2, 3],].elems
camelia ( no output )
1
ingy *blinks*
ok I'll play with that anyway 20:31
b2gills m: subset Not-Inf of Rational where .denominator; say 1/0 ~~ Not-Inf; my Not-Inf $v = 1/0; 20:33
camelia False
Type check failed in assignment to $v; expected Not-Inf but got Rat (<1/0>)
in block <unit> at <tmp> line 1
b2gills cono: Just use a subset ^ 20:34
ingy e: say [].WHAT, [,].WHAT, $[].WHAT
evalable6 (Array)(List)(Array)
b2gills m: say [[1,2,3],] 20:35
camelia [[1 2 3]]
b2gills ingy: That is the single argument rule
ingy url?
does this rule help more than hurt? :) 20:36
cono b2gills: thanks, but I just raised this concern as I'm thinking that I'm not alone who thinks that it's not like you expect
b2gills ingy: It makes Perl 6 more consistent
20:37 zakharyas left
b2gills It was basically added because of people writing `my @v = [1,2,3]` and getting confused when it turned into `my @v; @v[0] = [1,2,3]` 20:37
ingy so if $aa is an array of scalars and arrays, how do I not flatten it? 20:38
ie how do I map over it and keep my subarrays? 20:39
b2gills Perl 6 doesn't flatten by default, instead you have to turn values into a Slip
Voldenet it's a bit different from perl5 in that aspect, I wish it wasn't 20:40
b2gills [[1,2,3]] doesn't work because of the signature for &circumfix:« [ ] »
Before the GLR it did do a lot of flattening, and it was maddening. It was also difficult for experts to predict. It also prevented some things from even being possible. 20:41
ingy e: my $a = []; $a.push(1); $a.push([2,3]); say $a.perl 20:42
evalable6 $[1, [2, 3]]
b2gills If you have something that is flattening, most of the time you can just itemize it by using `item(…)` or `$…` 20:43
Note that `.push` tends to push single things, while `.append` pushes multiple values 20:44
m: my $a = []; $a.push(1); $a.append([2,3]); say $a.perl
camelia $[1, 2, 3]
ingy e: my $a = []; $a.push(1); $a.push([2,3]); sub f(*@args) { say @args.perl }; f(|$a)
evalable6 [1, [2, 3]]
b2gills Note that there is :( @ ), :( *@ ), :( **@ ), and :( +@ ) 20:45
ingy e: my $a = []; $a.push(1); $a.push([2,3]); sub f(*@args) { @args.map: { say $_ } }; f(|$a) 20:46
evalable6 1
[2 3]
b2gills The reason you have to use | is because it is in a scalar container, so is itemized
ingy e: my @a = []; @a.push(1); @a.push([2,3]); sub f(*@args) { @args.map: { say $_ } }; f(|@a) 20:47
evalable6 1
[2 3]
b2gills m: my $a = []; $a.push(1); $a.push([2,3]); sub f(@args) { @args.map: { say $_ } }; f($a)
camelia 1
[2 3]
b2gills m: my $a = []; $a.push(1); $a.push([2,3]); sub f(+@args) { @args.map: { say $_ } }; f(@$a)
camelia 1
[2 3]
b2gills m: my $a = []; $a.push(1); $a.push([2,3]); sub f(*@args) { @args.map: { say $_ } }; f(@$a)
camelia 1
[2 3]
20:49 unclechu left, mirlur[m] left, lance_w[m] left, Garland_g[m] left, Matthew[m] left
ingy e: my @a = []; @a.push([2,3]); sub f(*@args) { @args.map: { say $_ } }; f(|@a) 20:49
b2gills I generally think that :( +@ ) is the better choice
20:49 AlexDaniel`` left, CIAvash[m] left, wictory[m] left
evalable6 [2 3] 20:49
20:49 ilmari[m] left, mienaikage left
ingy why isn't map flattening here? 20:49
e: my @a = []; @a.push([2,3]); sub f(@args) { @args.map: { say $_ } }; f(@a) 20:50
b2gills Arrays itemize their elements
Where do you want it to flatten? 20:51
ingy does json load arrays or lists?
I don't want it to flatten ever
it is in my code but not here
20:51 reportable6 left 20:52 japhb joined, coverable6 joined, quotable6 joined, reportable6 joined
b2gills don't use the flattening :( *@ ) then, use one of :( @ ) :( **@ ) :( +@ ) 20:52
20:52 shareable6 left
evalable6 [2 3] 20:53
cono b2gills: where to read about thesee signatures? all 4 you showed
ingy b2gills: why did my last eval not flatten? it used *@ 20:54
b2gills It doesn't flatten itemized things (array itemizes, but lists don't)
m: -> *@_ { dd @_ }( (1,(2,3)) ) 20:55
camelia [1, 2, 3]
b2gills m: -> *@_ { dd @_ }( (1,$(2,3)) )
camelia [1, (2, 3)]
TimToady ingy, your last eval used @, not *@
b2gills m: -> **@_ { dd @_ }( (1,(2,3)) )
camelia [(1, (2, 3)),]
b2gills m: -> +@_ { dd @_ }( (1,(2,3)) )
camelia [1, (2, 3)]
b2gills m: -> @_ { dd @_ }( (1,(2,3)) )
camelia (1, (2, 3))
b2gills Again, in generally I prefer the :( +@ ) form 20:56
m: -> +@_ { dd @_ }( 1, (2,3) ) 20:57
camelia [1, (2, 3)]
b2gills m: -> @_ { dd @_ }( 1, (2,3) )
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
cono $(2,3) itemized List ?
b2gills basically `$` there acts like a prefix operator that does the same thing as `item` 20:58
cono what is `item`?
b2gills m: -> *@_ { dd @_ }( (1, item (2,3)) )
camelia [1, (2, 3)]
cono like a container box ?
20:59 sarna joined
b2gills If that helps, that is close enough 20:59
cono :), got it, thanks
sarna hey guys, I'm looking for a fun language to write hacky cli scripts in, is perl6 fit for this task 21:00
b2gills sarna: I think so
21:00 mcmillhj left
b2gills If you wait a minute, I will look for a link for you 21:00
sarna waits
I've been thinking about Ruby as I don't really like Python, but eh 21:01
ingy sarna: what langs do you know?
TimToady no language is fun all of the time, but p6 is pretty fun most of the time
sarna that should be enough TimToady :)
cono p6 is a language for the heart :D
sarna ingy: I've been mostly writing functional stuff/Rust
my first language was Python though 21:02
cono p6 have functional stuff and colored errors like in Rust :D
sarna o!
ingy sarna: you might love coffeescript.org/#try (I do)
sarna délicieux
ingy: ah no, it's definitely not for me 21:03
ingy I am porting coffee to perl6 at the moment
b2gills linuxtot.com/parsing-command-line-a...in-perl-6/
sarna thank you b2gills 21:04
ingy I have a project I'm writing in every lang (coffee, js, perl5, perl6, python) so far. coffee is cleanest
but perl6 is nice too
sarna yeah, but I don't want to deal with node
I won't run those scripts in the browser 21:05
ingy I use coffee as a server scripting lang and hardly deal with node at all
b2gills sarna: I wrote a command for counting bytes, for use on code golfs gist.github.com/b2gills/93d1e2aa6583b95315b2
ingy it's really fantastic
sarna still, I'd rather not :^)
b2gills: I'll definitely check it out. tomorrow though, it's pretty late here 21:06
raschipi Yuck, suggesting Javascript as a fun language means you can
means you're a masochist, ingy
sarna oh wow it's so short
21:06 Matthew[m] joined
sarna will be right back 21:07
b2gills sarna: It also generates a nice error message if you use it wrong
Or use -h
ingy raschipi: it's not js that I write
raschipi coffescript is a dialect of javascript 21:08
b2gills ingy takes write once run everywhere to heart
cono .tell sarna some funcy stuff: multi postfix:<❗>(1) { 1 }; multi postfix:<❗>($x) { $x * samewith($x - 1) }; say 5❗
raschipi java means coffee in english in case you're not aware, they don't even pretend to not be javascript 21:09
cono m: multi postfix:<❗>(1) { 1 }; multi postfix:<❗>($x) { $x * samewith($x - 1) }; say 5❗
camelia 120
ingy raschipi: I don't think you follow, compare these and tell me what's cleanest: github.com/testml-lang/testml/tree/master/lib
raschipi m: multi postfix:<❗>(1) { 1 }; multi postfix:<❗>($x) { $x * samewith($x - 1) }; say 0❗
cono m: multi postfix:<❗>(10 { 1 }; multi postfix:<❗>($x) { $x * samewith($x - 1) }; say 5❗
camelia (timeout)
5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3multi postfix:<❗>(10 7⏏5{ 1 }; multi postfix:<❗>($x) { $x * same
cono should be 0 :) 21:10
b2gills m: sub postfix:<❗> ( UInt $x ) { [*] 1..$x }; say 5❗
camelia 120
raschipi ingy: I don't care for "clean", I care for fun.
ingy coffee is super fun. honestly p6 could take some ideas from it
TimToady b2gills: 2..$x works just as well
21:10 subroot left
TimToady better, even 21:11
ingy coffee certainly took ideas from p6
raschipi It's fun for a masochist.
b2gills TimToady: I am well aware, but I didn't want to introduce too many unfamiliar things at once.
TimToady coffee always felt like a bit of hodgepodge language, on which I'm already too much of an expert :)
ingy raschipi: unless you are trolling me... coffeescript is by far less masochistic than p6 21:12
raschipi ingy, you do realize you're trying to convince me Javascript is fun, right?
ingy I'm not
at all
it sucks
b2gills TimToady: I think it's your shirts absorbing into your brain through osmosis.
raschipi Never though I would see the day someone would try to argue THAT, seriously.
It even uses node, yuck. 21:13
ingy but coffee took a language that was terrible to code and made it cleaner than even p6
raschipi It's still javascript. 21:14
ingy that's like saying all languages are really machine code 21:15
b2gills I think javascript would have been a real nice language if it wasn't forced by management to look like Java
21:15 mcmillhj joined
ingy b2gills: just read coffeescript.org/ for 10 minutes :) 21:15
TimToady we definitely chose to put our DWIMs and our WATs in different places than most other languages
ingy TimToady: you know I hate all langs :) 21:17
I certainly hate coffeescript (just a little less :)
b2gills I find a certain comfort when I see { } 21:18
cono did coffee fixed this incosistency in JS? "0" + 1 vs "0" - 1 ? 21:19
ingy b2gills: ironically you can use all the {} and other (unneeded) syntax that you want
21:19 mcmillhj left 21:20 robertle joined
ingy er, may have spoke too soon on that 21:20
b2gills # {␤ … ␤# } 21:21
ingy I'll give a lightning talk on coffee and p6 next week 21:22
cono: coffeescript.org/#try:%220%22%20%2B%201%0A 21:23
cono: coffee is a straight translation, so no 21:24
21:24 mahafyi left
ingy but it accomplishes an amazing amount while being a straight translation 21:24
21:24 mahafyi joined, wamba left
raschipi Yep, terrible language. Just lipstick on a pig. 21:26
cono well, then going to agree, terrible language, same as JS
sarna is kinda back 21:28
hmm is perl6 still very slow? 21:29
if it's just slow I'm alright with it
raschipi sarna: depends on what you're doing, but generally acceptable
sarna I won't be doing any matrix multiplication for sure
or will I :> 21:30
geekosaur it's better than it used to be. correctness came first, speed is still a work in progress 21:32
but it is in progress now
raschipi The dog slow part is parsing. TimToady is working on it.
cono yeah, much much better than it was. I really see and like progress
21:37 raschipi left
El_Che I remember the days starting was slower than a Moose command line application. Those days are long gone :) 21:38
robertle I have a program that reads large log files (few hundred MB), and matches each line against an if ... ifelse ... ifelse set of regular expressions. that is shockingly slow. but I guess the regexes fall into the "parsing" area and might get some more optimization in the future... 21:42
b2gills m: say sum 1..100000000000 21:47
camelia 5000000000050000000000
El_Che yes, I did a poc of an ldif diff for eg files of 500mb in perl6. I wrote the end version in an other language (that ended being 10-20x faster than the python and perl5 equivalents)
HOWEVER, I see that the speed in the meantime is way beter 21:48
for a lot of my use cases, perl6 is not slow at all
cono I have only one script which slow for me, I wrote a Fastly log searcher, which parse HTTP acccess log, and you can search with it something like: search '.status == 200'. and yeah, looks like grammar/parsing is not efficient still, and maybe because I'm using EVAL 21:54
but code sooo neat :) 21:55
this one: pastebin.com/CPV3J1s2 21:59
ingy b2gills: in the end I just had to change a couple [...] to $[...] 22:01
b2gills: thanks for all the help
22:02 rindolf left 22:12 MasterDuke joined
AlexDaniel quotable6: foobar 22:13
quotable6 AlexDaniel, OK, working on it! This may take up to three minutes (4582161 messages to process)
AlexDaniel, Something went wrong (Commit exists, but a perl6 executable could not be built for it)
AlexDaniel whooops
m: say 42 22:14
camelia 42
AlexDaniel but anyway, is matching ≈128000 strings per second against a relatively simple regex considered fast or slow? 22:16
robertle guess it depends on whether you are watching or going to get a coffee in the meantime ;) 22:18
AlexDaniel hmmm actually I think I lied, it's a bit less than that 22:19
because quotable6 starts several processes for that actually
so just about 32000. Slow. 22:20
22:20 Khisanth left
AlexDaniel sarna: fwiw interesting graph: tux.nl/Talks/CSV6/speed4.html 22:21
22:23 mcmillhj joined 22:28 robertle left, mcmillhj left
ingy can I make a sub return zero values like in perl5? 22:29
timotimo you can return Empty
ingy ta
timotimo though since i'm no 5er, that may be wrong 22:30
ingy it's right 22:31
I think
e: f { return Empty }; my @a = f(); say @a.perl
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/iUzl_5bkqi
Undeclared routine:
f used at line 1
ingy e: sub f { return Empty }; my @a = f(); say @a.perl 22:32
evalable6 []
ingy e: sub f { return }; my @a = f(); say @a.perl
evalable6 [Any]
ingy fwiw my new lang implemented in every other lang has a complete type system, and it's the hardest part to get the tests passing 22:33
after that it's pretty much a breeze
jnthn e: sub f { return () }; my @a = f(); say @a.perl
evalable6 []
jnthn That's 3 chars shorter than Empty and also works :)
ingy jnthn: I thought I tried that :\
22:34 breinbaas left
ingy it seemed dwimy 22:34
jnthn: you coming to utah next week?
22:34 breinbaas joined
jnthn ingy: No, 'fraid not 22:35
ingy jnthn: ha, in my code () behaves different than Empty
jnthn They're not equivalent in general 22:36
Empty is an Slip, () is a List 22:37
ingy ah
jnthn This doesn't matter for the case you wrote here, but I guess it does for the other one :)
ingy I don't check for Slip I do for List
actually I don't check for either 22:38
there's another difference I guess
cono jnthn: would you mind to look into my 2 merge request to cro::http? :) let me know if I need further rework 22:39
ingy ah. .defined is different
22:40 mcmillhj joined
cono jnthn: really want this merge request to promote: github.com/cono/react-tutorial/blo.../server.p6 , but dependent on these 2 for cro::http 22:40
jnthn cono: Merged one, left a minor tweak request on the other. 22:44
cono looking, ty 22:45
jnthn ooh, getting a Perl 6 example into the react tutorial would be very nice indeed :)
cono++ 22:46
ingy jnthn: is a ~~ b communative?
prolly not...
jnthn ingy: No, RHS controls semantics
22:47 lizmat left
geekosaur it's b.ACCEPTS(a), with a thunked, iirc 22:47
22:47 mcmillhj left, Khisanth joined
jnthn Yes, $_ is set to the evaluation of b temporarily 22:49
Um, wait, a
22:50 yoleaux joined 22:51 ChanServ sets mode: +v yoleaux, cognominal joined 22:53 lizmat joined 22:59 HaraldJoerg left 23:02 pecastro left 23:03 pecastro joined 23:12 Xliff joined
Xliff \o 23:12
23:15 Matthew[m] left 23:16 kaare_ left 23:26 mcmillhj joined 23:29 markoong left 23:31 mcmillhj left 23:33 Matthew[m] joined 23:35 Schepeers_ joined 23:37 Schepeers left 23:39 w_richard_w joined 23:41 Kaiepi left, mcmillhj joined, Schepeers_ left 23:43 Schepeers joined 23:45 mcmillhj left 23:59 MilkmanDan left