»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
thundergnat Should a failed open() set $! ? I was under the impression that it would but it doesn't on my system. 00:33
m: open("bogus/directory/file.txt") or die $! # EG 00:34
camelia
in block <unit> at <tmp> line 1
thundergnat Or am I perhaps just confused with Perl 5? 00:35
thundergnat The docs imply that it will return a failure, but not exactly where that failure will be set. 00:37
Xliff thundergnat: If open fails, it should throw an exception. 00:42
thundergnat Yeah, it should... but where is that exception so I can pass it along? It isn't in $_, it isn't in $!. Where is it? 00:44
MasterDuke saw this in hackernews, thought people might be interested rosie-lang.org/, a PEG implementation 00:46
thundergnat A failed open definitely returns a Falsey value because the die gets called above, but I'd like to let the user know _why_ it failed. 00:47
Xliff thundergnat: You'd have to use a try/catch block to inspect the exception and react accordingly.
thundergnat m: try open("./bogus/directory/file.txt", :w) or die; CATCH { default { say $_, $! } } # nope 00:53
camelia ( no output )
thundergnat m: open("./bogus/directory/file.txt", :w) or die; CATCH { default { say $_, $! } } # nope
camelia Died
in block <unit> at <tmp> line 1
Nil
thundergnat eval open("bogus/directory/file.txt") or die $! # perl5 00:56
bah, no perl5 bot.
Well, after poking around a bit in roast, it looks like a failed open DOESN'T return a failure, despite what the docs say, it just returns an undefined value and somehow _you_ have to figure out why it failed.. That's LTA. (I would be delighted to be proven wrong.) 01:06
Ok, if you actually want to get a failure, you need to pass a file handle to open, not just a path string. 01:13
m: my $fh = "bogus/directory/file.txt".IO; open($fh) or die $! 01:14
camelia
in block <unit> at <tmp> line 1
thundergnat Nope. That doesn't work either. Sigh.
SmokeMachine does any one have any idea why on this function (github.com/FCO/Red/blob/better-clo...q.pm6#L64) the `%poss` inside the `CONTROL` is different from outside? 01:17
here's how I test it... www.irccloud.com/pastebin/ZQcMCU99/ 01:18
thundergnat m: my $fh = IO::Handle.new( :path( "bogus/directory/file.txt".IO.path ) ).open or die $! # ok, I give up
camelia IO::Handle is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in method new at src/RESTRICTED.setting line 32
in block <unit> at <tmp> line 1
MasterDuke thundergnat: you can use evalable6 or committable6 for i/o stuff, they don't use the restricted settings 01:27
AlexDaniel, jmerelo: squashathons once a month might be hard to keep up. maybe align them right before star releases? could do something like one for docs, one for roast, one for ecosystem unbitrotting, and one whatever else is decided 01:33
SmokeMachine: different how? different contents? different WHICH? 01:37
Xliff m: my ($a, *@b) = ^5; say $a; say @b 02:37
camelia 0
[1 2 3 4]
Xliff m: my ($a, *@b) = ^5; say $a; say @b.flat
camelia 0
(1 2 3 4)
Xliff m: my ($a, *@b) = ^5; say $a; say @b[0]
camelia 0
1
holyghost Xliff: I sent you some email 02:59
Xliff: I don't know how to login without pass anymore, I have to look that up, but with my key _and_ pass I should be able to login 03:00
watch out for not setting a pass as if my box gets stolen, people can login freely 03:01
you can see it in .bash_history for example
holyghost the mac is the same but routes aren't always clear 03:02
Then another thing, not all versions of ssh clients on windows are key configurable. 03:05
I am on windows in the weekend with my children 03:06
So my dad's network is ok
holyghost I once had the problem by using linux there that the rom code of the DSL router got changed 03:09
Xliff OK. Do you want to use that key for git, too? 03:10
Xliff If so, you will have to scp it up to the shell. 03:10
(the private part)
holyghost no
Xliff Otherwise, you can use ssh-keygen there and download those files to your home machine.
I would prefer that last bit.
One sec.
holyghost I can also use git locally 03:11
I don't mind that
(I might be confused with cvs :pserver) 03:12
so nobody sees the checked in code
holyghost thanks for serving me Xliff :-) 03:20
holyghost note that perl6 chews up RAM but it should be ok with swap space 03:21
except for the image AFAIK 03:23
holyghost Xliff: AI-Agent-Embedded is strictly for Nintendo hackers, I'm just telling you so we don't get into trouble, I've uploaded it 03:39
s/Nintendo/Amiga
holyghost s/Nintendo/Nintendo and Amiga (M68000) 03:40
holyghost Xliff : I'm going to leave it where it is except for some minor modifications, AI-Agent-Embedded is an exclusive for your server later on 04:05
Xliff: It's just a gift I mean as a thanks for serving me :-)
Xliff LOL 04:06
You will be serving me, soon enough.
holyghost yes taskmaster...
Xliff The Gnomes, Trolls and Knolls clan need minions. :) 04:07
G'night!
holyghost thanks, gn
timotimo m: my $fh = "bogus/directory/file.txt".IO; open($fh) 04:15
camelia Failed to open file /home/camelia/bogus/directory/file.txt: No such file or directory
in block <unit> at <tmp> line 1
timotimo m: my $fh = "bogus/directory/file.txt"; open($fh) 04:16
camelia Failed to open file /home/camelia/bogus/directory/file.txt: No such file or directory
in block <unit> at <tmp> line 1
timotimo thundergnat: i'm not sure what problems you were having
except probably that you're not expecting that it returns a Failure?
holyghost timotimo: or die on $! he said 04:19
timotimo right 04:23
sorry, i had to go afk real quick in the middle of the next sentence
the important part is that orelse and andthen set $_, not $!
m: open("bogus/file.txt") orelse die $_
camelia Failed to open file /home/camelia/bogus/file.txt: No such file or directory
in block <unit> at <tmp> line 1
timotimo alternatively, do anything with it and it'll asplode, or explodify it directly with .self
thundergnat: i hope that helps, maybe you can find a good place in the docs where that could be pointed out more clearly 04:24
Xliff m: my sub a($a is rw) { say '1' without $a }; a(Nil) 04:39
camelia Parameter '$a' expected a writable container, but got Any value
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my sub a($a? is rw) { say '1' without $a }; a(Nil) 04:40
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use 'is rw' on optional parameter '$a'.
at <tmp>:1
holyghost Xliff: maybe write a cron job for git-publishing $HOME/perl6 ? 05:20
Xliff: else I'll put everything to be published in $HOME/perl6/github.local 05:22
Xliff No. For now, you should not think about publishing ANYTHING until you have tests for your code.
holyghost I've made the directory
ok 05:23
never mind
Xliff Unless you are pushing to the git repository. You can commit to git as much as you like, but dont' think about CPAN until you have a test suite.
And now I have to lie back down. Woke up to take an asprin.,
holyghost You want me to have fully working code on the local github ? 05:24
just asking
Xliff No. That does not matter. Just do NOT send anything to CPAN for a while.
holyghost I do not 05:25
timotimo explained that
why then not make a cron job for pushing to local git ?
Xliff And now I have to lie back down. Woke up to take an asprin!
holyghost once a day 05:26
Xliff TBH, if you want to push to git via cron, that's your call.
Just make sure you don't break anything.
holyghost AFAIK crontab ? 05:27
Xliff And I am going to lie down, now.
holyghost anyway, I'll try to fixify as a user
holyghost get well soon ! 05:27
crontab : command not found, ok 05:29
never mind, I'll write a script myself 05:30
I just gave food to my 7 birds, they're allright, they get to get up at 6am. the Gnoll crew :-) 05:33
I have 4 cages with couples except for the canarie 05:35
ther're parrots :-)
s/ther'/they'/
holyghost hi jmerelo 06:35
have a nice breakfast :-) 06:36
Geth_ doc: ff2e2bcf01 | (JJ Merelo)++ | doc/Type/Mix.pod6
Improves documentation and examples for Mix

The example for the second case was reproduced over and over, but it didn't behave the same in the first example, so I have changed it to a new one and explains behavior. Also adds another example for `is`, which uses a different mechanism, `STORE`
Closes #2459
06:54
synopsebot_ Link: doc.perl6.org/type/Mix
ufobat___ .tell leont thank you for the help :-) looking forward for a release :p 09:00
yoleaux ufobat___: I'll pass your message to leont.
AlexDaniel e: say 42 10:18
evalable6 42
AlexDaniel uhhhhhhhhh
.tell MasterDuke same can be said about rakudo releases :) But so far it wasn't bad, it's just that we need better ideas
yoleaux AlexDaniel: I'll pass your message to MasterDuke.
AlexDaniel where is the bot
if anybody was talking in the last few hours, sorry but nobody saw your messages
because the bot that gives voices is not there? 10:19
Geth_ ecosystem: ccworld1000++ created pull request #418:
add CCColor
10:22
AlexDaniel OK voices given, now where is the bot…
is the spam attack still going?
lizmat well, it *is* in irc.perl.org
rindolf AlexDaniel: which bot? 10:23
AlexDaniel rindolf: p6bannerbot 10:23
AlexDaniel ok that thing can work as a workaround for now 10:24
Geth_ ecosystem: 9405143a50 | CC++ (committed using GitHub Web editor) | META.list
add CCColor

Simple and flexible color color conversion module for Perl 6
10:34
ecosystem: 1dee200a97 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #418 from ccworld1000/patch-4

add CCColor
tobs` m: use Test; sub expo ($x, $e) is assoc<right> { $x**$e }; is [[&expo]] (2,3,4), [**] (2,3,4) 10:52
camelia Earlier failures:
Numeric overflow
in sub expo at <tmp> line 1
in block <unit> at <tmp> line 1

Final error:
Cannot resolve caller is(Failure); none of these signatures match:
(Mu $got, Mu:U $expected, $desc = "")
(Mu $go…
tobs` m: use Test; sub expo ($x, $e) is assoc<right> { $x**$e }; is ([[&expo]] (2,3,4)), ([**] (2,3,4)) # don't be so greedy 10:53
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: '2417851639229258349412352'
# got: '4096'
tobs` it seems like is assoc<right> is not honoured when reducing a mere function 10:54
and R#2147 is what prevents me from using a proper operator 10:56
synopsebot_ R#2147 [open]: github.com/rakudo/rakudo/issues/2147 [SEGV] segfaults raised when trying with this code.
andrzejku .seen araraloren 11:34
yoleaux I saw araraloren 4 Nov 2018 16:06Z in #perl6: <araraloren> Zoffix okay, thanks :)
andrzejku .seen loren
yoleaux I saw loren 8 Jul 2016 13:51Z in #perl6: <loren> e, ^_^ .. haha don't mind
scimon Sometimes I hate the work VPN. 11:54
azawawi hi 13:19
blog.discourse.org/2018/11/free-ho...source-v2/ # if we're interested in a perl6 users discourse free hosting site
lizmat looks interesting I guess 13:22
azawawi :(
:)
lizmat: hi :)
lizmat: meta.discourse.org/ 13:23
i started working on github.com/azawawi/p6-webservice-discourse to be able to use it from perl6 13:24
wip
most actions you do on the discourse website can be done with the api 13:25
WebService::Discourse once finished would be able to do these tasks github.com/discourse/discourse_api...r/examples 13:27
AlexDaniel eiro: hi o/ 13:56
El_Che eiro in da house 14:02
eiro: ça va, mon copain?
thundergnat .tell timotimo Ah! I was stuck in Perl5 mode and expected a failed open to set $! That ought to go into traps at least. Thanks! 14:03
yoleaux thundergnat: I'll pass your message to timotimo.
eiro El_Che, yes but we should probably use english in this channel 14:08
thundergnat .tell timotimo In particular, these paragraphs are misleading (pertaining to failed open): github.com/perl6/doc/blob/master/d....pod6#L542
yoleaux thundergnat: I'll pass your message to timotimo.
jnthn m: my $x = 0/0 16:09
camelia ( no output )
jnthn m: my $x = 0/0; dd $x
camelia Rat $x = <0/0>
jnthn Is there any way to make these things blow up a bit more eagerly?
(I'm fine with calling a method, or similar) 16:10
moritz m: my $x = 0/0; say $x.Num 16:11
camelia NaN
jnthn Also for debate: should `to-json` be turning these into NaN?
Because, at least for JSON::Fast, it explodes. 16:12
oh, apparently JSON doesn't allow NaN?
I probably exception rather than NaN anyway, in my case, though. 16:13
m: my $x = 0/0; ~$x
camelia WARNINGS for <tmp>:
Useless use of "~" in expression "~$x" in sink context (line 1)
Attempt to divide by zero when coercing Rational to Str
in block <unit> at <tmp> line 1
jnthn Guess I can always say "if it's a Rat, check if we can stringify it" :) 16:14
m: my $x = 0/0; say $x == 0/0
camelia False
jnthn m: my $x = 0/0; say $x === 0/0
camelia True
jnthn Ah, *that*'d work.
(For detecting it)
AlexDaniel yeah but what about infinity 16:15
maybe .denominator == 0 ? 16:16
jnthn ah, good point
AlexDaniel there's also .norm 16:17
jnthn m: my $x = 0/0; dd $x.norm
camelia <0/0>
AlexDaniel ah oops, my bad
“Returns a normalized Rational object, i.e. with positive denominator, and numerator and denominator coprime.” 16:18
well that's wrong then
tobs` m: 0 gcd 0
camelia WARNINGS for <tmp>:
Useless use of "gcd" in expression "0 gcd 0" in sink context (line 1)
tobs` m: say 0 gcd 0
camelia 0
tobs` :)
wrong twice 16:19
AlexDaniel D#2463 16:20
synopsebot_ D#2463 [open]: github.com/perl6/doc/issues/2463 .norm “Returns a normalized Rational object, i.e. with positive denominator”
jnthn I'll probably just check .demoninator 16:21
timotimo jnthn: JSON::Fast has an option that makes it allow NaN, -Inf, and Inf 16:32
not sure about -0
lizmat . 16:37
timotimo it's a dynamic variable for that 16:38
Geth_ doc: ca6e7ac018 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Rational.pod6
Document Rational.norm as deprecated
18:14
synopsebot_ Link: doc.perl6.org/type/Rational
tbrowder___ .seen DrForr 19:20
yoleaux I saw DrForr 5 Oct 2018 17:53Z in #perl6: <DrForr> Sounds like something for the docs :)
buggable New CPAN upload: PDF-ISO_32000-0.0.1.tar.gz by WARRINGD cpan.metacpan.org/authors/id/W/WA/...0.1.tar.gz 19:27
kudzo_ is there any way to pass std::string as argument to native('') without writing additonal C code for wrapping it? 21:53
leont I wouldn't expect so 22:22
yoleaux 09:00Z <ufobat___> leont: thank you for the help :-) looking forward for a release :p
Xliff m: my @a = <a b c d e f>; @a.clone.splice(2, (1, 2, 3)).say; @a.splice(2, |(1,2,3)).say; 23:50
camelia Cannot resolve caller splice(Array: Int, List); none of these signatures match:
(Array:D \SELF: *%_)
(Array:D: Whatever, *%_)
(Array:D: Callable:D $offset, *%_)
(Array:D: Int:D $offset, *%_)
(Array:D: Whatever, Whatever, …
Xliff m: my @a = <a b c d e f>; @a.clone.splice(2, 0, (1, 2, 3)).say; @a.splice(2, 0, |(1,2,3)).say;
camelia []
[]
Xliff m: my @a = <a b c d e f>; (my @b = @a.clone).splice(2, 0, (1, 2, 3)); @a.say; @a.splice(2, 0, |(1,2,3)); @a.say; 23:51
camelia [a b c d e f]
[a b 1 2 3 c d e f]
Xliff m: my @a = <a b c d e f>; (my @b = @a.clone).splice(2, 0, (1, 2, 3)); @b.say; @a.splice(2, 0, |(1,2,3)); @a.say;
camelia [a b 1 2 3 c d e f]
[a b 1 2 3 c d e f]
Xliff m: my @a = <a b c d e f>; (my @b = @a.clone).splice(2, 0, [1, 2, 3]); @b.say; 23:52
camelia [a b 1 2 3 c d e f]
Xliff m: my @a = <a b c d e f>; (my @b = @a.clone).splice(2, 0, [1, 2, 3].Array); @b.say;
camelia [a b 1 2 3 c d e f]
Xliff m: my @a = <a b c d e f>; (my @b = @a.clone).splice(2, 1, [1, 2, 3].Array); @b.say;
camelia [a b 1 2 3 d e f]
Xliff m: my @a = <a b c d e f>; (my @b = @a.clone).splice(2, 1, ([1, 2, 3]).Array); @b.say;
camelia [a b 1 2 3 d e f]
Xliff m: my @a = <a b c d e f>; (my @b = @a.clone).splice(2, 1, ([1, 2, 3])); @b.say; 23:53
camelia [a b 1 2 3 d e f]
Xliff m: my @a = <a b c d e f>; (my @b = @a.clone).splice(2, 1, [1, 2, 3]); @b[2].say
camelia 1
Xliff m: (0..0).eager.say 23:55
camelia (0)
Xliff m: 0..0.eager.say
camelia WARNINGS for <tmp>:
(0)
Useless use of ".." in expression "0..0.eager.say" in sink context (line 1)
Xliff m: 0..0.say
camelia WARNINGS for <tmp>:
0
Useless use of ".." in expression "0..0.say" in sink context (line 1)