»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
dha Huh. Interesting. Trying to install it with zef gives me "Expected MAST::Frame, but didn't get one" and failure. installing with panda succeeds. 00:02
skink timotimo, Any chance you know what Ubuntu/Debian package perf is in?
Kinda hard to search for :D
timotimo oof, good question 00:03
is that "gperftool"?
skink linux-tools-common apparently
timotimo wait, no
yeah, ok
skink Okay actually it's linux-tools-generic-lts-[release] in addition to that 00:05
00:05 canopus left
timotimo mhm 00:06
AlexDaniel apt-file find /usr/bin/perf
linux-base: /usr/bin/perf
00:07 canopus joined
AlexDaniel or linux-perf-x.x or linux-tools-x.x 00:07
00:08 kalkin- joined
kalkin- hi 00:08
skink AlexDaniel, trying to run it gave the apt-get autofind thing
AlexDaniel skink: autofind? 00:09
dha Ok, then. Installing Task::Star with zef bails on JSON::RPC, installing it with panda bails on OpenSSL (despite my having installed OpenSSL by itself with zef during this annoying process)
AlexDaniel u: combining
unicodable6 AlexDaniel, U+0300 COMBINING GRAVE ACCENT [Mn] (◌̀)
AlexDaniel, U+0302 COMBINING CIRCUMFLEX ACCENT [Mn] (◌̂)
AlexDaniel, U+0301 COMBINING ACUTE ACCENT [Mn] (◌́)
AlexDaniel, gist.github.com/67b91a6bf165abf0fb...45333c9213 00:10
skink In either your shell profile or some config file, you can define apt's command-not-found function
In Ubuntu it checks packages for what supplies that command
I forgot about it :) 00:11
kalkin- some time ago I was not satisfied with Software::License and wrote a replacement which allows a more exact application of software licenses + a perl6 script for generating license data . It is spitted in two modules: Legal::License and Legal::Licenses.
AlexDaniel u: Mc 00:12
unicodable6 AlexDaniel, U+0903 DEVANAGARI SIGN VISARGA [Mc] (◌ः)
AlexDaniel, U+093B DEVANAGARI VOWEL SIGN OOE [Mc] (◌ऻ)
AlexDaniel, U+093E DEVANAGARI VOWEL SIGN AA [Mc] (◌ा)
kalkin- Now i thought about submitting it to modules.perl6.org, but I'm not really satisfied with having two modules for this
AlexDaniel u: Me
unicodable6 AlexDaniel, U+0489 COMBINING CYRILLIC MILLIONS SIGN [Me] (◌҉)
AlexDaniel, U+0488 COMBINING CYRILLIC HUNDRED THOUSANDS SIGN [Me] (◌҈)
AlexDaniel, gist.github.com/c80b5e30bcee5d9478...834c53c477
AlexDaniel, U+1ABE COMBINING PARENTHESES OVERLAY [Me] (◌᪾)
AlexDaniel, gist.github.com/fb8f083ad838e5778b...813f65418f
skink timotimo, I have no idea what I'm looking at in this perf report btw :) 00:13
kalkin- Actually Legal::License just provides a Legal::License::Software class and a few helper objects, while Legal::Licenses provides all the templates and has the script
I'm thinking about merging it all in to one Legal::License::Software module, but isn't that a too deep nesting? 00:14
AlexDaniel will I ever see the day when combining characters will be rendered correctly on my computer? At least in the browser, please…
kalkin- github.com/kalkin/Legal-License github.com/kalkin/Legal-Licenses
timotimo skink: may want to also "perf report -g" 00:15
then you'll get "self" and "inclusive" (or what they are called) 00:16
self is the amount of samples that hit the function itself, inclusive is the amount of samples that hit while the function was anywhere on the call stack
so, like, "main" will usually be at 100% inclusive, but rarely a lot of "self"
00:16 firstdayonthejob left
skink I mean I see at the top a whole bunch of 'self' for the C lib 00:18
children being the other field
much more in children than in self
Those last lines sound like a markov chain based on a philosophy book 00:19
timotimo oh, it could be that your moarvm isn't compiled with debug symbols?
do you see any function names with MVM_ in the name?
skink only a few 00:20
Almost everything is addresses
timotimo ah, that's not so helpful, of course :)
skink :D 00:22
timotimo i've been meaning to implement improvements to the fixed size allocator inspired by the "hoard" allocator 00:23
it's just been kind of an overwhelming thing, not sure where to start, etc
but when i build that, we won't have trouble with that allocator being the bottleneck in multi-threaded situations
skink Is there any sneaky way around it for the time being? 00:26
timotimo hm
you could try using a multi-threaded malloc implementation and build rakudo with the fixedsize alloc debug thingie turned on
that will sidestep the fixedsize allocator completely and use malloc instead
skink @_@
00:27 frobisher joined
timotimo the fixedsize alloc debug is just a single #define 00:27
00:28 dha left, frobisher is now known as dha
timotimo other than that, try to write your code in a way that it doesn't have to invoke as many subs/methods or embedded curly blocks 00:28
dalek c: 21c1708 | ZzZombo++ | doc/Language/5to6-perlop.pod6:
Small corrections.

And the note about the complement is redundant and is out of place anyway.
00:37
synopsebot6 Link: doc.perl6.org/language/5to6-perlop
ZzZombo Here, I just vandalized the docs :0
dha Hm. How worried should I be that some modules seem to fail tests when using zef to install them but not when using panda (and possibly vice versa)? 00:41
That strikes me as an actual problem.
AlexDaniel ZzZombo: hey 00:43
ZzZombo wait, what, we still don't have proper multiline comments?
ye?
AlexDaniel context → concatenation is wrong I think
m: dd ~25
camelia rakudo-moar ecc202: OUTPUT«"25"␤»
AlexDaniel that's 25 in string context, no concatenation 00:44
ZzZombo m: say 1~~5
camelia rakudo-moar ecc202: OUTPUT«False␤»
ZzZombo m: say 1~5
camelia rakudo-moar ecc202: OUTPUT«15␤»
ZzZombo err
AlexDaniel no-no it talks about prefix op
there's infix ~ and prefix ~
ZzZombo ah
my bad then
timotimo we totally have multiline comments 00:45
AlexDaniel in fact it says “Unary C<~>”
dalek c: 0b97454 | ZzZombo++ | doc/Language/5to6-perlop.pod6:
Oops
synopsebot6 Link: doc.perl6.org/language/5to6-perlop
AlexDaniel m: say 25 #`{ multiline comment } + 50
00:45 mohae left
camelia rakudo-moar ecc202: OUTPUT«75␤» 00:45
ZzZombo timotimo: syntax?
AlexDaniel 00:46
ZzZombo is it just PODs?
timotimo no
m: say #`(( multiline comment )) "hey"
camelia rakudo-moar ecc202: OUTPUT«hey␤»
ZzZombo ah
timotimo you can choose any delimiter you like
ZzZombo okay
AlexDaniel you can use any parens in any amounts
00:46 trnh left
timotimo so it's even properer than many other langs 00:46
ZzZombo m: say 25 #`4 multiline comment 4 + 50 00:47
camelia rakudo-moar ecc202: OUTPUT«25␤»
timotimo right
AlexDaniel didn't expect that to work but yeah
ZzZombo m: say 25 #`| multiline comment | + 50
camelia rakudo-moar ecc202: OUTPUT«25␤»
00:47 mohae joined
timotimo m: say 99 #`# oh what # ~ 11 00:47
camelia rakudo-moar ecc202: OUTPUT«99␤»
ZzZombo m: say 25 #`{( multiline comment )} + 50
camelia rakudo-moar ecc202: OUTPUT«75␤»
AlexDaniel ZzZombo: what's the reason for removing “Assumes two's complement”, by the way?
timotimo when you have different opening braces, only the first set will be used 00:48
00:48 cdg left
timotimo m: say 25 #`{( multiline comment } + 50 00:48
camelia rakudo-moar ecc202: OUTPUT«75␤»
timotimo ^- it won't pick up the ( for the delimiter there
00:49 cdg joined
ZzZombo is it really needed? I don't recall it being any different in P5. 00:50
AlexDaniel ah it's a 5to6 document 00:51
perl -wE 'say ~0' # 18446744073709551615 00:53
m: say +^0
camelia rakudo-moar ecc202: OUTPUT«-1␤»
00:54 cdg left
timotimo i'm going to bed, have a good one! 00:54
AlexDaniel timotimo: have a nice night! 00:55
ZzZombo: sooo, it seems to be different?
viki m: say eager ^0 00:56
camelia rakudo-moar ecc202: OUTPUT«()␤»
viki wtf does that give -1 :S
s: &prefix:<+>, \(^0)
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/ecc2...ric.pm#L41
viki s: ^0, 'Numeric', \()
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/ecc2...ge.pm#L551
AlexDaniel s: &prefix:<+^>, \(0) 00:57
SourceBaby AlexDaniel, Sauce is at github.com/rakudo/rakudo/blob/ecc2...nt.pm#L401
viki :S 00:58
I see
AlexDaniel++
ZzZombo Holy hell, what??? Am I decieved?? I had to log onto my workplace, it behaves there differently in a project I booted up than my local perl that matches your output. What gives? 01:00
err, another dumb thing I did today. Horray! 01:01
01:01 dha left 01:02 finanalyst joined
dalek c: aa09454 | ZzZombo++ | doc/Language/5to6-perlop.pod6:
Err...

  Dumb me.
01:02
synopsebot6 Link: doc.perl6.org/language/5to6-perlop
ZzZombo Yes, don't tell me.
AlexDaniel ZzZombo: what about removing “right away”? :) 01:04
perhaps reasonable, but why?
ZzZombo To put emphasis it's references that you get almost everywhere by default, so no need to try to get them specifically. 01:06
AlexDaniel ok
5to6 documents need more love :( 01:07
so ZzZombo++
ZzZombo eh, thanks
unexpected but nice to hear :)
01:08 aborazmeh joined, aborazmeh left, aborazmeh joined
AlexDaniel m: sub foo { $++ < 5 }; 1 while foo() 01:08
camelia rakudo-moar ecc202: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (use Nil instead to suppress this warning) (line 1)␤»
AlexDaniel /o\
“Although it's not specifically documented, 1 while foo(); appears to work in this sense.”
no, nope. No
01:10 pierre_ joined
dalek c: b5aa558 | ZzZombo++ | doc/Language/5to6-perlvar.pod6:
Broken link
01:12
synopsebot6 Link: doc.perl6.org/language/5to6-perlvar
ZzZombo it didn't work? 01:13
damn
01:14 BenGoldberg joined
ZzZombo why does Github not have POD previewer, BTW? So I could see my changes before saving them. 01:14
01:17 Actualeyes joined, canopus left 01:18 rindolf left 01:19 canopus joined, kurahaupo__ joined
AlexDaniel ZzZombo: github.com/perl6/doc/issues/167 01:21
ZzZombo: feel free to work on it 01:22
ZzZombo hm 01:24
L<< this page|/language/variables#The_<_Twigil >> generates almost correct link now, but with a space at the end, so it stll doesn't jump to anywhere.
dalek c: f5020e2 | ZzZombo++ | doc/Language/5to6-perlvar.pod6:
Wait, used wrong character.
01:26
synopsebot6 Link: doc.perl6.org/language/5to6-perlvar
01:28 labster left
ZzZombo Where is the documentation for compunits? I can't figure it out myself. 01:29
01:36 Upasaka left
AlexDaniel ZzZombo: what exactly do you want to know? For example, there's this: docs.perl6.org/language/modules 01:36
ZzZombo to start, learn about the 'unit' keyword. Or whatever it is. 01:37
01:43 cdg joined 01:45 Upasaka joined 01:47 cdg left 01:51 kyclark_ joined
Juerd Suppose you override infix:<+> to mean something silly, as is commonly expected on Facebook, how would you access the original + from within the subroutine definition? 02:00
sum() is cheating :D
AlexDaniel without saving it first? 02:02
oh wait, what would that even mean…
02:08 ZzZombo left
Juerd Saving it is fine, but how to do that? 02:08
AlexDaniel one idea: 02:09
m: sub foo { sub infix:<+>($a, $b) { $a - $b }; say 50 + 20 }; foo; say 50 + 20
camelia rakudo-moar ecc202: OUTPUT«30␤70␤»
Juerd m: sub infix:<+> ($a, $b) { die "Looping" if $++ > 5; return 40 + 2; }; say 1 + 1 02:10
camelia rakudo-moar ecc202: OUTPUT«Looping␤ in sub infix:<+> at <tmp> line 1␤ in sub infix:<+> at <tmp> line 1␤ in sub infix:<+> at <tmp> line 1␤ in sub infix:<+> at <tmp> line 1␤ in sub infix:<+> at <tmp> line 1␤ in sub infix:<+> at <tmp> line 1␤ in sub infix:<+> at <t…»
Juerd I think - is cheating just like sum() :D
geekosaur subs are my by default. GLOBAL::infix:<+> ?
AlexDaniel m: my &plus = BEGIN &[+]; sub infix:<+>($a, $b) { $a - $b }; say 50 + 20; say &plus(50, 20) 02:11
camelia rakudo-moar ecc202: OUTPUT«30␤70␤»
geekosaur or some other scope
Juerd geekosaur: Could not find symbol 'infix:<+>'
geekosaur mrr, right there is some complication there because it only handles them exactly as defined or something
Juerd m: my &infix:<real+> = BEGIN &[+]; sub infix:<+> ($a, $b) { die "Looping" if $++ > 5; return 40 real+ 2; }; say 1 + 1 02:12
camelia rakudo-moar ecc202: OUTPUT«42␤»
Juerd Yay!
geekosaur and that might not be te right scope anyway
AlexDaniel I'd much rather prefer something involving GLOBAL or OUTER or whatever 02:13
but have no idea how to make that work
02:13 kaare_ joined
Juerd AlexDaniel: Sure, a generic solution would be nice. 02:14
02:15 labster joined, labster left
viki Juerd: callsame/nextwith/samewith/callwith? 02:15
Juerd viki: Please provide a working example :)
I don't know how to use those without OO.
Or, actually, I don't know how to use those at all, and vaguely recall that they had something to do with OO, which might even be wrong. 02:16
viki m: multi infix:<+> (Int:D $a, Int:D $b) { say "the real answer is {callwith $a, $b}, but the override is..."; $a - $b }; say 2 + 2 02:17
camelia rakudo-moar ecc202: OUTPUT«Ambiguous call to 'infix:<+>'; these signatures all match:␤:(Int:D \a, Int:D \b --> Int:D)␤:(Int:D $a, Int:D $b)␤ in block <unit> at <tmp> line 1␤␤»
viki >:(
cheetsy doodle then
m: multi infix:<+> (Int:D $a where {True}, Int:D $b) { say "the real answer is {callwith $a, $b}, but the override is..."; $a - $b }; say 2 + 2
camelia rakudo-moar ecc202: OUTPUT«the real answer is 4, but the override is...␤0␤»
viki \o/
AlexDaniel m: multi infix:<+> (Int:D $a, Int:D $b) { say "the real answer is {callsame}, but the override is..."; $a - $b }; say 2 + 2
camelia rakudo-moar ecc202: OUTPUT«Ambiguous call to 'infix:<+>'; these signatures all match:␤:(Int:D \a, Int:D \b --> Int:D)␤:(Int:D $a, Int:D $b)␤ in block <unit> at <tmp> line 1␤␤»
AlexDaniel m: multi infix:<+> ($a, $b) { say "the real answer is {callsame}, but the override is..."; $a - $b }; say 2 + 2 02:18
camelia rakudo-moar ecc202: OUTPUT«4␤»
viki \o/
AlexDaniel /o\
viki |
/\
02:18 labster joined, labster left
viki But yeah, AlexDaniel's way is even shorter 02:19
AlexDaniel except that it doesn't work!
viki m: multi infix:<+> (Int:D $a where {True}, Int:D $b) { say "the real answer is {callsame}, but the override is..."; $a - $b }; say 2 + 2
camelia rakudo-moar ecc202: OUTPUT«the real answer is 4, but the override is...␤0␤»
viki Well, you just needed the cheetsy-doodle :)
AlexDaniel wtf is this I don't even
viki where makes this multi take precedence over the core Int:D Int:D one :) 02:20
AlexDaniel /o\
Juerd: don't show this to anybody 02:21
it makes sense, but uhhh…
UUUUUHHHHH!
viki Juerd: they have to do with multies. callwith calls the next candidate with new args and returns; callsame calls the next candidate with same args as this candidate and returns; and the nextwith/nextsame work the same way, except they don't return
so the caller will receive whatever the next candidate gives 02:22
AlexDaniel viki: this kinda reminds me of this stuff: github.com/perl6/whateverable/blob...p6#L32-L33
perhaps a similar hack can be used to trick it?
viki doesn't follow what's stupid about that code 02:23
Juerd viki: Thanks for the explanation :)
AlexDaniel: Why not show it? I think it's beautiful :)
AlexDaniel viki: help|source|url processing is in the parent class
viki ooh 02:24
AlexDaniel viki: so we have to explicitly ignore messages like this to let the parent process it
viki right
no idea
At least at this time :)
viki goes to bed
\o
02:24 pierre_ left
AlexDaniel will more specific signature make it work or it always starts from the child? 02:24
02:25 pierre_ joined
viki Well, you can't make it more specific, I don't think. You got both candidates that take 1 arg and both have `where`s 02:27
The trick with infix:<+> worked, because the core one doesn't got :where
s/':'//
AlexDaniel :-/
viki m: subset Foo of Str where {True}; subset Bar of Any where {True}; multi foo(Foo $x) { say "in here" }; multi foo(Bar $x) { say "in there"}; foo "42" 02:28
camelia rakudo-moar ecc202: OUTPUT«in here␤»
viki oooh
m: subset Foo where {True}; subset Bar of Str where {True}; multi foo(Foo $x) { say "in here" }; multi foo(Bar $x) { say "in there"}; foo "42"
camelia rakudo-moar ecc202: OUTPUT«in there␤» 02:29
viki \o/
02:29 pierre_ left
viki Maybe something with that can be done, 'cause it appears to prefer the one with "of Str" rather than "of Any"..... 02:29
02:29 kalkin-_ joined, kalkin- left, pierre_ joined
viki So you'd make the help one take a subset of IRC::Client::Message, while, the other... um... just where? 02:30
m: subset Bar of Str where {True}; multi foo($x where {True}) { say "in here" }; multi foo(Bar $x) { say "in there"}; foo "42"
camelia rakudo-moar ecc202: OUTPUT«in there␤»
viki Yeah
Somethign like that's worth trying
viki really goes to bed
AlexDaniel or perhaps I can have it without where at all
and instead call nextsame inside 02:31
or… not
wasn't IRC::Client doing some magic with it?
viki: anyway, good night
02:32 seatek left 02:38 cdg joined 02:39 eisen74 joined 02:45 eisen74 left 02:46 ilbot3 left 02:47 ilbot3 joined 02:49 labster joined, zilti left 02:57 eisen74 joined 03:02 kyclark_ left 03:08 geraud joined 03:12 briandfoy left 03:14 eisen74 left, kyclark_ joined
dalek c: cfb08c8 | gfldex++ | doc/Language/typesystem.pod6:
show that methods overrule multis of parent classes
03:16
synopsebot6 Link: doc.perl6.org/language/typesystem
03:16 kyclark_ left 03:17 cpage joined, canopus left 03:21 xtreak joined 03:23 canopus joined 03:24 ZzZombo joined, ZzZombo left, ZzZombo joined 03:29 kyclark_ joined 03:33 noganex joined
ZzZombo "Examples of organising modules" 03:33
has barely much value, IMO.
samcv would a Pull request for Rakudo that makes the perl6 REPL prompt go forward or back a word on Ctrl + <- or -> arrow on keyboard like how linux shells do? 03:34
well at least if you have Readline library installed
err. i mean module
ZzZombo so, is the possibility of having multiple classes in one module still here, like in P5? 03:35
samcv you have have multiples classes in modules ZzZombo
03:36 noganex_ left
samcv just make sure to use `is export` 03:36
03:36 geekosaur left
ZzZombo on classes? 03:36
03:36 ilmari left 03:38 ilmari joined
samcv yes 03:38
ZzZombo alright, that's one question less. 03:39
still, where is are docs for the 'unit' keyword?
-is
03:41 kyclark_ left, geekosaur joined 03:44 pierre_ left 03:45 ilmari left, pierre_ joined
gfldex ZzZombo: you can do a fulltext search on the docs at docs.perl6.org/perl6.xhtml 03:45
AlexDaniel samcv: huh? 03:46
samcv in linux terminal you can press Ctrl + left arrow to go back a word
skip over text
03:46 ilmari joined
AlexDaniel samcv: I mean, that's already how it works if you have Readline module 03:46
samcv that works for you? 03:47
AlexDaniel yea
samcv must be your distro setting it that way maybe
it's not the Readline defaults
though there is a systemwide config file for readline that it will read. so yours must be set by your distro
gfldex m: UNIT.WHAT.say 03:48
camelia rakudo-moar ecc202: OUTPUT«(UNIT)␤»
gfldex m: UNIT.HOW.say
camelia rakudo-moar ecc202: OUTPUT«Perl6::Metamodel::ModuleHOW.new␤»
03:49 pierre_ left
gfldex ZzZombo: ^^^ so the doc for «unit» should be under /type/Metamodel/ModuleHOW 03:49
and that is ENODOC
ZzZombo :( 03:50
03:58 pierre_ joined 04:06 kent\n left 04:08 kent\n joined 04:12 khw left
samcv AlexDaniel, so i made a config file for readline to set those bindings. but i didn't know that other distros had defaults. 04:14
04:14 skink left
AlexDaniel samcv: so does it mean that nothing should be done on rakudo side? 04:15
samcv well. i mean we could make it set that as well, for distros that don't have those added to the readline configuration file 04:16
i figured out how to do it while i was trying to get it to do this 04:17
04:22 mr-foobar joined
AlexDaniel samcv: but does it mean that we will be overriding it for users who decided not to enable it on purpose? 04:34
04:34 aborazmeh left 04:35 briandfoy joined
samcv AlexDaniel, yeah this atm would. but there's a way to make it not override existing things, but the current Readline module doesn't really let that be used 04:40
well the .named-function method to get a pointer to a function, and using that we could call the method to only set that binding if it's not already set 04:41
04:43 pierre_ left
samcv i got it working in C though, i mean unless we can use what does work which is $read.parse-and-bind(Q「"\e[1;5D": backward-word」); 04:44
if there's some form of syntax readline accepts that is similar to rl_bind_key_if_unbound
the parse-and-bind reads a string and parses it like the config file. 04:45
AlexDaniel, and i tried the tty-set-default-bindings, but it segfaulted 04:49
when i tried that. i think that would be good, to just use the same settings the terminal has or whatever. but
04:53 pierre_ joined 04:54 cdg left 04:55 kyclark_ joined 04:57 pierre_ left 05:00 kyclark_ left
samcv AlexDaniel, so maybe if we could get that to work, that's what we want. at least every other language's prompt the ctrl left right has worked properly. not sure if they set it to the same as the terminal was or what 05:03
AlexDaniel samcv: that's a good question! 05:06
what other languages do in this case
samcv let me see if i can get that function working in C. and then try doing it in perl
AlexDaniel personally I'd much rather have it configured system-wide, but if people expect it to be this way… well, why not 05:07
geekosaur as long as they're not in a context where it will never work 05:08
samcv well... this is the only program it hasn't worked in AlexDaniel
every other program works without any config
AlexDaniel :-|
geekosaur (some terminal emulators, and any real terminal)
samcv so i will investigate
AlexDaniel samcv: yes please
geekosaur samcv, it might be useful to use ltrace and see if there is some common configuration they use
samcv they may be using tty_set_default_bindings to get the terminals bindings... but that's what i am just guessing 05:09
but that would make sure that it always performed as 'expected'
05:13 rindolf joined 05:14 Cabanossi left, Cabanossi joined 05:30 skids left 05:32 labster left 05:35 rpburkholder left 05:38 Vynce joined 05:45 Actualeyes left 05:47 Actualeyes joined 05:54 pierre_ joined 05:58 pierre_ left 06:07 Vynce left 06:11 BenGoldberg left 06:13 pierre_ joined 06:20 xiaomiao left 06:25 xiaomiao joined 06:26 domidumont joined 06:30 labster joined
samcv how do i do a direct lookup, but also use methods as well? 06:35
i can do: require Readline; my $read = $::Readline::Readline.new;
but then how do i call methods on the resulting object? 06:36
psch isn't $read a Readline then?
samcv yes
psch then the normal methodop syntax should work, shouldn't it?
i mean, you instantiated it and all..?
06:38 pierre_ left
samcv well, $read.read-init-file("/etc/inputrc"); this doesn't work. says no such method for invocant of type any 06:38
so maybe my $read = $::Readline::Readline.new; this line didn't work
psch right, if the invocant is Any in that line you're not getting a Readline instance
samcv yeah
not sure how to direct lookup for classes though, i've done it with functions before 06:39
06:43 domidumont left
psch well, that '$::' syntax seems weird from here 06:44
m: say $::FOO::BAR
camelia rakudo-moar ecc202: OUTPUT«(Any)␤»
psch as in, it doesn't complain when it doesn't find anything
so you'd have to check that first
samcv yes. well what's the syntax i need to do, to access a class?
that's what i'm asking 06:45
psch well what did you use to access a function?
samcv require Readline <&function>;
psch okay, afaik that means "load Readline but only import &function" 06:46
samcv well require doesn't import anything in by default 06:47
psch right, but you're explicitly asking for &function
samcv yeah
psch which isn't default behavior anymore
samcv well i need it to compile even when the person doesn't have that library
but have a codepath where it can be used for those who have it
psch so you're requiring a class but don't want to import it 06:48
right, because it might fail, yeah
06:49 wamba joined
psch star-m: constant URI = try { require URI }; say URI.^name 06:50
camelia star-m 2016.10: OUTPUT«URI␤»
psch m: constant URI = try { require URI }; say URI.^name
camelia rakudo-moar ecc202: OUTPUT«Nil␤»
psch samcv: ^^^ that looks about right, i think?
module loading stuff isn't my strong suite :)
[ptc] o/
06:51 RabidGravy joined 06:58 domidumont joined 07:01 domidumont left
dalek : 7c97a5a | nige123++ | misc/perl6advent-2016/schedule:
Contribute on the 19th
07:02
07:02 domidumont joined 07:06 bjz joined 07:09 neuraload joined 07:10 kurahaupo_ joined 07:13 kurahaupo__ left 07:14 darutoko joined 07:15 neuraload left, neuraload joined 07:17 pierre_ joined 07:21 bjz left 07:28 finanalyst left 07:30 firstdayonthejob joined 07:35 TEttinger left, TEttinger joined 07:36 bjz joined 07:42 firstdayonthejob left 07:59 labster left 08:00 labster joined 08:03 geekosaur left, geekosaur joined
lizmat clickbaits p6weekly.wordpress.com/2016/11/21/...perl-6-入门/ 08:06
psch lizmat++ 08:09
samcv AlexDaniel, github.com/rakudo/rakudo/pull/922 made a PR
for the readline thing. I think this seems like a good way to do it
psch m: say Nil.new 08:10
camelia rakudo-moar ecc202: OUTPUT«Nil␤»
samcv and I checked and I DO have config files (/etc/inputrc) but perl6 REPL using Readline wasn't loading them for whatever reason
AlexDaniel hmmm
psch samcv: i think you probably still want to check if you actually have Readline somewhere
that's to mean "check somewhere", actually :) 08:11
samcv hmm? i have Readline
or you mean those files?
well psch it already does
psch m: constant URI = try { require URI }; my $uri = URI.new;
camelia ( no output )
samcv psch, i did a brand new rakudo install, ran perl6 and REPL worked fine
then installed Readline, and it also worked fine 08:12
psch samcv: okay, cool. it is just looked like there might be a !=:= Nil check missing somewhere :)
samcv this was after removing Readline and changing the path to a new rakudo install directory
psch if it works it works vOv
08:12 seatek joined
samcv yeah it doesn't call that role unless it actually has it. otherwise it wouldn't have worked before either 08:13
08:13 ChoHag left
psch right, if it's in a further-out scope i clearly couldn't have seen it 08:13
m: constant URI = try { require URI }; my $uri = URI.new; $uri.do-any-uri-thingy # it just looks like this could happen
camelia rakudo-moar ecc202: OUTPUT«No such method 'do-any-uri-thingy' for invocant of type 'Any'␤ in block <unit> at <tmp> line 1␤␤»
samcv and checked that it compiles without Readline as well
psch ah, but the call is in a method, missed that
samcv yeah 08:14
lizmat samcv: merged 08:15
psch samcv++
samcv thanks lizmat :)
08:22 ChoHag joined 08:24 zakharyas joined 08:30 yqt joined, dakkar joined 08:36 CIAvash joined 08:43 cognominal joined, cog_ left 08:48 g4 joined, g4 left, g4 joined 08:51 girafe2 joined 08:53 girafe left 08:55 brillenfux joined, mohae_ joined 08:57 xtreak left 08:59 mohae left 09:04 labster left 09:11 zakharyas left 09:19 cognominal left 09:20 cognominal joined 09:22 TEttinger left, xtreak joined 09:25 jonas1 joined 09:27 mspo left 09:29 neuraload left 09:30 neuraload joined, wamba left 09:36 optikalmouse joined
optikalmouse ugh wrong chan, perl 5 *shudder* ;p 09:36
09:41 sunnavy joined
samcv hah 09:42
their channel isn't always the nicest if that's what you are meaning optikalmouse
well it depends on who you are talking to there
optikalmouse so I wrote 1 article on perl6, I wanted to write a 2nd where I'm do scraping/indexing and generally building a small search engine for a wiki site.
09:43 ugjka is now known as ugjka2, ugjka2 is now known as ugjka
samcv nice 09:43
optikalmouse samcv, tbh I haven't hung out on #perl in a while :S
samcv same
09:43 ugjka is now known as ugjka2, gregf_ joined
optikalmouse all I need is an HTML parser I think to do this, also a thesaurus, I need to be able to get synonyms for some common words. is the a perl6 lib for that like hooking into a thesaurus api? 09:44
09:44 geekosaur left
samcv perl 6 lib for html parsing? sorry is that what you mean 09:45
optikalmouse ^ yes
Ulti modules.perl6.org/dist/HTML::MyHTML modules.perl6.org/dist/HTML::Parser 09:46
09:46 ugjka2 is now known as ugjka
optikalmouse awesome :D 09:46
samcv it should probably be fine optikalmouse
Ulti modules.perl6.org it has a search box...
timotimo o/ 09:47
optikalmouse: i think on top of a thesaurus you'll also want a stemmer
Ulti optikalmouse: also github.com/Skarsnik/perl6-gumbo 09:48
09:49 geekosaur joined 09:51 zacts left 09:53 kent\n left
optikalmouse timotimo, yes possibly, I wanted to hack up something for a work hackathon which is why I was considering just regexs 09:53
Ulti, my head's search box is broken at 5AM EST :'( :'(
timotimo OK 09:54
09:54 kent\n joined
timotimo but please, if you make a search thing, if the user puts quotation marks around their query or something like that, don't go and "be smart" about what they "probably meant" :) 09:54
09:56 AlexDaniel left
arnsholt I think there's a Porter stemmer implementation 09:56
09:59 salva left
timotimo i think so, too 09:59
optikalmouse timotimo, hah ok 10:01
10:03 vytautas joined 10:05 optikalmouse left 10:07 kurahaupo_ left 10:08 kurahaupo__ joined, optikalmouse joined 10:12 kurahaupo__ left, optikalmouse left 10:18 wamba joined 10:23 zacts joined 10:25 salva joined 10:31 bjz_ joined 10:33 bjz left 10:47 kurahaupo__ joined 10:49 rindolf left, zakharyas joined 11:04 AlexDaniel joined 11:08 pierre_ left 11:09 pierre_ joined 11:10 ssm left 11:12 xtreak left, ssm joined, ocbtec joined, rindolf joined, pierre_ left
ZzZombo are multis the same in classes as anywhere else? docs.perl6.org/language/objects doesn't seem to recognize them, even. 11:18
gfldex ZzZombo: no, a multi method will ignore extra named args, multi subs will complain 11:19
jnthn To be fair, that's true of methods in general, not just multi methods :) 11:20
yoleaux 21 Nov 2016 19:09Z <viki> jnthn: is this a bug? A subset‒*located inside a class*‒with a WhateverCode that closes over an array doesn't get the values of that array: gist.github.com/zoffixznet/4cc5057...915b0a5df9
ZzZombo uh oh
gfldex m: my method foo(){}; my $c; $c.&foo(:answer(42))
camelia ( no output )
gfldex m: my multi method foo(){}; my $c; $c.&foo(:answer(42))
camelia ( no output )
gfldex m: multi sub foo(){}; foo(:answer(42))
camelia rakudo-moar bbbb2b: OUTPUT«Unexpected named argument 'answer' passed␤ in sub foo at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
11:21 AlexDaniel left, AlexDaniel joined
ZzZombo one thing I can't wrap my head around is the syntax for parameters and class attributes. 11:22
f(param:value) looks much better, than f(:param(value))
psch m: class A { method foo(:$a, *%a) { if %a.keys { X::AdHoc.new('Unexpecteed named arguments').throw } } }; A.foo :1a; # if you really want to break nextsame and all those
camelia ( no output )
psch m: class A { method foo(:$a, *%a) { if %a.keys { X::AdHoc.new('Unexpecteed named arguments').throw } } }; A.foo :1b;
camelia rakudo-moar bbbb2b: OUTPUT«Default constructor for 'X::AdHoc' only takes named arguments␤ in method foo at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
jnthn .tell viki Looks like it could be a code-gen issues, maybe not closure-capturing something right. That said, the better way to write all of those caeses imho is to use "constant" :-)
yoleaux jnthn: I'll pass your message to viki.
psch err, well, 'msg => ' is the missing bit :)
or "message" i think
jnthn psch: Pretty sure it's message 11:23
ZzZombo m: class X{sub XXX{}} 11:24
camelia ( no output )
ZzZombo huh
what does sub do?
psch m: class C { sub foo { say "bar" } }; C::foo
camelia rakudo-moar bbbb2b: OUTPUT«Could not find symbol '&foo'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
psch err, 'our'
m: class C { our sub foo { say "bar" } }; C::foo
camelia rakudo-moar bbbb2b: OUTPUT«bar␤»
psch ZzZombo: it declares a Sub 11:25
m: sub f {}; say &f.WHAT
camelia rakudo-moar bbbb2b: OUTPUT«(Sub)␤»
dalek c: 484e94a | gfldex++ | doc/Type/Method.pod6:
tell that Method ignores extra named args
synopsebot6 Link: doc.perl6.org/type/Method
ZzZombo like in a package, I see
psch ZzZombo: point there is that a class is a module is a package 11:26
ZzZombo: subs are 'my' scoped by default, hence the error in the first one
ZzZombo w/o 'our' or otherwise it can be accessed only from within the class, yes?
11:26 vytautas left
ZzZombo there is still a lot for me to learn 11:26
psch m: class A { multi method m(:$a, :$b) { say "2 nameds" } }; class B is A { method m(:$a) { say "1 named"; nextsame } }; B.m( :1a, :2b ) 11:28
camelia rakudo-moar bbbb2b: OUTPUT«1 named␤2 nameds␤»
psch gfldex: ^^^ that i think shows that it doesn't *ignore* additional nameds, but silently accepts them (and potentially passes them on)
gfldex psch: I shall rephrase 11:30
i get really odd errors when using modules 11:31
===SORRY!===
Expected MAST::Frame, but didn't get one===SORRY!===
without the 2nd SORRY
didn't do that a few days ago
psch gfldex++ thanks 11:32
dalek c: 9a43fbb | gfldex++ | doc/Type/Method.pod6:
better example and state forwarding
11:34
synopsebot6 Link: doc.perl6.org/type/Method
tbrowder hi #perl6 11:36
samcv hi tbrowder :)
tbrowder did i see a discussion some days ago about making the best practice for public modules have a META.info instead of a META6.json? 11:37
hi samcv!
11:39 gregf_ left
dalek c: f595b8f | gfldex++ | doc/Language/typesystem.pod6:
link to /type/Method and state our-scope default
11:39
synopsebot6 Link: doc.perl6.org/language/typesystem
viki tbrowder: considering META.info is an old format and META6.json is the new thing, I somewhat doubt there was a discussion about switching yet again 11:40
yoleaux 11:22Z <jnthn> viki: Looks like it could be a code-gen issues, maybe not closure-capturing something right. That said, the better way to write all of those caeses imho is to use "constant" :-)
gfldex ZzZombo: and there is much for me to doc too. Your questions are very helpful in that regard.
tbrowder hm, looks like the move was TO META6.json away FROM META.info, so I guess I'm still on track
sorry for the noise... 11:41
gfldex better noisy then sorry
viki ZzZombo: would you add yourself to this file, unless you wish to appear as "ZzZombo" in credits: github.com/rakudo/rakudo/blob/nom/CREDITS 11:42
seatek: would you add yourself to this file, unless you wish to appear as "seatek" in credits: github.com/rakudo/rakudo/blob/nom/CREDITS
same applies to cpin and adaptiveoptics... (don't see nicks in the channel...) 11:44
.oO( I need a robot to do this stuff... )
11:47
NeuralAnomaly: ^ this. learn it
11:49 CIAvash left
viki .seen MadCapJake 11:53
yoleaux I saw MadcapJake 17 Jun 2016 21:56Z in #perl6: * MadcapJake is off to dinner
11:53 Khisanth left
gfldex i solved the MAST::Frame-problem by `rm -rf rakudo/install/*` 11:56
12:00 lucasb_ joined
viki Interesting :| 12:00
12:03 CIAvash joined 12:07 Khisanth joined 12:14 gregf_ joined 12:16 rindolf left 12:28 brillenfux left
ZzZombo viki: that's fine. 12:32
'sub f(&c:(Int)) { }' 12:35
interesting
gfldex Perl 6 is a Signature oriented programming language :) 12:36
DrForr I've been playing with doing Prolog as almost purely signature-based. 12:37
ZzZombo so, since Signature is just a class, is it possible to use a predeclared instance of it as signature for a sub?
gfldex not without EVAL 12:38
seatek viki: thanks - i added my info
gfldex m: sub foo(Int $i, Str $s){}; &foo.signature.perl.say 12:39
camelia rakudo-moar 4723b9: OUTPUT«:(Int $i, Str $s)␤»
gfldex ZzZombo: macros may make the prossible in the future
ZzZombo argh, I just caught myself adding 'my $self=shift' to a method... 12:40
I take it as there is no built-in to trim a string? 12:42
gfldex m: " foo ".trim.say
camelia rakudo-moar 4723b9: OUTPUT«foo␤»
ZzZombo Woohoo
it about time
psch m: say " foo ".trim.indent(2) # we're also left-pad safe :) 12:43
camelia rakudo-moar 4723b9: OUTPUT« foo␤»
ZzZombo m: sub filename(Str $file where $x.trim ne '') 12:45
camelia rakudo-moar 4723b9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$x' is not declared␤at <tmp>:1␤------> 3sub filename(Str $file where 7⏏5$x.trim ne '')␤»
ZzZombo m: sub filename(Str $file where $file.trim ne '')
camelia rakudo-moar 4723b9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3lename(Str $file where $file.trim ne '')7⏏5<EOL>␤ expecting any of:␤ new name to be defined␤»
ZzZombo m: sub filename(Str $file where {$file.trim ne ''})
camelia rakudo-moar 4723b9: OUTPUT«5===SORRY!5===␤Expression needs parens to avoid gobbling block␤at <tmp>:1␤------> 3ename(Str $file where {$file.trim ne ''}7⏏5)␤Missing block (apparently claimed by expression)␤at <tmp>:1␤------> 3name(Str $file where {$file.trim ne …»
psch m: sub filename(Str $file where .so) { }
camelia ( no output )
psch m: sub filename(Str $file where .so) { }; filename ''
camelia rakudo-moar 4723b9: OUTPUT«Constraint type check failed for parameter '$file'␤ in sub filename at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
psch ZzZombo: remember, '' is falsey :) 12:46
nine psch: but ' ' isn't
psch oh right
so .trim.so
:/
ZzZombo alright
nine m: sub filename(Str $file where $file.trim.chars) { say $file; }; filename(' ')
camelia rakudo-moar 4723b9: OUTPUT« ␤»
psch hm 12:47
nine odd
psch $ touch ' ' # works fine fwiw
but yeah, i can see how people wouldn't want space-named files lying around
m: say ' '.trim.chars
camelia rakudo-moar 4723b9: OUTPUT«0␤»
jnthn Remember that where smartmathces the param against the expression 12:48
gfldex m: my $filename = "somefile-001.txt"; say $filename++ for 1..3;
camelia rakudo-moar 4723b9: OUTPUT«somefile-001.txt␤somefile-002.txt␤somefile-003.txt␤»
psch m: say ' ' ~~ $_.trim.chars
gfldex do we doc that ^^^ anywhere?
camelia rakudo-moar 4723b9: OUTPUT«True␤»
nine sub filename($file where {$_.trim.chars}) { say "<$file>" }; filename " "
m: sub filename($file where {$_.trim.chars}) { say "<$file>" }; filename " "
camelia rakudo-moar 4723b9: OUTPUT«Constraint type check failed for parameter '$file'␤ in sub filename at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
arnsholt *.trim.chars should work too, no?
nine m: sub filename($file where *.trim.chars) { say "<$file>" }; filename " "
camelia rakudo-moar 4723b9: OUTPUT«Constraint type check failed for parameter '$file'␤ in sub filename at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
nine yes
12:49 pierre_ joined
arnsholt Yaaaay, I remembered correctly for a change =D 12:49
(Part of the reason I backed Learning Perl 6 is to get a chance to brush up on my Perl 6 =)
ZzZombo so is {$_.trim.chars} or .trim.so? :/ 12:50
arnsholt Yeah. Just *.trim would work, I guess
Or prefix:<?> instead of .so
psch m: say ' ' ~~ {.trim.so}; say so ' ' ~~ {.trim.chars} 12:51
camelia rakudo-moar 4a711b: OUTPUT«False␤False␤»
12:51 AlexDaniel left
psch ZzZombo: TIMTOWTDI vOv 12:51
ZzZombo yeah, right, but I was worried one way has something over another that you wanted to show me, but I failed to see :v 12:52
psch well, one is "are there characters left after trimming" and the other is "is it truthy after trimming" 12:53
and, well, where does, in the end, check for truthiness itself 12:54
12:54 wamba left
psch so arnsholt++ is right 12:54
...i think
arnsholt About what?
psch m: sub f(Str $ where *.trim) { }; f ' '
camelia rakudo-moar 4a711b: OUTPUT«Constraint type check failed for parameter '<anon>'␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
psch < arnsholt> Yeah. Just *.trim would work, I guess
arnsholt Right, that one] 12:55
12:55 CIAvash left 12:56 sufrostico left
dalek c: 222d162 | coke++ | doc/ (2 files):
remove trailing whitespace
12:57
c: b790d39 | coke++ | doc/ (2 files):
Fix pluralizations
c: ab292eb | gfldex++ | doc/Language/operators.pod6:
doc postfix:<++/-->(Str:D $s)
12:58
synopsebot6 Link: doc.perl6.org/language/operators
ZzZombo m: class A{};class B is A{};sub x(A:U $obj){$obj->new};x(B).say 12:59
camelia rakudo-moar 4a711b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot resolve caller trait_mod:<is>(B, A, Hash); none of these signatures match:␤ (Mu:U $child, Mu:U $parent)␤ (Mu:U $child, :$DEPRECATED!)␤ (Mu:U $type, :$rw!)␤ (Mu:U $type, :$nativesiz…»
psch spaces are free /o\
ZzZombo m: class A {};class B is A {};sub x(A:U $obj){$obj->new};x(B).say
camelia rakudo-moar 4a711b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of -> as postfix; in Perl 6 please use either . to call a method, or whitespace to delimit a pointy block␤at <tmp>:1␤------> 3};class B is A {};sub x(A:U $obj){$obj->7⏏5new};x(B).say…»
gfldex m: class A {};class B is A {}; sub x(A:U $obj){$obj.new}; x(B).say
camelia rakudo-moar 4a711b: OUTPUT«B.new␤» 13:00
ZzZombo pff
gfldex pointers aint pointy in Perl 6 :)
psch only Blocks can be pointy
13:02 lucasb_ left 13:03 AlexDaniel joined
dalek c: 92b7ba4 | ZzZombo++ | doc/Type/Signature.pod6:
Update Signature.pod6
13:04
synopsebot6 Link: doc.perl6.org/type/Signature
ZzZombo Shh
hush 13:05
viki The next sentence is kinda weird. Failure ain't a Nil's subclass so while it's also ignored, the "This allows" bit is off 13:06
m: say Failure.new ~~ Nil
camelia rakudo-moar 4a711b: OUTPUT«True␤»
viki :o
dafuq
psch m: say Failure.^mro
camelia rakudo-moar 4a711b: OUTPUT«((Failure) Nil (Cool) (Any) (Mu))␤»
viki Well, I stand corrected :(
s: Failure, 'new' 13:07
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/4723.../Mu.pm#L92
viki s: Failure, 'new', \()
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/4723...ure.pm#L17
13:07 gregf_ left
viki Weird, I thought it inherited Exception :\ 13:07
m: Failure ~~ Exception
camelia ( no output )
viki m: say Failure ~~ Exception
camelia rakudo-moar 4a711b: OUTPUT«False␤»
[Coke] sub first-parent-class-in-common($a, $b) { ... } 13:08
dalek c: 815059e | coke++ | xt/code.pws:
learn new code sample text
viki m: sub foo { fail X::AdHoc.new }; say foo() ~~ Exception 13:09
camelia rakudo-moar 4a711b: OUTPUT«False␤»
viki m: use Test; sub foo { fail X::AdHoc.new }; throws-like { foo }, Exception 13:10
camelia rakudo-moar 4a711b: OUTPUT« 1..2␤ ok 1 - code dies␤ ok 2 - right exception type (Exception)␤ok 1 - did we throws-like Exception?␤»
viki ^ this is why I thought it was Exception.
moritz throws-like implies fatal, no?
so it actually throws an exception, not a Failure
psch m: sub foo { fail X::AdHoc.new }; say foo().WHAT; say { foo() }().WHAT 13:11
camelia rakudo-moar 4a711b: OUTPUT«(Failure)␤(Failure)␤»
viki m: use Test; sub foo { fail X::AdHoc.new }; try foo.sink; say $!.^name
camelia rakudo-moar 080630: OUTPUT«X::AdHoc␤»
viki Now it makes sense :)
13:12 sufrostico joined 13:13 khw joined
viki Well! Learn something new every day. 13:13
ZzZombo m: say Int.new / Int.new 13:14
camelia rakudo-moar 080630: OUTPUT«Attempt to divide by zero using div␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
viki And I've been with Perl 6 for 1 year
ZzZombo I don't understand docs.perl6.org/type/Signature#Type_Captures then
what does that line do?
viki ZzZombo: try the actual code. 13:15
m: say (Int.new / Int.new).^name 13:16
camelia rakudo-moar 080630: OUTPUT«Rat␤»
viki It's only by trying to use the actual value that it explodes with zero divion.
ZzZombo huh
[Coke] lizmat: the p6 weekly shows up in my feedly feed as "PHA+WWVzLCA8aT5OYW91bSBIYW5rYWNoZTwvaT4mIzgyMTY7cyA8YSBocmVmPSJodHRwOi8vcGVybDZpbnRyby5jb20iPnBlcmw2aW50cm8uY29tPC9hPiBoYXMgYmVlbiA8YSBocmVmPSJodHRwOi8vemgucGVybDZpbnRyby5jb20iPnRyYW5zbGF0ZWQgdG8gQ2hpbmVzZTwvYT4gYnkgPGk" <elided>. click through, everything's fine on the site. just some weird interaction with my rss reader, I guess.
ZzZombo so... is it really needed to be that complicated then?
viki A Rat has a numerator and denominator. It's perfectly happy for those to be zeros, until you try to actually divide it 13:17
ZzZombo: prolly not :)
brrt A rat has a tail and a nose, two feet and two hands
gfldex [Coke]: it's not just you. pl6anet.org fails to link too. Likely some unicode accident. 13:18
ZzZombo IMO such constructions don't bode well, generally. They should be avoided, I believe.
gfldex stmuk_: please take note ^^^
ZzZombo Better to just place Rat there
viki I don't get that example at all TBH
ZzZombo than confuse readers, potentially. 13:19
viki Like, wtf is ::C involved at all
and why is it called $closure
ZzZombo because reasons.
viki m: gist.github.com/zoffixznet/5f5e6fa...a502fcec4e 13:20
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:5␤------> 3 return sub(T7⏏5 $p1) {␤ expecting any of:␤ infix␤ infix stopper␤»
viki broken example too
And it might be old enough that Int.new was returning something else, I recall writing some code for it... 13:21
committable6: 2015.12 say Int.new
committable6 viki, ¦«2015.12»: 0
viki committable6: 2015.12 say Int.new: 5
committable6 viki, ¦«2015.12»: 5
viki shrugs
Oh, I think it was the cloning bit 13:22
committable6: 2015.12 5 does role {}; dd Int.new: 5
committable6 viki, ¦«2015.12»: 5
viki committable6: 2015.12 dd Int.new: 5 but role {}
committable6 viki, ¦«2015.12»: 5
lizmat [Coke] perhaps having chinese characters in the URL is triggering some bug 13:23
ZzZombo m: sub named(:official($private)) { "Official business!" if $private }
camelia ( no output )
ZzZombo named :official;
psch committable6: 2015.12 5 does role { method Str { "foo" } }; print 5
committable6 psch, ¦«2015.12»: fooo
ZzZombo m: sub named(:official($private)) { "Official business!" if $private }
say named :official;
camelia ( no output )
psch m: 5 does role { method Str { "foo" } }; print 5 13:24
camelia rakudo-moar 080630: OUTPUT«foo»
viki m: 5 does role { method Str { "foo" } }; dd 5
camelia rakudo-moar 080630: OUTPUT«foo␤»
psch dunno tbh
viki m: 5 does role { method Str { "foo" } }; dd Int.new: 5
camelia rakudo-moar 080630: OUTPUT«foo␤»
viki /o\
psch i mean, i'm not even sure what "cloning bit" this is about :S
viki Well, the idea was that Int.new would create a new 5, and the old way was just passing it along 13:25
Unless I imagined this all :D
psch that doesn't look too much like it's happening...
viki s: Int, 'new', \()
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/0806.../Mu.pm#L93
viki s: Int, 'new', \(5)
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/0806...Int.pm#L21
[Coke] lizmat: yah. no worries, just an FYI.
ZzZombo so, what is 'named :official' call even doing? What is ':official' for in the wild here?
viki ZzZombo: it's just a named argument 13:26
psch the Type Captures example is a bit dense, yeah, but mostly understandable i think
viki ZzZombo: so you pass :official, but the var is named $private
psch: but it's broken. it doesn't compile
ZzZombo m: sub named(:official($private)) { "Official business!" if $private } say named 'yes'
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3e)) { "Official business!" if $private }7⏏5 say named 'yes'␤ expecting any of:␤ infix␤ infix stoppe…»
psch oh, right 13:27
ZzZombo m: sub named(:official($private)) { "Official business!" if $private } named('yes').say
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3e)) { "Official business!" if $private }7⏏5 named('yes').say␤ expecting any of:␤ infix␤ infix stopp…»
viki ZzZombo: you need a semicolon after the }
ZzZombo m: sub named(:official($private)) { "Official business!" if $private }; named('yes').say
camelia rakudo-moar 080630: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub named at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
ZzZombo m: sub named(:official($private)) { "Official business!" if $private }; named(:official).say
camelia rakudo-moar 080630: OUTPUT«Official business!␤»
viki Right, 'yes' is a positional arg. You need :official<Yes>
or that :)
psch hm, that's a bit weird
moritz or official => 'yes'
viki or :42official 13:28
:D
ZzZombo RLY
13:28 seatek left
ZzZombo m: sub named(:official($private)) { "Official business!" if $private }; named(:666official).say 13:28
camelia rakudo-moar 080630: OUTPUT«Official business!␤»
ZzZombo why
viki ZzZombo: :5th, :3rd
psch m: say "foo" ~~ s:2nd/o//
camelia rakudo-moar 080630: OUTPUT«Cannot modify an immutable Str␤ in block <unit> at <tmp> line 1␤␤»
viki our .subst method takes those
psch m: say "foo" ~~ S:2nd/o//
camelia rakudo-moar 080630: OUTPUT«Potential difficulties:␤ Smartmatch with S/// is not useful. You can use given instead: S/// given $foo␤ at <tmp>:1␤ ------> 3say "foo" ~~ 7⏏5S:2nd/o//␤False␤»
psch ...
viki m: say S:2nd/o// given "foo" 13:29
camelia rakudo-moar 080630: OUTPUT«fo␤»
psch is clearly bad at Perl 6 /o\
viki: i think that the inner sub doesn't recognize T is buggy
consider the /me above though, i suppose :)
viki :D
psch bisect: sub f(::T $a) { sub(T $b) { $a ~ $b } }; f(2)(3).say
bisectable6 psch, On both starting points (old=2015.12 new=080630c) the exit code is 1 and the output is identical as well 13:30
viki And yeah, looks like my clone doesn't clone
bisectable6 psch, gist.github.com/5f4f9b9a2b3f7b9750...7de4c20538
viki committable6: 2015.12 m: 5 does role { method Str { "foo" } }; dd Int.new: 5
committable6 viki, ¦«2015.12»: foo
viki ...at least I didn't make it worse ^_^
Or rather it does clone... but the wrong thing 13:31
psch m: sub f(::T $a) { -> T $b { $a ~ $b } }; f(1)(2).say
camelia rakudo-moar 080630: OUTPUT«12␤»
psch i mean, yeah
viki leaves to do an honest day of work for a change
psch i suppose we lose lexical generics when parsing a new signature...
m: sub f(::T $a) { -> T $b { $a ~ $b } }; f(1)("2").say 13:32
camelia rakudo-moar 080630: OUTPUT«Type check failed in binding to $b; expected Int but got Str ("2")␤ in block <unit> at <tmp> line 1␤␤»
psch m: sub f(::T $a) { sub (T $) { $a } }; f(1)("2").say 13:33
camelia rakudo-moar 080630: OUTPUT«Type check failed in binding to <anon>; expected Int but got Str ("2")␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
psch okay what
m: sub f(::T $a) { sub (T $b) { $a } }; f(1)("2").say 13:34
camelia rakudo-moar 080630: OUTPUT«Type check failed in binding to $b; expected Int but got Str ("2")␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
psch oh ffs
sub()
m: sub()
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ sub used at line 1. Did you mean 'sum'?␤␤»
psch m: sub($a) { }
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3sub(7⏏5$a) { }␤»
psch m: sub(Int $a) { }
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3sub(Int7⏏5 $a) { }␤ expecting any of:␤ infix␤ infix stopper␤»
psch m: sub f(::T $a) { sub(T) { $a ~ $b } }; f(1)(2).say 13:35
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5===␤Word 'sub' interpreted as 'sub()' function call; please use whitespace around the parens␤at <tmp>:1␤------> 3sub f(::T $a) { sub7⏏5(T) { $a ~ $b } }; f(1)(2).say␤Unexpected block in infix position (two terms in a row)␤at …»
gfldex you need a space between sub and (
psch *that* is the error i wanted
gfldex: yeah, my point is that we don't error because of that often enough apparently
gfldex: otherwise the problem with the example would've been clear way earlier... :)
m: gist.github.com/anonymous/13419e6e...d958fcaae7 13:36
camelia rakudo-moar 080630: OUTPUT«10␤»
ZzZombo why is it not described you can put type constraints on named parameters? 13:38
m: sub x(Int:D :$i){say $i}; x 'asd';
camelia rakudo-moar 080630: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub x at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
ZzZombo m: sub x(Int:D :$i){say $i}; x i=>'asd';
camelia rakudo-moar 080630: OUTPUT«Type check failed in binding to $i; expected Int but got Str ("asd")␤ in sub x at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
13:40 Actualeyes left
viki ZzZombo: well volunteered! ;) 13:41
ZzZombo heh
viki m: sub x(Int:D :$i where *.is-prime){say "$i is a prime number!"}; x :31337i; 13:42
camelia rakudo-moar 080630: OUTPUT«31337 is a prime number!␤»
viki Can also do this type of constraints
gfldex type constraints on named args is ENODOC too 13:44
i shall doc
ZzZombo Whatever? 13:47
LOL 13:48
viki m: say *.^name
gfldex ** <-- HyperWhatever
camelia rakudo-moar 080630: OUTPUT«{ ... }␤»
viki :(
psch m: say *.WHAT
camelia rakudo-moar 080630: OUTPUT«(Whatever)␤»
psch m: say **.WHAT
camelia rakudo-moar 080630: OUTPUT«(HyperWhatever)␤»
dalek c: df6644f | (Zoffix Znet)++ | doc/Type/Signature.pod6:
Fix compilation error in example

  psch++
synopsebot6 Link: doc.perl6.org/type/Signature
viki m: say (1, 1, *+* … *)[^20] 13:51
camelia rakudo-moar 080630: OUTPUT«(1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765)␤»
viki m: say (2, 2, * ** * … *)[^20]
camelia rakudo-moar 080630: OUTPUT«Numeric overflow␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
viki damnyouitshouldbeInf
m: say (2, 2, * ** * … *)[^10]
camelia rakudo-moar 080630: OUTPUT«Numeric overflow␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤» 13:52
viki m: say (2, 2, * ** * … *)[^5]
camelia rakudo-moar 080630: OUTPUT«(2 2 4 16 4294967296)␤»
viki \o/
DrForr Heh. I had someone at Cluj.pm specifically ask about Fibonacci.
ZzZombo how do I translate a P5 class that uses autoload to do its magic?
viki ZzZombo: we have FALLBACK 13:53
method FALLBACK
viki does the gun stance
ZzZombo nice
viki docs.perl6.org/language/typesystem...8method%29 13:54
ZzZombo Get outta my mind!
13:54 grondilu_ joined
ZzZombo how'd you know I was looking for it? 13:54
viki I'm very smrt 13:55
13:57 wamba joined
ZzZombo so f :foo is f foo=>True, don't see that mentioned anywhere 13:57
dalek c: 6cb3ee8 | gfldex++ | doc/Type/Signature.pod6:
doc type constraints on named parameters
synopsebot6 Link: doc.perl6.org/type/Signature
13:58 grondilu left
viki m: say (1.1, 1.2, 1.3 * ** * ** * … *)[^5] 13:58
camelia rakudo-moar 080630: OUTPUT«*␤ in any at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1␤ in block <unit> at <tmp> line 1␤␤»
viki heh
it thinks … * is a stud
a *stub
gfldex ZzZombo: see docs.perl6.org/language/glossary#i...Colon_Pair
i should link there I guess 13:59
viki m: say eager 1.1 .. 1.4' 14:00
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say eager 1.1 .. 1.47⏏5'␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end␤ statement modifie…»
viki m: say eager 1.1 .. 1.4
camelia rakudo-moar 080630: OUTPUT«(1.1)␤»
viki m: say eager 1.1 ... 1.4
camelia rakudo-moar 080630: OUTPUT«(1.1)␤»
viki :(
psch m: say eager 1.1, * + .1 ... 1.4
camelia rakudo-moar 080630: OUTPUT«(1.1 1.2 1.3 1.4)␤»
14:00 Actualeyes joined
kalkin-_ Is there some guide with best practices on how to document Classes and methods in POD? I've read (parts) of S26, but it's too general 14:01
viki Don't think so.. 14:02
I don't even think we support all of S26 entirely
m: say (|(1.1, * + .1 … 1.7), * ** * ** * ** * ** * ** * ** * … *)[^10]
camelia rakudo-moar 080630: OUTPUT«(1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.14214710482005 1.40899329027426 1.91186164454408)␤»
viki \o/
14:02 kyclark_ joined
viki m: say (|(1.1, * + .1 … 1.7), * ** * ** * ** * ** * ** * ** * … *)[^100] 14:02
camelia rakudo-moar 080630: OUTPUT«(1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.14214710482005 1.40899329027426 1.91186164454408 2.56762564221384 6.80825317520194 Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf In…»
viki And here we have an Inf instead of throwage
14:03 bjz_ left
DrForr #| is used, at least I've used it for samples. 14:03
kalkin-_ m: sub foo( |#{A C<Str>} $b} { $b.say } foo.WHY
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3foo( |#{A C<Str>} $b} { $b.say } foo.WHY7⏏5<EOL>␤ expecting any of:␤ constraint␤»
kalkin-_ m: sub foo( |#{A C<Str>} $b} { $b.say }; foo.WHY
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3oo( |#{A C<Str>} $b} { $b.say }; foo.WHY7⏏5<EOL>␤ expecting any of:␤ constraint␤»
kalkin-_ m: sub foo( #|{A C<Str>} $b} { $b.say }; foo.WHY
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3sub foo( #|{A C<Str>} $b7⏏5} { $b.say }; foo.WHY␤ expecting any of:␤ constraint␤»
dalek c: a7f6994 | gfldex++ | doc/ (2 files):
link to colon-pair
c: e91b7fd | gfldex++ | doc/Type/Pair.pod6:
index colon-pair in /type/Pair
synopsebot6 Link: doc.perl6.org/type/Pair
psch m: sub foo( #|{A C<Str>}␤ $b} { $b.say }; foo.WHY 14:04
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:2␤------> 3 $b7⏏5} { $b.say }; foo.WHY␤ expecting any of:␤ constraint␤»
psch m: sub foo( #|{A C<Str>}␤ $b) { $b.say }; foo.WHY
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling foo() will never work with declared signature ($b)␤at <tmp>:2␤------> 3 $b) { $b.say }; 7⏏5foo.WHY␤»
psch m: sub foo( #|{A C<Str>}␤ $b) { $b.say }; .say &foo.WHY
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling foo() will never work with declared signature ($b)␤at <tmp>:2␤------> 3 $b) { $b.say }; .say &7⏏5foo.WHY␤»
psch m: sub foo( #|{A C<Str>}␤ $b) { $b.say }; say &foo.WHY:
camelia rakudo-moar 080630: OUTPUT«Nil␤»
14:04 kyclark_ left
psch m: sub foo( #={A C<Str>}␤ $b) { $b.say }; say &foo.WHY: 14:04
camelia rakudo-moar 080630: OUTPUT«A C<Str>␤»
psch kalkin-_: ^^^ there you go :)
14:04 domidumont left
kalkin-_ psch: ahh, ok let's see if p6doc will display it 14:04
ZzZombo class A { method asd(-->A){ say self } } 14:05
class A { method asd(-->self){ say self } } # <-- doesn't work.
psch m: say say "" 14:06
camelia rakudo-moar 080630: OUTPUT«␤True␤»
psch ZzZombo: &say returns True
kalkin-_ psch: just a second. AFAIK #= assigns the documentation to the element before. so #= rightly assigns it to foo.WHY, but actually I want to document the parameters, simmilar to javadoc style
psch ZzZombo: True probably isn't a A
14:06 domidumont joined
ZzZombo well, it wasn't even the error I encountered 14:06
'Type 'self' is not declared'
kalkin-_ and then display the .WHY text in pod (which is currently displayed correctly in p6doc) and the documentation for the sub parameters
14:07 kalkin-_ is now known as kalkin-
ZzZombo but good point nonetheless 14:07
viki m: class A { method asd(-->self){ say self } }
psch m: sub foo( #|{A C<Str>}␤ $b) { $b.say }; say &foo.signature.params[0].WHY:
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Type 'self' is not declared␤at <tmp>:1␤------> 3class A { method asd(-->self7⏏5){ say self } }␤»
rakudo-moar 080630: OUTPUT«A C<Str>␤»
psch kalkin-: well, #| assigns to the param, and it works too
ZzZombo: well, self is not a type. there is ::?CLASS, which is the class of self 14:08
m: class A { method m(--> ::?CLASS) { self } }; class B is A { }; say A.new.m; say B.new.m
camelia rakudo-moar 080630: OUTPUT«A.new␤B.new␤»
14:09 jonas1 left
kalkin- psch: ok, 14:09
psch m: class A { method m(--> A) { self } }; class B is A { }; say A.new.m; say B.new.m # or be explicit if you don't want to inherit it i guess?
camelia rakudo-moar 080630: OUTPUT«A.new␤B.new␤»
kalkin- then it's definitly a p6doc issue for not showing them
psch oh damn you liskov, foiled again!
kalkin- thank you guys for helping
ZzZombo beat me to it
thanks
m: class C { 14:10
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3class C {7⏏5<EOL>␤»
ZzZombo my $.local = 42;
has $.x = self.local
};
say C.new.x
ugh
viki I've just made a program that takes ages to compile (dunno how long, still waiting) :(
m: gist.github.com/zoffixznet/d58450a...c1d9f42e81
ZzZombo m: class C { my $.local = 42; has $.x = self.local }; say C.new.x
camelia rakudo-moar 080630: OUTPUT«(timeout)» 14:11
rakudo-moar 080630: OUTPUT«42␤»
ZzZombo why is self here visible then?
viki Good question!
psch m: class C { my self $x }
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5===␤Type 'self' is not declared␤at <tmp>:1␤------> 3class C { my self7⏏5 $x }␤Malformed my␤at <tmp>:1␤------> 3class C { my7⏏5 self $x }␤␤»
psch visible as *what* is the question 14:12
self is not a type, nowhere
viki ZzZombo: I think the literals you can specify in --> thing just don't include `self`. You can't for example specify 2+2 either
14:12 cdg joined
psch self is not a literal in that sense, it's more of an automatically lexpad-inserted constant 14:13
viki m: class C { method foo (self) { say "w00t" } }; say .foo: $_ given C.new
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'self' in parameter declaration.␤at <tmp>:1␤------> 3class C { method foo (self7⏏5) { say "w00t" } }; say .foo: $_ given C␤»
gfldex ZzZombo: the self is pointing at the type object while constructing objects
ZzZombo yes, I know.
14:14 kyclark_ joined
ZzZombo in a function I wanted to declare return type of the class. 14:14
viki m: class C { method foo (-> ::?CLASS) { self } }; say .foo given C.new
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3class C { method foo (7⏏5-> ::?CLASS) { self } }; say .foo given ␤»
viki m: class C { method foo (--> ::?CLASS) { self } }; say .foo given C.new 14:15
camelia rakudo-moar 080630: OUTPUT«C.new␤»
14:15 cdg left
viki m: class C { method foo (--> ::?CLASS:D) { self } }; say .foo given C.new 14:15
camelia rakudo-moar 080630: OUTPUT«C.new␤»
ZzZombo also apparently you can't do 'method foo returns Whatever{}'
viki m: class C { method foo (--> ::?CLASS:D) { self } }; say .foo given C
camelia rakudo-moar 080630: OUTPUT«(C)␤»
viki huh
psch m: sub f(--> Int:D) { Int }; f()
camelia rakudo-moar 080630: OUTPUT«Type check failed for return value; expected return type Int cannot be itself (perhaps returning a :D type object?)␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
14:15 cdg joined
psch huh indeed 14:15
gfldex m: class C {...}; class C { method m returns C {} }
camelia ( no output )
psch m: class C { method foo (--> ::?CLASS:D) { say self.defined; self } }; say .foo given C 14:16
camelia rakudo-moar 080630: OUTPUT«False␤(C)␤»
ZzZombo well, it didn't sneeze when I was returning bools, so...
psch do we not do that right?
viki m: class C { method foo () returns Whatever { * } }; say .foo given C.new
camelia rakudo-moar 080630: OUTPUT«*␤»
viki ZzZombo: ^ seems you can
psch m: class C { method foo (::?CLASS:D $ --> ::?CLASS:D) { say self.defined; self } }; say .foo(C) given C
camelia rakudo-moar 080630: OUTPUT«Parameter '<anon>' requires an instance of type C, but a type object was passed. Did you forget a .new?␤ in method foo at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
psch curious 14:17
m: class C { method foo (--> ::?CLASS:D) { False } }; say .foo given C
camelia rakudo-moar 080630: OUTPUT«Type check failed for return value; expected C but got Bool (Bool::False)␤ in method foo at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
viki m: class C { method foo (--> ::?CLASS:D) { say ::?CLASS:D.HOW; self; } }; say .foo given C
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤You can't adverb ::?CLASS␤at <tmp>:1␤------> 3od foo (--> ::?CLASS:D) { say ::?CLASS:D7⏏5.HOW; self; } }; say .foo given C␤ expecting any of:␤ pair value␤»
ZzZombo viki: yup... seems the error message I've been getting related to self. 14:18
not to returns
viki m: class C { method foo (--> ::?CLASS:D) { say (::?CLASS:D).HOW; self; } }; say .foo given C
camelia rakudo-moar 080630: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤You can't adverb ::?CLASS␤at <tmp>:1␤------> 3d foo (--> ::?CLASS:D) { say (::?CLASS:D7⏏5).HOW; self; } }; say .foo given C␤ expecting any of:␤ pair value␤»
viki So it looks like it'd just not interpreting ::?CLASS:D as a :D smiley
ZzZombo D: 14:19
gfldex i would consider this a bug
viki is reporting it
14:21 AlexDaniel left, AlexDani` joined
viki rt.perl.org/Ticket/Display.html?id=130151 14:21
ZzZombo wanna one more? "class A { method asd returns A:D { say self } }" doesn't seem to catch anything violating the constraint. 14:22
> A.asd 14:23
(A)
> A.new.asd
A.new
> say A.asd
(A)
viki m: class A { method asd returns A:D { 42 } }; say A.asd
camelia rakudo-moar 080630: OUTPUT«Type check failed for return value; expected A but got Int (42)␤ in method asd at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
viki m: class A { method asd returns A:D { say self } }; say A.asd
camelia rakudo-moar 080630: OUTPUT«(A)␤Type check failed for return value; expected A but got Bool (Bool::True)␤ in method asd at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
viki Seems to catch fine.
ZzZombo huh
viki REPL issue?
Maybe you need to clear it? 14:24
Restart..
gfldex m: class A { method asd returns A:D { A } }; say A.asd
camelia rakudo-moar 080630: OUTPUT«Type check failed for return value; expected return type A cannot be itself (perhaps returning a :D type object?)␤ in method asd at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
ZzZombo I was just launched
viki Whatever the strange people who use REPL do :)
ZzZombo it*
viki Could be a bug in REPL :(
psch yeaah the REPL is weird
i think it's at least partly an architectural thing that makes it weird
viki nods
ZzZombo c:\rakudo\bin>perl -e "class A { method asd returns A:D { say self } };A.asd" 14:25
WHAT
syntax error at -e line 1, near "returns A:"
Execution of -e aborted due to compilation errors.
dammit 14:27
indeed REPL is causing that 14:28
never again
awwaiid ZzZombo: perl vs perl6? 14:29
ZzZombo what? 14:30
timotimo yeah
awwaiid are you running perl6 code through perl5?
timotimo that's totally what's happening
viki eyes the c: part.... 14:31
Your Rakudo may also be old enough that it's missing some of the fixes
14:31 AlexDani` left
timotimo don't judge people who install stuff on their system partition … 14:31
viki Thanks to our ultra-rapid bug fixing and stuff
viki wasn't :) 14:32
ZzZombo especially when the installer doesn't even ask you where to install things...
viki /o\
ZzZombo c:\rakudo\bin>perl6 -v 14:33
This is Rakudo version 2016.11 built on MoarVM version 2016.11 implementing Perl 6.c.
I'm not so sure, but I think it can't be old.
timotimo cool, that's the newest beta
i didn't know we had a .msi for that yet
i would really appreciate if someone could take the time to make the perl6 installation thing on windows relocatable ... 14:34
viki TBH, I thought it were :/ 14:36
psch i wasn't aware it was relocatable anywhere
viki downloads 2016.07 Star to try out
14:36 user9 left
psch welp 14:36
moved my local, current build of nom around: 14:37
$ ./perl6-j -e'say "foo"'
Error: Could not find or load main class perl6
granted, maybe r-m has that solved..?
moritz nope
rakudo isn't relocatable
psch and since C: is the mostly likely partition to exist... 14:38
14:38 titsuki joined
viki Well, what do you guys mean by "relocatable"? I meant that it doesn't force people to install to %HOME_DRIVE%:\rakudo\bin on Windows, not that you can move it anywhere ya want after you do 14:38
14:38 user9 joined
psch viki: well, it isn't relocatable after being compiled 14:38
viki Ah
psch and the .msi only unpacks it 14:39
afaiu
viki Yeah, the installer just says "Imma install stuff there" and no option to change anything
psch right, and since we probably don't want to package all the compile dependencies into the msi, someone builds it and makes an msi that unpacks the precompiled installation 14:40
14:40 ___crlz___ joined
viki :( 14:40
kalkin- Ohh, it looks like there is no general consents on which pod blocks are generated when. p6doc default formatted doesn't generate text for method parameters, Pod::To::Markdown skips randomly methods and documentation 14:41
I assume that the perfect POD Viewer would render all the documentation which does not start with #\s ? 14:42
right?
At least this is the impression i get from reading S26
viki shrugs 14:43
the #'() stuff looks more like something for auto-doc-generators Doxygen-like stuff rather than Pod renderer. At least that's what they feel to me, since they're "attached" to bits of code 14:44
Just rendering them without rendering adjascent code may not prove useful
DrForr I use them pretty extensively as block commenets.
*comments
kalkin- viki: yeah that one also needs to be skipped. I use it for LICENSE headers in my files 14:45
viki You could ask ShimmerFairy, I recall they were heavily into Perl 6 pod stuff, so they would know all the details 14:46
14:46 yqt left
viki .seen ShimmerFairy 14:46
yoleaux I saw ShimmerFairy 18 Oct 2016 04:22Z in #perl6: <ShimmerFairy> m: say "CEF" ~~ /<+alpha - [Ff]>+/
timotimo but #`() isn't even pod 14:47
viki Ah, OK :) 14:48
kalkin- Intersting if i hook in to the render method of Pod::To::Markdown and print out the ast, I'm missing elements, like the previously discussed pod in a subroutine parameter 14:49
may be sub foo(#|{ ASD } $asd ) { $asd.say } isn't the right way to document parameters? may be there is another indented way? 14:50
or is it a bug in perl6 --doc ?
viki kalkin-: but is #|{ ... } Pod at all? 14:51
timotimo that stuff at least gets attached to methods/subs/parameters/... via the .WHY 14:52
ZzZombo method FALLBACK ($name,|c) will capture everything after $name, so I can forward it to another routine? 14:54
like foo |c;
viki ZzZombo: yup, foo(|c)
It's a Capture
huggable: Capture
huggable viki, Argument list suitable for passing to a Signature: docs.perl6.org/type/Capture
kalkin- ahh I see it's not a bug 14:55
You have to query the ast elements for the data
at least this is what i read from Pod::To::Markdown
timotimo well, pod makes a tree-like structure 14:56
14:59 zakharyas left, zakharyas joined
kalkin- if I have a Pod::Block::Declarator, i need to ask it for his .WHEREFORE, check if it's a Method, then check the signature parameters for .WHY 14:59
(check the .WHY of the signature parameters)
timotimo ah
that makes sense, yeah
15:00 wamba left
viki m: say WHY "Life, the Universe and Everything": 15:00
camelia rakudo-moar 080630: OUTPUT«42␤»
viki ^_^
kalkin- It would be nice if the AST which is provided to render would already have this kind of information, so that the renderer doesn't need to have a lot of custom logic, but I don't know how it will fit in to general Pod 15:01
15:01 ufobat joined
kalkin- viki: ^^ 15:01
viki kalkin-: are you saying I should watch for a PR from you to improve Rakudo's Pod stuff? :) 15:02
15:03 zakharyas left
viki It's probably all here: github.com/rakudo/rakudo/blob/nom/...ore/Pod.pm 15:04
kalkin- viki: I'm not sure if this needs to be patched
viki Oh, OK.
15:05 rindolf joined
kalkin- I don't understand Pod enough to make the decision if the current behavior is intended, or if Pod::Block::Declarator should by default encapsulute information of it's .WHEREFORE 15:07
15:07 foreignFunction joined
viki doesn't know anything about Pod 15:07
foreignFunction Hi there.
viki foreignFunction: \o
foreignFunction Why does dir().iterator.count-only throw "Method 'count-only' not found for invocant of class '<anon|140689890204704>'"? 15:08
viki s: dir(), 'iterator', \()
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/0806...Seq.pm#L52
timotimo count-only isn't necessary to be implemented
kalkin- may be i should patch the default pod renderer to show pod doc on method parameters, so people start using it, so we can have a better discussion about handling it in a year or two 15:09
foreignFunction But why is it not implemented for sequence returned from dir?
*dir()
viki Well, it doesn't seem to implemented on other Seqs either: 15:10
m: (1, 2 … 3).iterator.count-only.say
camelia rakudo-moar 080630: OUTPUT«No such method 'count-only' for invocant of type '<anon|456463536>'␤ in block <unit> at <tmp> line 1␤␤»
kalkin- wasn't the default renderer Pod::To::Text? I can't find the module for it
ohh i see it's part of rakudo now 15:11
viki kalkin-: it's part of standard Rakudo modules: github.com/rakudo/rakudo/blob/nom/...o/Text.pm6
foreignFunction Uncool. How do I do what I intended, then?
(and why isn't there some kind of default implementation?)
gfldex foreignFunction: count-only is not defined in Iterable 15:12
foreignFunction: it may even be a leaking implemenation detail
m: say +dir(); 15:13
camelia rakudo-moar 080630: OUTPUT«54␤»
kalkin- I think i just need to patch this subroutine github.com/rakudo/rakudo/blob/7af9...t.pm6#L114 to include the WHY of parameters in the output
15:13 user9 left
gfldex if count-only is called or not is up to Rakudo to decide 15:13
timotimo there is no default implementation for count-only because count-only existing is a flag for "can we get the number of things in it without actually calculating anything?"
a default implementation would probably be "calculate everything and count it"
which goes against what the method is meant for
foreignFunction gfldex: ah, so I am not supposed to call it? 15:14
15:14 user9 joined
foreignFunction Or use the Iterator methods directly at all? 15:14
15:14 user9 left
viki foreignFunction: well, what were you trying to do exactly? Just get the number of files? 15:14
timotimo you're not supposed to use iterator methods directly, no. 15:15
only if you have very, very, very specific things you want to do with iterators
15:15 user9 joined
viki m: dir.elems.say 15:15
camelia rakudo-moar 080630: OUTPUT«54␤»
15:16 pierre_ left
gfldex Rakudo will call count-only whenever possible 15:17
15:17 pierre_ joined 15:18 canopus left
foreignFunction Okay, I've got this. I was sure I've tried dir().elems and it didn't work, but it works now, so it seems that I did something wrong the first time. 15:21
viki \o/
15:21 pierre_ left
viki It returns a Seq, which does Cool, so along with using .elems you can just use it in numeric context to get the number of elements. 15:22
15:24 canopus joined
kalkin- Is it possible to shorten even more this statement: $foo ?? $foo !! 'NO FOO'; 15:25
jnthn $foo || 'NO FOO'
kalkin- omg, yes of course. thanks jnthn 15:26
viki :) 15:27
timotimo NO SOUP FOR YOU 15:32
15:33 CIAvash joined, FROGGS joined 15:34 pierre_ joined 15:35 lucasb_ joined, rindolf left
lucasb_ m: Mu.Str 15:36
camelia rakudo-moar 080630: OUTPUT«Use of uninitialized value of type Mu in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤ in block <unit> at <tmp> line 1␤»
[Coke] Wenzel P. P. Peppmeyer ? 15:37
lucasb_ just a nitpick... suggesting ".say" there is strange, because it is different from the others
viki [Coke]: it's gfldex
lucasb_ .say doesn't return a stringified version of the object
[Coke] gfldex: you just committed some sample code with "fortytwo" in it. Can you pick a different word so I don't have to whitelist the wrong way to spell forty-two? 15:39
timotimo right, it does read strangely
but it *is* helpful to also have .say in the suggestion
gfldex [Coke]: will do 15:40
[Coke] (or if forty-two works there, even better.)
viki haha, lucasb_ just made my prediction come true :) 15:41
[Coke] gfldex++
gfldex m: sub f(Int :$i){}; f :i<forty-two>;
camelia rakudo-moar 080630: OUTPUT«Type check failed in binding to $i; expected Int but got Str ("forty-two")␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
lucasb_ viki: what prediction?
viki lucasb_: That time would come when we'd bikeshedding that warning again. (that was when I commited a fix to it last time and was ranting about that we don't have any "standard" for what errors/warnings are supposed to look like) 15:42
dalek c: 6687e2d | gfldex++ | doc/Type/Signature.pod6:
make spell checker happy
synopsebot6 Link: doc.perl6.org/type/Signature
[Coke] \o/ 15:43
[Coke] wonders he is now code named, "spell checker". :)
lucasb_ viki: sorry for the bikeshedding :D but, indeed, a standard on how to write the warnings/errors would be very interesting 15:44
for example, IMO, I really don't like to see newline characters inside those messages 15:45
see "perl6 -v"
viki Interesting
lucasb_ "\n" implementing Perl 6.c.
viki I, on the other hand, do. Otherwise, on my 1440p monitor they'd all be in 1 line
Well, yeah, perl6 -v is weird :) 15:46
gfldex -v may be processed by a non-human and they tend not to care much for newlines. 15:47
15:47 pierre_ left 15:48 rindolf joined
gfldex i need to find 4 more doc-holes to fill the 600 commits before the year ends 15:48
viki Why 600? 15:49
gfldex because it's a nice round number
viki m: say 1337-1137
camelia rakudo-moar 080630: OUTPUT«200␤»
jnthn 600 doc commits total, or 600 by you? :)
FROGGS o/
viki Get 200 more and you'll have 1337 commits in a year :)
gfldex by me
jnthn gfldex++ # so commit!
gfldex total is at 5082 since it was created 15:50
15:50 kyclark_ left
gfldex that's a lot of man-hours 15:50
15:52 g4 left
viki jnthn alone made 5,911 commits to rakudo since it was created :o 15:52
that's a lot of... superman-hours :) 15:53
I wish there were an easy way to see how many contributions you made to all repos in an organization 15:54
15:54 optikalmouse joined
jnthn viki: That's...quite a few :) 15:57
I think if you add NQP, Rakudo, and MoarVM I'm into 5 figures by now.
timotimo ah, figures.
15:59 neuraload left 16:01 kalkin- left, kalkin- joined 16:03 domidumont left
viki kalkin-: how can I generate what your PR produces? 16:05
kalkin-: I've tried with ./perl6 --doc=Text -e 'sub foo(#|{ Just some ASD param } $asd ) { $asd.WHY.say }' 16:06
but I get same output from normal Perl 6 and from your patch :/
16:18 zakharyas joined 16:22 zakharyas left 16:23 ugjka is now known as ugjka|
___crlz___ hi all! 16:24
need help. i'm trying to compile rakudo-star-2016.10 16:25
compilation stops with this message:
== Installing modules for MoarVM
cd modules/panda && sh -c "PATH=/usr/bin:/root/coding/dmd2/linux/bin32/:/root/.rakudobrew/bin/:/root/coding/Nim/bin/:/root/perl5/bin/:/opt/bin:/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin /tmp/SBo/package-rakudo-star/usr/bin/perl6-m bootstrap.pl"
Unhandled exception: While looking for '/usr/share/perl6/runtime/perl6.moarvm': no such file or directory
Makefile:65: recipe for target 'modules-install-m' failed
make: *** [modules-install-m] Error 1
moritz ___crlz___: have you intentionally configured rakudo star with prefix /usr/share ? 16:27
___crlz___ i type: 16:28
$ perl Configure.pl --prefix=/usr --backend=moar --gen-moar --gen-nqp
$ make
$ make DESTDIR=/tmp/SBo/package-rakudo-star
timotimo ah
i think rakudo star hasn't gotten the treatment for being destdir-aware yet?
16:29 ugjka| is now known as ugjka
ilmari ___crlz___: shouldn't the last one be 'make install DESTDIR=...'? 16:29
timotimo mst: what's the status of your patches for the makefile/configure stuff?
16:30 wamba joined
___crlz___ ilmari, yes a made a typo 16:30
here, not in terminal)
timotimo i personally would recommend against installing rakudo into the system like that. but i'm not up to date on how our makefiles and such behave 16:33
___crlz___ timotimo, if so then how do I install in a specific directory?
timotimo i have --prefix=/home/me/perl6/install for example
stmuk_ is rakudo itself destdir-aware? 16:34
timotimo i think so
viki Yup.
timotimo does configure.pl also have to see the destdir for things to work right? 16:35
16:36 sufrostico left, wamba left
viki No idea. I just recall there was a DESTDIR issue with one of the releases and I had to do a point release after we fixed it... so that means it is DESTDIR-aware :) 16:37
I think it worked with just DESTDIR
(not making configure aware of anything) 16:38
timotimo ok 16:39
16:39 TEttinger joined 16:40 CIAvash left 16:41 sufrostico joined
viki If I built both moarvm and jvm backends, can I tell it to re-build only jvm after I make source change? 16:41
timotimo make j-install 16:42
viki Thanks 16:43
16:46 mohae_ left 16:47 skids joined, mohae joined
viki has a newfound respect for psch and bartolin .... 16:49
This stuff's taking ages to compile! 16:50
16:50 wamba joined
[Coke] it's a bear, aye 16:52
16:53 brillenfux joined
viki wonders how long bears take to compile... 16:53
timotimo are they a clang-bear, or a gcc-bear?
17:02 domidumont joined, kyclark_ joined 17:06 brillenfux left, AlexDani` joined 17:08 foreignFunction left 17:16 AlexDani` left 17:23 acrussell_ joined 17:29 brrt left 17:30 araujo left 17:35 sufrostico left 17:40 dakkar left 17:42 araujo joined, araujo left, araujo joined
TEttinger worst compile times I ever had were trying out MLton, a Standard ML compiler. about 10 minutes for Hello World, admittedly on 2007 or so hardware 17:47
it's a whole-program optimizing compiler, which apparently is a valid excuse
17:48 pierre_ joined
viki 10 minutes to optimize Hello World? :D 17:49
17:49 wamba left, ugjka left
geekosaur whole-program includes the standard library, which if it's not split up could mean a lot of compiling/optimizing unnecessary code 17:49
TEttinger there was no unoptimized compilation at the time, I think? that I believe was only on the first compile since it needed to check where in the library hello world called, so what geekosaur said 17:50
17:52 pierre_ left, sufrostico joined 17:56 optikalmouse left 17:58 lichtkind joined 17:59 vendethiel left 18:02 sufrostico left, vendethiel joined 18:04 ugjka joined 18:08 nowan_ left 18:11 nowan joined 18:14 labster joined 18:20 lucasb_ left 18:22 zakharyas joined 18:27 ugjka left 18:31 dmaestro left 18:33 ggoebel left 18:34 sufrostico joined 18:40 ugjka joined 18:45 dp[m] joined, ugjka left
kalkin- viki: I ran ./perl6 -Ilib --doc=Text foo.pm6 18:51
with foo containing: #| Hahaha 18:52
sub foo( #|{ Asd } $ads ) {
$ads.say
}
18:53 wamba joined
viki kalkin-: and what was the output? 18:54
kalkin- sub foo(
$ads, # Asd
)
Hahaha
class $ads
Asd
viki lemme fire up my VM and rebuild.. 18:55
kalkin- The current default behaviour of Pod::To::Text is to skip printing out the anything related to subroutine if it doesn't have pod attached to it 18:57
I probably should also supress the ouput of the signature pod
Or may be there should be a more sensible default behavior for cases when there is no subroutine documentation but documentation on signagure elements 18:58
18:59 labster left 19:00 ssm left
kalkin- IMHO Pod::To::Text should print all the exported methods/subroutines, even if they do not have any documentation attached 19:00
viki What I don't get is wtf it prints "class $ads 19:08
Asd
"
At the end. (and it's not your change, it was like that before)
Seems to think #|{ ... } is used for classes or something? 19:09
19:09 zakharyas left
viki kalkin-: what's the fix for trailing commas look like? I rather leave the trailing commas in that add overly-complex code to avoid them 19:11
s/that/than/;
kalkin- just join on(,) after that add the parameters documentation and join on \n 19:13
I just need to fix me EDITOR first
s/me/my 19:14
19:15 darutoko left 19:18 Tonik joined 19:20 cdg_ joined
viki but it'd have to know if it's the last item, won't it? :) 19:21
viki shuts up and waits...
19:22 cdg left 19:25 kyclark_ left
viki m: sub pt { join ",", $^p.perl, ($_ ?? " # $_" !! "" given $p.?foo) }; ("foo", class { method foo { "MEOWS" } }, "moos").map(&pt).join("\n").chop.say 19:27
camelia rakudo-moar 17604e: OUTPUT«"foo",␤<anon|78647312>, # MEOWS␤"moos"␤»
viki \o/
19:29 vike left
kalkin- Ohh this is even smarter, my current solution tries to check if the current element is the last one 19:29
19:30 kyclark_ joined
El_Che ugexe: if you have the time, I have a problem when installing zef as a user (trying to write to a system location even when zef was installed with -install-to=home: gist.github.com/nxadm/853c96253912...05b6e886be 19:32
arnsholt Implementing join yourself is a useful learning exercise for this kind of stuff 19:33
I prefer to print the first one and then print $separator$item from 1..*
viki In this case that would fail, 'cause in some cases the separator must go in the middle of $item :) 19:35
And preferrably the sub that generates $item doesn't need to be told whether or not it's generating the last item
kalkin- viki: your algo chops always of the last char 19:43
(or may be I misunderstood it) 19:44
viki kalkin-: yeah, it always chops the last char and that last char is always a comma 19:45
.oO( or is it! Tun-tun-taaaaaann )
m: sub pt { join ",", $^p.perl, ($_ ?? " # $_" !! "" given $p.?foo) }; ().map(&pt).join("\n").chop.say
camelia rakudo-moar 17604e: OUTPUT«␤»
viki seems ok
kalkin-: oh, right, my algo is crap :D 19:49
heh
19:49 pierre_ joined
viki m: sub pt { join ",", $^p.perl, ($_ ?? " # $_" !! "" given $p.?foo) }; ("foo", class { method foo { "MEOWS" } }).map(&pt).join("\n").chop.say 19:49
camelia rakudo-moar 17604e: OUTPUT«"foo",␤<anon|74735568>, # MEOW␤»
viki fail
19:51 ___crlz___ left 19:52 lichtkind_ joined 19:53 ___crlz___ joined 19:54 pierre_ left 19:56 lichtkind left
kalkin- i think just passing a boolean to param2text would be simpler 19:56
viki m: sub pt { [$^p.perl, ($_ ?? " # $_" !! "" given $p.?foo)] }; say (|.[^(*-1)]».join(", "), .[*-1].join).join: "\n" given ("foo", class { method foo { "MEOWS" } }, "moos").map(&pt) 19:57
camelia rakudo-moar 17604e: OUTPUT«"foo", ␤<anon|66662512>, # MEOWS␤"moos"␤»
viki Perfect amount of insanity :)
viki still votes on leaving the trailing comma in
kalkin- ++1 19:58
viki Ok, then I'm merging :)
kalkin- perfect
viki done 19:59
kalkin- awesome thanks
viki kalkin-++ thank you!
20:01 dmaestro joined
kalkin- how would i go to switching my rakudo to nom with rakudobrew? Beside using rakudobrew tripple nom 2016.10 2016.10 20:06
or is the tripple command the right one?
AFAIK build only accept the backend type right? 20:07
20:07 eisen74 joined
geekosaur it's two steps actually. you build it with one, and rakudobrew select to specify which is default 20:07
er rakudobrew switch
kalkin- yeah right 20:08
geekosaur hm, but that is choosing a branch you are talking about? or just the backend?
20:09 TimToady left
kalkin- the branch of rakudo 20:09
20:11 TimToady joined
viki kalkin-: `rakudobrew build moar` build HEAD 20:11
*builds HEAD
of nom branch 20:12
20:12 bjz_ joined 20:15 vike joined
kalkin- viki: thanks 20:15
could the whole stack rakudo + moarvk + nqp be build without perl5? currently i know there are some perl5 dependencies, how important are they? 20:16
[Coke] it's theoretically possible. you'd have to replace it with some other thing that is available at configure time, though. 20:17
viki our Configure.pl is a Perl 5 script
kalkin- ic, thanks
[Coke] easier to depend on perl 5 so we can focus on perl 6. 20:18
kalkin- Coke: I understand completely, :)
20:19 eisen74 left
[Coke] need 14 more slots filled on advent. I think folks are still hoping for a special day 1 post - mine is just there for a placeholder, but will include one paragraph on "hey, it's our first year" if needed. 20:20
kalkin- Why is it that perl6 programms on error output the Usage with the whole path prefixed with a hash to it? 20:22
As far as I remmeber zef (or was it panda) had an empty MAIN for just printing the Usage which is readable
viki Yeah, it's LTAness :)P 20:23
kalkin- The Usage which is output on error is so long that it's unusable
viki:?
viki The PRO argument is that you don't know where the thing actually is so saying "run blah whatever" may not actually work.
20:23 ocbtec left
viki But in reallity: the output is unreadable :) 20:24
m: sub MAIN ($) {}
camelia rakudo-moar 689da7: OUTPUT«Usage:␤ <tmp> <Any> ␤»
viki well, it's cheating here
And it really affects installed binaries, dunnit?
kalkin- you can always print the whole path as a fallback
also printing the whole path for _every_ subcommand doesn't make any sense at all 20:25
viki What do you mean as a fallback? Fallback to waht?
20:25 cdg_ left
kalkin- fallback if you can't resolve any meaningful name 20:25
20:25 cdg joined
kalkin- even just printing the hash should be enough, because you know where your perl6 resources are 20:26
something like $PERL6_RESSOURCES/$HASH would probably be enough
20:26 wamba left
kalkin- The easiest solution would be to print the path only once. Something like this: 20:27
Usage:
LONG PATH
20:27 cdg left
kalkin- -option1 20:27
-option2
Should i make a patch for that? 20:28
kalkin- is on fire!
viki kalkin-: but how would that look for positional args? 20:29
Ironically, when I actually try to use the giant path, I'm getting a bash error:
bash: /home/zoffix/.rakudobrew/moar-nom/install/share/perl6/site/resources/3DD33EF601FD300095284AE7C24B770BAADAF32E: Permission denied
'cause you gotta use perl6 blah blah 20:30
kalkin- I would separate it
Options:
- op1
POSITINAL FIELDS:
$FOO
@BAR
perlpilot kalkin-: yuck. 20:31
kalkin- I have something similar to the output of pythons argeparse in mind
python prog.py -h 20:32
usage: prog.py [-h] [--sum] N [N ...]
Process some integers.
positional arguments:
N an integer for the accumulator
optional arguments:
-h, --help show this help message and exit
--sum sum the integers (default: find the max)
perlpilot kalkin-: and with subcommands? (which are constant "positional fields") 20:33
viki kalkin-: and would the output be a mile long when you have a bunch of multies, like here: gist.github.com/zoffixznet/7a09ee8...84b9dfcf4a
[Coke] kalkin-: maybe gist that. :)
viki: "multis"
(only because I've made that edit several times to the doc site" 20:34
[Coke] wonders of (" is a valid quote pair. :)
kalkin- This is output of one of command using argparse with subcommands gist.github.com/anonymous/98380b7a...1cacc5b708
viki: your command line interface sucks, :D. I don't think any one in it's right mind would wright a command like that. I had too look twice at it to see the argument differences 20:35
:)
viki That's not true. zef has similar assortiment of commands. 20:36
The point wasn't in their names, but in the presence of multiple ways to call the script.
Here's zef's Perl 6 generated usage if you toss the giant filename with the sha hash in it: gist.github.com/zoffixznet/f1208f6...fd87f1c85c 20:37
20:37 pyrimidine joined
viki And from what I undestand your proposal, *each line* in that output would be at least a screen long, because *for each of those multies* you'll ve listing the POSITIONAL FIELDS and the rest of the stuff 20:38
kalkin- viki in your case I would it to generate something like this this foo --meows=<Any> --foos=<Any> ABC [CZE|CDE]
hmm
perlpilot kalkin-: If you can make it better, please submit a PR to do so. The worst that can happen is that no one likes it. 20:39
viki yeah :)
kalkin- zef's case where I'm having multiple subcommands the proper way for the interaction is to allow to pass --help to each of this subcommands
this is how git and many more do
viki FWIW, yes, the giant "/home/zoffix/.rakudobrew/moar-nom/install/share/perl6/site/resources/3DD33EF601FD300095284AE7C24B770BAADAF32E" in the Usage is very LTA and isn't helpful and makes the rest of the output unreadable... But, I'm fine with the rest of the output, even if I've not witnessed much of it 20:40
I wonder if that installation knows the original name the script was installed under and whether that can be queued up 20:41
kalkin- may be before rewriting the whole output it would be enough to print the program path once on a line belove "Usage:" and keep the rest as it is?
20:41 domidumont left
perlpilot kalkin-: also, an alternative auto-usage-generator would make a nice advent article ;) 20:41
kalkin- perlpilot: last time i spoke about this topic here i got a similar hint :D 20:42
I will think about it :)
20:43 kurahaupo__ is now known as kurahaupo
viki kalkin-: yeah, maybe print the file once, then on new line, indent and show all options. Like this: gist.github.com/zoffixznet/c61e303...f6e93cecaf 20:44
Altough, on smaller screens those lines would wrap around and make it hard to see where one calling varian ends and other starts
viki shrugs
perlpilot viki: yucl.
er, yuck
viki haha :)
perlpilot I'd rather not ever see those long paths unless I've somehow asked for them. 20:45
viki What would you like to see instead? 20:46
gist.github.com/zoffixznet/0a2af23...f4f8191261 ?
With "command" being literal... same for all scripts
ugexe El_Che: you have to `--install-to=home` for your `zef install Readline` command, or modify the config 'DefaultCUR" : ["site"]' to home (or inst#/my/target)
perlpilot viki: yes
viki Seems very unorthodox 20:47
kalkin- doesn't care
both seem ok
I mean most of the time i know what command i run, and also there is always which foo 20:48
viki I wonder how much of that stuff is bolted down with roast
kalkin- that's what your shell is for
ugexe El_Che: you can also put a copy the config to $*HOME.child('.zef/config.json') combined with modifying DefaultCUR to have per-user settings
20:48 acrussell_ left 20:50 mspo joined, wamba joined
viki doesn't see any giant shas or any other script names in github.com/perl6/roast/blob/master...in-usage.t 20:50
ugexe the shas only show up because of the wrappers that get installed
viki kalkin-: FWIW, out of all the examples we've seen so far, I'd be +1 only on the one with the literal "command" but I still think it's unperfect. 20:51
kalkin- I'm ok with literal “command”, but what would your perfect solution look like? 20:52
viki In fact, "unperfect" is the perfect word for it... You kinda know what it means, but it's off :)
perlpilot What does "non-technical write up" mean for Advent Dec 24? Is that "Perl 6 is awesome. Here's where we are and here's what lies ahead..." ?
viki kalkin-: what's perfect... no idea... I could say what I typed on the terminal, which is somewhat true currently, but looks like crap for long pahts 20:53
ugexe the wrapper gets the original bin name, so bin/foo is just a wrapper that invokes /home/perl6/install/site/resource/salksjdfalkewjoj. MAIN_USAGE then prints the full path of this because bin/foo is shadowed in PATH
viki relocates
20:54 avalenn left, AlexDani` joined, AlexDani` is now known as AlexDaniel 20:55 kyclark_ left
ugexe otherwise if you install 2 versions of a distribution with bin/foo, which one gets invoked with `foo`? if the newer one should be chosen and the older one ignored, then when you actually directly invoke the older one the help command would be lying to you 20:55
20:55 avalenn joined
kalkin- So should i print the full path to the binary? 20:56
ugexe there is no right answer >:)
kalkin- Or may be change "Usage:\n" to "Usage for command $LONGPATH:\n" 20:57
mspo kalkin-: how can you reliably know the full path to a binary?
I mean really know
kalkin- mspo: I mean the same thing what currently is printed on each line 20:58
ugexe i think the easiest way would be to show the root directory once towards the top, and the filename/command everywhere else
kalkin- i think its $*PROGRAM-NAME currently
20:59 wamba1 joined
kalkin- ugexe: … the easiest way would be to show the root directory once towards the top … ← how do you mean this 20:59
21:00 Tonik left
mspo I mean it's not possible to 100% reliably show a full path of a running command in unix 21:00
21:00 wamba left
ugexe kalkin-: for instance "ROOT: /home/nickl/.rakudobrew/moar-2016.06/install/share/perl6/site/resources/ .. USAGE: 5307F92100F994360D0C5D2C7F46DABA38C42FC4 --help" 21:01
kalkin- ugexe: yuck! it leaves all the rakudobrew users with long meaningless stuff in front of the option 21:02
21:03 zakharyas joined
ugexe yep. no way around that 21:03
kalkin- why don't do just `which my-perl6-command`?
I mean yes it wouldn't be the actual command if there are wrappers around it, but still... 21:04
ugexe well the wrappers are the entire problem
kalkin- btw why wrappers and not symlinks?
because of windows?
ugexe because the wrappers can invoke different versions
kalkin- You can just change the symlink to the bin directory to the proper version 21:05
ugexe and they also allow you (if you know how) to precompile your bin script by giving them a perl6 entry point to the precompiled code
kalkin- (when you execute rakudobrew switch)
ugexe you can install zef:ver<1.0> and zef:ver<2.0> into a single perl6 install
thats 2 different versions of the same bin/ script 21:06
now what?
kalkin- ok what would be executed normall if i call zef?
s/normall/normally/
ver 1 or 2? currently the wrapper would need to solve the same issue
21:07 kyclark_ joined
ugexe you send it --version=whatever or it choses the first one it finds 21:07
what probably needs to happen is a way for wrappers to pass in the original filename (the filename of the wrapper itself) to the actual script they invoke (which would then be shown in the USAGE) 21:08
kalkin- ugexe: i would assume that if i call zef --version it would be parsed by zef not by some wrapper, or am i wrong, and it currently implements the behaviour you explained?
dmaestro m: say so "\c[EM DASH]" ~~ /<:Line_Break<Break_Both>>/
camelia rakudo-moar 689da7: OUTPUT«False␤»
ugexe kalkin-: no it is parsed by the wrapper and yes this is not good
dmaestro m: say so "\c[EM DASH]" ~~ /<:Break_Both>/ 21:09
camelia rakudo-moar 689da7: OUTPUT«True␤»
ugexe github.com/rakudo/rakudo/blob/nom/...ion.pm#L55
dmaestro m: say so "A" ~~ /<:Break_Both>/
camelia rakudo-moar 689da7: OUTPUT«True␤»
ugexe --name --auth and --ver all get removed by the wrapper
dmaestro What is going on here with Unicode property matching? I haven't been able to get what I want at all.
ugexe so if you install a script that requires one of those it will never get passed the argument
21:10 kalkin- left, kalkin- joined
kalkin- can't the information which version, author & Co to use for a module be stored in an environement variable? 21:11
Because actually it's the information about your run time ENVIRONMENT
viki perlpilot, not at all! It's a story about sisters Meg and Lo who live in Perlandia. Lo "knows" there's no Santa and tries to prove it to younger Meg. Why does Santa only grant wishes for toys but not the real problems of Perlandia... Then something exciting happens and they find themselves on a journey! They meet a... um... odd elf who enjoys hunting buggers in the Bugger field, and then they get captured by
the Core Spinners... will they be OK? Find out on Dec 24!
21:12 AlexDaniel left
kalkin- This is how i would handle such case in the shell normally. Let the shell set some ENV_VAR depending on the `pwd` and on execution an alias which stores the path to the right version is set 21:12
so for zef i would expect rakudo to create (similar to how python is handled :D) zef → zef.2, zef1 & zef2 21:13
your shell will pick the right version depending on your requirments 21:14
ugexe but perl6 isn't python, and our versions / filenames can contain all sorts of non-filesafe stuff
21:15 cdg joined
kalkin- ugexe: how you actually encode the binary -> to actual CompUnit(is this the right jargon?) should be part of logic of rakudobrew 21:15
rakudobrew list bin zef should list all the available zef symlinks and their actual Perl6 version/auth/name combination 21:16
dmaestro How does one properly match a character based on a multi-valued Unicode property?
say so "\c[EM DASH]" ~~ /<:Line_Break<Break_Both>>/
m: say so "\c[EM DASH]" ~~ /<:Line_Break<Break_Both>>/
camelia rakudo-moar 689da7: OUTPUT«False␤»
kalkin- or am I bikeshading?
ugexe well rakudobrew should not have anything to do with precompilation 21:17
21:17 cdg left, cdg_ joined
mspo is zef overtaking panda? 21:17
ugexe it could figure out every version of zef that is installed though
[Coke] m: say "\c[EM DASH]".ord; 21:19
camelia rakudo-moar 689da7: OUTPUT«8212␤»
21:20 hankache joined
dmaestro Using Inline::Perl5 with Unicode::UCD I do this: 21:21
> say charprops_all("\c[EM DASH]".ord)<Line_Break> Break_Both
kalkin- so the general consensus on the whole zef/symlink/path length debacle is that removing wrappers from rakudobrew wouldn't be a bad idea? 21:22
[Coke] m: say "\c[EM DASH]".uniprop("Line_Break"); 21:23
camelia rakudo-moar 689da7: OUTPUT«BK␤»
21:23 bjz_ left
dmaestro m: say so "\c[EM DASH]" ~~ /<:Line_Break<BK>>/ 21:23
camelia rakudo-moar 689da7: OUTPUT«True␤»
ugexe perl6 -MZef::Client -MZef::Config -e '.say for Zef::Client.new(config => Zef::Config::parse-file(Zef::Config::guess-path)).list-available().grep(*.dist.?scripts).map: { qq|{.dist.identity} -> {.dist.scripts.values.join(",")}| };' 21:24
dmaestro m: say so "A" ~~ /<:Line_Break<BK>>/
camelia rakudo-moar 689da7: OUTPUT«True␤»
ugexe kalkin-: ^ for instance, running that will list each version of a module and the bin/script-name it provide
perlpilot viki: Well ... as long as it's a good story that features Perl 6 ... :-)
dmaestro m: say so "A" ~~ /<:BK>/
camelia rakudo-moar 689da7: OUTPUT«True␤»
[Coke] dmaestro: What is Break_Both? trying to find it in the 9 spec somewhere, but I'm a n00b. 21:25
hankache good evening #perl6
kalkin- ugexe: but rakudo knows nothing about zef, so it can't use it to resolve the path
I mean it would be nice if instead of literal “command” it would be something like “Zef::Cli::ver<123>” 21:26
dmaestro coke: It is a value of the line break property, like BA (Break_After), BB (Break_Before), etc.
[Coke] ;ah, and it's B2, whereas we have BK here.
dmaestro I want to use these, but can't seem to get anywhere in Perl6 ....
coke: yeah, that's a clue ... 21:27
[Coke] can you point at something in the 9 spec that indicates that [EM DASH] is supposed to have B2? 21:28
dmaestro Code: Afraid not from any Perl6 spec; I find it in perl5 Unicode::UCD, though. 21:30
I thought I found it in the 5 spec: Properties with arguments are passed as the argument to the pair:
<:East_Asian_Width<Narrow>> <:!Blk<ASCII>> 21:31
[Coke] dmaestro: not the perl 6 spec, the unicode 9 spec.
dmaestro Those don't seem to work exactly, either.
kalkin- so rakudobrew is just a big perl5 script o_O
dmaestro Oh, unicode.org/reports/tr14/#Descripti...Properties 21:32
kalkin- I bet it can be replaced by plain shell script
.o0(What can go wrong?)
dmaestro coke: I've tried all the permutations I can think of ;-)
[Coke] (I'm trying to figure out the format on raw.githubusercontent.com/MoarVM/M...icode_db.c so I can see if we're trying to add that property.)
ugexe kalkin-: you dont "need" zef to do that, its just easier 21:33
m: say $*REPO.repo-chain.grep(*.?prefix.?e).map(*.prefix).map(*.child("dist")).grep(*.e).map(*.IO.dir.grep(*.IO.f).Slip).map({Rakudo::Internals::JSON.from-json($_.IO.slurp)}).map({.<name> ~ " -> " ~ .<ver> // .<version>}).join(", ")
camelia rakudo-moar 689da7: OUTPUT«CORE -> 6.c␤»
mspo kalkin-: get rid of perl5 from the perl6 bootstrap instead
ugexe star-m: say $*REPO.repo-chain.grep(*.?prefix.?e).map(*.prefix).map(*.child("dist")).grep(*.e).map(*.IO.dir.grep(*.IO.f).Slip).map({Rakudo::Internals::JSON.from-json($_.IO.slurp)}).map({.<name> ~ " -> " ~ .<ver> // .<version>}).join(", ")
camelia star-m 2016.10: OUTPUT«File::Find -> 0.1, Shell::Command -> *, JSON::Fast -> 0.4, File::Which -> *, panda -> 2016.02, XML::Writer -> *, SVG -> *, SVG::Plot -> *, Terminal::ANSIColor -> *, Test::Mock -> *, Grammar::Profiler::Simple -> 0.01, Grammar::Debugger -> *, MIME::Base64 -> 1.2…»
21:33 kyclark_ left, labster joined
kalkin- So replace the literal “command” with the proper module name <auth> version combination? 21:35
[Coke] dmaestro: pinged the moarvm folks to figure out the process for pulling data from the unicode spec for inclusion in moar, so I can make sure we're looking at that page.
ugexe kalkin-: rakudobrew *was* a shell script at one time
no, you would have to use that to create a rakudobrew wrapper to call the perl6 wrapper with some --vers --auth extracted from that 21:36
viki perlpilot, yeah, it's all a reflection on how throughout the past year folks voiced concerns over Perl 6 being slow, or buggy, or unpopular, or poorly marketed... And how those problems are exacerbated beyond what they really are and how the work of volunteers may be muted by time but is quite incredible... At least that's my exploration of the story as a writer.... The pharmaceuticals I'm abusing while 21:37
writing may make the parallels non-obvious to the reader :)
kalkin- ugexe: but you still would need to have short and meaningful paths to the wrappers no matter how the wrappers will work 21:39
21:40 mniip left
ugexe kalkin-: you can cheat aroudn that github.com/rakudo/rakudo/blob/nom/...ion.pm#L86 by setting `my $env = $*ENV; $env<PATH> = join(":", $bin-script-path, $env<PATH>); run(..., :$env)` 21:41
by making sure the actual script path is not shadowed via putting it at the front of PATH for the instance run() executes
kalkin- ugexe: but wouldn't that break some users expectations about $*ENV?
ugexe like i said, there is no right answer 21:42
21:43 mniip_ joined 21:45 flaviusb left, mniip_ is now known as mniip
ugexe remember earlier i mention a possible solution is allowing the wrapper to pass this in - this is along those same lines. However the real solution would create different var (RAKUDO_BIN_PATH or some such) and then MAIN_USAGE would have to be updated to check PATH *after* RAKUDO_BIN_PATH (with the expectation that RAKUDO_BIN_PATH is only meant to be a single use thing and users should not be manually setting 21:46
it)
21:46 ___crlz___ left 21:47 domidumont joined 21:48 zakharyas left 21:49 ___crlz___ joined 21:54 domidumont left
ugexe or make the rakudobrew shim rename its bin/ directory to bin-bak/ immediately after being invoked, and renaming it back $x seconds later >:) 21:55
nothing can go wrong 21:56
[Coke] dmaestro: near as I can figure, we parse the PropertyValueAliases.txt which tells us what a B2 is, but we don't parse the LineBreak.txt, which tells us which characters have it.
dmaestro coke: I've found that most other properties can be recognized as either present or not, but trying to drill down on multivalued properties is hard - I wish the syntax shown in design.perl6.org/S05.html was working, but it doesn't seem to at all. 22:00
22:00 lichtkind__ joined
[Coke] dmaestro: those are ancient design docs. 22:00
dmaestro I understand, was just hoping ;-)
[Coke] you can only rely on what you see in roast.
ah, ok.
22:01 lichtkind__ left
[Coke] please feel free to open a rakudo ticket. Having dug this far, I might be able to patch MoarVM to add this info. 22:01
dmaestro Yeah, I'll probably consider that - thanks for the help. 22:02
22:02 lichtkind_ left 22:03 hankache left
[Coke] dmaestro: might be an easier fix than I anticipated (diakopter++) 22:07
22:09 grondilu_ left 22:10 bjz joined 22:12 kyclark_ joined
labster bisectable6: old=2016.10 my $v = rx/foo/; say("foobar" ~~ $v); say("foobar" ~~ /foo/) 22:15
bisectable6 labster, Bisecting by output (old=2016.10 new=689da7a) because on both starting points the exit code is 0
labster, bisect log: gist.github.com/347cf40a6b5abdc7fe...efaeeff330
labster, (2016-10-27) github.com/rakudo/rakudo/commit/5a...925c544ea4
22:15 bjz left 22:16 RabidGravy left
labster Oh cool, thanks for the fix lizmat++. Now to just add a test and close RT#127071. 22:17
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127071
22:23 firstdayonthejob joined, ___crlz___ left
viki labster: that's a dupe. There are already tests for that bug 22:25
labster: oh, now I remember. I thought there weren't a ticket. But the tests are there
22:25 seatek joined
viki labster: github.com/perl6/roast/commit/8395...381fdfe75e 22:26
labster bisectable6: old=2016.10 my $r = rx/a/; my $a = "a" ~~ $r; say $a; say $/ 22:28
bisectable6 labster, Bisecting by output (old=2016.10 new=689da7a) because on both starting points the exit code is 0
labster, bisect log: gist.github.com/6b22d4bff38e975147...091e2094d3
labster, (2016-10-27) github.com/rakudo/rakudo/commit/5a...925c544ea4
labster The $/ part of the ticket isn't tested, though.
22:29 rindolf left
viki ¯\_(ツ)_/¯ it tests the cause of the bug. 22:29
labster yeah, that's probably tested elsewhere. 22:31
22:32 kurahaupo__ joined 22:34 mohae_ joined 22:35 kurahaupo left 22:37 mohae left 22:42 ChoHag left 22:46 skids left 22:47 cooper_ joined, cooper_ left, cooper_ joined, kyclark_ left 22:54 espadrine joined, firstdayonthejob left 22:58 kurahaupo__ left 22:59 firstdayonthejob joined, Vynce joined 23:01 ufobat left 23:03 espadrine left, cdg joined 23:05 itcharlie joined 23:06 cdg_ left 23:15 pyrimidine left, pyrimidine joined 23:19 trnh joined 23:20 trnh left, trnh joined, pyrimidine left 23:24 kurahaupo__ joined, woodruffw left 23:27 kurahaupo__ is now known as kurahaupo_______ 23:35 Vynce left, kyclark_ joined 23:38 Vynce joined
samcv as a sidenote of my change viki, perl6 REPL no longer enters a streaming loop of error messages if it can't find readline library version 6 but still shows an error message, just only one time, and falls back 23:44
that is nice
it used to spew a stream of error messages never actually going into REPL if Readline failed 23:46
23:46 pyrimidine joined, labster left
samcv oh also what's the best way to install a perl 6 module from a directory? if i want to try and get the Readline library to fallback to some version other than version 6, since that's hardcoded in, and doesn't work for readline 7 without editing it 23:49
23:50 pyrimidine left 23:52 kyclark_ left
samcv hmm nice looks like i can just do: `zef install .` cool :) 23:53
23:55 firstdayonthejob left 23:56 pyrimidine joined