»ö« 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.
Herby_ m: say index "Find index of Year in this string", "Year"; 00:22
camelia 14
Zoffix m: say WHY "Life, the Universe and Everything": 00:25
camelia 42 00:26
Herby_ :) 00:27
SuicidalSunchip is anyone here 00:35
comborico1611 hi
Herby_ o/ 00:36
SuicidalSunchip hello 00:37
comborico1611 Sunchips make my teeth feel really weird. Like stripping the enamel. 00:39
I have to eat a big bag for it to do it, though. I stoppped eatting sunchips. 00:40
I'm off to enjoy the sunset! 00:43
SmokeMachine m: say 42 ~~ Int; say 42 ~~ (* > 10); say 42 ~~ Int & (* > 10); shouldn't the last one return `all(True, True)`? 00:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus term
at <tmp>:1
------> 3(* > 10); shouldn't the last one return 7⏏5`all(True, True)`?
expecting any of:
argument list
infix
infix stopper
p…
SmokeMachine m: say 42 ~~ Int; say 42 ~~ (* > 10); say 42 ~~ Int & (* > 10); #shouldn't the last one return `all(True, True)`?
camelia True
True
all((Int), True)
SmokeMachine m: say 42 ~~ 42 & (* > 10) 00:50
camelia all(42, True)
SmokeMachine m: say 42 ~~ (* > 10) & 42
camelia all(True, 42)
SmokeMachine m: say 42 ~~ (42 & Int) 00:51
camelia True
SmokeMachine m: say 42 ~~ 42 & Int
camelia True
SmokeMachine m: say 42 ~~ (* > 10) & (* < 100)
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
Zoffix m: say 42 ~~ Int; say 42 ~~ (* > 10); say 42 ~~ Int & ((* > 10)); 01:51
camelia True
True
True
Zoffix SmokeMachine: you were closing over the `&` op
m: say ((Int & (* > 10))).^name
camelia WhateverCode
Zoffix m: say (Int & ((* > 10))).^name 01:52
camelia Junction
SmokeMachine Zoffix: thats it!! thanks!
Zoffix And ~~ collapses Junctions, so it's just a True, not all(True, True)
Herby_ hmm. 02:01
I'm trying to get a grammar token to match year (ex: 2001), as long as the year is not at the start of the string
"Party 1999" -> TRUE, "2001 Space" -> False
token year { <[ \[ \(]>? <!after ^> [19 <[0..9]> | 20 <[0..1]>] <[0..9]> <[ \] \)]>? } 02:02
sorry
token year { <[ \[ \(]>? [19 <[0..9]> | 20 <[0..1]>] <[0..9]> <[ \] \)]>? } 02:03
that is how it currently sits
I tried that <!after ^> pattern, but that didnt quite work
any ideas?
geekosaur I'd have said <after .> but would it have that context? 02:11
actually, it should, I'm overthinking it 02:12
Herby_ geekosaur: you're right. I'm trying to capture an edge case and its messing with my other matches 02:13
i'll figure out a different way to approach it
geekosaur did you try it? I have no idea what you're trying to do but the rephrased after might work 02:14
(instead of trying to say "after start of line", say "after any character". positive matches are more likely to do what you expect than negative ones) 02:15
[Coke] docs.perl6.org/%20tilde.html 02:16
looks like quite a few pages with leading spaces. (many more in the coke/build branch) 02:17
Herby_ geekosaur: I did. it does work as described but then a later token starts failing instead 02:18
Geth doc/coke/build: 10be05c24c | (Will "Coke" Coleda)++ | 3 files
Attempt to process all pod files

Unsure if the right move here is to convert everything to string when needed, or if we should have converted it to string when trying to save it.
Herby_ tyil: Looking at your "Introduction to Application Programming" article, and under the section of "creating library", you say to use "touch lib" but your code uses "touch unit" 03:51
just an fyi
tyil Herby_: nice catch, thanks! 05:41
ufobat in perl5 'x 2' would also double a list. e.g. (1..3) x 2 06:43
what would be the perl6 way of doing this?
m: (1..3) x 2
camelia WARNINGS for <tmp>:
Useless use of "x" in expression "(1..3) x 2" in sink context (line 1)
ufobat m: say (1..3) x 2
camelia 1 2 31 2 3
ufobat x seems to stringify it 06:44
geekosaur xx? 06:46
m: say (1..3) xx 2
camelia (1..3 1..3)
geekosaur m: say |(1..3) xx 2
camelia (1 2 3 1 2 3)
ufobat yay! thanks
ufobat and if i want to put this in a pair ;-) 06:49
m: say Pair.new( |@((qw|ru be uk|) xx 2)) 06:50
camelia (ru be uk) => (ru be uk)
ufobat looks not really readable :(
i can leave out the @ 06:51
moritz m: say (<ru be uk> xx 2).flat
camelia (ru be uk ru be uk)
moritz m: say Pair.new: |(<ru be uk> xx 2) 06:52
camelia (ru be uk) => (ru be uk) 06:52
moritz let's say I've seen worse :-)
m: say Pair.new: |<ru be uk> xx 2
camelia Cannot resolve caller new(Pair: Seq); none of these signatures match:
(Pair $: Cool:D \key, Mu \value, *%_)
(Pair $: Mu \key, Mu \value, *%_)
(Pair $: Mu :$key!, Mu :$value!, *%_)
in block <unit> at <tmp> line 1
ufobat m: say |<ru be uk> xx 2 06:53
camelia (ru be uk ru be uk)
ufobat that would flatten to much
moritz right 06:54
I wasn't sure about the relative precedence of prefix | and infix xx
ufobat ty :-)
stmuk_ Herby_: wakelift.de/ 07:29
jmerelo Hi 07:44
ufobat stackoverflow.com/questions/389091...h-in-perl6 ++ :( 07:47
Geth doc: 52e38a9dcc | (JJ Merelo)++ | doc/Language/grammars.pod6
Reverts in part 9b1a88acf50cc31a

Because the code that generates indexes is terra incognita and changing the grammar declarator from one place to another leads to errors. Change related to #1912 remains in place.
07:49
synopsebot Link: doc.perl6.org/language/grammars
jmerelo ufobat: thanks!
ufobat jmerelo, huh? 07:50
jmerelo ufobat: thanks for posting an StackOverflow link. We should do that much more :-) 07:52
ufobat: and/or post questions/answers to StackOverflow :-)
ufobat heh :-) indeed. i was just.. whining because i was missing this method and i switched to @array with calling .unique in the end, because it looks better 07:54
m: @a = <a>; my @values = (1,2,3); @a.append: @values; say @a 07:58
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@a' is not declared
at <tmp>:1
------> 3<BOL>7⏏5@a = <a>; my @values = (1,2,3); @a.appen
ufobat m: my @a = <a>; my @values = (1,2,3); @a.append: @values; say @a
camelia [a 1 2 3]
ufobat m: my @a = <a>; my @values = (1,2,3); @a.append: @values, 4; say @a
camelia [a [1 2 3] 4]
ufobat is this a bug?
it's confusing to me 07:59
m: my @a = <a>; my @values = (1,2,3); @a.push: @values, 4; say @a
camelia [a [1 2 3] 4]
jmerelo I would say the "single argument rule" is kicking in.
ufobat m: my @a = <a>; my @values = (1,2,3); @a.push: @values; say @a
camelia [a [1 2 3]]
jmerelo ufobat: when you add the comma in @values,4 you're making it two different arguments. The single argument rule implies arguments to iterators are not flattened, basically 08:00
, is creating a list with two elements, @values and 4 08:01
ufobat yeah - it makes sense to me now
jmerelo I just added yesterday that to the documentation, closing issue #600
ufobat i knew it actually. but i was just assuming that append would work differently 08:02
jmerelo Now, I would be _extremely_ happy if you posted that same question to StackOverflow :-) you can answer it yourself, if you want, but the point is to make everything easily searchable
ufobat okay! i'll create an stackoverflow account 08:03
jmerelo ufobat: thanks! 08:07
ufobat jmerelo, done ;) 08:16
jmerelo ufobat++ 08:19
pmurias re parrot in a new hat, they got low level and high level languages to run together so they succedded in more than parrot was ever imagined to be 08:24
Zoffix: re porting over to a new backends you mostly need to port over the nqp:: ops and some QAST::* nodes 08:29
TEttinger pmurias: was the re about MOAR or some other VM? 08:30
pmurias TEttinger: Zoffix was asking a question about porting Rakudo to GraalVM
TEttinger oh...
I uh have had very poor experiences with Graal 08:31
it may become usable at some point though
pmurias what was wrong with it?
TEttinger it has a ton of backing from Oracle, I guess. what's wrong with it is multifaceted. there's no windows support; when I tried it they apparently thought there was but it had some mix of very basic Python code bugs in their NIH build tool called mx, and very hard bugs in other parts. it's GPL2, no exceptions, so it's license incompatible with a ton of Java code despite being for the JVM 08:33
it couldn't use anything from Apache, for instance 08:34
TEttinger it needs lab JVMs, it won't currently work on a normal JVM at least for dev 08:35
TEttinger its licensing scheme is generally confusing and I don't know why they didn't match OpenJDK's restrictive license and went with something even more restrictive 08:37
pmurias TEttinger: re windows support it seems like something that could have been ironed out for 1.0 08:38
TEttinger I can find my issue
github.com/graalvm/graal-core/issues/262
they've since rearranged all the projects to erase all old issues it looks like
pmurias TEttinger: re license issues I'm not a lawyer but they seem to license a bunch of GraalVM parts differently 08:41
TEttinger it may have improved, I dunno. I just had a very unpleasant experience with it 08:45
pmurias they don't seem to advertise windows support on their downloads page 08:46
TEttinger indeed, it needs you to build the VM yourself 08:47
github.com/oracle/graal/blob/maste...jvmci-jdk8
TEttinger it also says it works with JDK9, later builds 08:48
pmurias I don't use windows myself for anything than playing some games once in a blue moon, but I understand it's a limitation
TEttinger it's my currently only OS
TEttinger ugh but some stuff won't work with jdk9 anyway github.com/oracle/graal/blob/maste...ild-script 08:52
lol, and their motto is "GraalVM: Run Programs Faster Anywhere" 08:53
tadzik the good, ol' "run everywhere" :P
TEttinger the funnier thing is there's an open bug with its support for normal Java apps that use libGDX, which is a gamedev framework that actually does run almost everywhere with no code changes in some cases (I've had android ports of desktop apps be simply an extra compilation) 08:58
I kinda doubt graal targets iOS 08:59
LLVM would let it do that though
JITs aren't allowed by App Store rules though
pmurias TEttinger: graalvm doesn't run on the LLVM 09:22
jmerelo exit 09:26
TEttinger sulong does, which is an implementation of graalvm 09:26
pmurias TEttinger: nope, sulong runs LLVM *on* the graalvm 09:49
TEttinger: so you can run C++ or Rust on the graalvm using sulong 09:50
TEttinger that's uh something 09:53
pmurias TEttinger: they *could* disable the JIT and run it slower on the iOS not sure if it's something they are interested in 10:16
TEttinger: it seems to be they want to take over the server side dynamic/scripting language marker 10:17
* market
TEttinger mmmm 10:18
Zoffix pmurias: it wasn't me who was asking tho. It was simcop2387 10:36
pmurias Zoffix: sorry, meant to say answering 10:46
Zoffix ah
pmurias but hopefully for GraalVM a lot of the more mudane nqp:: ops can be stolen from our existing JVM backend 10:47
Geth ¦ doc: JJ self-assigned Explanation of the "Single Arg Rule" github.com/perl6/doc/issues/600 10:48
timotimo m: say (<ru be uk> xx 2).pairup # ufobat 10:49
camelia ((ru be uk) => (ru be uk))
yoleaux 01:02Z <MasterDuke> timotimo: some info re sinking and loops from TimToady and Zoffix irclog.perlgeek.de/moarvm/2018-04-18#i_16059397
pmurias Zoffix: for me a large part of building a rakudo backends was implementing stuff and then discovering "not that's not how Rakudo wants things to work" 10:50
Zoffix And buggy tests :) 10:54
Zoffix &
daxim www.johndcook.com/blog/2018/04/17/...ent-936952 (via hn) 11:12
tadzik darkpan! 11:13
timotimo oh, i should definitely put "perl programming" in visible text on my blog 11:20
now that i have a site with stuff on it, might as well have it counted by tiobe
tadzik heh 11:21
timotimo seriously, though. tiobe's methodology is so bunk it's not even funny
tadzik X-Powered-By: Mojolicious BTW PERL PROGRAMMING HI TIOBE
well, it's an ok methodology, but not exactly for progamming language popularity 11:22
timotimo yet somehow people keep mentioning tiobe. it's as if homeopathy kept showing up in medical journals with the aside "i won't argue if homeopathy works, but for this article i'll assume it's good enough"
tadzik heh 11:23
true that
but it's hard to argue that perl is not exactly a shining star anymore 11:24
when perl shops have to hire non-perl programmers and teach them on site in order to get *anybody*
we have a guy now at one of the clients whose daily standup report is "I did chapter 7 and 8 from learning perl"
donpdonp heh 11:25
timotimo does it count if it's inside <small> tags?
tadzik hm, does it actually count text on websites? I thought it's google search terms 11:26
jkramer I think I've asked this bevor, but I don't remember. How can I look up an enum object by it's value? 11:28
m: enum Foo (:bar('lol'), :baz('yay')); say Foo.enums.antipairs.Map<yay>.WHAT
camelia (Str)
timotimo there's the mailing list thread where one of the tiobe folks comes to the pascal community and says "oh, just add 'pascal programming' to all your sites!" and later "hey your work has paid off, your rank has improved significantly!"
jkramer This gives me the name as a string, but not the object
m: enum Foo (:bar('lol'), :baz('yay')); say Foo.enums.antipairs.Map<yay>.WHAT; say bar.WHAT 11:29
camelia (Str)
(Foo)
timotimo m: enum Foo (:bar('lol'), :baz('yay')); say Foo("lol").perl
camelia Foo::bar
timotimo jkramer: just like that 11:30
jkramer Ooh, so simple :)
timotimo: Thanks!
timotimo delphi.org/2008/10/delphi-language-...year-2008/ 11:34
AlexDaniel nice. 11:37
buggable New CPAN upload: List-SomeUtils-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 11:48
jkramer When I have an object hash like my ValueClass %hash{KeyClass}, how are KeyClass keys looked up in the hash? Or rather how are they compared with each other? 12:03
timotimo it uses the WHICH method 12:04
jkramer Hmm, so I guess I can't do %foo{$basically-the-same-object-contentwise-as-the-key-but-a-new-instance}? 12:05
Or can I override WHICH for my key class? Would that be a smart thing to do? :) 12:06
timotimo you can of course do that 12:08
jkramer But might it break something else? I'm assuming WHICH is kind of internal stuff that I might not want to touch :) 12:09
lizmat jkramer: .WHICH is how you would like to provide an object of your class with a unique ID 12:11
the default assumes that each instantiated object of your class is unique 12:12
jkramer Basically what I want to do is: %grid{Coordinates.new(:x(123), :y(345))} and have it find the value for those coordinates, even though the Coordinates object is a new one
lizmat then you need to provide a .WHICH method that is unique for the *values* in your object
jkramer So I guess in Coordinates you could just do method WHICH { "$.x $.y" }
lizmat well, you'd probably want to include the name of your class
as .WHICH values are considered to be global 12:13
jkramer Ha true
lizmat but yes, that's basically it
of course you may want to make sure that :x(12),:y(345) and :x(123),:y(45) don't produce the same .WHICH value
jkramer Yeah I think the space should do that :) 12:15
lizmat jkramer: if it's just about numerical values, that's fine 12:15
with string values not so much :-)
jkramer So method WHICH { "$.^name $.x $.y" } should work I guess, I'll try that now :)
lizmat: They're both Int so that should be fine :) 12:16
ufobat pairup!!!!!! timotimo thx :D
jkramer Actually, why not just do method WHICH { $.perl }? 12:17
lizmat jkramer: if you don't expect subclasses, then it would probably be wiser to hard code the .^name value and use $!x $!y for performance
jkramer: if the attributes are public, sure
jkramer lizmat: It's just a little script for a coding challenge, I don't expect subclasses and don't care about performance ;)
lizmat then $.perl should do just fine 12:18
jkramer Ha, fun fact: .perl calls .WHICH to find out the class name, so that's an infinite loop/recursion :) 12:21
lizmat ah, hmmm...
jkramer Or well it calls it anyways, don't know what it actually does with it
lizmat ah, looks like that's the self-referring data structure check that's interfering 12:22
timotimo ufobat: don't forget it returns a list 12:23
lizmat jkramer: I guess you'll have to throw your own then anyways 12:23
jkramer Yup
Herby_ o/ 12:30
timotimo maybe create an ObjValAt in the WHICH for your custom class 12:35
[Coke] pondering a htmlify option that will not emit information about what commit and when the docs were created, to help with refactoring so it's easier to compare the differences. 13:24
buggable New CPAN upload: List-MoreUtils-0.0.3.tar.gz by ELIZABETH modules.perl6.org/dist/List::MoreUt...:ELIZABETH 13:38
nwellnhof rakudo: say (<a b c>, *.reverse ... *)[5] 14:12
camelia The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
nwellnhof Can anyone explain?
timotimo m: say (<a b c>, *.reverse.List ... *)[5] 14:13
camelia (c b a)
timotimo m: say (<a b c>, *.reverse.cache ... *)[5]
camelia (c b a)
Geth marketing: 37dc838609 | (Zoffix Znet)++ | 154 files
Rename "Table Posters" to "Flyers"
timotimo i'm not sure i've got a proper explanation for this, but i do have the solution 14:14
AlexDaniel well, it's trying to reverse the same Seq over and over
m: <a b c>.reverse.reverse.say 14:15
camelia (a b c)
AlexDaniel but that works
that initial snippet actually worked previously before github.com/rakudo/rakudo/commit/be...d919c695d0 14:16
but List.reverse returning a Seq is probably right 14:17
nwellnhof I don't really understand why the Seq is iterated twice. 14:19
Geth marketing: 7e0b5999e7 | (Zoffix Znet)++ | 154 files
Add IDs to print materials

Makes things a lot easier to manage when you got 100s of flyers
14:21
moritz once from the series operator at least, and once form say()
*from*
Geth marketing: 723ac43d50 | (Zoffix Znet)++ | 12 files
Add "All Your Cores" flyer / ID: 1524053519
14:22
nwellnhof But say() only receives the last Seq that hasn't been iterated yet. 14:25
AlexDaniel moritz: but why is … iterating it? Isn't it supposed to build a sequence of Seqs? 14:27
m: dd (<a b c>, *.Seq ... *)[^2] 14:28
camelia (("a", "b", "c"), ("a", "b", "c").Seq)
AlexDaniel m: dd (<a b c>, *.Seq ... *)[^3]
camelia (("a", "b", "c"), Seq.new-consumed(), Seq.new-consumed())
AlexDaniel m: dd (<a b c>, *.Seq ... *)[3]
camelia The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
moritz AlexDaniel: well, the third item has to iterate the second item in order to create the reversed-again list 14:30
AlexDaniel oh 14:32
wait uh
m: <a b c>.reverse.reverse.reverse.reverse.reverse.say 14:33
camelia (c b a)
AlexDaniel but that works, right?
so why can't it be done with … operator? what am I missing?
nwellnhof Yeah, that's my point.
Zoffix AlexDaniel: there you're not using the Seq the second time 14:33
m: my $s1 := <a b c>.reverse; my $s2 := $s1.reverse; say $s1; 14:34
camelia The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
Zoffix This is the right equivalent
AlexDaniel so what is using the Seq the second time when using … ? 14:37
like here
Zoffix say
AlexDaniel m: say (<a b c>, *.Seq ... *)[3]
camelia The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
AlexDaniel ok, what's the first time then?
Zoffix .reverse
AlexDaniel what did .reverse on the 3rd element? 14:38
I never asked for 4th
Zoffix 3 is 4th
m: say (<a b c>, *.Seq ... *)[^2] 14:39
camelia ((a b c) (a b c))
Zoffix m: say (<a b c>, *.Seq ... *)[^3]
camelia The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
Zoffix m: @ = (<a b c>, *.reverse ... *)[^3] 14:39
camelia The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
AlexDaniel m: my $l1 := <a b c>; my $s1 := $l1.reverse; my $s2 := $s1.reverse; say $s2 14:40
camelia (a b c)
AlexDaniel that works
m: say (<a b c>, *.reverse ... *)[2]
camelia The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
AlexDaniel that doesn't
AlexDaniel is stupid and does not get it
Zoffix [2] is the third item, not second: 0, 1, 2
AlexDaniel m: my $l0 := <a b c>; my $s1 := $l1.reverse; my $s2 := $s1.reverse; say $s2 14:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$l1' is not declared. Did you mean any of these?
$l0
$s1

at <tmp>:1
------> 3my $l0 := <a b c>; my $s1 := 7⏏5$l1.reverse; my $s2 := $s1.reverse; say
AlexDaniel m: my $l0 := <a b c>; my $s1 := $l0.reverse; my $s2 := $s1.reverse; say $s2
camelia (a b c)
AlexDaniel l0, s1, s2
Zoffix ah
m: @ = (<a b c>, {dd $_; .reverse} ... *)[^3] 14:43
camelia List @tail = $("a", "b", "c")
The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1
Zoffix it doesn't even get sent as a Seq to the code
Golfed: 14:55
m: dd gather { ().Seq.take }
camelia (Seq.new-consumed(),).Seq
Zoffix s: ().Seq, 'take', \()
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/0579...Mu.pm6#L62
Zoffix s: &take, \(().Seq) 14:56
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/0579...ol.pm6#L62
Zoffix Filed as R#1742 14:59
synopsebot R#1742 [open]: github.com/rakudo/rakudo/issues/1742 Can't .take uncached Seq
Zoffix nwellnhof: so the answer to your question: it's either a bug (more likely) or a limitation.
nwellnhof Thanks for the answer! 15:01
Zoffix oh, lol, I see the bug :) 15:02
&THROW returns the arg and it gets sunk and consumes the seq
timotimo %) 15:03
Zoffix Well, I guess it's really .take returning its value that messes this up 15:05
m: dd gather { my $ = ().Seq.take }
camelia (().Seq,).Seq
Zoffix patches &SEQUENCE
Zoffix e: say (<a b c>, *.reverse ... *)[5] 15:18
evalable6 (c b a)
Zoffix nwellnhof: so the answer to your question: it works fine if your rakudo is recent enough ^_^ 15:19
AlexDaniel hahaha 15:30
Zoffix++ thank you
nwellnhof Cool, thanks. 15:31
So it seems I could golf my PCG answer by two more bytes: codegolf.stackexchange.com/a/162701 15:33
Geth doc: b409bd1d3d | (JJ Merelo)++ | doc/Language/list.pod6
Clarifies even more the "single arg rule"

eliminates reference to Synopsis, too. Closes #600 again.
16:09
synopsebot Link: doc.perl6.org/language/list
Geth doc: 68390f1467 | (Will "Coke" Coleda)++ | doc/Language/list.pod6
style: space after comma
16:14
jmerelo What was that robot that told you where some particular class was implemented? 16:15
geekosaur SourceBaby 16:19
jmerelo SourceBaby: CompUnit::Repository::Installation
geekosaur: thanks
SourceBaby: s CompUnit::Repository::Installation 16:21
SourceBaby: 'CompUnit::Repository::Installation'
SourceBaby: 'CompUnit::Repository::Staging'
geekosaur usage is a bit complex, iirc 16:23
Zoffix jmerelo: it doesn't really tell where class is defined. It reports the .line and .file for a particular routine 16:25
jmerelo p6: $*REPO.resolve(CompUnit::DependencySpecification.new(:short-name<Compunit::Repository::Installation>)) 16:26
camelia ( no output )
Zoffix It's in rakudo's lib/
The CompUnit::Repository::Staging I mean
jmerelo OK, I found it github.com/rakudo/rakudo/blob/98e5...gistry.pm6 Thanks! 16:27
Zoffix jmerelo: as I remember it, the CompUnit's interface is essentially unspecced and can't really be documented. 16:28
oh, there's some in S11-compunit/S10-packages 16:29
Zoffix and S11-repository 16:29
lindylex p6: say 3; 17:50
camelia 3
lindylex p6: 100.WHAT.say; 18:04
camelia (Int)
comborico1611 I forgot how to call the REPL. 19:12
round (42.25, 1)
Produces 2. I'm not sure why. I understand it has something to do with the leading space first parenthesis. 19:13
tobs m: round(42.25, 1)
camelia WARNINGS for <tmp>:
Useless use of "round(42.25, 1)" in expression "round(42.25, 1)" in sink context (line 1)
tobs m: say round(42.25, 1)
camelia 42
tobs m: say round (,)
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix , instead.
at <tmp>:1
------> 3say round (,7⏏5)
tobs comborico1611: anyway, iirc, the space between routine call and parentheses makes the list of arguments a single list which is passed to the routine 19:14
comborico1611 So how is (42.25, 1) being rounded to 2? 19:15
tobs no idea
comborico1611 Bazaarness.
xq number of elements in a list?
comborico1611 Heh.
Let me check
tobs looks like it
comborico1611 m: round (42.25, 1, 3) 19:16
camelia WARNINGS for <tmp>:
Useless use of "round (42.25, 1, 3)" in expression "round (42.25, 1, 3)" in sink context (line 1)
xq m: say round (42.25, 1);
camelia 2
xq m: say round (42.25, 1, 3);
camelia 3
comborico1611 This REPL is different than my REPL.
xq that's how
comborico1611 oh. semicolon
xq note the space between d and (
comborico1611 Hmm.
xq round() is different from round ()
comborico1611 So round also works as an element counter 19:17
xq: Roger that.
tobs m: say (42.25, 1).isa(Cool) 19:19
camelia True
tobs round coerces Cool to Numeric, so that's why 19:20
(I guess?)
comborico1611 Less than awesome error message for round( 42.25, 1, 3). Proto signature? Never heard of it, neither is listed under search in Docs. 19:21
I can tell you Perl6 is much better error messing than Common Lisp, though!
And I do speculate Perl6 has the best error messing in the biz. 19:22
messaging*
Which is smart.
comborico1611 Same error message with: say round; 19:26
moritz m: say round 19:29
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling round() will never work with proto signature ($, $?)
at <tmp>:1
------> 3say 7⏏5round
moritz just ignore the word you don't understand :-) 19:30
comborico1611 :-)
I will try.
Zoffix It is a bit LTA that you can give a Cool in single-arg form, but you gotta give a Numeric in 2-arg form 19:31
Zoffix m: say round <a b c> 19:31
camelia 3
Zoffix m: say round <a b c>, 10
camelia Cannot resolve caller round(List, Int); none of these signatures match:
($a)
(Numeric $a)
(Numeric $a, $scale)
in block <unit> at <tmp> line 1
Zoffix comborico1611: what would be a clearer error message?
Zoffix R#1745 19:32
synopsebot R#1745 [open]: github.com/rakudo/rakudo/issues/1745 [LHF][consistency] &round inconsistent on types of arguments.
Zoffix comborico1611: also, I'd say Rust has the best error messages in the biz :) but we're catching up 19:34
comborico1611 Zoffix: I'm not knowledgeable enough to provide a clearer error message. I'm just reporting what I'm finding as a newbie. 19:35
Zoffix: That is intersting to know.
Zoffix comborico1611: it's basically saying of all the ways you can call &round, none of them will accept the 3 arguments
m: proto z($, $?) {}; z 1, 2, 3 19:36
camelia Too many positionals passed; expected 1 or 2 arguments but got 3
in sub z at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix s: &round 19:37
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/9e6a...c.pm6#L199
geekosaur that message is telling you that it wants some kind of scalar, and another optional scalar. it can't say more, really, it doesn't know enough
comborico1611 Zoffix: So instead of proto signature, I would say that, "passed too many arguments". But I'm not sure if that will not be adequate for all the scenarios like proto signature I assume is.
Zoffix m: proto z($, $?) {*}; z 1, 2, 3 19:38
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling z(Int, Int, Int) will never work with proto signature ($, $?)
at <tmp>:1
------> 3proto z($, $?) {*}; 7⏏5z 1, 2, 3
geekosaur hypothentically it could go digging for all possible implementations, but that could take a long time even given that it's an error message
comborico1611 But I want to be vocal in case my newbieness DOES find an legitimate LTA error message.
Newbies are good at producing unexpected errors. 19:39
Zoffix m: proto z($ where rand) {*}; say z "x"
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling z(Str) will never work with declared signature
at <tmp>:1
------> 3proto z($ where rand) {*}; say 7⏏5z "x"
Zoffix Well, you found at least 1 bug :) That's missing the declared signature
comborico1611 Zoffix: I did? Haha 19:41
I remember a while back someone thought something was worthy of a report.
tobs does the "where rand" constraint produce a function that's almost non-callable? 19:44
Zoffix R#1746
synopsebot R#1746 [open]: github.com/rakudo/rakudo/issues/1746 [LHF][LTA] Error missing declared signature if `where` clause is used in proto
geekosaur intercal, only more so 19:45
timotimo "where rand" will almost always succeed, given how unlikely it is for rand to result in exactly 0
Zoffix tobs: pretty much. The given argument would have to be numerically equal to the value produced to rand
timotimo oh
tobs :)
timotimo of course it's that way
tobs ah, it's a smartmatch.
Zoffix timotimo: it'd be 0 if it were `where {rand}`. A thunked `where` ain't got a block 19:46
m: -> $ where {42} {}(10)
camelia ( no output )
Zoffix m: -> $ where 42 {}(10)
camelia Constraint type check failed in binding to parameter '<anon>'; expected anonymous constraint to be met but got Int (10)
in block <unit> at <tmp> line 1
Zoffix m: -> $ where 42 {}(42)
camelia ( no output )
Zoffix wait, it'd be anything BUT 0 :) 'cause it'd need to be truthy :) 19:47
R#1747 19:51
synopsebot R#1747 [open]: github.com/rakudo/rakudo/issues/1747 [LHF][LTA] X::TypeCheck::Argument could use a minor wording tweak
Zoffix comborico1611: ^ I think that'd address it in some way. We can't really say "passed to many arguments" since there are many other ways to violate the sig of the proto
Zoffix &
Geth ¦ perl6.org: zoffixznet self-assigned Implement Perl 6 Academy for use as call to action on marketing pieces github.com/perl6/perl6.org/issues/107 20:14
comborico1611 AlexDaniel: I'm not sure how to put that Issue into a label. 20:47
And, I hope that qualifies for LTA.
AlexDaniel you mean R#1748 ? I've already added a label 20:48
synopsebot R#1748 [open]: github.com/rakudo/rakudo/issues/1748 [LTA] LTA: Clunky expression in error message ("Useless use")
AlexDaniel if I understand correctly, non-members of the rakudo github org can't add labels 20:49
comborico1611 Yes. I was just explaining why I didn't add the label myself.
AlexDaniel which is not cool
comborico1611: ah yeah, don't worry about that, you did it right
comborico1611 I see. Very good. 20:49
comborico1611 AlexDaniel: The "useless use" phrase showed up in another error message. : -( What should I do? 21:00
Kaiepi m: say $*VM.osname 21:01
camelia linux
Kaiepi m: chdir '~'
camelia Failed to change the working directory to '/home/camelia/~': does not exist
in block <unit> at <tmp> line 1
Kaiepi should this work?
AlexDaniel comborico1611: what do you mean? If it's something about the bug report, feel free to click the pencil button and edit it
geekosaur no
~ is shell magic
Kaiepi ah 21:01
comborico1611 AlexDaniel: Alright.
AlexDaniel m: chdir $*HOME 21:02
camelia ( no output )
AlexDaniel m: say $*HOME
camelia "/home/camelia".IO
AlexDaniel m: say “$*HOME” 21:03
camelia /home/camelia
AlexDaniel Kaiepi: ↑
geekosaur perl 5 used to try to make it work in some circumstances (I don't know if they stopped at some point). it was never consistent, and if it leaks through to the OS then the call will fail
AlexDaniel geekosaur: haha
Kaiepi ah
bazzaar o/ perl6
geekosaur unless it goes through a shell without quoting, in which case the shell wille xpand it 21:04
AlexDaniel geekosaur: at first it was funny, now I'm about to cry… please stop! :'D 21:05
AlexDaniel though I'm interested to know what perl5 was doing exactly 21:05
Kaiepi m: my $conf = '~/Documents'; $conf ~~ s/\~/$*HOME/; say $conf 21:06
camelia /home/camelia/Documents
Kaiepi alright i think i know what to do now 21:07
thanks
AlexDaniel oh, it was in angle quotes I think < >
bazzaar I'm just viewing "gpw2016 Bernhard Specht - ‎the beauty of perl6‎" talk [youtube video], the first example RLI encoding
El_Che releasable6: status
geekosaur should be a thing in perlguts to expand ~ and ~user, but if an XS or etc. uses a filename and doesn't call it then the ~ goes untranslated
releasable6 El_Che, Next release in ≈2 days and ≈21 hours. 7 blockers. 224 out of 241 commits logged
El_Che, Details: gist.github.com/afac81adab322c60fa...ae119ff900
geekosaur ~ is in general a lot of "too clever", and not just in p5 21:08
bazzaar m: my Int @bits = "0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1".words».Int;
camelia ( no output )
comborico1611 Why does leaving the ( ) off trip a warning? sub do_twice($code) {$code; $code}
geekosaur use of ~ in filenames is a C faq, I think
comborico1611 Versus: sub do_twice($code) { $code(); $code() } 21:09
bazzaar but, putting the method call on a separate line doesn't
geekosaur use/mentuon distinction
AlexDaniel comborico1611: the warning is correct, because just “$code;” does not call the code 21:10
comborico1611 Hmm. I see. 21:12
geekosaur think about it. if it did then you couldn't pass it to the sub in the first place 21:13
AlexDaniel Kaiepi: why do you need this by the way? ~ is a valid file/directory name so you shouldn't be replacing it like that
bazzaar: sorry, what's the question? 21:14
comborico1611 I will start using () then to play it safe.
AlexDaniel m: my Int @bits = "0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1" .words.map: *.Int 21:15
camelia ( no output )
AlexDaniel bazzaar: you want something like this but with », right?
bazzaar sorry, I wasn't very clear, the presence of a newline between the string and .words brings up an error 21:16
AlexDaniel you can try this 21:16
m: my Int @bits = "0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1"\ .words».Int
camelia ( no output )
AlexDaniel m: my Int @bits = "0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1"\␤.words».Int # testing with a newline
camelia ( no output )
AlexDaniel so called “unspace” docs.perl6.org/language/syntax#ind...ax_Unspace 21:17
El_Che: note that this release will be late (kinda obvious given 7 open blockers) 21:20
bazzaar AlexDaniel: thanks for the Unspace link, I can see it is documented that I should escape the whitespace in front of the method call
AlexDaniel bazzaar: not always, but in complex cases yes 21:21
AlexDaniel m: say 25 . sqrt 21:21
camelia 5
AlexDaniel in this case . works like an infix operator 21:22
so you can have whitespace around it without unspace
bazzaar I see, ... I wonder if the hyper causes the complication, since the error says "missing << or >>" 21:25
bazzaar m: my Int @bits = "0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1"\␤.words».Int; say @bits; 21:39
camelia [0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1]
bazzaar that last codeline seems to fail on my Rakudo Star 2018.01 linux, says "expecting postfix" after the escape char 21:44
timotimo did you use an actual newline? 21:46
because camelia will translate ␤ to a proper newline and back, because irc doesn't do multi-line text
bazzaar timotimo: aaah, that explains it, sorry my bad, didn't realise that's what Camelia did 21:49
timotimo no prob :) 21:54
Herby_ o/ 23:06
\o 23:08
comborico1611 Hello 23:09
comborico1611 Wondering why this very simple program isn't doing what I want: hastebin.com/kitibizesa.pl 23:25
tobs comborico1611: what do you want? (You never use the return value of do_twice, for one) 23:29
comborico1611 Oh! Let me try that real quick. Thanks 23:30
tobs ah, wait. I think I get it. You expect the "x 2" in do_twice to execute your "say" twice? 23:31
comborico1611 Right.
tobs But it will just duplicate the return value of the function call, not call the function twice.
comborico1611 I see. That's what I needed to understand! Thanks!
tobs m: -> $code, $val { $code($val) for ^2 }((* x 2).say, "Wall") 23:33
camelia WallWall
WallWall
tobs "for ^2" is your do_twice 23:34
timotimo you want xx instead of x here, i think 23:35
m: sub do_twice($code, $val) { $code($val) xx 2 }; sub print_twice($x) { (say $x) xx 2 }; do_twice({ say "i do the $_ 'round these parts!" }, "saying"); print_twice("hello") 23:36
camelia i do the saying 'round these parts!
i do the saying 'round these parts!
hello
hello
timotimo comborico1611: x is string multiplication, that's why it doesn't re-evaluate the LHS multiple times. the xx operator, aka list multiplication, does exactly that, though 23:37
comborico1611 timotimo: Ah yes. It worked. Truly more than one way to do it. 23:39
Thanks!
timotimo YW
comborico1611 LHS?
timotimo left-hand side 23:40