»ö« 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.
00:00 yurivish_ left
Skarsnik self.foo does not work? 00:00
orbus I have another method in my class overriding foo
that does something else :p
Skarsnik oh ok
00:01 avs_ left
orbus so I'm doing like self.WALK(:name<foo>,:super)[0](self,item) 00:01
Skarsnik I never played with that x)
orbus (where item is the argument to foo)
mspo docs.perl6.org/routine/.::.html
orbus yeah, this does seem to work
mspo I think is just what you're looking for
orbus ooh 00:02
00:02 linuxuser9000 joined
orbus might be 00:02
thanks
mspo Child.Parent::foo
seems backwards but whatevs
orbus yeah, that's kind of weird
Skarsnik it's not with stuff like callnext?
orbus but if it works
callnext calls the same method in the parent
I'm using that where I override foo 00:03
but I also want to call parent foo from a new method with a different name
00:03 rodi joined
orbus let me see if this does what I need 00:03
okay 00:05
first I tried Child.Parent::foo
that was no good
but self.Parent::foo seems to work
00:05 rodi left
orbus is still kind of struggling with the object model 00:05
mspo: thanks for that - that does seem cleaner 00:06
mspo how do I figure out panda's prefix?
00:06 spider-mario left
orbus prefix? 00:06
mspo I can't figure out where it is putting stuff :) 00:07
orbus oh
mspo installed from rakudobrew
00:07 linuxuser9000 left
orbus I've never used rakudobrew 00:07
I always just build from the tarballs
mspo orbus: I would have never figured out self.WALK(:name<foo>,:super)[0](self,item)
orbus haha, I had to dig around in the synopsis documents and then experiment a lot 00:08
trying to figure out how to get panda to report where it's putting stuff... 00:09
"which panda" might give you a clue?
mspo rakudobrew does weird stuff 00:12
abaugher mspo, This might not be the best way to do it, but if you run perl6 and try to 'use' a module that doesn't exist, it will tell you where it tried to find it. Presumably that would be where panda is putting things. 00:14
so: perl6 -e 'use Nonsense'
mspo ./.rakudobrew/moar-nom/install/share/perl6/ 00:15
thanks that worked
00:19 Peter__R left
Skarsnik mspo, any chance with your lib C ? x) 00:22
Nonsence sound like an interesting module to do
00:27 Skarsnik left
orbus hmmm 00:28
according to S28 there should be a special variable for include path 00:29
mspo getting a bunch of these, I guess from gccxml: lmdb/libraries/liblmdb/mdb.c:1882: error: invalid conversion from 'void*' to 'MDB_page*'
oh he left
orbus there's supposed to be @?INC
and I guess @*INC
(I'm a little unclear)
but neither of them works, so....
m: say @*INC 00:33
camelia rakudo-moar 770d10: OUTPUT«Dynamic variable @*INC not found␤ in block <unit> at /tmp/tPIXFkiyn1 line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/tPIXFkiyn1 line 1␤␤»
orbus say @?INC
m say @?INC
argh
m: say @?INC
camelia rakudo-moar 770d10: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ko_B7t4n5O␤Variable '@?INC' is not declared␤at /tmp/ko_B7t4n5O:1␤------> 3say 7⏏5@?INC␤»
mspo yeah I noticed that too ;)
orbus there's several references to it in older changelogs 00:34
it seems like it was kind of in flux
there's no mention of it being removed in the changelog, but it could have happened
mspo quite a few things need some settling down
orbus lots of rough edges need filing, but there's at least a pretty solid base to build on now 00:35
00:36 pierre-vigier joined, cfedde left 00:37 cfedde joined
Util m: my @a1 = <a b c>; my @a2 = @a1 xx 2; say @a2.perl; 00:38
camelia rakudo-moar 770d10: OUTPUT«[["a", "b", "c"], ["a", "b", "c"]]␤»
Util my @a1 = <a b c>; my @a2 = @a1.flat xx 2; say @a2.perl;
m: my @a1 = <a b c>; my @a2 = @a1.flat xx 2; say @a2.perl;
camelia rakudo-moar 770d10: OUTPUT«[("a", "b", "c"), ("a", "b", "c")]␤»
Util How can I get ["a", "b", "c", "a", "b", "c"] instead?
00:39 lokien_ left
orbus I haven't really dug into lists and arrays 00:42
but
m: say ((1,2,3),(1,2,3)).flat
camelia rakudo-moar 770d10: OUTPUT«(1 2 3 1 2 3)␤»
00:44 pierre-vigier left
orbus but flat doesn't work on arrays 00:44
apparently
00:45 cfedde left, pierre-vigier joined
orbus m: say [(1,2,3),(1,2,3)].flatmap({$_.flat}) 00:48
camelia rakudo-moar 770d10: OUTPUT«(1 2 3 1 2 3)␤»
orbus that does it, but I'm not totally sure I understand why :)
mspo there you go 00:49
00:50 cfedde joined
orbus has to dash for a bit 00:50
later
Util orbus: thanks 00:55
sortiz hi #perl6
AlexDaniel where's huggable? 00:59
Util: flat works on arrays, but it does not dwim… it does something with shaped arrays
Util: see this: rt.perl.org/Public/Bug/Display.html?id=127121 01:00
.seen huggable
yoleaux I saw huggable 13 Jan 2016 18:17Z in #perl6: <huggable> ZoffixW, Added user experience as Identifying issues in and improving the Perl 6 user experience: github.com/perl6/user-experience
01:00 pierre-vigier left, pierre-vigier joined
AlexDaniel m: my @a1 = <a b c>; my @a2 = @a1.list.flat xx 2; say @a2.perl; 01:01
camelia rakudo-moar 770d10: OUTPUT«[("a", "b", "c"), ("a", "b", "c")]␤»
AlexDaniel ah 01:02
m: my @a1 = <a b c>; my @a2 = @a1 xx 2; say @a2.list.flat.perl;
camelia rakudo-moar 770d10: OUTPUT«($["a", "b", "c"], $["a", "b", "c"]).Seq␤»
AlexDaniel ah
m: my @a1 = <a b c>; my @a2 = |@a1 xx 2; say @a2.perl; 01:03
camelia rakudo-moar 770d10: OUTPUT«["a", "b", "c", "a", "b", "c"]␤»
AlexDaniel Util: what about this? ↑
01:03 yeahnoob joined
sortiz m: my @a1 = <a b c>; my @a2 = @a1 xx 2; say @a2.List.flat # With uppercase List. 01:04
camelia rakudo-moar 770d10: OUTPUT«(a b c a b c)␤»
AlexDaniel sortiz: riiight…
01:05 mcmillhj left
sortiz Array.flat is for work with the inner structure of the Array, you only seen "works" when @foo.shape.elems > 1 01:06
azawawi how can simplify the following code: github.com/azawawi/perl6-opencv/bl...nCV.pm6#L5 01:07
s/can/can i/
sortiz m: my @a[2;2] = ([1,2],[3,4]); say @a.flat; 01:08
camelia rakudo-moar 770d10: OUTPUT«(1 2 3 4)␤»
AlexDaniel m: my @a[2;2] = ([1,2],[3,4]); say @a.List.flat; 01:09
camelia rakudo-moar 770d10: OUTPUT«(1 2 3 4)␤»
AlexDaniel
sortiz IMHO Array.flat should be Array.Seq, to avoid the confusion. 01:10
AlexDaniel I still don't understand why we can't have .flat that dwims
this question is asked every few days…
sortiz Yes, I know and I'm lobbying for a resolution. 01:12
But there are 9 tests in roast that depends of the current behavior. 01:14
01:15 Actualeyes joined
sortiz And in other side, shaped arrays are not fully implemented yet. 01:16
I'm dreaming with an Iterable.flat :deep adverb to solve that. 01:18
01:18 AndyDee left 01:19 linuxuser9000 joined
skids sortiz: as an aside, probably always best to "say thing.perl" rather than "say thing" when discussing these issues. 01:20
sortiz AlexDaniel, yes you right, or use dd 01:21
skids Another option is an adverb on [] that breaks Scalars, but that would only help when you are using [].
sortiz m: my @a[2;2] = ([1,2],[3,4]); dd @a.flat; 01:22
camelia rakudo-moar 770d10: OUTPUT«(1, 2, 3, 4).Seq␤»
Hotkeys ʔ 01:25
I should use glottal stop instead f question mark
just to see if people notice
?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ?ʔ
AlexDaniel Hotkeys: well, the difference is huge here 01:26
.u ʔ 01:27
yoleaux U+0294 LATIN LETTER GLOTTAL STOP [Lo] (ʔ)
skids sortiz: I am guessing any decision on a resolution to Array.flat and the fuller implementation of shaped arrays will happen at the same time.
geekosaur they're distinctive when next to each other
also in my font it's oddly bold so I'd probably look more closely (this may in fact be the point...)
AlexDaniel interesting thing is that it is Lo 01:28
m: sub wtfʔʔʔ { say ‘oh noes’ }; wtfʔʔʔ
camelia rakudo-moar 770d10: OUTPUT«oh noes␤»
AlexDaniel m: sub ʔʔʔ { say ‘oh noes’ }; ʔʔʔ
camelia rakudo-moar 770d10: OUTPUT«oh noes␤»
sortiz skids, sure. 01:29
Hotkeys lol 01:32
I actually meant to put that in another channel 01:33
not exactly perl 6 related
:p
Util AlexDaniel, sortiz: thanks! 01:35
01:43 hippie2 joined 01:45 hippie1 left
mspo AlexDaniel: how would I translate your 'my @a1 = <a b c>; my @a2 = |@a1 xx 2; say @a2.perl;' example into using Slip 01:47
also what is List (upper case?)
AlexDaniel m: my @a1 = <a b c>; my @a2 = slip(@a1) xx 2; say @a2.perl; 01:48
camelia rakudo-moar 770d10: OUTPUT«["a", "b", "c", "a", "b", "c"]␤»
AlexDaniel mspo: I'm not sure what you mean
01:48 cpage_ joined
skids mspo: .List is a type coercion to type List, which is what , makes. 01:49
01:49 perlawhirl joined
mspo oic 01:49
perlawhirl hi perlers
mspo AlexDaniel: thanks
01:50 bpmedley joined
AlexDaniel mspo: | does the same thing, as far as I can see 01:50
mspo apparently they are synomyms
perlawhirl besides '.reverse[^3]', is '[*-3..*]' the preferred way to get the last 3 elems?
mspo I was typing (@a,Slip.new(@a xx 2)), which did not work
skids There is a difference, it has to do with iterators/caching. 01:51
Juerd perlawhirl: .tail(3)
perlawhirl: As for "preferred", TIMTOWTDI. Pick your favorite.
Perl 6 is very young so we'll have to find out what the community's favorites are :) 01:52
That might take a few years.
perlawhirl Juerd: thanks! i now prefer tail :D
sortiz AlexDaniel, but Array.List isn't the same that List(Array:D), beware.
mspo just .roll until you get what you want :)
skids Oh sorry, The difference between | and Slip is that | breaks a single item into a Slip whereas Slip takes a list. 01:53
mspo and slip() is the same as Slip.new() ?
skids mspo: it is not complete yet but there is now doc.perl6.org/language/list
mspo: I would think so. 01:54
mspo perl6 syntax is big
skids Uness there is a corresponding difference as with .list and .List
Juerd mspo: Not quite as big as any natural language. You'll manage :) 01:55
sortiz I assume slip(...) as the inverse of item(...), and sugared as |(...) and $(...) 01:56
Juerd sortiz: A Slip is a special kind of List.
m: my $a = (42, 23); my $b = (1, $a, 2); say $b; 01:57
camelia rakudo-moar 770d10: OUTPUT«(1 (42 23) 2)␤»
Juerd m: my $a = slip (42, 23); my $b = (1, $a, 2); say $b;
camelia rakudo-moar 770d10: OUTPUT«(1 42 23 2)␤»
Juerd In most cases you'd use 'slip' or '|' as late as possible 01:58
m: my $a = (42, 23); my $b = (1, |$a, 2); say $b;
camelia rakudo-moar 770d10: OUTPUT«(1 42 23 2)␤»
Juerd finds it a bit weird to use Slip.new explicitly.
sortiz Slip lists are autodeitemized.
Juerd sortiz: Still not inverse. Slippiness (for lack of a better word) is carried with the list value, whereas itemization happens instantly and isn't stored as such. 01:59
skids m: ((1,2),$(2,3)) # I would consider the second to be an "itemized" list not the first 02:00
camelia rakudo-moar 770d10: OUTPUT«WARNINGS for /tmp/A_IrC67yRD:␤Useless use of constant integer 1 in sink context (lines 1, 1)␤Useless use of constant integer 2 in sink context (lines 1, 1)␤»
skids m: ((1,2),$(2,3)).say
camelia rakudo-moar 770d10: OUTPUT«((1 2) (2 3))␤»
skids m: ((1,2),$(2,3)).perl.say
camelia rakudo-moar 770d10: OUTPUT«((1, 2), $(2, 3))␤»
sortiz m: dd (1,(2,3),4) 02:02
camelia rakudo-moar 770d10: OUTPUT«(1, (2, 3), 4)␤»
sortiz m: dd (1,$(2,3),4)
camelia rakudo-moar 770d10: OUTPUT«(1, $(2, 3), 4)␤»
sortiz m: dd (1,$(2,3),4).flat
camelia rakudo-moar 770d10: OUTPUT«(1, $(2, 3), 4).Seq␤»
sortiz m: dd (1,(2,3),4).flat
camelia rakudo-moar 770d10: OUTPUT«(1, 2, 3, 4).Seq␤»
sortiz Jured, its stored, no?
Juerd sortiz: It seems I completely understood what $ does wrong.
I think I let myself be misled by .say 02:03
I wonder what the use case for it is though
When would you use this? 02:04
sortiz The "problem" with @foo = ... is that the assignment auto itemized all elements.
mspo Juerd: Slip.new was on a docs page that said "you can also use | for this" 02:05
skids sortiz: It's more that any accesses to Array through normal means auto-itemizes; you have to use := or one of the mop methods to bypass that behavior. 02:07
mspo: I should probably clear that language up, like I said, that page is a bit new.
BenGoldberg m: dd (1,(2,3),4)
camelia rakudo-moar 770d10: OUTPUT«(1, (2, 3), 4)␤»
BenGoldberg m: dd (1,|(2,3),4) 02:08
camelia rakudo-moar 770d10: OUTPUT«(1, 2, 3, 4)␤»
sortiz skids, Yes, but in that case I prefer don't use an Array.
List itself is indexable.
02:08 chacewells joined
skids sortiz: Yes the only proble is if you want to use non-itemized things and still be able to push/pop/splice/bind 02:09
sortiz Yes, Array is mutable, List not. 02:10
02:10 xpen joined
sortiz IMO and in a deep sense, the existence of real Lists is the biggest departure from perl5 02:12
and the importance of the GLR 02:14
AlexDaniel star: my @a1 = <a b c>; my @a2 = @a1 xx 2; say @a2.flat.perl; 02:15
camelia star-m 2015.09: OUTPUT«($["a", "b", "c"], $["a", "b", "c"]).Seq␤»
02:18 linuxuser9000 left 02:19 bpmedley left
perlawhirl i have another question... can i lazily get regex captures... something like... my $matches = $text ~~ m:g/ <$foo> ( <$bar> ) /; 02:20
but that seems to search all the text. can i make it wait until i ask for $matches[0], etc
AlexDaniel perlawhirl: yes 02:21
perlawhirl AlexDaniel: Cool! now how to i do it ?
AlexDaniel perlawhirl: well, I'm trying to find it…
perlawhirl thanks... i searched the Regexes doc for the work lazy... no hits 02:22
s/work/word/
AlexDaniel perlawhirl: :c or :continue 02:24
ah no
or maybe yes…
let's see, there is something else…
02:24 leont left 02:25 daotoad joined, adu joined 02:26 daxim left, daxim joined
AlexDaniel I wonder if p5-style thing works in this case? 02:26
perlawhirl hmm, maybe i can put it in a map... since assigning maps to scalars is typically done lazily 02:28
dalek c: a70059b | skids++ | doc/Language/list.pod:
Fix a link and elaborate on Slip.new versus prefix:<|>, add slip()
02:29
AlexDaniel perlawhirl: according to the design docs there is also :p 02:30
sortiz skids++ # For the docs
AlexDaniel right 02:31
m: given ‘this is a test’ {.say for m:global:p/\w+{say 'ok'}/ } 02:34
camelia rakudo-moar 770d10: OUTPUT«ok␤「this」␤ok␤「is」␤ok␤「a」␤ok␤「test」␤»
AlexDaniel perlawhirl: ↑
m: given ‘this is a test’ {.say for m:g:c/\w+{say 'ok'}/ }
camelia rakudo-moar 770d10: OUTPUT«ok␤「this」␤ok␤「is」␤ok␤「a」␤ok␤「test」␤»
AlexDaniel I wonder what is the practical difference between :c and :p 02:35
skids :p takes a parameter? 02:36
AlexDaniel skids: :c does too 02:37
skids Ah -- it s whether it anchors. 02:38
AlexDaniel perlawhirl: a good question is how do you turn that into a lazy list :) 02:39
pierre-vigier speaking about regexes, something really strange, i can't understand why, first part:
p6: my $str = "plop"; my $match = $str ~~ rx{ ^ $<tt>=[plop] $ }; say $match; say $/; 02:40
camelia rakudo-moar 770d10: OUTPUT«「plop」␤ tt => 「plop」␤「plop」␤ tt => 「plop」␤»
pierre-vigier match is equivalent to $/
p6: my $rule = rx{ ^ $<tt>=[plop] $ }; my $str = "plop"; my $match = $str ~~ $rule; say $match; say $/;
camelia rakudo-moar 770d10: OUTPUT«True␤「plop」␤ tt => 「plop」␤»
pierre-vigier if rule is in a Variable, match is a boolean
perlawhirl AlexDaniel: yeah, trying to wrap it in a gather/take just to see if i can make it happen
pierre-vigier Even weirder, if using a hash value for the string, the capture diseappear 02:41
p6: my $h = test => "plop"; my $rule = rx{ ^ $<tt>=[plop] $ }; my $str = $h<test>; my $match = $str ~~ $rule; say $match; say $/;
camelia rakudo-moar 770d10: OUTPUT«True␤「plop」␤ tt => 「plop」␤»
skids m: for "ab", "a b" { m/a/; m:c/b/.say; }; for "ab", "a b" { m/a/; m:p/b/.say; }
camelia rakudo-moar 770d10: OUTPUT«「b」␤「b」␤「b」␤Nil␤»
pierre-vigier p6: my $h = test => "plop"; my $rule = rx{ ^ $<tt>=[plop] $ }; my $match = $h<test> ~~ $rule; say $match; say $/;
camelia rakudo-moar 770d10: OUTPUT«True␤Nil␤»
02:43 pierre-vigier left, linuxuser9000 joined
skids pierre-vigier: That's a known bug, RT#127071 02:45
02:46 mohae left, pierre-vigier joined
pierre-vigier is there something wrong in my last regex test? 02:46
p6: my $h = test => "plop"; my $rule = rx{ ^ $<tt>=[plop] $ }; my $match = $h<test> ~~ $rule; say $match; say $/; 02:47
camelia rakudo-moar 770d10: OUTPUT«True␤Nil␤»
pierre-vigier why it's not capturing, that's weird
AlexDaniel m: given ‘this is a test’ { say m:g:c/\w+/.is-lazy }; 02:48
camelia rakudo-moar 770d10: OUTPUT«False␤»
02:48 raiph left
AlexDaniel why not? 02:48
skids Cause the regex engine is really complicated and nobody got to it yet?
(just guessing)
02:49 mohae joined
Juerd It seems to be related to $h<test>, because a literal "plop" in that spot will match just fine. 02:51
pierre-vigier indeed, it's working without $h<test> 02:53
it's even working if i affect $<test> to a scalar
perlawhirl AlexDaniel... got it working inside gather/take. though i imagine there might be another way, this works for my use case
m: my $m = gather {given "a man a plan a canal panama" {for m:g:c/:i<<'a'<.ws>(<:L>+)/ {take $_[0].Str;}}}; say $m[0];
camelia rakudo-moar 770d10: OUTPUT«man␤»
02:53 Actualeyes left
Juerd pierre-vigier: I think this is a bug. Could you file the bug by emailing to [email@hidden.address] 02:54
pierre-vigier directly email there? it will go in RT ?
Juerd Yes
pierre-vigier anything special for the title format?
AlexDaniel m: my $m = gather {given "a man a plan a canal panama" {for m:g:c/:i<<'a'<.ws>(<:L>+){say ‘ok’}/ {take $_[0].Str;}}}; say $m[0];
camelia rakudo-moar 770d10: OUTPUT«ok␤man␤»
AlexDaniel m: my $m = gather {given "a man a plan a canal panama" {for m:g:c/:i<<'a'<.ws>(<:L>+){say ‘ok’}/ {take $_[0].Str;}}}; say $m[2];
camelia rakudo-moar 770d10: OUTPUT«ok␤ok␤ok␤canal␤»
AlexDaniel perlawhirl: great
skids it is probably related to 127071 so I can just add this IRC chat there, if you ike.
perlawhirl gather/take can solve so many problems... it's the hammer in my toolbox 02:55
skids star: my $h = test => "plop"; my $rule = rx{ ^ $<tt>=[plop] $ }; my $match = $h<test> ~~ $rule; say $match; say $/;
camelia star-m 2015.09: OUTPUT«「plop」␤ tt => 「plop」␤「plop」␤ tt => 「plop」␤»
skids Yes most likely the same bug as 127071
pierre-vigier what is star ? another version? 02:56
02:56 molaf_ joined
skids Older version. 02:56
02:57 Actualeyes joined
pierre-vigier Actually, when reading the ticket, i found that bug by trying to fix Lingua::NUmber :D 02:57
02:58 azawawi left 03:00 molaf left
pierre-vigier something "new" that is not in the RT, is that now, the capture $/ is empty as well 03:01
p6: my $h = test => "plop"; my $rule = rx{ ^ $<tt>=[plop] $ }; my $match = $h<test> ~~ $rule; say $match; say $/;
camelia rakudo-moar 770d10: OUTPUT«True␤Nil␤»
03:01 pjscott joined
skids rt.perl.org/SelfService/Display.html?id=127071 updated. 03:01
pierre-vigier Thank you for the reporting 03:02
skids np, thanks for saying "ouch" :-) 03:03
AlexDaniel perlawhirl: although it is very powerful, still I find it a little bit verbose in this case
perlawhirl AlexDaniel: agreed. like i said, i'm sure there (should be) an easier way. i'll keep looking about and report back if i find anything 03:04
03:09 kid51 left 03:11 pjscott left
AlexDaniel perlawhirl: found it! 03:12
03:12 pjscott joined
perlawhirl hand it over! 03:12
03:12 pjscott left
AlexDaniel m: $_ = ‘this is a test’; my @a := m:g:c/\w+{say ‘ok’}/; say @a[0]; 03:13
camelia rakudo-moar 770d10: OUTPUT«ok␤「this」␤»
AlexDaniel m: $_ = ‘this is a test’; my @a := m:g:c/\w+{say ‘ok’}/; say @a[3];
camelia rakudo-moar 770d10: OUTPUT«ok␤ok␤ok␤ok␤「test」␤»
03:14 pjscott joined
AlexDaniel interestingly it always attempts to find at least one match 03:14
even if you don't ask it to do so
m: $_ = ‘this is a test’; my @a := m:g:c/\w+{say ‘ok’}/; 03:15
camelia rakudo-moar 770d10: OUTPUT«ok␤»
03:17 daotoad left
AlexDaniel if you use binding then it acts like a lazy list, but is-lazy says that it's not. Do I get it right that it is a bug? 03:18
m: my @a := m:g:c/\w+{say ‘ok’}/ given ‘this is a test’ # ok that's lazy 03:19
camelia rakudo-moar 770d10: OUTPUT«ok␤»
skids Maybe... there was some argument as to whether "is-lazy" was a good idea IIRC so it might not have been fully implemented.
AlexDaniel m: my @a := m:g:c/\w+{say ‘ok’}/ given ‘this is a test’; say @a.is-lazy # and now it's not. WTF?
camelia rakudo-moar 770d10: OUTPUT«ok␤ok␤ok␤ok␤False␤»
skids seems to remember working on that code a bit, maybe should have a look. 03:20
AlexDaniel so it's lazy as long as I don't look at it. Quantum mechanics right in Perl 6… 03:21
sortiz m: my $a = lazy m:g:c/\w+{say ‘ok’}/ given ‘this is a test’; say $a.WHAT; 03:22
camelia rakudo-moar 770d10: OUTPUT«ok␤(Seq)␤»
03:22 pjscott left
AlexDaniel sortiz: a bit longer than binding but works too! 03:24
03:26 daotoad joined
skids m: my $rx = rx/\w+{say "ok"}/; $rx(Cursor."!cursor_init"("a")); # yeah, the immediate match is in the forest where only dark maes dare tread 03:29
camelia rakudo-moar 770d10: OUTPUT«ok␤»
skids *mages
Hrm though maybe that could be deferred. 03:32
03:33 pjscott joined 03:34 pjscott left 03:49 noganex joined 03:51 sortiz left 03:54 pjscott joined 03:56 daotoad left 04:04 pjscott left 04:05 pjscott joined 04:08 pjscott left 04:09 pjscott joined, AlexDaniel left 04:11 rickbike joined, daotoad joined 04:12 vendethiel left, vendethiel joined 04:13 pjscott left 04:14 pjscott joined 04:15 linuxuser9000 left, daotoad left 04:16 pjscott left, pjscott joined 04:17 daotoad joined, daotoad left 04:22 pjscott left 04:23 pjscott joined 04:28 pjscott left, pjscott joined
MadcapJake can anyone explain the anon scope modifier? The example given in language/variables works just the same with or without `anon`. 04:29
04:31 BenGoldberg left
au m: say (anon sub foo { 1 })() + (anon sub foo { 2 })() 04:32
camelia rakudo-moar 770d10: OUTPUT«3␤»
au m: say (sub foo { 1 })() + (sub foo { 2 })()
camelia rakudo-moar 770d10: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vkuKPP1xvb␤Redeclaration of routine foo␤at /tmp/vkuKPP1xvb:1␤------> 3say (sub foo { 1 })() + (sub foo { 2 }7⏏5)()␤ expecting any of:␤ horizontal whitespace␤ statement end␤ …»
MadcapJake m: say (sub foo { 1 })() + (anon sub foo { 2 })()
camelia rakudo-moar 770d10: OUTPUT«5===SORRY!5=== Error while compiling /tmp/jgE5hNWXLX␤Redeclaration of routine foo␤at /tmp/jgE5hNWXLX:1␤------> 3 (sub foo { 1 })() + (anon sub foo { 2 }7⏏5)()␤ expecting any of:␤ horizontal whitespace␤ statement end…»
04:33 pjscott left, pjscott joined
au m: say (anon sub foo { 1 })() + (sub foo { 2 })() 04:33
camelia rakudo-moar 770d10: OUTPUT«3␤»
04:34 TEttinger joined
MadcapJake interesting, thanks au! 04:35
skids m: sub foo { }; &foo.name.say; (sub { }).name.say; 04:36
camelia rakudo-moar 770d10: OUTPUT«foo␤␤»
skids Also the "anon" one is supposed to now its own name inside itself, but that seems to be NYI.
*know (as in, that name is declared inside the "anon"-declared one) 04:37
MadcapJake what i gather, anon allows you to declare an anonymous sub whilst giving it a name (but the name is only accessible from within the sub, i think)
04:37 BenGoldberg joined
skids m: anon sub foo { }.name.say; (sub { }).name.say; # what the example above was supposed to be. 04:38
camelia rakudo-moar 770d10: OUTPUT«foo␤␤»
skids MadcapJake: yes, and from error messages. But the part about inside itself is NYI.
MadcapJake so `anon sub foo { ... }` is equivalent to `sub { ... }` albeit the former has an internally available name (for recursion i presume?)
04:39 pjscott left, pjscott joined
skids Yes for recursion, and .name for introspection. 04:39
MadcapJake ok cools, thanks skids!
skids BTW where was this example at? 04:40
04:41 pjscott left, pjscott joined
MadcapJake skids: doc.perl6.org/language/variables#Th...Declarator 04:43
04:43 pjscott left
MadcapJake m: my $i = 3; (anon sub foo ($x) { state $y = 1; if $x == 0 { return $y } else { $y *= 10; foo($x--) } })($i) #skids: so this should work, technically? 04:43
camelia rakudo-moar 770d10: OUTPUT«5===SORRY!5=== Error while compiling /tmp/GK1D3o4smD␤Undeclared routine:␤ foo used at line 1␤␤»
04:44 pjscott joined
skids Yes, the example from S06 is: 04:44
m: my $secret = anon sub tract($n) { say $n; tract($n-1) if $n };
camelia rakudo-moar 770d10: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ysnbl1BXLz␤Undeclared routine:␤ tract used at line 1␤␤»
MadcapJake ok well that is neat, hope that gets in 6.c.1 or 6.d! 04:45
or is that really a compiler thing not a language version number thing? 04:46
04:47 jme` left
skids Depends on whether it breaks any tests, I guess. 04:47
04:50 revhippie left 04:52 rickbike left 04:55 pierre-vigier left, pierre-vigier joined 05:02 linuxuser9000 joined 05:04 pjscott left 05:07 rickbike joined 05:11 khw left 05:12 BenGoldberg left
skids files RT#127304 to give that NYI a reminder in RT. 05:14
MadcapJake skids: 👍 05:18
05:19 pjscott joined 05:25 Psyche^ joined 05:30 Psyche^_ left 05:37 zhi joined 05:40 linuxuser9000 left 05:43 eone joined 05:49 eone left, Cabanossi left 05:52 Cabanossi joined 05:54 pjscott left 06:07 xpen left 06:09 xpen joined
dalek c: 3e3a649 | skids++ | doc/ (2 files):
Minor massaging, mostly to links
06:16
06:25 geraud left 06:32 pierre-vigier is now known as pierre__, pierre__ is now known as pierre-vigier, perlawhirl left 06:34 pierre-vigier left 06:35 pierre-vigier joined 06:36 rickbike left 06:40 skids left 06:43 jevin joined 06:44 pierre-vigier left 06:45 sjoshi joined 06:51 CIAvash joined
chacewells How would I do dynamic coersion? 07:02
I.e. my %types = land => Int, owner => Str; 07:03
Then hire can I use the type in the hash to coerce some data base on the key? 07:04
s/hire/how/
gfldex m: my $s = 42; my Int $i; my $type = "Int"; $i = $s."$type"(); dd $i; 07:05
camelia rakudo-moar 770d10: OUTPUT«Int $i = 42␤»
gfldex chacewells: ^^^
see: design.perl6.org/S12.html#Fancy_method_calls
chacewells Ooh. That makes a lot of sense 07:06
gfldex chacewells: please note: if you want to do that you are most likely doing it wrong.
07:07 sno left
adu gfldex: there should be an IDE plugin for that 07:09
chacewells Hmm. I'm all about doing it right, so what's a better way to do dynamic type dispatch? 07:10
gfldex in what context do you think you need that dynamic lookup?
chacewells What I want to do is pull stuff out of a CSV and determine the type based on the column name 07:11
gfldex chacewells: i need to think about that for a while 07:13
chacewells K. Quick and dirty's good for now. So much to learn with a new language! 07:15
I mean. I guess there's always given when 07:16
07:21 domidumont joined 07:26 domidumont left, domidumont joined
[Tux] csv-ip5xs 50000 18.197 12.564 07:27
test 50000 23.068 22.431
test-t 50000 12.632 11.742
csv-parser 50000 52.600 1.981
07:27 zhi left 07:40 firstdayonthejob joined 07:41 Zero_Dogg left, Zero_Dogg joined, Zero_Dogg left, Zero_Dogg joined 07:44 xpen left 07:45 FROGGS joined 07:48 xpen joined, _mg_ joined 07:49 _nadim joined 07:53 xpen left 07:55 xpen joined 07:56 zakharyas joined
gfldex m: sub convert(Int(Str) $i, Str(Str) $s, Rat(Str) $r){ dd $i, $s, $r; }; my @a = "123", "abc", "3.1415", "567", "hgf", "2.7182"; for @a -> $c1, $c2, $c3 { convert($c1, $c2, $c3) }; 07:56
camelia rakudo-moar 770d10: OUTPUT«123␤"abc"␤3.1415␤567␤"hgf"␤2.7182␤»
gfldex chacewells: you would have to construct &convert at runtime what would need macros, which are not well impemented yet (and drive you crazy). 07:57
07:58 adu left
gfldex you could also write a module file at runtime and load that module after you got the first line from the CSV file. What is madness. 07:59
08:01 vendethiel left 08:02 vendethiel joined
gfldex chacewells: i was wrong, macros wont really help you 08:04
08:06 xpen left
moritz \o 08:06
08:07 xpen joined 08:14 rurban joined 08:18 finanalyst joined 08:19 TimToady left 08:21 TimToady joined
nine .tell orbus docs/module_management.md for why @*INC is gone 08:27
yoleaux nine: I'll pass your message to orbus.
08:27 lnrdo joined
finanalyst Afternoon all, Just wrote an Intro to Sixy Perl to answer perenial why Perl6/Rakudo = pastebin.com/zRpjuWWR 08:29
08:29 pdcawley joined 08:32 xpen left 08:33 xpen joined 08:34 lnrdo left
moritz What is this Sixy Perl you're talking about? 08:35
I mean, with Perl 6 and Rakudo around, we have enough names, IMHO
starting with yet another seems contra productive
08:37 xpen_ joined 08:38 firstdayonthejob left
finanalyst Moritz, the idea is to be humourous. As some will see an 'e' before they see an 'i' 08:38
moritz finanalyst: the pun was clear to me, though the humor doesn't seem to reach me. Maybe it's because I'm German :-) 08:39
finanalyst also I tried to avoid formal language, trying to be in the spirit of Camelia ???
Not really a good pun. 08:40
08:40 xpen left
finanalyst anyway, if the rest of the text is useful, it's not a hassle to rewrite things to eliminate the pun 08:41
08:42 c99896 joined
moritz finanalyst: sorry, I think I'm feeling unfairly grumpy right now; you should wait for feedback from others before rewriting anything 08:44
finanalyst moritz: your grumpy is others being generous. I'll take your feedback any time. But I'll wait a day. 08:46
masak fwiw, I agree with moritz, though for different reasons 08:48
"Sixy Perl" doesn't use the Perl 6 brand clearly enough
so it's a waste of brand opportunity
finanalyst Fair comment 08:49
masak s/waste of/wasted/
08:50 rurban left, rurban joined 08:52 darutoko joined
Hotkeys is there a builtin for accessing urls? 08:54
eg json apis
moritz no
08:57 sno joined 08:58 rurban1 joined 08:59 xpen_ left, rurban1 left 09:00 rurban left 09:01 xpen joined 09:08 abraxxa joined
chacewells @gfldex thanks for hanging in there. I got it working using the first solution you showed me 09:11
Though I guess dynamic dispatch is a little overkill when I could just use given when 09:12
09:14 kjs_ joined 09:15 TimToady left 09:17 TimToady joined 09:19 rindolf joined 09:23 dakkar_ joined, yeahnoob left, RabidGravy joined 09:26 rindolf left
RabidGravy marning 09:28
09:31 marmay left, marmay joined 09:33 bjz joined 09:41 rindolf joined
nine Ok, singing off now. Will be afk till Saturday evening. Wish everyone a nice week :) 09:43
moritz nine: have the apropriate amount of fun!
09:44 domidumont left
FROGGS nine: have a nice week! :o) 09:45
09:45 bjz left 09:48 bjz joined, domidumont joined
RabidGravy have fun nine, don't do anything I wouldn't 09:49
09:52 domidumont left 10:01 brrt joined 10:03 [TuxCM] joined
brrt good * #perl6, TuxCM 10:04
|Tux| o/ 10:05
10:05 marmay left, [TuxCM] left 10:21 cognominal left 10:25 espadrine joined
RabidGravy erp 10:30
jnthn morning, #perl6 10:31
10:32 kjs_ left 10:35 TEttinger left 10:37 lnrdo joined 10:40 pmurias joined
RabidGravy jnthn++, I only just realised the Promise has a Supply coercion which makes things so much nicer :) 10:50
jnthn ;) 10:52
So does Channel 10:53
Also, whenever blocks automatically coerce
So whenever $promise { } and whenever $channel { } will Just Work
10:54 finanalyst left
RabidGravy yeah, just turned github.com/retupmoca/P6-Net-AMQP/b...rinter.pl6 into github.com/retupmoca/P6-Net-AMQP/b...-react.pl6 10:55
:)
I knew about the Channel coercion already 10:56
jnthn my $body-supply = $q.message-supply.map( -> $v { $v.body.decode }); 10:57
Note that because we build the pipeline afresh, you'll be decoding twice here
Adding .share on the end should help with that 10:58
RabidGravy yeap that works 11:00
nice one 11:01
11:04 llfourn left
RabidGravy at some point this week I'm going to make an article with P6 versions of www.rabbitmq.com/getstarted.html 11:05
jnthn Cool :)
RabidGravy I concluded over the weekend that pushing the reactive, asynchronous and possibly distributed stuff as a niche is a great way of countering the "not fast enough" complaints 11:07
jnthn Yes, I can easily imagine "concurrent glue" being where Perl 6 gets used soonest because you're often not CPU bound, just juggling. 11:08
RabidGravy it's all going to be fabulous 11:13
11:16 domidumont joined 11:17 cognominal joined 11:26 Peter_R left 11:27 vendethiel left
brrt interestingly, concurrent glue is the original niche i imagined for node.js 11:27
i think perl6 might well fit that better 11:28
11:28 vendethiel joined
brrt if only because it doesn't have the same web / frontend centered culture arround it 11:29
11:35 marmay joined
pmurias jnthn: are there any ground breaking performance improvements planned or will things be just speed up the hard way by a bazillion small ones? 11:39
11:40 xpen left, xpen joined 11:42 _nadim left 11:44 xpen_ joined 11:45 kaare_ joined
jnthn pmurias: I suspect there'll be various medium-sized ones and a bunch of small ones. But that's oversimplifying things. 11:45
pmurias: Because typically optimizations interact in interesting ways
pmurias: For example, more aggressive lexical -> local lowering is only so valuable in and of itself, but it also cuts down the number of guards spesh needs to add, for example. 11:46
11:47 xpen_ left 11:48 xpen left
jnthn Another example is better code-gen for accessors. It's again only so much of a direct improvement, but making the inlinable is a huge force-multiplier. 11:48
*them
11:48 xpen joined
jnthn And even the above two interact: an inlined thing free of guard clauses eliminates a deopt safepoint. 11:49
pmurias jnthn: good to know there is a vision in place for getting things fast 11:52
with a few of the past Perl 6 attempts I took part we run into a performance problem "brick wall" :/ 11:53
jnthn resists running into a Wall pun... 11:55
11:55 xpen left 11:56 kjs_ joined
RabidGravy brrt, in my last contract that was actually what I using node.js for - as a sort of reactive middleware between a backend system a client browser - getting some event from RabbitMQ, filling in additional bits from the backend webservice and pushing to the interested clients via web sockets 11:58
worked really nicely, but I'd make it Perl 6 today ;-) 11:59
12:00 llfourn joined 12:04 zakharyas left 12:05 llfourn left 12:07 leont joined
brrt RabidGravy: cool. i argued for node.js in a similar function, but it was ignored in favor of synchronous (!) python-via-http-in-a-wait-loop 12:14
i.e. each request would just sleep until some value was stored in memcached
yes, memcached
RabidGravy well to be fair, python asynchronous stuff can be rather special, there's some real stunt code in the Airtime media-manager and playout engine 12:16
brrt python was simply the wrong tool for this job
masak when reading the Perl Weekly today, I learned there has been a "brouhaha" about Perl 6.
that's something, I guess.
RabidGravy brouhaha!
brrt synchronous-http-python was a very, very wrong tool for this job
what is brouhaha?
masak brrt: some kind of uproarious reaction
DrForr Well, I did see a little spike in pageviews...
RabidGravy a sort of comedy uproar 12:17
brrt hmmm
oh well
RabidGravy geeks will be geeks
masak I'm sorely tempted to tweet that I will consider any more "debate" about either the name or the mascot to be entirely devoid of substance 12:18
and maybe challenge people to discuss more interesting things
RabidGravy masak++ # precisely
moritz masak: like their ideas of ideal macros that automagically save the world (in a double sense)?
:-)
brrt debate is a huge misnomer for the shouting that goes around about camelia
masak (I did like sue++'s post, though)
moritz: ah, yes. 12:19
moritz: at least those ideas *have* substance
(even if they're wrong in various ways)
12:20 Skarsnik joined
masak brrt: camelia is a kind of insect trap for trolls. 12:20
MadcapJake anyone know what's up with rakudo *? Still only see a 2015.11 on site and github.
masak the trolls come buzzing up to camelia, and then get stuck there 12:21
brrt thats true 12:23
RabidGravy yeah
moritz MadcapJake: there'll be a R* after the 2016.01 release
RabidGravy but yeah, virtualsue++ is spot on with that article 12:24
moritz URL?
12:25 lokien_ joined
RabidGravy moritz, virtualsue.blogspot.co.uk/2016/01/p...ecide.html 12:25
12:26 kid51 joined
moritz RabidGravy: thanks; virtualsue++ indeed 12:30
12:36 perlawhirl joined
masak ok, I don't want it to sound like blame, more like constructive criticism: not releasing a R* in December was a missed opportunity. (given that R* is what relative outsiders probably come looking for.) 12:36
12:36 AlexDaniel joined
masak and no, I haven't done anything to further the release of R* myself... so don't mind me :) 12:37
pmurias re camelia it's hard to have a serious debate when it's mostly a question of taste
masak pmurias: even if taste were completely non-objective, it's still Larry's decision. 12:38
moritz masak: I agree, and I can explain exactly what we did wrong; but I didn't counter-act either, so I guess it's wasted breath
masak moritz: ooc and for posterity -- what exactly did we do wrong?
MadcapJake I really do like Camelia, I just feel there is room for another presentation of her. Not a replacement, not for perl6.org. Just as the go gopher has many variations (some for fun, some for design). Search «golang logo» on image search, and you'll see there are some really slick representations of the gopher. In fact, I feel the many variations of the gopher really *add* to the culture surrounding go.
brrt any OSX devs arround? 12:39
moritz masak: we declared that with v6.c, we'd have stability, so we crammed all backward-incompatible changes into the last release where we could
MadcapJake Also would love to see camelia here: www.squishable.com/s/custom_squish
brrt i want to determine, preferably at build time, whether i'm compiling for 64 bit or for 32 bit 12:40
moritz masak: to the point where the compiler release was sufficiently broken that we couldn't easily do an R* release
brrt preferably using some kind of macro
moritz masak: so the next time, we should declare an internal stability goal for one release in advance, and publicly one release later 12:41
brrt: I seem to recall that this is rather difficult, and OS X lying about its bit length in order to prevent such introspection
diakopter
.oO( next time.. )
Skarsnik brrt, build time of what? 12:42
moritz brrt: and parrot uses some linker invocation to find the actual bitness
diakopter: there will be a next language release, v6.d etc.
brrt moritz: i'd assume, perhaps wrongly, that compiling for both archs would simply compile the object files twice, once with 32 bit configuration and once with 64 bit configuration
build time of MoarVM
Skarsnik
Skarsnik Oh ok
jnthn Having deadlines nearly always *reduces* software quality. We've done the Christmas thing now. We don't need to force ourselves to meet any further artificial deadlines again, just deliver gradually increasing value to our userbase at regular intervals, as we've become well practiced at doing. 12:43
masak diakopter: trying to think of something to say to that that wouldn't garner a #thatsthejoke response
jnthn: hear, hear
brrt thing is, people are compiling universal MoarVMs, despite there not being a 32 bit x86 mac produced in years; MoarVM detects the 64 bit arch and assumes it can run the JIT, which breaks when running on 32 bit 12:44
MadcapJake moritz: is it possible now to do an R* for 2015.12? I kind of feel like (if it's possible) it's something that really should be out there.
brrt 'can people not stop compiling univesal MoarVMs? sure, but we'd have to provide the alternative'
jnthn brrt: Does testing sizeof(void *) at runtime not do it?
brrt hmmm
i can test
well, i would be able to test if i had a mac or something like that 12:45
jnthn (Then refuse to JIT if it's not 8)
Yeah, I've no Mac either :)
Let alone a 32-bit one
brrt well, apparantly you can run 32 bit apps on 64 bit macs, so that should not be a problem
jnthn: maybe this is not the correct discussion for this channel... but i kind of feel we need a smarter/better Configure system, any ideas? 12:47
at least the JIT bit should need a smarter configure system
12:47 kjs_ left
moritz MadcapJake: no, it'd need a point release of 2015.12 12:47
12:47 Guest24090 left
jnthn brrt: No, I'm *absolutely* the wrong person for Configure systems. 12:48
12:48 luiz_lha joined
brrt hmmm... well, i'm not really an expert myself 12:48
12:48 luiz_lha is now known as Guest59623
brrt i just feel like we should separate the issues of compiler system, target platform, and host platform, and the current system fails at that 12:49
also, i don't want to use autotools
(we don't use autotools, but it would be a 'solution') 12:50
or gyp, or cmake, or .. name it
preferably i'd have just a makefile and it would do everything
fwiw, luajit manages that, as does tcc and similar projects (iirc), so i kind of feel like we should be able to manage too 12:51
12:51 rindolf left, xpen joined
brrt the shortcut i have in mind is to first compile a 'configure' executable, have it read everything from macros, and output the correct invocation flags for whatever compiler is in use 12:52
hmmmm....
that may actually be feasible
12:52 vendethiel left, scz left 12:53 Guest59623 left
brrt e.g. foo.o: foo.c\n\t$(CC) `configure --flags` $< $@ 12:53
or that could be
12:53 vendethiel joined
brrt foo.o: foo.c\n\t ./compile $< $@ where ./compile is a wrapper 12:54
nm, solved it; developer.apple.com/library/mac/do...iling.html 12:55
12:56 xpen left, zhi joined 12:57 scz joined
RabidGravy I only just realised that github generates anchors from headings in markdown 13:00
13:01 zhi left
brrt yeah, it's really useful 13:01
13:01 llfourn joined 13:03 jshy joined 13:07 ChoHag left, rindolf joined 13:08 llfourn left 13:15 zacts left
timotimo o/ 13:33
RabidGravy erp 13:34
13:34 [dpk] joined, dpk left
brrt hi timotimo 13:34
13:35 espadrine left, espadrine_ joined, [dpk] is now known as dpk 13:38 Zero_Dogg left 13:43 hippie1 joined 13:44 jdrab joined, hippie2 left
jshy hi, I am getting killed on async networking. 13:47
timotimo brrt: so, if people build universal moarvm binaries, and 32bit macs aren't being made any more ... how does it end up accidentally running jitted code in 32bit mode anyway?
jshy: sounds like you're running into a crash of some kind; can you tell us what exact version of rakudo you're running with "perl6 --version" first? 13:48
jshy I am trying to work with binary protocol. and I copied the stuff from Stomp client example, but although I get the data in the whenever block. it never finishes or whatever,
the program just hangs.
I can't move onto the next method.
This is Rakudo version 2015.12 built on MoarVM version 2015.12 13:49
implementing Perl 6.c.
timotimo hm, okay, maybe you can paste a bit of the code? 13:50
jshy I tried this also with regular IO::Socket::INET and have the same problem. it's like the program doesn't know the data stream is finished and to move on.
brrt timotimo: no idea, really 13:51
maybe you can choose which version you want to run
jshy so here is the connect.
method connect () {
start {
my $conn = await IO::Socket::Async.connect($!host, $!port);
$!incoming = self!process-messages($conn.Supply(:bin));
await $!incoming;
$!connection = $conn;
True
}
timotimo oh, sorry, i didn't mean paste into the irc directly
jshy }
and the other part
method !process-messages($incoming) {
supply {
timotimo please use a no-paste service on the web somewhere
jshy my @chars = '';
whenever $incoming -> $data {
say $data.unpack('H');
}
}
}
timotimo IRC is very ill-suited for pasting stuff directly into it 13:52
AlexDaniel oh geez
gfldex jshy: please have a look at gist.github.com/ 13:53
jnthn jshy: that await $!incoming is never going to complete
timotimo jnthn: the supply isn't going to shut itself down when the connection is closed by the other side?
jnthn At least, not unless the server closes the connection.
timotimo: Yeah, that can happen.
So I guess the question is: does that happen? :) 13:54
jshy that link doesnt take me to code.
brrt jshy: that's where you can put code for others to see 13:55
gfldex m: sub foo(::T $t --> T){ dd T.^name; dd $t.WHAT; return T.new }; my Int $i = 42; foo($i); 13:56
camelia rakudo-moar 770d10: OUTPUT«"Int"␤Int␤Type check failed for return value; expected T but got Int␤ in sub foo at /tmp/jSQsazeLbp line 1␤ in block <unit> at /tmp/jSQsazeLbp line 1␤␤»
gfldex m: sub foo(::T $t --> T){ T.new }; my Int $i = 42; foo($i);
camelia rakudo-moar 770d10: OUTPUT«Type check failed for return value; expected T but got Int␤ in sub foo at /tmp/HqdmxVFmny line 1␤ in block <unit> at /tmp/HqdmxVFmny line 1␤␤»
jshy ok, misunderstood. Like I said I tried copying the stuff from stomp client, so I had the .share after at the end if $!incoming etc.. and nothing seemed to work.
ok, pastebin. pastebin.com/8m9QL3Nj 13:57
brrt waitaminute, i can't compile rakudo/nom; could not find symbol &bool 13:58
this in a clean build
timotimo brrt: may need to nuke your install folder for this 13:59
13:59 lucasb joined
brrt that is... uncool 13:59
13:59 rindolf left
timotimo i've seen that bug half a month ago 14:00
14:01 llfourn joined
timotimo so your complaining comes a bit late :) 14:01
stmuk_ annoys other-half with clicky Model M 14:04
brrt :-P
14:04 rindolf joined
brrt still uncool 14:04
timotimo did nuking help, though? 14:05
14:06 llfourn left 14:10 pi1 left 14:11 pi1 joined 14:12 xpen joined 14:13 zakharyas joined
RabidGravy jshy, I think more useful would be *how* it doesn't work 14:14
jshy yep.
post new code in a sec. (pastebin).
14:15 finanalyst joined
jshy pastebin.com/tPnpP8DJ I have a comment in there, that says ' I never get here '. 14:16
14:17 pmurias left 14:18 xpen left 14:20 josgraha joined 14:22 prammer joined, pjscott joined 14:25 _Vi left 14:26 finanalyst left 14:27 brrt left, perlawhirl left
RabidGravy jshy, it looks like it is never receiving a 0xFF from the other end. You probably want to instrument the !process-messages to see what it is getting 14:28
14:29 lokien_ left
RabidGravy I can't test myself right now as my RabbitMQ server appears to refuse to run with the stomp plugin for some reason 14:30
jshy if I say instead of emit I get [fffd ...] its 12 hex values.
mspo I wonder if this would be useful as a module: github.com/concurrencykit/ck
jshy actually this fffd18fffd20fffd23fffd27 14:31
JimmyZ jshy: maybe you need await $conn before await $connected; ? 14:32
14:33 jdrab left
jshy JimmyZ: isnt that the first line in after start { 14:33
14:34 virtualsue joined
RabidGravy yeah, it actually is awaiting right 14:34
14:34 jdrab joined, jdrab left
JimmyZ oh, miss that 14:34
RabidGravy mspo, if you think it could play nicely with the existing stuff (and compose in the same way,) 14:35
jshy so it really looks like the problem is in the emit @chars ... $!income.grep(0xff).Promise stuff and the promise never leaving the Planned status. 14:36
RabidGravy jshy, what do you get if you alter the emit there to "say $data.decode;" it may crao out 14:37
jshy, yes clearly
jshy ha, I will try, but I think I get the Malformed UTF-8 message
RabidGravy but as it appears that it something going on with the protocol there it may be something we can't help with
ie. the code may well be doing what it is supposed to, it's just whatever you are connected to isn't 14:38
if you get malformed utf-8 try decoding to ascii or iso-8859-1 or something 14:39
of course if it is actually binary it wouldn't make sense at all
14:40 scz left
jshy so with the data.decode, I get nothing back. I put data.decode before data.unpack and it never gets to data.unpack 14:40
mspo RabidGravy: yeah probably more interesting inside of moar 14:41
jshy say $data.decode; say $data.unpack('H*'); never gets to unpack. 14:42
and say $data.decode doesn't 'say' anything; 14:43
ugexe a whenever block that isnt inside a react?
14:43 FROGGS left
timotimo you can $data.decode('utf8-c8'), which is able to decode even invalid utf8 14:43
RabidGravy yeah, it works inside a supply { } block too
timotimo (it looks quite weird, though, if it encounters a lot of invalid utf8)
14:44 ojvcakgo joined, MadcapJake left
RabidGravy This is from jnthn's STOMP articles right? 14:44
I'm pretty sure that works, which is why I am suspecting whatever it is that is being connected to 14:45
14:45 domidumont left, MadcapJake joined, scz joined
jshy yes, but instead of char data I am using with binary data? 14:45
RabidGravy but as I say I don't have a stomp server right now to test
mspo do you have use experimental :pack; ?
RabidGravy hah, yeah 14:46
jshy yes t experimental
the result of say $data.decode('utf8-c8') is Segmentation fault (core dumped)
RabidGravy yes
known fault 14:47
jshy what?
timotimo oh!
right, when there's invalid data at the very start, it breaks 14:48
sorry for suggesting it, then :)
Skarsnik hm, how experimental is cached?
14:48 jdrab joined, raiph joined
jshy so are you saying there is no way this is going to work right now? 14:48
jnthn Just don't try to decode stuff that isn't utf-8 as if it was utf-8. latin-1 will do fine, so every byte is a valid value :P 14:49
*since
14:50 mohae_ joined 14:51 jdrab left
jshy ok so I wasn't trying to decode as utf-8 I was following debugging instructions. 14:51
as latin-1 I get ÿýÿý ÿý#ÿý' which is the correct binary interp. 14:52
14:52 AlexDaniel left
jshy but again, I get to say 'done'; but the promise never 'completes' 14:52
14:53 mohae left
timotimo oh, i didn't know latin-1 is that amazing ... :P 14:53
moritz jshy: I don't think you emit for every character, do you? 14:54
14:54 n0tjack joined
jshy no its [fffd...] 14:55
moritz then .grep(0xff) can't ever work
jshy I must be doing something wrong in grep.
RabidGravy right, the $connected Promise is only Kept when 0xFF is seen on the supply
lucasb timotimo: making a weekly post are in your plans this week?
RabidGravy jshy, yeah
moritz jshy: that's only true if an even equals 255
jshy yes, I have just come to that conclusion.\ 14:56
RabidGravy so if they are bytes then its probably emit each byte
jshy is that like a while with an emit inside? 14:57
RabidGravy yeah or a for most probably 14:58
jshy I notice the buf does not flush. is there a way to get the buf to shift?
RabidGravy it's tricky when we can't understand your data
jshy so I have to keep track of my position in the buf?
RabidGravy well you if you are looking for binary values then you could just do, "emit $data[$_] for ^$data.elems" 14:59
jshy so really what I need it to sub buf range ...
RabidGravy or something
jnthn Note that the buf you're given is never mutated again aside from anything you choose to do
You'll get another buffer when the next packet of data arrives
jshy guess what, $data.elems says 1 even though there are 12 bytes.
15:01 Begi joined
jshy ok thanks for the help. I will bang on it from here. 15:01
15:01 MadcapJake left
moritz jshy: what typs is $data? if it's a Str, that's to be expected 15:01
timotimo could be your $data is a list of a single buf, or something like that
moritz (.chars is the number of characters)
timotimo oh, or a string, yeah
15:01 MadcapJake joined, llfourn joined
jshy thanks, I am really trying to learn --- but it has been liking chewing glass and drinking gas. 15:02
15:02 lokien_ joined
gfldex lol i propaganda ... err .. blogged a little! gfldex.wordpress.com/2016/01/18/a-...direction/ 15:04
moritz jshy: one piece of advice is to iterate and test in smaller increments
jshy: create the supply, tap it with { say .perl }; only start working with the supply once you're confident it gets the right values 15:05
timotimo lucasb: i'm not sure why, but somehow i'm having a hard time keeping up with my perl6 stuff at the moment 15:06
lucasb timotimo: ah, ok. I was just curious :) thanks, anyway
15:07 llfourn left
jshy moritz: where? in the whenever or the $!incoming? 15:07
timotimo lucasb: my readers deserve an update, i know :S
15:08 silvester6 joined
RabidGravy I suddenly have a need for a transaction manager, someone write one quicky, or port CICS or something 15:10
;-)
moritz jshy: both, actually :-)
dalek blets: 36d67c2 | lichtkind++ | docs/tablet-3-variables.txt:
update array methods
15:12
blets: 932cc37 | lichtkind++ | docs/ (2 files):
update array to hash methods
15:13 pjscott left
RabidGravy the next module I make is only going to have one method I have decided, this documentation is getting tiresome 15:20
15:20 _Vi joined
Skarsnik x) 15:21
stop doing new modules!
RabidGravy NEVER! 15:22
Juerd RabidGravy: dwim() 15:24
stmuk_ Please remove leading 'v' from perl version in JSON::Fast's meta info. 15:25
is this a 6.d change?
RabidGravy :)
orbus another concurrency question - say I start some async work with start 15:28
yoleaux 08:27Z <nine> orbus: docs/module_management.md for why @*INC is gone
orbus .tell nine thanks - taking a look 15:29
yoleaux orbus: I'll pass your message to nine.
orbus so say I start async work - get a promise back
is there any way that background work can be explicitly killed?
I ask because it complicates something I'm working on if it can :p 15:30
15:30 huggable joined
orbus like, I dunno - something like 'my $p = start { sleep 20 }; $p.kill' 15:30
something like that
I don't see anything
stmuk_ is there a ChangeLog of 6.d v 6.c? 15:31
15:31 khw joined
orbus I think there's more like a vague wishlist at this point 15:31
Skarsnik why?
jnthn orbus: No, and don't sleep
orbus sleep is bad?
15:32 kjs_ joined
jnthn orbus: Best pattern at the moment is to use a Promise to signal cancellation. We may in a future version sugar this a bit 15:32
mspo you mean $p.break?
jnthn orbus: Or even .keep, it doesn't matter
orbus right well but that's a signal for a (hopefully) controlled shutdown 15:33
jnthn my $c = Promise.new; my $p = start { await Promise.anyof(Promise.in(20), $c); }; $c.break
orbus basically I've got some stuff I'm worried about being left in an inconsistent state if somebody kills the thread
sounds like I don't need to worry
jnthn You can also cheaply poll $c as a boolean
15:33 sjoshi left
orbus oh, I"m not actually trying to kill something 15:33
jnthn (iirc, doesn't acquire any locks just to poll "was it kept yet"
orbus I just want to see if it's possible to see if I need to design around it
jnthn Right, you just want to communicate something
And a Promise is a good way to communicate a single thing, which can also be cancellation. 15:34
orbus actually not even that at this point - but I might later
jnthn OK
orbus much appreciated
jnthn Anyway, there's not (won't be) any $promise.kill
orbus good to know
I think it introduces a lot of potential problems 15:35
jnthn Yeah...most interesting code can only be sanely stopped at safe points.
masak there *shouldn't* be a $promise.kill 15:36
it goes against the whole design of promises
orbus I agree - but just making sure I hadn't missed something 15:37
Skarsnik when is fork/wait? x)
orbus go wrap them with NativeCall? :p 15:39
Skarsnik I tried for something, but it did not work well
orbus jnthn: so you said don't use sleep - is sleep inherently bad somehow, or does that just mean my thread can't be listening for kill signals?
15:40 ChoHag joined
jnthn orbus: It's that sleep actually forces the thread pool thread to sleep. 15:40
orbus: Whereas an await Promise.in(20) will in 6.d actually free that pool thread up to so something else.
*to do
orbus ohhh 15:41
15:41 bpmedley joined, gtodd joined
orbus I guess I kind of assumed sleep would be implemented via Promise.in 15:41
jnthn No, it's done with scheduling.
masak could sleep() be made to work like `await Promise.in(20)`? seems like a nice default. :) 15:42
orbus that's kind of what I was thinking 15:43
moritz masak: and maybe a :blocking named argument for the old behavior
15:43 sftf joined 15:47 musiKk joined, espadrine_ left
gtodd sigh ... what is an operator in perl6 ... is it made from a class ... i.e. is it an "object" ? ... (if so this would help me understand that it is something you can hack on and make custom hyper infix prefix versions of) 15:48
Skarsnik I am not sure to understand your question x)
gtodd e.g. I relaized I can't explain how this works stackoverflow.com/questions/3485785...-an-array/ 15:49
jnthn gtodd: It's just a sub, normally a multi sub
gtodd because I don't know what a perl6 operator is :-D
jnthn Those are objects, of course.
gtodd jnthn: phew :-D
ok I was heading down a rabbit hole
thanks
15:50 vendethiel left 15:51 vendethiel joined, ifim joined 15:52 musiKk left 15:53 espadrine_ joined, domm_ left, silvester6 left 15:54 domm_ joined 15:55 Begi left 15:57 jme` joined
sftf Hi, is it possible to parse Perl 6 code from Perl 6 easily using the existing grammar like STD.pm or something? 15:58
15:59 zakharyas left, scz left
leont I suppose you could use the built-in grammar to build the AST and then work from that, but I have no idea how that'd work 16:00
ugexe easily? probably not
16:00 domm_ left, domm_ joined
ugexe Perl6::Grammar.parse($source, :actions(Perl6::Actions.new())) is probably a good place to start 16:02
orbus oh, I have a question (and I should probably just test this but I'm going to ask anyway)
if I create a Promise
16:03 llfourn joined
orbus and then I get a Vow on that Promise 16:03
16:03 espadrine_ left
orbus what happens to the Promise if the Vow goes out of scope and gets gc'ed or whatever 16:03
if the vow is destroyed
is the Promise broken?
mspo that would be a bug?
jnthn orbus: No, it'll just never be kept 16:04
orbus ah okay
I was wondering
jnthn orbus: And if nobody is interested in it, it too will be gc'd.
orbus okay
jnthn There's lots of perfectly ordinary situations where this can occur
orbus sure 16:05
16:05 lucasb left
orbus that's why I was wondering how it would behave 16:05
jnthn Like, you are making a request to two servers, and taking the result from whichever wins and cancelling the second somehow.
16:06 scz joined
timotimo ugexe: parsing perl6 won't work without a world object 16:06
and i'm not sure Grammar.parse will create a world object for you. or actions.new for that matter 16:07
jnthn timotimo: Think Grammar's TOP or comp_unit method does that.
16:07 llfourn left
timotimo oh. OK! 16:07
16:08 molaf_ left
ugexe m: use nqp; use Perl6::Grammar:from<NQP>; use Perl6::Actions:from<NQP>; my $source = q|say "hello world";|; my $*LINEPOSCACHE; my $p6c = Perl6::Grammar.parse($source, :actions(Perl6::Actions.new())); say $p6c.dump 16:11
camelia rakudo-moar 770d10: OUTPUT«- statementlist: say "hello world";␤ - statement: 1 matches␤ - EXPR: say "hello world"␤ - longname: say␤ - name: say␤ - identifier: say␤ - args: "hello world"␤ - arglist: "hello world"␤ - EXPR:…»
timotimo not bad.
but keep in mind that anything like "BEGIN" or "use" will cause code to run at parse time already 16:12
also, applying traits
so you're likely to run into security issues if there's any way that untrusted input will end up as your source code
16:13 jshy left
ugexe wouldnt such security issues for untrusted input stand regardless of how its parsed? 16:14
or do you mean some sort of code that modifies itself when parsed so it does something else
hoelzro o/ #perl6 16:15
16:20 c99896 left, dwarring left, _mg_ left
timotimo well, you might say "oh, i'm just *parsing* the code, not actually running it!" 16:22
sftf Ok i got it. Is it possible to parse it safely? Stripe it somehow to just "Only literals and expressions" for example?
timotimo we don't have anything for that yet, sadly
sftf Nice 16:23
16:23 psy_ joined
jnthn I suspect eventually we'll expose some API for isolated execution environments that can be configured with restrictions. 16:24
timotimo right
that'd be very nice to have
16:26 _mg_ joined
ugexe .tell jdv79 is it possible to bring the elastic search back up for your metacpan fork? its returning `Could not connect to '127.0.0.1:9200': Connection refused` 16:27
yoleaux ugexe: I'll pass your message to jdv79.
sftf timotimo: whether it is possible to control "BEGIN" or "use" at compile-time? 16:29
timotimo hum?
16:33 kjs_ left
hoelzro sftf: if you're asking whether you can selectively disable BEGIN blocks or use statements when parsing, sadly, I don't think you can 16:37
sftf thanks 16:38
hoelzro chalks that up to difficulty translating "ли"
timotimo the what now?
sftf ok :)
16:39 espadrine_ joined, espadrine_ is now known as espadrine
jnthn Not executing use statements can also affect your ability to parse what follows them. :) 16:39
timotimo that's the problem, yeah
ideally, we'd allow BEGIN-time things like "use" and trait mods, but just don't allow it to contaminate the host program or the system around the program (by deleting files or something) 16:40
16:41 bowtie left
hoelzro this may be a stupid question, but could one use two separate settings for BEGIN time and runtime? 16:41
I imagine that would run into all sorts of nasty problems
16:42 bowtie joined 16:44 zakharyas joined 16:53 ChoHag left 16:57 dfcarpenterak joined
sftf So, if I want to write Perl 6 extensible application (with trusted or untrusted code in plugins, callbacks, etc written also in Perl 6), what options are available? What about the safety of these options? 16:57
Skarsnik hm tricky 17:00
abraxxa Skarsnik: hi! did you find time to look at my repo and the test module work? 17:02
orbus I have a question - module naming - I take it there's no mechanism to enforce people into using second (or lower) level names for their modules right?
Skarsnik abraxxa, for DBIish?
orbus like if I want to call my module BestModuleEver
abraxxa Skarsnik: yes
orbus nothing's stopping me, right? 17:03
ugexe no, because ideally you also declare the auth as part of the identity
orbus other than good taste
Skarsnik Do a pull request. it look fine for me, but probably other has some concern x)
abraxxa Skarsnik: who else is interested/involved?
orbus I'm interested in the Oracle stuff
17:03 kjs_ joined
orbus but I haven't had time to really look through it 17:03
I was thinking of writing my own oracle binding, but you're much farther along :) 17:04
abraxxa the DBI(ish) and DBD(ish) API design is more important
17:04 llfourn joined
Skarsnik maybe moritz and other people x) 17:04
but do a pull request, people interested will see it at least
abraxxa if someone really has concerns about breaking the DBIish/DBDish api at this time I'd start a new module which api isn't 100% based on Perl 5 DBI 17:05
hoelzro sftf: are you planning on embedding Perl 6 in C/C++, or just having your Perl 6 code be extendable by user-provided, untrusted Perl 6 code?
abraxxa but I don't see a problem breaking it now as there isn't even versioning
Skarsnik: ok
17:05 perl6newbee joined
sftf hoelzro: "Perl 6 code be extendable by user-provided, untrusted Perl 6 code" 17:06
17:06 AlexDaniel joined
orbus my impression was DBIish was a stopgap measure until the "real" perl6 database system could be implemented - but such stopgaps have a way of becoming the final solution 17:06
sftf but mabe (semi)trusted
Skarsnik abraxxa, I think if you don't touch at all the old fetch_stuff you will have no issue
hoelzro ah ha
abraxxa Skarsnik: I haven't looked at all those methods and decided if I like them or not 17:07
hoelzro sftf: I don't know if you can do that (yet), but it would be nice/difficult to allow EVAL to load code under a restricted setting
abraxxa the one part that doesn't make sense to have an API which just returns Str's as everybody can do .Str if he wants
Skarsnik abraxxa, I did not look at them either, that why I rewrite the row stuff complety 'from' scrach
abraxxa Skarsnik: I think the new method names could be better too 17:08
Skarsnik The doc advice to use row/allrows that does not returns Str :)
Well nobody say a thing x)
abraxxa and I'd love to get ribasushis and msts opinion about a DBI API in regards to what downstream as in DBIx::Class would love to have
mst: ^^ 17:09
ribasushi: ^^
17:09 llfourn left
Skarsnik I wanted to use rows, not row, but it used (by nobody probably) to get the number of result 17:10
abraxxa and another big point regarding modules in general if we want to establish a way of having versionable APIs right in Perl 6 or its toolchain so not every module author has to think about that him/herself
as in 'if you break the API you HAVE TO increase the major version number'
get-row?\ 17:11
abraxxa loves the dash in method names
ugexe :api<...>?
abraxxa i remember that was one of the WTF moments about 15 years ago when I first came in touch with Perl 5
why the hell can't I use the dash char in sub names?
sftf hoelzro: so I try to understand the ability to filter the source code somehow, but as I see it's the wrong way
abraxxa I should probably start a discussion about the module api versioning in the new git repo 17:12
or is there a mailing list that's preferred?
17:14 skids joined
abraxxa Skarsnik: PR sent 17:16
ugexe: is your suggested syntax something that Perl 6 provides already? 17:18
seen lizmat? 17:19
ugexe use Some::Module:auth<*>:ver<*>:api<*>; exists, but im not sure about actually handling how modules will implement api versioning 17:22
abraxxa is there a synopsis for it? 17:23
S11
not sure if :ver and :api are overengineered 17:24
having the api version level in the module version would ensure sane versioning
mst :ver is definitely overengineered, but can be used for semver just fine 17:26
:ver(v1.3.*) for example
mst wonders if we want plain v1.2.3 to mean >= 1.2, < 2 or not 17:27
abraxxa there isn't much talk about :api in S11 17:28
17:28 zakharyas left
abraxxa mst: S11 says that v1.2.3 means only this exact version 17:28
mst I don't think, tbh, anybody has any idea what :api is going to end up being used for in the wild
ugexe i thought the same thing about :api<>. maybe if a distribution could provide multiple api versions was the intention
abraxxa you can do :ver<1.2.*> or use Dog:ver(v1.2..^v2); 17:29
mst oh, of course, if a dist produces e.g. a v1 compat layer
abraxxa i'd define the current DBIish as :api<0> and go on if it was possible
mst abraxxa: I fully intend to carve out a minimal subset of S11/S22 that we focus on first, btw
:ver is smartmatch so can very rapidly go turing complete 17:30
abraxxa I was just wondering if the module has to implement all api versions or if that is handled by having additional, older versions of the module installed in parallel (preferred)
mst er, no, it doesn't have to
abraxxa that would be great from a module authors perspective because it makes breaking the api and not having to drag around old code easy 17:31
where can I find the docs how modules are found and loaded? do they map to files like in Perl 5? I guess yes but with differences 17:32
or is that depending on the compiler used? 17:33
masak m: say v1.2.3 ~~ v1.2 17:34
camelia rakudo-moar 770d10: OUTPUT«True␤»
masak mst: ^
ugexe src/core/CompUnit/*
abraxxa ugexe: the beginning of S11 explains it quite good
abraxxa sees mst implementing a CompUnitRepo for remote class loading ;) 17:35
mst masak: ooooh 17:36
abraxxa: I've totally been thinking about that
17:36 kid51 left
ugexe abraxxa: CompUnitRepo does not even exists anymore 17:37
take s11 and s22 with a grain of salt
abraxxa ugexe: S11 mentions it, haven't looked in Rakudo
17:37 scz left
abraxxa i thought those ARE the v6.c specs? 17:38
then the roast tests are the spec?
17:39 chacewells left 17:41 scz joined, molaf joined 17:43 dakkar_ left 17:48 raiph left
abraxxa 'installing' could be just: launch the app, the Perl 6 interpreter loads the modules from the (Internet/CPAN and/or company) repo and caches them locally for the next launch 17:48
http caching headers are used for update checks
I think that might blew some devs head away ;) 17:49
ugexe i wrote a compunitrepo::github that did that a year or so ago
abraxxa would require https and signed modules/dists for security though
ugexe: awesome!
Skarsnik abraxxa, hm you get conflcit. did you forget to rebase? 17:50
abraxxa Skarsnik: I haven't rebased the last three or four commits but they only touched Pg as far as I saw 17:51
Skarsnik If you changed num to rat that probably why it conflict 17:52
abraxxa yes
should I rebase and send the PR again?
I wouldn't want to merge the PR but rebase it so no merge commit is generated
Skarsnik rebase with ff? 17:53
I am not good with git x)
abraxxa Skarsnik: I could do It but I'm not sure if I have rights on the DBIish repo 17:54
Skarsnik on your fork
abraxxa also I'd like to leave it open for a few days so others can voice their opinions
Skarsnik You can still work on the PR
abraxxa really? how? 17:55
Skarsnik well you repo
and the PR will have the new commit added
abraxxa i see
then I might do that
not now because I have to catch my train
Skarsnik x)
abraxxa bye! 17:56
17:56 abraxxa left 17:59 xpen joined
masak mst: yes, using smartmatching for versions feels Very Right 18:00
one of the things about :ver that feels, not overdesigned, but well-designed 18:01
mst masak: smartmatching against ranges is definitely very right
masak: the fact you can manage to pass a closure is the part I'm less fond of :)
masak hm, I'm not sure I know which part that is. do you have an example? 18:03
18:04 ChoHag joined
ugexe m: use Test:ver({$_.parts[0] > 5}); 18:04
camelia ( no output )
18:04 xpen left
TimToady it's okay to have a restricted subset of smartmatching for things we have to store externally 18:04
18:05 cschwenz joined, espadrine left, llfourn joined
cschwenz o/ #perl6 18:05
18:09 _mg_ left 18:10 llfourn left
cschwenz .botsnack 18:12
yoleaux :D
18:16 sftf left 18:22 prammer left, cschwenz left
flussence TimToady: does "ranges and scalars" sound like a reasonable subset? can't really think of anything else that'd fit besides those, closures and junctions... 18:23
18:24 _mg_ joined 18:25 musiKk joined
TimToady junctions might be possible, but it really needs to be driven from the implementability end, just with the constraint that it should be extensible in the direction of fuller smartmatches someday without breaking 18:25
it's hard to store closures in a database 18:26
there are also potential security issues there 18:28
jnthn Closure serialization is decidedly the most gnarly part of our module pre-comp serialization.
TimToady it's hard enough on a system you trust
jnthn (As in, I don't wish it upon anyone :))
That also
18:29 prammer joined, n0vacane joined
flussence any()/| makes sense to allow, none() and one()/^ sorta do, all()/& in a version specifier just seems silly 18:29
PerlJam Greetings! 18:30
TimToady allowing injection attacks into your dependency calculations seems...fraught...
18:33 n0tjack left 18:34 n0tjack joined 18:38 _Vi left
mst I think starting off with something with no greater flexibility than the CPAN::Meta version spec is a good first cut 18:39
18:39 ojvcakgo left
mst I also think we need to version the heck out of formats so it can 'be extensible in the direction of fuller smartmatches' even in spite of the fact we'll probably screw something up there even if we're trying to avoid it 18:39
and CPAN::Meta mostly comes down to 'ranges and scalars' plus room to have >1 requirement 18:40
dalek osystem: 207f05d | RabidGravy++ | META.list:
Add Tinky

  github.com/jonathanstowe/Tinky
mst all(v1.3.*, !v1.3.27) would be nice
of some sort
i.e. "we can use any 1.3.* version except the one we know has a bug that screws us up" 18:41
flussence m: say $_ ~~ all(v1.3.*, none(v1.3.27)) for v1.3, v1.3.27.1, v1.3.27
camelia rakudo-moar 770d10: OUTPUT«False␤False␤False␤»
flussence hrm 18:42
m: say $_ ~~ all(v1.3.*, !v1.3.27) for v1.3, v1.3.27.1, v1.3.27
camelia rakudo-moar 770d10: OUTPUT«False␤False␤False␤»
18:42 n0tjack left
flussence nesting junctions leads to madness 18:42
18:43 Actualeyes left
ilmari m: say !v1.3.27 18:43
camelia rakudo-moar 770d10: OUTPUT«False␤»
ilmari would it be perverse to verride &prefix:<!>(Version) to return a negative-matching object? 18:44
flussence m: say $_ ~~ v1.3.* ^ v1.3.27 for v1.3, v1.3.0, v1.3.27, v1.3.27.1 # works, but you can't have variable-length versioning 18:46
camelia rakudo-moar 770d10: OUTPUT«False␤True␤False␤False␤»
18:46 musiKk left
CIAvash I'v encountered a weird issue, I think. here's the code: gist.github.com/CIAvash/1af6cd0fb167526ba847 18:47
It gives this error: 'Type check failed for return value; expected Array[Str] but got Array[Str].new("", "", "")'
It works when I remove `use B;` or change Str in `has Str @.arr` to something else or change @.arr to $.arr 18:48
ilmari flussence: the v1.3.27.1 case is fixed by doing ^ v1.3.27.* 18:51
but not the v1.3 case
18:52 lnrdo left 18:54 marmay_ joined
TimToady ilmari: yes, it would be perverse, since junctions are supposed to collapse in boolean context 18:55
and ! is very definitely a boolean context
18:56 firstdayonthejob joined 18:57 ely-se joined 18:58 pjscott joined, pjscott left 18:59 lokien_ left
skids CIAvash: That looks buggy. Especially the part where "use B" does anything at all. Probably worth filing an RT for it. 19:00
ely-se Morning, camels. 19:01
CIAvash skids: Yeah. Not sure how to describe the bug! :) 19:02
19:05 perl6newbee left 19:07 llfourn joined
skids CIAvash: I dunno maybe "spurious return type check error caused by irrelevent inclusion from another compunit"? 19:07
19:07 lokien_ joined 19:09 lp joined, hankache joined
hankache hello #perl6 19:09
19:09 n0tjack joined 19:10 lp left
lokien_ waves 19:10
ely-se
.oO(Google Wave)
19:12
19:12 llfourn left, avalenn_ joined, avalenn left 19:13 Sgeo left
gfldex CIAvash: if you add a method to B it works too 19:17
19:21 snarkyboojum joined
CIAvash rt.perl.org/Public/Bug/Display.html?id=127309 19:23
gfldex: any method? I tried now it didn't work. 19:24
19:25 _mg_ left
gfldex CIAvash: gist.github.com/0fdba2e12c14baa655e2 19:28
19:28 snarkyboojum left
CIAvash gfldex: You used Array instead of `Array of Str`. I think that's why it works. 19:31
gfldex nvm then
19:35 Sgeo joined 19:36 _Vi joined
CIAvash I think this used to work before 6.c. But doesn't work anymore: 19:41
m: class A { has Int @.arr }; my %attributes = arr => (1,2,3); A.new: |%attributes;
camelia rakudo-moar 770d10: OUTPUT«Type check failed in assignment to @!arr; expected Int but got List␤ in block <unit> at /tmp/AU7Uz_txhT line 1␤␤»
Skarsnik can someone tell me if this branch (git clone github.com/Skarsnik/gptrixie.git -b reftype) segfault?
CIAvash Has something changed?
Skarsnik I think there is an issue with |
m: class A { has Int @.arr }; my %attributes = arr => (1,2,3); say |%attributes;
camelia rakudo-moar 770d10: OUTPUT«Unexpected named parameter 'arr' passed␤ in block <unit> at /tmp/ndiwCYNruZ line 1␤␤»
Skarsnik m: class A { has Int @.arr }; my %attributes = arr => (1,2,3); say %attributes.flat; 19:42
camelia rakudo-moar 770d10: OUTPUT«(arr => (1 2 3))␤»
Skarsnik m: class A { has Int @.arr }; my %attributes = arr => (1,2,3); say (|%attributes);
camelia rakudo-moar 770d10: OUTPUT«(arr => (1 2 3))␤»
Skarsnik I had the same issue with pgarray 19:43
it try to put a Array of Array of Int in @.arr 19:44
19:44 Sgeo_ joined
Skarsnik you gain an extra level of array for fun 19:44
CIAvash Yeah. So it's a bug?
Skarsnik m: class A { has @.arr }; my %attributes = arr => (1,2,3); my $b = A.new: |%attributes; say $b.arr; 19:46
camelia rakudo-moar 770d10: OUTPUT«[(1 2 3)]␤»
Skarsnik for me it's a bug but
CIAvash Has it been reported? 19:47
19:47 Sgeo left
Skarsnik jnthn and nine explain me that it has to do with hash value being always scalar, but I don't get why it always end with an extra level of array 19:48
for me it's a bug, yes
jnthn It's not a bug. Learn how scalars work.
m: my %h = a => [1,2,3]; my @b = %h<a>; say @b.perl 19:49
camelia rakudo-moar 770d10: OUTPUT«[[1, 2, 3],]␤»
Skarsnik m: class A { has @.arr }; my %attributes = arr => (1,2,3); say %attributes<arr>.WHAT; say %attributes<arr>.VAR.WHAT;
camelia rakudo-moar 770d10: OUTPUT«(List)␤(Scalar)␤»
jnthn Also nothing to do with attributes and everything to do with assignment.
19:50 sno left
Skarsnik m: my Str @a = "hello".comb; my %attributes; %attributes<arr> = @a; say %attributes<arr>.WHAT; say %attributes<arr>.VAR.WHAT; 19:50
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤»
Skarsnik It's lieing here then
since it end in an Array of Array of Str 19:51
19:51 bjz left
CIAvash Passing attributes was just something I needed to do. And I think it would work before 6.c. That's why I was surprised. 19:51
Skarsnik m: my Array[Str] $a = "hello".comb; my %attributes; %attributes<arr> = $a; say %attributes<arr>.WHAT; say %attributes<arr>.VAR.WHAT; 19:52
camelia rakudo-moar 770d10: OUTPUT«Type check failed in assignment to $a; expected Array[Str] but got Seq␤ in block <unit> at /tmp/7l4l7mmcSG line 1␤␤»
19:52 bjz joined
Skarsnik m: my Array of Str $a = "hello".comb; my %attributes; %attributes<arr> = $a; say %attributes<arr>.WHAT; say %attributes<arr>.VAR.WHAT; 19:52
camelia rakudo-moar 770d10: OUTPUT«Type check failed in assignment to $a; expected Array[Str] but got Seq␤ in block <unit> at /tmp/TlYk0SBP1n line 1␤␤»
jnthn Skarsnik: No, it's not lieing at all. It's that the assignment of an item into an array always gives you an array of one item.
m: my @a = [1,2,3]; say @a.perl # not an item 19:53
camelia rakudo-moar 770d10: OUTPUT«[1, 2, 3]␤»
jnthn m: my @a = $[1,2,3]; say @a.perl # an item
camelia rakudo-moar 770d10: OUTPUT«[[1, 2, 3],]␤»
Skarsnik m: my Str @a = "hello".comb; my $a = @a; my %attributes; %attributes<arr> = $a; say %attributes<arr>.WHAT; say %attributes<arr>.VAR.WHAT;
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤»
jnthn m: my @a = (my %h = a => [1,2,3])<a>; say @a.perl # an item because a Hashes values are Scalars
camelia rakudo-moar 770d10: OUTPUT«[[1, 2, 3],]␤»
Skarsnik m: my Str @a = "hello".comb; my $a = @a; my %attributes; %attributes<arr> = $a; say %attributes<arr>.WHAT; say %attributes<arr>.VAR.WHAT; say %attributes<arr>; 19:54
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤[h e l l o]␤»
Skarsnik jnthn, how is not lying on the WHAT? it should say it's an Array, not give the type of the first element 19:56
19:56 lichtkind joined
jnthn Skarsnik: But at that point it *is* a Scalar holding an Array. And then you assign that into *another* array. 19:57
Assignment is not binding. That is, my @a = @b; does *not* make @a refer to the same array as @b, it puts the things from @b into @a. 19:58
mspo @a := @b is a reference, right?
confusing from golang ;) 19:59
jnthn @a := @b # means @a and @b point to the same data structure, yes
m: my @b = 1..3; my @a = @b; @b.push(4); say @a
camelia rakudo-moar 770d10: OUTPUT«[1 2 3]␤»
gfldex are @a and @b individual containers? 20:00
jnthn m: my @b = 1..3; my @a := @b; @b.push(4); say @a
camelia rakudo-moar 770d10: OUTPUT«[1 2 3 4]␤»
jnthn gfldex: In which case? In the assignment one, yes
If you individual you mean distinct bunch of storage slots
*If by 20:01
Skarsnik m: my Str @a = "hello".comb; my %a; %a<arr> = @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say %a<arra>;
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤(Any)␤»
Skarsnik m: my Str @a = "hello".comb; my %a; %a<arr> = @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say %a<arr>;
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤[h e l l o]␤»
MadcapJake i can't seem to capture a «$» in a regex
Skarsnik even with '$' ?
ely-se I think ws should be uppercase (WS) like TOP
masak m: say '$' ~~ /'$'/
camelia rakudo-moar 770d10: OUTPUT«「$」␤»
DrForr \$, '#' or <[ $ ]> should all do the trick. 20:02
masak MadcapJake: ^
DrForr s/#/\$
gfldex m: my @a; my @b; say @a.WHERE, @b.WHERE; @a := @b; say @a.WHERE, @b.WHERE;
camelia rakudo-moar 770d10: OUTPUT«139651022082440139651022082576␤139651022082576139651022082576␤»
MadcapJake ohh i know what my problem is, im wrapping my test string in double quotes :P
Skarsnik m: my Str @a = "hello".comb; my %a; %a<arr> = @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say %a<arr>; say (|%a);
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤[h e l l o]␤(arr => [h e l l o])␤»
gfldex m: my @a; my @b; say @a.WHERE,' ', @b.WHERE; @a := @b; say @a.WHERE,' ',@b.WHERE;
camelia rakudo-moar 770d10: OUTPUT«140108190378984 140108190379120␤140108190379120 140108190379120␤»
Skarsnik m: class F {has Str @.arr}; my Str @a = "hello".comb; my %a; %a<arr> = @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say %a<arr>; say (|%a); say C.new(|%a); 20:03
camelia rakudo-moar 770d10: OUTPUT«5===SORRY!5=== Error while compiling /tmp/t7NQZDrBoO␤Undeclared name:␤ C used at line 1␤␤»
Skarsnik m: class F {has Str @.arr}; my Str @a = "hello".comb; my %a; %a<arr> = @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say %a<arr>; say (|%a); say F.new(|%a);
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤[h e l l o]␤(arr => [h e l l o])␤Type check failed in assignment to @!arr; expected Str but got Array[Str]␤ in block <unit> at /tmp/ysVQUjNUSK line 1␤␤»
RabidGravy boom!
MadcapJake masak, DrForr: thanks! it was a double quote trap xD
Skarsnik And now I don't get it
masak MadcapJake: only use double quotes if you're willing to take the consequences :P 20:04
Skarsnik |%a display me an Array of Str, not an Array of Array
MadcapJake masak: i want to make my editor warn me with a beep or a popup anytime I enter a double quote!
RabidGravy well they mean different things in different languages 20:05
Skarsnik and why my gptrixie code segfault at parse lol 20:06
20:06 xdoctor joined
RabidGravy nothing like a segfault, to get the blood flowing 20:07
Skarsnik I rakudobrew nuke, rebuild moar; move into another directly and it keep segfaulting x) 20:08
20:08 llfourn joined
Skarsnik maybe I should remove other file x) 20:08
mspo Skarsnik: I tried gptrixie but I was getting bad stuff from gccxml I think
20:08 spider-mario joined
mspo Skarsnik: check ~/.perl6/ for cached objects 20:09
Skarsnik Na, it's perl6 that sigsev
mspo Skarsnik: sorry- two topics :)
Skarsnik: when I ran it against mdb
Skarsnik: do check ~/.perl6 and clear it out; I was also getting segv's when I forgot to have "use v6;" in my file
Skarsnik Oo 20:10
hm did it crash on mdb?
mspo gccxml was the trouble
gfldex m: class F {has Str @.arr}; my Str @a = "hello".comb; my %a; %a<arr> = @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say %a<arr>; say (|%a); dd %a; say F.new(arr=>%a<arr>.list); 20:11
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤[h e l l o]␤(arr => [h e l l o])␤Hash %a = {:arr(Array[Str].new("h", "e", "l", "l", "o"))}␤F.new(arr => Array[Str].new("h", "e", "l", "l", "o"))␤»
20:11 ely-se left, yqt joined, perlawhirl joined
perlawhirl hi perlers 20:12
20:12 hankache left
Skarsnik so I can't assign the array to the attrib directly? that look like a bad thing x) 20:12
20:12 hankache joined
Skarsnik *it? 20:12
mspo, what was your gccxml binary?
castxml does not work for c99 for me 20:13
perlawhirl just a quick q. I'm fairly certain that about 2 months ago, 'my Int $x = "25";' was a compile time error... now it's not
am i mistaken, or is this a regression?
20:13 llfourn left
mspo Skarsnik: I just built it from github 20:13
AlexDaniel star: my Int $x = “25”
camelia star-m 2015.09: OUTPUT«Type check failed in assignment to '$x'; expected 'Int' but got 'Str'␤ in block <unit> at /tmp/aQxJhaCzG_:1␤␤»
perlawhirl now it dies at runtime
AlexDaniel perlawhirl: ↑ 2015.09 no compile-time error 20:14
perlawhirl hmm, ok... i'm probably mistaken
Skarsnik Potential difficulties:
The returning type of 'ERR_get_error' --> Int is erroneous. You should not return a non NativeCall supported type (like Int inplace of int32), truncating errors can appear with different architectures
skids m: class F {has Str @.arr}; my Str @a = "hello".comb; my %a; %a<arr> := @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say %a<arr>; say (|%a); dd %a; say F.new(|%a);
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Array[Str])␤[h e l l o]␤(arr => [h e l l o])␤Hash %a = {:arr(Array[Str].new("h", "e", "l", "l", "o"))}␤F.new(arr => Array[Str].new("h", "e", "l", "l", "o"))␤»
Skarsnik hm it's in Panda?
RabidGravy It's OpenSSL
gfldex m: class F {has Str @.arr}; my Str @a = "hello".comb; my %a; %a<arr> = @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say %a<arr>; say (|%a); my $c = |%a; dd $c; 20:15
RabidGravy I saw it earlier and checked
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤[h e l l o]␤(arr => [h e l l o])␤Slip $c = slip$(:arr(Array[Str].new("h", "e", "l", "l", "o")),)␤»
perlawhirl i think it should be picked up at compile time. calling an Int-signatured sub with a Str does, so why not for var assignment 20:16
ugexe can nqp/tools/build/MOAR_REVISION get bumped so it can be built on windows again?
skids m: my %a; my Int @a = 1,2,3; %a<foo> := @a; %a.perl.say
camelia rakudo-moar 770d10: OUTPUT«{:foo(Array[Int].new(1, 2, 3))}␤»
skids m: my %a; my Int @a = 1,2,3; %a<foo> = @a; %a.perl.say 20:17
camelia rakudo-moar 770d10: OUTPUT«{:foo(Array[Int].new(1, 2, 3))}␤»
skids .perl is missing a $
Skarsnik hm still sigsev
skids m: my %a; my @a = 1,2,3; %a<foo> = @a; %a.perl.say
camelia rakudo-moar 770d10: OUTPUT«{:foo($[1, 2, 3])}␤»
skids m: my %a; my @a = 1,2,3; %a<foo> := @a; %a.perl.say
camelia rakudo-moar 770d10: OUTPUT«{:foo([1, 2, 3])}␤»
skids ...but only in the typed case
ergo, confusion
20:18 brrt joined
gfldex m: class F {has Array[Str] $.arr}; my Str @a = "hello".comb; my %a; %a<arr> = @a; say %a<arr>.WHAT; say %a<arr>.VAR.WHAT; say F.new(|%a); 20:20
camelia rakudo-moar 770d10: OUTPUT«(Array[Str])␤(Scalar)␤F.new(arr => Array[Str].new("h", "e", "l", "l", "o"))␤»
skids wonders if an adverbial type constraint on array literals would work out nicely.
[1,2,3]:of(Int)
geekosaur I think that's not really possible? the adverb gets passed to the nearest function/operator 20:21
Skarsnik m: class F {has Array[Str] $.arr}; my Str @a = "hello".comb; my %a; %a<arr> = @a; say F.new(|%a);
camelia rakudo-moar 770d10: OUTPUT«F.new(arr => Array[Str].new("h", "e", "l", "l", "o"))␤»
geekosaur (it's really a named parameter)
Skarsnik m: class F {has @.arr}; my Str @a = "hello".comb; my %a; %a<arr> = @a; say F.new(|%a);
camelia rakudo-moar 770d10: OUTPUT«F.new(arr => [Array[Str].new("h", "e", "l", "l", "o"),])␤»
skids m: [1,2,3]:of(Int)
camelia rakudo-moar 770d10: OUTPUT«Unexpected named parameter 'of' passed␤ in block <unit> at /tmp/SJHqsJ7qpr line 1␤␤»
Skarsnik that really confusing x)
skids I think it is being passed to [] there 20:22
geekosaur probably
&postcircumfix:<< [ ] >>
would be said nearest function
or someting like that 20:23
skids Right, so is that not the same thing creating the array?
Anyway, not a feature we are in desperate need of right away.
20:23 sno joined 20:24 hankache left
gfldex skids: the type constrain is a runtime thing. Array literals are constant. As long as you don't want the type constrain to spill into any container you assign the constant too, it makes little sense to have one. 20:25
Skarsnik mspo, if my installation stop sigseg on gptrixie I will trie with my gccxml x)
20:26 darutoko left
mspo Skarsnik: panda install gptrixie worked for me 20:26
Skarsnik: but I installed my own gccxml
20:26 prammer left
Skarsnik well gptrixie does not have test x) 20:26
mspo Skarsnik: I was getting segv on some very simple nativecode when Ididn't have "use v6;" in my source files 20:27
Skarsnik: unrelated to gptrixie
Skarsnik There is no NC code in gptrixie
skids m: my %a; my Int @a; @a := [1,2,3] # would make sense here, and might also make .perl prettier than having Array[Int].new(…)
camelia rakudo-moar 770d10: OUTPUT«Type check failed in binding; expected Positional[Int] but got Array␤ in block <unit> at /tmp/rJ6MMOJhcX line 1␤␤»
mspo weird
Skarsnik now I am worried. I rm .perl6 and removed the install in rakudobrew, removed the precomp file in the project, then rebuild everything and it still sigseg at the parse stage 20:29
root@testperl6:~/piko/gptrixie# perl6 --stagestats -I lib bin/gptrixie
Stage start : 0.000
Stage parse : Erreur de segmentation
skids time to go buy more caffeine.
20:32 _mg_ joined 20:33 perlawhirl left
brrt Skarsnik: what's your platform 20:34
Skarsnik debian stable 32bits
brrt also, is this sensitive to MVM_JIT_DISABLE=1
hmm... that wold give a bus error then 20:35
MVM_SPESH_DISABLE=1?
20:35 ifim left
n0tjack if I have two Bags, how can I find the Bag difference between them? (For example, if one Bag has 7 "a"s and the other has 4 "a"s, the resulting bag should have 3 "a"s.) 20:35
Skarsnik I never have this issue x) 20:36
20:36 TEttinger joined
brrt it shouldn't happen imho 20:38
20:38 prammer joined
masak m: say bag("a" xx 7) (-) bag("a" xx 4) 20:38
camelia rakudo-moar 770d10: OUTPUT«bag(a(3))␤»
masak n0tjack: ^
n0tjack what's with the (-) around the - ? 20:39
masak++ btw
masak n0tjack: the `(-)` is the entire operator
it's only meant to remind you of subtraction
n0tjack wow, operators can be spelled with ()s? that smells risky.
masak operators can be spelled however you like
can't have spaces in them, though
n0tjack yeah the - made intuitive sense; my first attempt at doing the difference was straight -
masak but that's the only limitation I know
brrt we like living dangerously 20:40
masak n0tjack: straight - will numify first -- not what you want
brrt i think we also have the reduce metaop
m: say [*] 1..10;
camelia rakudo-moar 770d10: OUTPUT«3628800␤»
n0tjack masak: so I discovered
masak n0tjack: one key to understanding Perl operators is to realize that - will only ever do subtraction
n0tjack: and that principle holds "all the way"
n0tjack: for example, + and ~ *have* to be two different operators
n0tjack why?
masak they can't be the same operator, because they do two different things 20:41
string concatenation is not numeric addition
brrt one is on numbers, other is on strings
n0tjack I meant why in the philosophical sense
brrt same thing in perl5, to its great virtue
n0tjack plenty of languages overload operators with different semantics depending on type
masak because Perl is an operator-oriented language
that's the philosophical answer
brrt yeah, and plenty of people give funnily-meant WAT talks about those
n0tjack let me think on that
masak n0tjack: in other languages, people load type differences into the nouns. Perl tends to load type differences into the verbs 20:42
geekosaur polymorphic operators + dynamic types = WTF when you accientally pass something of the wrong type
masak that's also a reason why Str has .chars and Array has .elems, by the way :)
brrt (into the verbs) depending on the nouns, in perl6
n0tjack masak: but the operators (verbs) aren't polymorphic in P6
20:42 kid51 joined
Skarsnik ok it segfault too on a debian testing 32bits 20:42
masak n0tjack: not by default, no
n0tjack: that's part of my point -- they're monomorphic 20:43
brrt Skarnsik: hang on, i'mma get a VM
geekosaur worse, it's usuallya runtime WTF that you might only find out about when you get a weird result
masak n0tjack: the guarantee in Perl is that when you see a - you *know* that it's numeric subtraction
n0tjack masak: I mean, overall I like the p6 structure and philosophy; I'm just trying to get a sense of the rationale behind choices like this
geekosaur no error thrown, just bizarre output
mspo except when it's in a name-like-this
n0tjack I've read the Synopses but they don't stick in my head
masak mspo: yeah but :) 20:44
n0tjack masak: ok, that makes sense
masak: principle of least surprise
Skarsnik brrt, try checking out the reftype branch github.com/Skarsnik/gptrixie/tree/reftype
mspo or -- or (-) but yeah :)
masak n0tjack: there are no absolute rights or wrongs here. it's just a design decision that runs fairly deep in Perl.
mspo: well, `(-)` is a different operator 20:45
brrt Skarsnik: are you getting bugs on perl6, or on your tool?
masak mspo: it's only meant to remind you of `-`
mspo: as is `--`
20:45 lnrdo joined
Skarsnik it's not the tool 20:45
brrt oh, ok
mspo * is highly overloaded :)
brrt good :-)
Skarsnik It did not even reach a BEGIN { say "hello" }
brrt * is a verb
in perl6, at least
mspo it's multiplication or curry-magic ;) 20:46
n0tjack * is a a Whatever, it's a Kleene Start, it's Multiplication, it's got some unary interpretation, I imagine...
Kleen Star
brrt Skarsnik: can you file a MoarVM issue? i'll look at it tomorrow further
Skarsnik the issue it worked, I added some code, it sigseg. I commented the code, no luck xD 20:47
I can try on 64 bits
brrt plesae do...
my sleep-avoidance buffers are running low. see you tomorrow 20:48
Skarsnik good night ^^
20:48 brrt left 20:49 kaare_ left 20:50 kaare_ joined, kjs_ left
Skarsnik ok sigseg too on x64 with an 'old' rakudo 20:51
dafuq this code
20:52 dfcarpenterak left 20:56 kaare_ left 20:58 virtualsue left 20:59 musiKk joined, dfcarpenterak joined
masak n0tjack: those uses are all disambiguated by context and position. 21:01
21:02 revhippie joined, alpha123 joined
masak n0tjack: because the Perl parser is very careful with knowing whether it's seeing a term or an operator, it knows that the * in `4 + *` is a whatever term, but the * in `1 * 2` is an infix operator representing multiplication 21:02
n0tjack: recognizing and disambiguating the Kleene star is even easier, since it's a postfix operator in the regex slang. 21:03
n0tjack: the "unary" interpretation you're thinking of is probably `*@foo` in parameter lists. I hesitate to call that an operator, though, because the parameter slang is not really an expression language. :) 21:04
(for example, things don't nest arbitrarily. the `*@foo` parameter does not become a term that you could then apply more operators to) 21:05
'night, #perl6
21:09 llfourn joined 21:10 espadrine joined
n0tjack night masak 21:13
21:13 n0vacane left 21:14 llfourn left, lnrdo left 21:15 zacts joined, dfcarpenterak left
AlexDaniel n0tjack: though “* * *” indeed looks scary :) 21:15
m: say (* * *)(2, 5) 21:16
camelia rakudo-moar 770d10: OUTPUT«10␤»
AlexDaniel m: say (* × *)(2, 5)
camelia rakudo-moar 770d10: OUTPUT«10␤»
AlexDaniel n0tjack: and we are still waiting for this magic man to come and find the right non-texas version of whatever star :) 21:17
21:18 marmay_ left
AlexDaniel m: say {$^a × $^b}(2, 5) 21:18
camelia rakudo-moar 770d10: OUTPUT«10␤»
AlexDaniel m: say -> $a, $b {$a × $b}(2, 5) 21:19
camelia rakudo-moar 770d10: OUTPUT«10␤»
AlexDaniel m: say sub ($a, $b) {$a × $b}(2, 5)
camelia rakudo-moar 770d10: OUTPUT«10␤»
geekosaur .u 2a33 21:20
yoleaux U+2A33 SMASH PRODUCT [Sm] (⨳)
AlexDaniel m: say anon sub foo($a, $b) {$a × $b}(2, 5)
camelia rakudo-moar 770d10: OUTPUT«10␤»
geekosaur granted, that looks like a fuzball in my client >.>
AlexDaniel .u 𖡄 21:22
yoleaux U+16844 BAMUM LETTER PHASE-A UNKNOWN [Lo] (𖡄)
21:22 CIAvash left
RabidGravy are there any more than callsame/callwith/nextsame/nextwith/samewith ? they keep confusing me when I think I understand them 21:23
21:23 geraud joined
AlexDaniel RabidGravy: samewith?? 21:23
.u ⊨ 21:24
yoleaux U+22A8 TRUE [Sm] (⊨)
AlexDaniel .u ⊭
yoleaux U+22AD NOT TRUE [Sm] (⊭)
RabidGravy calls the same named multi with new different arguments
AlexDaniel .u 〃 21:27
yoleaux U+3003 DITTO MARK [Po] (〃)
orbus anybody got any tips for writing tests for stuff that may block indefinitely? 21:30
(I don't want it to block, but it might in a failure case) 21:31
21:32 azawawi joined
orbus there doesn't seem to be a good way to implement timeouts on like Channel.receive 21:33
azawawi hi
21:33 n0tjack left
skids orbus: Promise.anyof(start{ thing }, Promise.in(5)) or somesuch. 21:34
orbus that will work for promises
what about channels though
you can await a channel
but you can't anyof it
once you start channel.receive, it seems like it'll just block forever 21:35
unless it receives something
AlexDaniel .u ⋅
yoleaux U+22C5 DOT OPERATOR [Sm] (⋅)
21:35 bjz left
daxim .u ∘ 21:35
yoleaux U+2218 RING OPERATOR [Sm] (∘)
orbus is writing a subclass of Channel and trying to write tests for it 21:36
until I get it right, it tends to block a lot
I'd rather not have my test suite hang indefinitely if I do something wrong 21:37
skids orbus: just let it block inside the start { }. If it does, the .in will finish frst.
orbus yeaaaaaaah, that's true
and for this case that may be sufficient 21:38
in a long running program you probably wouldn't want to do that
21:38 Skarsnik left
AlexDaniel m: gather { take ‘💊’ } 21:38
camelia ( no output )
orbus you could wind up with a ton of start blocks hanging around that will never complete
jnthn orbus: You can .Supply a Channel, if you want to work with it in a reactive rather than blocking manner 21:39
skids orbus: well, we need cancellation to be fully impleeted, really.
jnthn sub receive-async(Channel $c) { $c.Supply.head(1).Promise } 21:40
orbus oh
that's not in the docs
:p
jnthn Ah
orbus at least not in the Channel documentation
jnthn Drop an Issue in the docs tracker if you have a moment :)
orbus mail to rakudobug, or what?
AlexDaniel github.com/perl6/doc/issues/new :) 21:41
jnthn No, github.com/perl6/doc/issues or so
ah, beaten to it
Though I typed it from memory :P
orbus don't have a github account 21:42
suppose I ought to finally set one up
jnthn :)
orbus if I ever get this module done and publish it, I'll need one
azawawi any chance we could have faster Travis CI builds now that we have 2015.12? i.e. skip building `rakudobrew build 2015.12` and use a ready-made image?
orbus I'm writing a bounded subclass of channel
jnthn Ah, k
orbus that blocks if you try to stick too many things in it - potentially dangerous, potentially useful 21:43
jnthn Using a condvar for adding, I guess?
21:43 mohae_ is now known as mohae
jnthn Well, sending for follow the naming scheme... :) 21:43
orbus you probably know all kinds of tricks I don't 21:44
21:44 _mg_ left
orbus nah, there's an internal channel that I'm popping the counter in and out of 21:44
to control access to it
basically there's a counter that keeps track of how many elements are in the channel 21:46
that increments and decrements as stuff is sent and received
21:46 TEttinger left
orbus but then I had to get creative with channels and promises to deal with cases where the channel is full or empty 21:46
it's mostly working
I"m not sure I have everything totally right yet
but when it's done, setting the limit to 0 *should* make it behave like a unix pipe 21:47
(deadlocks and all!)
I also added a nonblocking variant of send
since send can now block
it's all built with channels and promises though - no low level constructs 21:49
mspo here's a quote I got from another chat :) -- Perl6 is for all those who always wanted to do OO raw sendmail.cf; but otherwise it is nice 21:51
21:52 kid51 left
orbus I was reading the slashdot thread from the 6.c announcement the other day 21:52
a lot of it was pretty cringe-worthy
DrForr It's slashdot. Barely attention-worthy. 21:53
mspo langauge pissing contests are amusing
to be young and get passionate about that stuff again... 21:54
orbus yeah
I have a different perspective since I'm not really a capital D Developer anyway
I just write stuff to make my life easier 21:55
mspo I'm just having fun learning a new thing
orbus perl's always been good for that
jnthn orbus: I just quickly hacked together a BoundedChannel the way it first occurs to me to do it. Warning: I'm really tired and about to sleep. :) gist.github.com/jnthn/03e01cba53418c1f0f3c
mspo yes
orbus: perl has always been best for getting you to the bar faster than other tools
orbus jnthn: you are clearly much much smarter than me - I've been poking at it for two days :p 21:56
jnthn Refresh gist; I factored out some dupe :)
orbus let's see 21:57
I'd have to parse this a bit
I'm not using signals - I'm passing promises on internal channels when I need to signal something to another thread
21:57 scz left
orbus and the counter was the only thing that really needed a lock around it, so I used a channel for that too 21:57
otherwise, maybe broadly similar
21:58 n0vacane joined, n0vacane left, n0vacane joined
mspo that's a lot of \foo = callsame() for me to grok quickly 21:58
orbus have to read it a bit closer
mspo speaking of beer
jnthn has probably been teaching concurrency related topics on average monthly over the last few years, so tends to have canned answers for relatively common stuff by now. :) 21:59
orbus true
I see you're using condition variables 22:00
which I didn't understand at all
jnthn Ah
orbus reading the docs
jnthn The guts of channel are built out of cond-var
*cond-vars
orbus ah, now I put two and two together
yeah, what I did is say the channel is full 22:01
and I try to send
there's no more slots
so the sending thread creates a promise and sticks that on an internal channel
then blocks on send
when some other thread comes along and calls receive
jnthn Ah, awaits the Promise?
orbus oh
yes
so then when another thread comes along to receive 22:02
it checks that channel
and pops a promise off it if there are any
then keeps the promise
jnthn Yeah, it's possible to construct something that way.
orbus had to get creative
it's been a good learning exercise anyway 22:03
jnthn :)
orbus that's why I keep popping in here asking concurrency questions
and I have the day off
so I'm just fiddling around
actually I think it's mostly working
that's why I'm trying to write tests
to make sure
but it's hard to write tests for blocking stuff
or multithreaded stuff 22:04
jnthn Indeed
Anyways, I should go get some rest, so I can be useful tomorrow... :) 22:05
'night, #perl6
22:05 _nadim joined
orbus actually there's a couple of internal channels 22:05
because if the channel is empty
timotimo gnite jnthn :)
orbus and a receive is blocking
that caused problems too
have a good one
22:06 kjs_ joined 22:09 prammer left 22:10 llfourn joined 22:13 avs_ joined 22:15 xdoctor left, llfourn left 22:17 prammer joined 22:23 n0vacane left 22:24 rindolf left 22:28 llfourn joined
azawawi ci.appveyor.com/project/azawawi/pe...uild/1.0.3 # OpenCV AppVeyor CI build rolling on windows 7... ugexe++ 22:32
22:35 dfcarpenterak joined 22:39 musiKk left 22:41 vendethiel left
RabidGravy cool 22:42
22:42 FatalNIX left, FatalNIX joined 22:43 _nadim left, _nadim joined 22:44 vendethiel joined, cschwenz joined
cschwenz o/ #perl6 22:45
it's been a long day and i know i am missing something silly
panda install Task::Star 22:46
gives:
env: perl6: No such file or directory
22:46 molaf left
cschwenz echo $PATH gives /Users/cal/perl5/perlbrew/bin:~/.rakudobrew/moar-nom/install/share/perl6/site/bin:~/.rakudobrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 22:46
suggestions on what i am doing wrong? 22:48
ugexe whats your cwd
cschwenz pwd gives /Users/cal
22:49 prammer left
ugexe rakudobrew rehash, then try again? 22:50
cschwenz aha! found it. Mac OS brain damage. said OS doesn't expand ~ in $PATH. replacing ~ with /Users/cal fixed it. :-| 22:51
my terminal is now happily installing Task::Star 22:52
hoelzro o/ cschwenz! 22:53
let's hope it stays happy =)
cschwenz o/ hoelzro! :-D 22:54
bringing perl6 up on my new $work mbp 22:55
it feels good to be back after over two months away
hoelzro nice! a few things have changed, as you may have noticed =) 22:56
cschwenz i keep hearing rumours about this thing called Perl 6.c :-P 22:57
22:57 virtualsue joined 22:58 nadim joined, _nadim left 22:59 lokien_ left
azawawi github.com/azawawi/perl6-opencv # AppVeyor status badge added to README.md :) 23:04
23:04 virtualsue left, vendethiel- joined, vendethiel left 23:05 virtualsue joined 23:08 vendethiel- left 23:11 virtualsue left 23:15 kjs_ left 23:17 Herby_ joined
Herby_ Hello, everyone! 23:17
AlexDaniel o/ 23:20
23:21 RabidGravy left
AlexDaniel .u 🕴 23:21
yoleaux No characters found
AlexDaniel m: ‘🕴’.uniname.say 23:22
camelia rakudo-moar 770d10: OUTPUT«MAN IN BUSINESS SUIT LEVITATING␤»
AlexDaniel m: ‘🕲’.uniname.say
camelia rakudo-moar 770d10: OUTPUT«NO PIRACY␤»
23:31 [Sno] joined
Herby_ Alex. I don't have a good grasp on unicode 23:31
how would I input "MAN IN BUSINESS SUIT LEVITATING", and get an output of that symbol?
23:33 _nadim joined, sno left 23:35 nadim left
leont "\c[MAN IN BUSINESS SUIT LEVITATING]".uniname.say 23:35
m: "\c[MAN IN BUSINESS SUIT LEVITATING]".uniname.say
camelia rakudo-moar 770d10: OUTPUT«MAN IN BUSINESS SUIT LEVITATING␤»
revhippie m: "\c[MAN IN BUSINESS SUIT LEVITATING]" 23:36
camelia rakudo-moar 770d10: OUTPUT«WARNINGS for /tmp/9gp2Vq109g:␤Useless use of constant string "🕴" in sink context (line 1)␤»
Herby_ m: say "\c[MAN IN BUSINESS SUIT LEVITATING]";
camelia rakudo-moar 770d10: OUTPUT«🕴␤»
Herby_ Ahhh, thanks!
m: "\c[NO PIRACY]".say;
camelia rakudo-moar 770d10: OUTPUT«🕲␤»
23:41 lichtkind left
Ulti Hotkeys re: glottal stop instead of question mark it could be Perl 6 related github.com/MattOates/Text--Homoglyph 23:45
dalek c: 74e295f | skids++ | doc/Language/list.pod:
Flesh out Array sections.
23:55
23:55 dfcarpenterak left 23:58 firstdayonthejob left, azawawi left