»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
cognominal Why io.d throws an exception on a missing directory? I would like some sort of Exception (or Failure?) that boolify to false and is passed to chained methods lke Nil does. 00:01
Certainly it does not deserve a throw.
timotimo well, maybe you want .IO.e && .IO.d? or something? 00:02
cognominal I meant .IO.d 00:03
timotimo yes
.d seems to only be "is it a directory?"
yoleaux Sorry, I couldn't find a definition for 'seems to only be "is it a directory?"'.
timotimo rather than "does it exist, and is it a directory"?
cognominal github.com/rakudo/rakudo/blob/nom/.../IO.pm#L47 00:04
timotimo ah, interesting 00:05
so if you .e && .d, you'll actually stat it for existence twice in a row
well, i hope stat is cheap
cognominal "/foobar-nor-a-dir|.io.d.mymethod-derived-from-IO() || .fail # what I would like to write 00:06
hum, something like that. I don't know how to get to the failure to throw it. 00:07
timotimo i'm confused
what do you want the code to do? 00:08
cognominal if the .d is false, I would like it to be an exception that I can throw myself, so that means a defined exception that would boolify to false. 00:09
And acts like Nil on chained methods.
But I don't know how to get to it at the right of the ||
timotimo that seems like orelse would do the trick 00:10
cognominal bed time.
My ideas are fuzzy
orelse sound like it.
timotimo orelse will give you a $_ on the right hand side that is the value of what fails on the left side
cognominal "/foobar-nor-a-dir".io.d.mymethod-derived-from-IO() orelse $_.fail 00:11
segomos_ i thought it was :d to test if it was a dir
timotimo that also exists, but i think you have to .IO ~~ :d 00:12
because matching against a pair calls the pair's key as a method on the object and compares it to the value of the pair 00:13
so :d is "d" => True
so "call .d and compare it to True"
i'm still amused by the pygments lexer thinking "method s() { ... }" is a big substitution operator 00:14
cognominal that would be nifty but that means many semantic changes : 1/ defined exception returning false, or defined with "but false" and exception acting like Nil on method chaining.
segomos_ seems like the concurrency issues i was having with IO::Socket::Async in perl6-j are resolved :-)
thank you to whomever is working on it 00:15
cognominal timotimo++ for signaling me the orelse
timotimo i'm aware of it because i recently spent some time on it
mostly tests, though
TimToady we used to have pairs compare to the value, but that turned out to be a bad idea, so smartmatch on a pair is only for true/false 00:16
timotimo oh? what's the bad idea about it?
TimToady so :d does not, in fact, compare against True
timotimo well, okay, if you implement it as "smartmatch against the value", that'll be problematic with :d and :!d 00:17
because that'd always give True or False
m: say True ~~ True
camelia rakudo-moar 1a3706: OUTPUT«Potential difficulties:␤ Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead␤ at /tmp/0MlgJ8M3e6:1␤ ------> say True ~~⏏ True␤TrueTrue␤»
TimToady :s is supposed to be true for non-zero-sized files, not just files of size 1
timotimo oh
TimToady or files of size True
timotimo wrote a "create supersmartmatcher" routine for the spesh log to diff tool in moarvm's tools directory 00:18
so that you could have a pair as the matcher and the key will be the value it'll be smartmatched against 00:19
(recursively)
i don't know if i said this in here before, but when using qast and stuff in perl6 code with :from<NQP> becomes robust enough, it'd be a good time to build a deparse module, IMO 00:20
cognominal what :from<NQP> does? 00:21
timotimo you can "use Foo::Bar:from<NQP>" to import an nqp module into perl6 code 00:22
kind of like the :from<Java> we already have on rakudo-jvm
cognominal r: say Exception.isa(Nil) 00:24
camelia rakudo-jvm 1a3706: OUTPUT«(timeout)»
..rakudo-{parrot,moar} 1a3706: OUTPUT«False␤»
cognominal I suppose that would be too costly to have exception riding on method chaining like Nil. Testing for .isa(Nil) would cost more than testing for Nil. 00:27
Mouq Pretty serious, IMO, bug: 00:39
for .isa(Nil) would
cost more than testing for Nil.
gah
Mouq sorry 00:39
echo '1+' > Uhh.pm6
perl6 -e'use lib <.>; use Uhh; '
Unhandled exception: Cannot find method 'Stringy': no method cache and no .^find_method
...
('1+' is just an example; any compile-time error seems to do it) 00:41
raiph Mouq: reproduced using fresh rakudobrew build moar 00:48
raiph@feather:~/work/slangs$ echo 'say 1+' > Uhh.pm6
raiph@feather:~/work/slangs$ perl6-debug-m -e 'use lib <.>; use Uhh'
===SORRY!===
Start argument to substr out of range. Is: -1, should be in 0..0
Ah. Sorry. That's unrelated I think (jnthn said he hoped get to it soon) 00:50
timotimo m: echo '1+'
camelia rakudo-moar 1a3706: OUTPUT«===SORRY!=== Error while compiling /tmp/F8l1Xap9Sp␤Undeclared routine:␤ echo used at line 1␤␤»
timotimo ah, that's what the error is 00:51
mhh, better catch some sleep
Mouq raiph: Thanks! 00:54
raiph goodnight timotimo
Mouq: Does it make sense to create and add a spectest that would have caught your error and if so, would you be able/willing to help me do so? 01:07
Mouq_ raiph: Definitely! :) 01:41
raiph cool :)
Do you know of a doc I could follow? 01:43
Mouq_ raiph: Not that I know of; But my guess is that a test could be used in S10-packages/basic.t or so ( github.com/perl6/roast/tree/master/S10-packages ) 01:47
raiph m: use Test; say Test.WHY # you never know :) 01:49
camelia rakudo-moar 1a3706: OUTPUT«(Any)␤»
Mouq_ maybe something like `try EVAL "use lib <.>; use SyntaxError"; is $!, X::Syntax::Confused` 01:51
s/use lib <.>// 01:52
raiph: And then fudging is just putting the line `#?rakudo todo 'reason'` above the test 01:53
raiph Mouq_: Awesome help, thx. What's your tz -- will you be around for next hour or so? 01:55
chenryn why there is only json in perl6 core? while the yaml.pm6 can only dump but not load... Is yaml not needed?
Mouq_ raiph: EST, and yup :)
Mouq_ chenryn: JSON was needed for.. I think modules, which use JSON for configuration (?) 01:57
chenryn: As for why Perl 6 doesn't have a YAML parser... :( I've often wondered that myself 01:58
raiph cherryn: it's only a little bit of it and not exposed for general use, please ignore that bit in core. (see irclog.perlgeek.de/perl6/2014-06-09#i_8843679) 01:59
Mouq_ m: say from-json(q[{ "abcd" : 123 }]) # Sure about that? 02:01
camelia rakudo-moar 1a3706: OUTPUT«{"abcd" => 123}␤»
Mouq_ (Dang lexically scoped core) 02:03
So who wants to translate github.com/ingydotnet/yaml-pm/blob.../Loader.pm ? :9
TimToady hmm, after upgrading to linux mint 17 and doing 'apt-get install mono-complete', my niecza won't run or even compile 02:04
Mouq_ (I'm kidding; I'm sure a grammar would be better suited)
Mouq Aha! github.com/ingydotnet/yaml-pgx 02:07
Pretty basic, but it's better than nothing
raiph Mouq: Did you see github.com/ingydotnet/yaml-pm6/ (doesn't build per 75.134.170.198:3001/report) 02:09
TimToady mono version has jumped from 2.10 to 3.2, eep 02:10
[Coke] .d coleda 02:12
yoleaux Sorry, I couldn't find a definition for 'coleda'.
Mouq .d yoleaux 02:15
yoleaux Sorry, I couldn't find a definition for 'yoleaux'.
Mouq raiph: Yes :/ I've been hoping ingy would fix TestML.pm6 since all of YAML.pm6's tests are written for it 02:16
Mouq sees how long it'll take him to whip up an YAML::Tiny 02:17
BenGoldberg Mouq, yoleaux is pronounced the same as 'YOLO', and acronym meaning 'You Only Live Once', which means "you should do stupid things now, since you won't get to do stupid things when you're dead" 02:19
Mouq BenGoldberg: Haha, well sometimes I like to imagine that people actually mean Carpe Diem when they say it, but then reality kicks in 02:22
Mouq And instead of plucking the blossoming day they've decided on puking just outside the bathroom door 02:24
Though most of the time I hear "YOLO", it's sarcastic, happily 02:25
BenGoldberg doesn't quite understand why yolo/carpe diem seems to mean, "I/You should get so drunk that puking happens." Surely it should also include things like sex, Waterskiiing, Skydiving/BASE Jumping, etc. 02:27
Mouq It should 02:28
And does 02:29
but YOLO
raiph m: use t::spec::packages::A; # is the github.com/perl6/roast/tree/master/packages readme correct? should something like this work with camelia? with a local install? 02:48
camelia rakudo-moar 1a3706: OUTPUT«===SORRY!===␤Could not find t::spec::packages::A in any of: /home/p6eval/.perl6/2014.05-167-g1a3706c/lib, /home/p6eval/rakudo-inst-2/languages/perl6/lib, /home/p6eval/rakudo-inst-2/languages/perl6/vendor/lib, /home/p6eval/rakudo-inst-2/languages/perl6/si…»
raiph Mouq: ^^ ?? 02:51
Mouq raiph: See github.com/perl6/roast/blob/master...sic.t#L158 02:55
"This way, we can just use t::spec::packages::Whatever; 02:56
"
^^^ That I think is pretty incorrect 02:57
Mouq Also, I 02:59
well, nvm
:P
raiph heh, but thx :)
Mouq is a little out of it tonight
raiph np
Mouq m: use Test; say Test::&ok.WHAT 03:00
camelia rakudo-moar 1a3706: OUTPUT«===SORRY!=== Error while compiling /tmp/nZ70USn6HD␤Calling 'ok' requires arguments (if you meant to operate on $_, please use .ok or use an explicit invocant or argument)␤ Expected any of: :($cond, Any $desc = { ... })␤at /tm…»
Mouq m: use Test; say Test::<&ok>.WHAT
camelia rakudo-moar 1a3706: OUTPUT«(Any)␤»
BenGoldberg m: use Test; say &Test::ok 03:01
camelia rakudo-moar 1a3706: OUTPUT«(Any)␤»
BenGoldberg m: use Test; say Test::<&ok>
camelia rakudo-moar 1a3706: OUTPUT«(Any)␤»
BenGoldberg m: use Test; say &ok
camelia rakudo-moar 1a3706: OUTPUT«sub ok (|) { #`(Sub|59050272) ... }␤»
Mouq m: use Test; say Test::.keys
camelia rakudo-moar 1a3706: OUTPUT«EXPORT␤»
Mouq wonders if the YAML spec is actually a modern labyrinth 04:17
chenryn Is ingy still write perl6? 04:20
segomos_ how do i check to see if a socket is still open? 04:27
ingy hi chenryn 04:38
I write perl6, but only in spirit at the moment :)
heya Mouq 04:40
I've been doing some modern yaml stuff lately 04:41
some of which you seem to have found
yaml.pgx is really new, so expect it to flesh out quite a bit soon
Mouq ingy: Okay, thanks! I did spend two hours on a YAML::Tiny, but I'm having a lot of trouble with the Tiny part, so I may abandon it 04:50
FROGGS_ .tell Mouq no, not really. need to fix that 05:31
yoleaux FROGGS_: I'll pass your message to Mouq.
ChoHag Is there any way to keep the jvm loaded and avoid the startup cost? 06:13
timotimo yes, the evalserver thing exists 06:17
we use it to run the test suite in a reasonable amount of time
ChoHag How does that work then? 06:21
timotimo i didn't use rakudo-jvm in a long time, sorry 06:25
the makefile should give you some hints
you start the eval server and it gives you a cookie that you have to provide in the client in order to be allowed to connect
sergot morning o/ 07:05
FROGGS morning 07:06
yoleaux 10 Jun 2014 21:47Z <lizmat> FROGGS: does it make sense to have CUR::Local::File instances if which the directory does not exist ?
10 Jun 2014 21:51Z <lizmat> FROGGS: or CUR::Local::Installation for that matter ?
10 Jun 2014 22:46Z <Mouq> FROGGS: With your slang example, what is matched by `use COBOL; test ` is `; test `. Is the inclusion of the semicolon intentional?
FROGGS .tell lizmat perhaps yes... this way you could have a repo pointing to your usb stick 07:07
yoleaux FROGGS: I'll pass your message to lizmat.
lizmat good *, #perl6! 07:27
yoleaux 07:07Z <FROGGS> lizmat: perhaps yes... this way you could have a repo pointing to your usb stick
FROGGS morning lizmat
lizmat FROGGS: would it be too much too ask to mount your USB stick *before* starting to run the program ?
also: a USB stick sits on a mount point, which usually *is* a directory underneath 07:28
FROGGS lizmat: what if you have pulled out the stick... do you want to change your configuration every time?
lizmat: the lop level dir of that mount point exists, correct
lizmat it's not about the configuration, it's about what sits in @*INC
FROGGS but the MyCPAN/lib/whatever does not
ahh 07:29
yes, we don't need to put that in @*INC then
lizmat whenever we create the CUR::Local::object
ok, then we are in agreement :-)
breakfast&
FROGGS :o) 07:32
lizmat FROGGS: when trying to make "use lib" lexical, I found that somehow exporting variables seems to be done at runtime, rather than at compile time 08:16
but exporting subs *does* work at compile time 08:17
so I was thinking of creating a global sub INC { @*INC }
and export another sub INC { local setting closure } when doing "use lib"
moritz the problem with variables is that at compile time, only the proto lexpad is available 08:18
not the actual lexpad
lizmat indeed, but a closure would be available, afaics
dalek rlito: 11913e2 | (Flavio S. Glock)++ | src5/util/perlito5.pl:
Perlito5 - command line - fix @INC order
08:18
lizmat scratches the INC idea 08:40
lizmat FROGGS: I'm starting to think we need to special case "use lib" in the grammar 08:48
and generate a temp @*INC in the scope it is called
*have it
FROGGS hmm, I was hoping we can solve it in a better way... 08:49
moritz that doesn't make me very hopeful about extensibilty through modules
lizmat the other solution to have exporting @*INC at compile time with proper visibility at compile time work 08:50
*is
lizmat moritz: are you implying a replacement for lib.pm6 ? 08:55
or something else ?
moritz lizmat: not at the moment :-)
lizmat: but I'm pretty sure the equivalent of Par::Packer might want to do something like that 08:56
lizmat that would be a matter of creating a custom Compunit::Repo object, and putting it in @*INC
if I understand Par::Packer's functionality
FROGGS froggs@TL02L-R8RXTCW-linux:~/dev$ echo 'sub EXPORT(|) { say "exported hurz"; my %h; %h<$hurz> = 42; %h }' > Hurz.pm
froggs@TL02L-R8RXTCW-linux:~/dev$ perl6-m -I. -e 'use Hurz; BEGIN say $hurz'
exported hurz
42
lizmat: ^^ 08:57
I think for the @*INC case you get a redecl error message
lizmat FROGGS: that doesn't work if Hurz.pm is already compiled 08:58
afaik
(like in the lib.pm6 case)
FROGGS hmmm, exporting @*INC has no effect, but @INC does... 08:59
lizmat perhaps a deserialization issues ?
FROGGS lets see
froggs@TL02L-R8RXTCW-linux:~/dev$ perl6-m --target=mbc --output=Hurm.moarvm Hurz.pm
froggs@TL02L-R8RXTCW-linux:~/dev$ perl6-m -I. -e 'use Hurz; BEGIN say @INC'
exported hurz
42
err
no, also without the type it works 09:00
typo
-.-
MODULE_DEBUG: done loading /home/froggs/dev/Hurz.moarvm
exported hurz
42
so, when we import symbols we need to fix the case for dynamic variables 09:01
then exporting @*INC should work
lizmat where does that live?
FROGGS (unless somebody declared a my @*INC in the loading code)
import_EXPORTHOW in Perl6::Grammar or merge_globals in Perl6::ModuleLoader 09:02
or do_import in the grammar
lizmat ok, need to prepare for commute to Paris (FPW coming up) 09:03
FROGGS hmmm, when we import @*INC it is :decl(static) in the ast and then ignored when 'say'ing it, when we declare it ourself, it is :decl(contvar) and then not ignored 09:06
lizmat so it would be a matter of exporting it with :decl(contvar) ? 09:08
FROGGS that is my guess, but my gut feeling says that this is not the issue 09:10
lizmat commute& 10:00
ChoHag I have managed to make moar segfault. 10:26
OTOH it's caused by abusing threads and with the eval server the jvm is only about 0.2 seconds slower than moar. 10:27
dalek rlito: c03563c | (Flavio S. Glock)++ | src5/lib/Perlito5/Javascript2/CORE.pm:
Perlito5 - js - fix split()
10:45
masak ChoHag: do you have more details of how you made moar segfault? 11:26
ChoHag It's from a very small snippet actually. 11:31
So yes, but I'd have to rewrite it. 11:32
masak any clues would be welcome. 11:33
ChoHag Basically $*SCHEDULER.cue({ loop { $channel.receive; } }) with says at every point.
Changing $*SCHEDULER.cue to Thread.start stops the segfaulting. 11:34
And all .cue does is enqueue the code block then start it in another thread. 11:35
ChoHag So I think it's something to do with passing coderefs to other threads. 11:35
masak ok, thanks. 11:36
ChoHag However it's triggered quite randomly.
masak someone more threads-savvy than me might be able to turn that into a failing test.
ChoHag I'll put the code back into shape. It's quite tricky (ie. random) to reproduce. 11:36
masak well, indeterminism is a problem, but not an insurmountable one, usually. 11:37
liztormato FWIW, there are several S17 stress tests set to skip in the spectest. It's on jnthn's radar 12:01
masak ah. 12:19
dalek kudo-star-daily: c2c8e9e | coke++ | log/ (14 files):
today (automated commit)
12:40
[Coke] moar spectest run will be clean again today. \o/ 12:41
timotimo cool :) 12:42
masak [Coke]++ # untiring spectesting 13:02
sergot m: my @a; @a.first({ $_ eq "A" }); 13:04
camelia ( no output )
sergot m: my @a; @a.first({ .name eq "A" }); 13:06
camelia ( no output )
masak 'say' 13:07
sergot masak++: actually I didn't want to say anything. 13:08
masak ok :) 13:13
sergot m: my @a = <a b b>; @a.first({ $_ eq 'b' }):delete; say @a;
camelia rakudo-moar 1a3706: OUTPUT«a b b␤»
masak hm, no.
sergot masak: do you know maybe how can I do this? :)
masak :delete is an adverb on .{}
so that won't work.
I'd perhaps use .first-index or whatever
sergot yeah, I thought so.
masak and then .{$index}:delete
sergot hmmm 13:14
m: my @a = <a b b>; my $index = @a.first-index({ $_ eq 'b' }); @a{$index}:delete; say $2; 13:15
camelia rakudo-moar 1a3706: OUTPUT«===SORRY!===␤Can not remove values from a Array␤»
sergot m: my @a = <a b b>; my $index = @a.first-index({ $_ eq 'b' }); @a{$index}:delete; say $@;
camelia rakudo-moar 1a3706: OUTPUT«===SORRY!=== Error while compiling /tmp/BoeoJSIbUj␤Unsupported use of @; variable␤at /tmp/BoeoJSIbUj:1␤------> { $_ eq 'b' }); @a{$index}:delete; say $⏏@;␤ expecting any of:␤ argument list␤ …»
sergot m: my @a = <a b b>; my $index = @a.first-index({ $_ eq 'b' }); @a{$index}:delete; say @a;
camelia rakudo-moar 1a3706: OUTPUT«===SORRY!===␤Can not remove values from a Array␤»
sergot m: my @a = <a b b>; my $index = @a.first-index({ $_ eq 'b' }); @a[$index]:delete; say @a; 13:16
camelia rakudo-moar 1a3706: OUTPUT«a (Any) b␤»
sergot masak++ thanks
masak and I wonder if you really want to leave a hole there. 13:17
maybe you want .splice($index, 1) ?
sergot m: my @a = <a b b>; my $index = @a.first-index({ $_ eq 'b' }); @a.splice($index, 1); say @a.perl; 13:18
camelia rakudo-moar 1a3706: OUTPUT«Array.new("a", "b")␤»
sergot masak: yes, much better
masak++ :)
masak m: my @a = <a b b>; .splice(.first-index({ $_ eq 'b' }), 1) given @a; say @a.perl 13:21
camelia rakudo-moar 1a3706: OUTPUT«Array.new("a", "b")␤»
masak \o/
sergot nice! 13:22
masak oh, actually
m: my @a = <a b b>; .splice(.first-index('b', 1) given @a; say @a.perl
camelia rakudo-moar 1a3706: OUTPUT«===SORRY!=== Error while compiling /tmp/8cx82qy5__␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/8cx82qy5__:1␤------> = <a b b>; .splice(.first-index('b', 1) ⏏given @a; say @a.perl[0…»
masak oops
m: my @a = <a b b>; .splice(.first-index('b', 1)) given @a; say @a.perl
camelia rakudo-moar 1a3706: OUTPUT«Cannot call 'first-index'; none of these signatures match:␤:(Any: Regex:D $test, *%_)␤:(Any: :D $test, *%_)␤:(Any: $test, *%_)␤ in block at /tmp/awYaDbDYFR:1␤␤»
masak aww
clearly .first-index should be able to match on literal things, no? 13:23
.grep and .first certainly do.
moritz yes, it should take Mu and smart-match against it
masak submits rakudobug 13:24
[Coke] rakudo.jvm run getting much further this morning. 13:34
[Coke] m: my @a = <a b b>; say @a.squish 13:35
camelia rakudo-moar 1a3706: OUTPUT«a b␤»
ChoHag Can I have a class attribute which must be set on initialisation, has no default yet cannot be changed? 13:38
Or, rather, how?
moritz m: class A { has $.required = die 'attribute "required" is, well, required'; }; say A.new(required => 42).required; A.new() 13:39
camelia rakudo-moar 1a3706: OUTPUT«42␤attribute "required" is, well, required␤ in method at /tmp/dZJZqIK0d6:1␤ in block at src/gen/m-CORE.setting:921␤ in method BUILDALL at src/gen/m-CORE.setting:876␤ in method bless at src/gen/m-CORE.setting:865␤ in method new at src/gen…»
Timbus fail 13:40
.. er. you could use fail. or as someone pointed out to me a little bit ago, you can also use !!! 13:41
moritz you can also add a submethod BUILD that initializes the attribute, and complain if the value is missing
Timbus i do think a 'required' trait would be better tho 13:42
it feels odd to suggest stealing things from moose... 13:43
[Coke] rakudo.jvm only made it as far as S06-other/main.t this time. 13:44
.tell donaldh rakudo.jvm only made it as far as S06-other/main.t this time. it worked fine with your first tweak but has failed on subsequent runs with later changes. Any ideas?
yoleaux [Coke]: I'll pass your message to donaldh.
dalek rl6-roast-data: c00b578 | coke++ | / (6 files):
today (automated commit)
13:45
Timbus m: my ($a) = (1,); say $a.perl; ($a) = (1,); say $a.perl; 13:47
camelia rakudo-moar 1a3706: OUTPUT«1␤$(1,)␤»
masak unexpected. 14:00
moritz m: my $a; ($a, ) = (1,); say $a.perl 14:01
camelia rakudo-moar 1a3706: OUTPUT«1␤»
moritz expected
jnthn , is what constructs parcels, not parens. 14:05
moritz ... except in the declaration
jnthn In the declaration we parse a signature there, not a list. 14:07
masak ah, that explains it.
dalek osystem: d65f753 | (Kamil Kułaga)++ | META.list:
added lacuna-cookbuk
14:36
osystem: 6d22cd5 | moritz++ | META.list:
Merge pull request #30 from teodozjan/patch-1

added lacuna-cookbuk
masak cook..buk? 14:39
FROGGS lacuna-expanse seems to.... expand 14:41
masak it's not big enough to have a Wikipedia entry yet. 14:42
hoelzro I wish I could use P6 regexes in P5 =/ 15:02
I also wish I knew how to how P6 regexes. 15:03
*how to use
hoelzro also, FROGGS++ on COBOL.pm 15:04
FROGGS well, P6 regexes are not very hard 15:05
ChoHag Not like that.
hoelzro FROGGS: I don't think they're right, per se...I just have to familiarize myself with them 15:06
FROGGS yeah 15:07
hoelzro I started an Anki deck for them 15:09
but I need to finish up my other project first...
I'm guessing that p6 slangs (like COBOL) are only good for completely overriding the grammar atm? it is still impossible to augment the existing P6 grammar (ie. to add keywords?) 15:22
FROGGS wait 15:23
first, that COBOL.pm is just a stub, it does not implement anything COBOLish 15:24
second, these kind of slangs allow you to parse the code of a block for example differently, or generate a different ast 15:25
it is still possible to add keywords to the current P6 grammar, like by doing: my &infix... my &term... 15:26
what does not work yet is that we have categories like 'statement_control' that we can add candidates for 15:27
FROGGS m: sub infix:<ß>(\a, \b) { a + b }; say 2 ß 3 15:30
camelia rakudo-moar 1a3706: OUTPUT«5␤»
FROGGS m: sub sigil:<*>(\a) { 3*a }; my *2 15:31
camelia rakudo-moar 1a3706: OUTPUT«===SORRY!=== Error while compiling /tmp/tCxnZEE_zJ␤Cannot add tokens of category 'sigil'␤at /tmp/tCxnZEE_zJ:1␤------> sub sigil:<*>⏏(\a) { 3*a }; my *2␤ expecting any of:␤ colon pair␤ quot…»
FROGGS and this is the way to augment the current grammar, at least I think so
ChoHag How do you write a BUILD submethod does something (just print for now) and then continues the default BUILD process? 15:33
moritz you don't
it's either your own, or the default process
jnthn (With a sidenote that defualt still get applied if you don't touch the attribute...) 15:34
*defaults
hoelzro FROGGS: ok, that's what I was thinking
ChoHag But they don't. 15:35
hoelzro I already knew that COBOL.pm didn't actually do anything COBOLish =)
ChoHag > class foo { submethod BUILD { say "IN BUILD" }; has $.bar }; say foo.new: bar=>"6*7";
IN BUILD
jnthn m: class F { has $.x = 42; submethod BUILD() { say "build" } }; F.new.x.say
ChoHag foo.new(bar => Any)
camelia rakudo-moar 1a3706: OUTPUT«build␤42␤»
jnthn I said *defaults*.
FROGGS hoelzro: though it would be nice of course when you could declare a grammar that inherits from Perl6::Grammar... but this will be a bit painful
jnthn Like the "= 42" thing there
ChoHag So how can I get the default behaviour without having to reproduce it? 15:36
jnthn You don't.
What moritz said.
ChoHag So how do I carry out the default process with a slight rather than wholesale adjustment? 15:36
Or is this one of those elusive easy things made hard perl is famed for not having? 15:37
hoelzro FROGGS: that's what I was hoping for 15:37
I have had a few ideas for neat modules that would require such a feature
moritz ChoHag: for example by giving attributes default values 15:37
hoelzro well, they could still work without it, but they would be prettier to look at =) 15:38
moritz that can depend on other attributes
FROGGS hoelzro: in theory you can inherit from it but then you must write your stuff in nqp
hoelzro right
ChoHag In particular, I don't want to have to deal with every attribute (especially those belonging to roles) passed to the constructor.
jnthn m: class A { has $.x; method BUILDALL(|) { callsame; say "and after all the default building..."; self } }; A.new(x => 42).x.say 15:41
camelia rakudo-moar 1a3706: OUTPUT«and after all the default building...␤42␤»
jnthn After BUILDALL you know you've got a fully constructed object. 15:42
ChoHag Thankyou. 15:45
rindolf jnthn: hi, are you there? 16:43
rindolf hoelzro: hi, are you there? 16:44
hoelzro rindolf: yes 16:45
what's up?
rindolf hoelzro: I'm fine.
hoelzro: I'm looking for someone to go over all the pages here: www.shlomifish.org/humour/bits/facts/ and comment. 16:46
I'm willing to give a link with name/email/URL/etc. and 1,000,000 love points.
rindolf www.shlomifish.org/humour/fortunes/...-HUGE-LOVE - GREAT HUGE LOVE. 16:48
masak ah, rindolf, you off-topic huggable, you. 16:49
rindolf hugs masak 16:50
I'm looking for one person, and in big forums, the chance that anyone will answer is lower.
[Coke] reads www.shlomifish.org/humour/bits/fact...ma-Watson/ quickly, doesnt' get it, and moves on. 17:08
ingy Mouq: idea. if I get a perl5 yaml parser working with pegex, we should easily be able to port to p6 17:34
since pegex =~= p6rules
lizmat has arrived in Paris, France 17:35
nwc10 lizmat: wave to paris.pm from me, please 17:43
lizmat will do so when we see them (tomorrow night, afaik) 17:44
vendethiel will wave to lizmat too, but IRL hopefully 17:46
lizmat vendethiel: when will you be where ? 17:47
vendethiel lizmat: I wasn't aware of something tomorrow
lizmat ah?
[Coke] Any sixers want to try to make an Albany.pm meeting? :)
vendethiel lizmat: don't take your informations from me ! You'd be lost in no time 17:48
vendethiel lizmat: I think there was something tonight ? 17:50
you'd need to ask cognominal
cognominal vendethiel: there's is a social meeting at the Maldoror. About to go to it. 17:52
vendethiel well, would've told lizmat. 17:53
cognominal too late, sorry. She probably knows about it. She knows elbeho who coordiantes all social mongueurs activities. 17:54
vendethiel and there's something tomorrow as well ? 17:55
cognominal wendethiel: hope, I will see you tonight. And I hope, the RER B train will be work normally (or abnormally because abnormal is the new norm for this line) 17:56
vendethiel: apparently, there will be a pre fpw dinner, as usual. It should be announced in the wiki here, journeesperl.fr/fpw2014/wiki 17:58
vendethiel I'll grab something to eat first, then
lizmat noithing on the wiki yet
cognominal lizmat, I am going to maldoror, I should be there in 30-60 minutes depending on potential problems on RER B (they are more or less on strike) 18:00
lizmat maldoror, c'est quoi ca? 18:01
cognominal I can't join elbeho on its personnal phone meaning he is probably in the subway.
www.maldoror.fr/ that's our usual meeting place
... named after a Lautreamont's novel en.wikipedia.org/wiki/Les_Chants_de_Maldoror 18:02
www.google.com/maps/place/Maldoror...eb3656ad6a 18:03
metro Oberkampf. And yes it is open again www.ratp.fr/fr/ratp/r_105365/metro-...oberkampf/ 18:04
so see you there if you come
lizmat ah, the revolutionary place ? 18:05
cognominal nope. en.wikipedia.org/wiki/Oberkampf 18:06
really gone now
masak .oO( In the Land of Maldoror, where the Shadows lie. ) 18:08
woolfy cognominal: hoooo
wait, what do you mean? Oberkampf what?
lizmat Maldoror, the anarchistic restaurant where I had Andouille for the first (and last) time ? 18:10
woolfy Hmmm too late...
FROGGS yays! I got my shipping confirmation from [email@hidden.address] :D 18:13
woolfy Yep, just got message from elbeho... they are whaiting for us at Maldoror, near Oberkampf station.
FROGGS Oberkampf!!!
why do germans always have names like these?
but it fits that Oberkampf is near Mordor 18:14
lizmat the funny thing is, to get to Oberkampf from the hotel, we need to change at Stalingrad :-) 18:16
woolfy It's not German, Oberkampf was a Frenchman.
Real German name, isn't it. :-)
FROGGS "The name refers to Rue Oberkampf, named for Christophe-Philippe Oberkampf, an 18th-century German-born French industrialist."
FROGGS okay, back to hacking :o) 18:17
vendethiel is grabbing something to eat before coming 18:18
woolfy See, French!
FROGGS hehe
lizmat vendethiel: don't they have something at Maldoror ? 18:19
vendethiel lizmat: they probably do, but as a student, I prefer eating home 18:20
lizmat ah, ok :-)
lizmat remembers eating at home
vendethiel lizmat: will I see you tonight, or friday/saturday ? 18:22
lizmat we'll be coming to maldoror as well
not sure how long that will take... :-)
vendethiel Well, I'll be here by 9pm or so :)! 18:23
vendethiel Time to get going -- o/, * 18:23
FROGGS vendethiel: o/
ggoebel111116 I'm working to setup a travis ci proof of concept... running into issue compiling moar. Any thoughts on the following: travis-ci.org/perl6-ci/rakudo/builds/27334735 18:29
===SORRY!=== 18:30
Start argument to substr out of range. Is: -1, should be in 0..0
make: *** [RESTRICTED.setting.moarvm] Error 1
FROGGS it successfully compiled moar and nqp btw 18:32
sad that there is no backtrace for the substr error
xfix I find it interesting you configured Travis to compile Perl code. 18:33
I think Perl is still available even in C mode, and C mode would allow different compilers.
ggoebel111116 hmm... I read the docs the opposite way. C is available in modes. I can certainly switch things up. 18:34
I noticed travis now has support for osx
FROGGS xfix: I'm not sure I get what you say
ggoebel111116 c compilers are available in all the language vm's
assume I know very little about what I'm doing... and you won't be far off... 18:35
figured if I could break my Europa Universalis IV addiction... I might be able to spend a couple hours a day working on ci 18:36
xfix You will need to set --compiler variable for Perl 6 however.
There is no need to work couple hours a day ;-).
xfix Travis CI is something that can be set, and then it notifies you when the build breaks. 18:37
xfix Also, it would be great if it would run tests. 18:37
However, that may break execution time limit. 18:38
ggoebel111116 I believe the compiler is available as an env variable 18:38
xfix Yes, CC variable.
rurban1 ggoebel111116: you can have a look at my B::C .travis.yml or the parrot .travis.yml
xfix Oh, it appears they increased the limit to 50 minutes (it was 20 minutes once), or 10 minutes without any new output. 18:39
rurban1 I have a special testfast target for travis
And you can also specify which part of the testmatrix is a TODO 18:40
ggoebel111116 rurban1: thx that is very helpful 18:41
rurban1 running testjobs in parallel helped most (TEST_JOBS=10)
and skipping long-running tests
ren1us so, apparently Hash.exists() is deprecated, and I'm supposed to use a :exists adverb. what's an adverb, to perl6, and how do i use it? 18:47
colomon %my-hash{"key"} :exists 18:50
m: my %h; say %h{"blue"} :exists
camelia rakudo-moar 1a3706: OUTPUT«False␤»
ren1us eh, that works
colomon m: my %h; %h<blue> = "gill"; say %h{"blue"} :exists
camelia rakudo-moar 1a3706: OUTPUT«True␤»
colomon m: my %h; %h<blue> = "gill"; say %h{"blue", "green"} :exists 18:51
camelia rakudo-moar 1a3706: OUTPUT«True False␤»
colomon m: my %h; %h<blue> = "gill"; say %h<blue green> :exists # don't know if this one works or no
camelia rakudo-moar 1a3706: OUTPUT«True False␤»
ggoebel111116 hmm... I get no error when following the same steps locally on windows 19:02
ggoebel111116 compiling moarvm, nqp, and rakudo that is... 19:04
perl Configure.pl --gen-moar --gen-nqp --backends=moar
is anyone else seeing the substr error on linux? 19:06
ren1us erm, what's a multidimensional index? 19:09
apparently i just tried to use them and they're not in yet so i'm not sure which part of this line i need to change
you guys are really good at coming up with fancy sounding names for things 19:10
rurban1 multidimensional index is a common CS term. en.wikipedia.org/wiki/Array_data_s...nal_arrays 19:13
ren1us oh, that's kinda awkward since i don't, to my knowledge, actually have any arrays in the line that's pitching a fit 19:15
nwc10 ggoebel111116: I am not seeing it. Tested just now 19:16
so, sorry, can't help 19:17
ggoebel111116 nwc10: thx 19:21
carlin that substr error is what perl6-debug currently fails with, which I think has something to do with the version number not being set properly 19:30
might be related
might not be as well though
ggoebel111116 carlin: thx. -I'll switch to a different backend and see if I make more headway 19:32
Guest29714 r: .d "wtf" 19:43
camelia rakudo-jvm 1a3706: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-{parrot,moar} 1a3706: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> .d ⏏"wtf"␤ expecting any of:␤ method arguments␤ postfix␤ infix stopper␤ …»
masak Guest29714: "two terms in a row" because you're making a method call (.d) and then just writing a literal ("wtf") next to it 19:45
Guest29714: that's always illegal in Perl 6.
Guest29714: `.d: "wtf"` works
Guest29714: as does `.d("wtf")` 19:46
Guest29714 m: my $a = "foo".IO.d
camelia rakudo-moar 1a3706: OUTPUT«Unhandled exception: Failed to find 'foo' while trying to do '.d'␤ at <unknown>:1 (/home/p6eval/rakudo-inst-2/languages/perl6/runtime/CORE.setting.moarvm:throw:4294967295)␤ from src/gen/m-CORE.setting:12907 (/home/p6eval/rakudo-inst-2/languages/per…»
masak is not sure he likes .d throwing an exception if the file isn't found 19:47
seems to me a likelier use case to ask "is there a directory at 'foo'?"
and not care about whether the reason for there not being one is that (a) it's a regular file or (b) it's not there at all
Guest29714 m: my $a = "foo".IO.d; 1 19:48
camelia ( no output )
masak yes, that's do it. the Failure isn't evaluated, so it doesn't trigger.
'd*
[Coke] rakudo-j camelia failures: probably related to last tweak of eval server? 19:54
[Coke] ah. did a run where I backed out only the most recent change to the eval server - it still explodes. 19:54
Guess I'll have to shut it off again. :( 19:55
timotimo i think the .exists() deprecation message could very well mention that :exists is used with postcircumfix:<{ }> 19:57
[Coke] .tell donaldh This exception from the eval server look fixable? gist.github.com/coke/77a58d476a1008749362
yoleaux [Coke]: I'll pass your message to donaldh.
masak timotimo: well volunteered. I agree, I think. 20:06
timotimo heh.
seems easy enough
dalek kudo/nom: 243ef3e | timo++ | src/core/Hash.pm:
point at postcircumfix:<{ }> for adverbs
20:10
masak nice.
raiph masak: 'use' of a module with a compile time error in it dies with the "Start argument to substr out of range. Is: -1, should be in 0..0" error that popped up in the last couple days. (irclog.perlgeek.de/perl6/2014-06-11#i_8852890) 20:16
masak: That led me to suggest a spectest that would have caught this basic fail 20:18
masak oh, I've had 'use' of a module with a compile time error lately too. 20:20
masak had been too busy to golf it, though. thought it was just me. 20:20
the error was different, but that might have changed.
ChoHag How can a class provide a value for a role's attribute?
masak ChoHag: assign it during initialization? 20:21
ChoHag I mean what is the syntax to do that, short of adding it to the BUILD method?
raiph masak: Looks like any compile time error. Which raises an exception. Which is presumably triggering another exception when processing that exception. 20:22
masak *nod* 20:23
ChoHag: I think 'adding it to the BUILD method' might be it. 20:25
that's where initialization tends to happen, after all.
m: role R { has $.a }; class C does R { submethod BUILD { $!a = 42 } }; say C.new.a
camelia rakudo-moar 1a3706: OUTPUT«42␤»
raiph masak: Mouq suggested adding a module to t/spec/packages with a compile time error in it then making sure 'use'ing it does indeed return a compile time error. But it strikes me that the issue is more basic: is exception handling itself borked? 20:26
masak raiph: checking that it returns the *right* compile time error should do it.
raiph masak: Yes. Wasn't happy with using a "confused" error cuz a "Confused" error might one day become something else for a particular type of error. 20:28
masak: But more generally this is borked processing of an exception message 20:29
masak *nod* 20:37
actually_masak grr. 20:42
actually_masak look away one minute, and freenode decides to storm and disallow access to one's nick. 20:42
raiph actually_masak: Is there really any practical value to creating a generic "Does Rakudo catch that a module has a compile time error in it" test? 20:44
raiph actually_masak: I'm thinking there might be value in having a "Are error/warning messages getting processed correctly" test. 20:45
actually_masak raiph: I think there is a lot of practical value in creating a test that would have caught *specifically* the failure we're seeing right now. 20:46
actually_masak raiph: thinking about catching a wider set of errors feels like premature generalization. 20:47
raiph actually_masak: Well what exactly is the error? It's catching a compile time error in a module -- but then the complaint is going awry. 20:49
raiph actually_masak: I'm really just trying to address the underlying problem; the fact it's more generic is almost incidental 20:50
actually_masak raiph: what I'm proposing is a test that does 'use' on a module with (say) two terms in a row. then we check for the presence of the substring "Two terms in a row" in the resulting error. 20:55
raiph: that currently fails, and so we have a failing test for what needs to be fixed. 20:56
PerlJam Yeah, those pesky TTIAR should be eliminated! ;)
actually_masak ;) 21:01
PerlJam: no, we'd be checking for the *presence* of that error. 21:02
raiph actually_masak: Sure. (Well, I was thinking $! ~~ X::Syntax::TTIAR) But what's really broken is not TTIAR processing, and, I suspect, not even compile time error processing, but something about error processing itself. Anyhow, I'll go ahead and try prepare a PR for a basic 'use' test.
actually_masak oh, smartmatching is even better, I guess.
PerlJam better than checking for a specific string
actually_masak I figured we'd need to do this in a subprocess, because it fails at compile time.
but if we can actually get the exception out in the same process, that's better, of course. 21:03
PerlJam Is there no way to EVAL the use?
raiph PerlJam: that's what Mouq suggested; I didn't know why
actually_masak raiph: the fact that we didn't get an X::Syntax::TTIAR back would (correctly) indicate that something is wrong about error processing itself.
oh, EVAL'ing the use should do it. 21:04
PerlJam doesn't look like it works in my little experiment locally, so maybe a subprocess is needed 21:06
(or I'm daft in making it work)
actually_masak m: try EVAL "42 43"; say $!.message 21:08
camelia rakudo-moar 1a3706: OUTPUT«Two terms in a row␤»
actually_masak I get the same when I put "use A" in the eval, and A.pm contains "42 43".
and the exception type is the same -- X::Syntax::Confused -- in both cases, too. 21:09
it's only when I actually `use A;` outside of an EVAL that I get odd results.
segomos_ is there a way in a class to do 'is rw' and have a default value? 21:47
for a $.var
timotimo uh, can't you just is rw = 42?
jnthn class A { has $.a is rw = 42 } 21:48
timotimo m: class Foo { has $.var is rw = 42; }; Foo.new().var.say;
camelia rakudo-moar 243ef3: OUTPUT«42␤»
segomos_ jesus
i should stop
ty
timotimo np
masak 'night, #perl6 21:56
raiph night masak 21:57
thx for help
timotimo dogeon.org/index-de.html %) 22:07
vendethiel made it alive (apparently) 22:36
vendethiel I basically spent the whole antenoon annoying lizmat. 22:37
lizmat hehe.... I was *so* annoyed, you can't believe it! 22:37
vendethiel "when is he gonna stop talking?"
vendethiel had a lot of fun :) 22:38
lizmat we did as well :-) 22:39
woolfy was annoyed because some people were annoying to eachother... incredible... that is so not #perl6 ! 22:57
vendethiel couldn't really talk with woolfy at all
woolfy wanted to take pictures but was forbidden...
vendethiel hit his head trying to avoid a picture :( 22:58
woolfy that was funny :-) 22:59
vendethiel Hey, uncool !
woolfy Oh was cool, you did it in a real Charlie chaplin slapstick way, sooo cool. Really.
I should have taped it. 23:00
But you forbade it.
(forbidded?)
vendethiel good.
(havn't seen enough charlie chaplin movies to know what you're talking about.)
woolfy Back to work! 23:01
dalek kudo/nom: 60aaed2 | (Elizabeth Mattijsen)++ | src/core/ (11 files):
Continue with timotimo++ 's work
23:09
ast: 4c8ca36 | (Elizabeth Mattijsen)++ | S02-types/deprecations.t:
Adapt deprecation checks to changed messages
23:10
lizmat and this completes it for now for me... 23:11
good night, #perl6!
cognominal got back despite the obfuscations. At Gare du Nord, the displays was saying there was perturbation not indicating anymore where/when the trains were going. 23:16
ren1us is there anything *wrong* with using an object (other than a string or something standard like that) as a key in a hash? 23:46
because it's making my code freak out and that makes me freak out 23:47
raiph ren1us: can you paste something here to illustrate? 23:56
m: my $o = Any.new; my %h = $o => 1; say %h{$o} :exists 23:59
camelia rakudo-moar 243ef3: OUTPUT«True␤»
raiph m: my $o = Any.new; my %h = $o => 1; say %h{$o} :delete
camelia rakudo-moar 243ef3: OUTPUT«This type cannot unbox to a native string␤ in method delete_key at src/gen/m-CORE.setting:9503␤ in block at src/gen/m-CORE.setting:2037␤ in sub postcircumfix:<{ }> at src/gen/m-CORE.setting:2699␤ in block at /tmp/c5GThS4aHM:1␤␤»