»ö« 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:02 pmurias left
BooK mmm, same error with the commit before that, it seems 00:02
timotimo masak: thanks for the fantastic laugh you gave me :)
00:03 ptolemarch left, labster left
timotimo BooK: potentially we were trying to make Version more efficient and neglected the possibility of subclassing it 00:04
so it's assuming something is one thing (or type) in all instances, where you replace it with a different thing in your subclass
like, returning a List or Array in a place where it used to be a nqp::list or nqp::hash or something
00:05 cdg joined 00:07 labster joined
BooK timotimo: actually, lizmat knows that I'm trying to subclass it 00:08
timotimo oh 00:13
did you get a --ll-exception of the thing? that could hopefully tell us where it's trying to iterate a P6opaque directly 00:14
it sounds like something's calling nqp::iter on a thing that's a class containing an iterable, rather than using its .iterator or having a directly-iterable object there
m: use nqp; nqp::iter([1, 2, 3, 4])
camelia rakudo-moar 2126ed: OUTPUT«===SORRY!===␤No registered operation handler for 'iter'␤»
timotimo m: use nqp; nqp::iterator([1, 2, 3, 4])
camelia rakudo-moar 2126ed: OUTPUT«Cannot iterate object with P6opaque representation␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: use nqp; nqp::iterator(nqp::list(1, 2, 3, 4)) 00:15
camelia ( no output )
timotimo m: use nqp; nqp::iterator([1, 2, 3, 4].FLATTENABLE_LIST)
camelia ( no output )
timotimo like that
BooK my code is using this to create the new instances:
multi method new(Version: @parts, Str:D $string, Int() $plus = 0) {
that's the definition from Version.pm
sortiz Book, in particular the standard Version cmp expects that $!parts can be uses by the low level nqp::iterator
timotimo well, i'm expecting the problem isn't in your code :)
BooK github.com/rakudo/rakudo/blob/nom/...pm#L21-L23 00:16
sortiz s/uses/used/
Yep, but see: github.com/rakudo/rakudo/blob/781c...on.pm#L134 00:17
timotimo ah, in SET-SELF it directly grabs the $!reified out of the List you pass
BooK so what should I pass it?
00:17 cdg left
BooK right now I'm handing stuff like: Array @v = [0, 99, 0, 0, 0, 0] 00:18
timotimo hm, Array derives from List, right?
m: say List.^mro
camelia rakudo-moar 2126ed: OUTPUT«((List) (Cool) (Any) (Mu))␤»
timotimo right ...
could you output the value of nqp::getattr(nqp::decont(a),Version,'$!parts'), or its .WHAT? 00:21
doesn't have to be in cmp, maybe just after you create an instance of your thing 00:23
sortiz or nqp::getattr(self,Version,'$!parts') after creation.
BooK ok 00:24
00:26 MasterDuke_ joined
BooK if I want to run that in my code, how do I write it ? 00:26
AlexDaniel this is pretty cool: github.com/perl6/doc/issues/114
timotimo also, there's things to consider like can you reach SET-SELF from a subclass? because all the derived "new" candidates will just nqp::create(Version) and there's no version of bless you will get for free by running ".new" 00:27
BooK: all you need is a "use nqp" at the beginning
i should go to bed about now 00:28
00:30 TimToady joined
BooK is there a preferred paste site? 00:30
00:30 BenGoldberg joined
timotimo i often use github's gist, but anything is fine 00:31
BooK paste.scsys.co.uk/523600
MasterDuke_ m: my $*TOLERANCE = .1; say .9 =~= 1
camelia rakudo-moar 2126ed: OUTPUT«False␤»
MasterDuke_ m: my $*TOLERANCE = .1; say 1.1 =~= 1
camelia rakudo-moar 2126ed: OUTPUT«True␤»
MasterDuke_ is ^^^^ expected behavior? 00:32
BooK the code that fails is using the second new
AlexDaniel m: my $*TOLERANCE = .1; say .90001 =~= 1
camelia rakudo-moar 2126ed: OUTPUT«True␤»
sortiz BooK, yep, as timotimo says, that bless worries me 00:33
AlexDaniel m: my $*TOLERANCE = .1; say .90000 =~= 1
camelia rakudo-moar 2126ed: OUTPUT«False␤»
timotimo yeah, when you run that bless, it won't do the necessary setup for the rest of the Version object at all
AlexDaniel MasterDuke_: I'd be interested to see somebody who expected that
timotimo because you're not giving it anything for those values
00:33 ssotka left
sortiz So $!parts is Mu. 00:33
BooK so it should do something like the one above 00:34
MasterDuke_ yeah, it doesn't like what i'd expect
00:34 ssotka joined
timotimo also, i thought in a recent-ish moarvm version i added a piece of extra output for the "with p6opaque representation" thing 00:34
looks like i missed that one
AlexDaniel bisect: my $*TOLERANCE = 0.1; say .9 =~= 1
bisectable AlexDaniel: on both starting points the exit code is 0 and the output is identical as well
BooK so, dropping that broken new runs 12000+ tests instead of 500 :-) 00:35
MasterDuke_ the implementation of =~= has only changed once
timotimo found it, added it.
MasterDuke_ TimToady created it, and then modified it shortly after
timotimo Cannot iterate object with P6opaque representation (Mu) 00:36
^- this would probably have helped immediately
BooK not sure why there's this Str $s is there, I'll just put $v
MasterDuke_ also, why do i have an '_' after my name? pretty sure i didn't type that
timotimo it often happens that you disconnect from your internets, and your old connection stays until it ping-timeouts and blocks the nick you had 00:37
00:37 Zoffix joined
BooK so your client picked it up 00:37
timotimo then, when the server tells your client "that nick is already in use" it'll fallback, usually by adding a number or _ to the name
AlexDaniel MasterDuke_: please do something about it
Zoffix MasterDuke_, it picks max, which is why there's a difference. 00:38
MasterDuke_ yeah, i see why it's doing that, don't know how intentional it is though
00:39 kerframil joined
Zoffix I'd bet on intentional: en.wikipedia.org/wiki/Relative_cha...difference 00:39
MasterDuke_ seems like changing 'abs($a - $b) < ($a max $b) * $tolerance' to 'abs($a - $b) <= ($a max $b) * $tolerance' would "fix" it
Zoffix m: use Test; is-approx .9, 1, :rel-tol<.1> 00:40
camelia rakudo-moar 2126ed: OUTPUT«ok 1 - ␤»
MasterDuke_ nice, i was googling for all sorts of things but never came up with relative change
00:40 silug joined
Zoffix MasterDuke_, you may be right 00:40
Unless I'm really bad at math, I've used the same algo in is-approx 00:41
hmmm
AlexDaniel but this tolerance is not absolute, hmm
Zoffix m: say 2 ≅ -2 00:42
camelia rakudo-moar 2126ed: OUTPUT«True␤»
Zoffix bug \o/
MasterDuke_ for absolute it's 'abs(a.Num - b.Num) < $tolerance'
AlexDaniel Zoffix: /o\
Zoffix missing abs
m: say -∞ ≅∞ 00:43
camelia rakudo-moar 2126ed: OUTPUT«False␤»
Zoffix m: say -1e100 ≅ 1e100
camelia rakudo-moar 2126ed: OUTPUT«True␤»
Zoffix giggles
I'll submit a PR
AlexDaniel m: my $*TOLERANCE = 0.1; say 95 =~= 100
camelia rakudo-moar 2126ed: OUTPUT«True␤»
AlexDaniel I'm not sure if I understand it
BooK thanks timotimo, sortiz and AlexDaniel 00:44
Zoffix m: say 100*.1 < 5
camelia rakudo-moar 2126ed: OUTPUT«False␤»
Zoffix m: say 100*.1
camelia rakudo-moar 2126ed: OUTPUT«10␤»
AlexDaniel so 0.1 is basically 10% 00:45
Zoffix Ah, the >
AlexDaniel, right, 10% of max, which is 10, they can differ by 10, so 90 ^..^ 110 will give True
AlexDaniel Zoffix: um 00:46
Zoffix ?
AlexDaniel 10% of 110 is something different
BooK so $*TOLERANCE is multiplicative and the initial issue was that .9 + .9*.1 == .99
AlexDaniel which is why this works 00:47
m: my $*TOLERANCE = 0.1; say 111 =~= 100
camelia rakudo-moar 2126ed: OUTPUT«True␤»
Zoffix AlexDaniel, right, when RHS is 100, left one can be 90 ^..^ 110
BooK m: my $*TOLERANCE = 0.1; say .9 =~= 1, 1 =~= .9;
camelia rakudo-moar 2126ed: OUTPUT«FalseFalse␤»
Zoffix AlexDaniel, oh, I see what you mean
Yeah, it'd pick the bigger one
BooK ok, so I misunderstood too :-)
MasterDuke_ m: say (90 ^..^ 110).map( {my $*TOLERANCE = .1; $_ =~= 100} ) 00:48
camelia rakudo-moar 2126ed: OUTPUT«(True True True True True True True True True True True True True True True True True True True)␤»
Zoffix m: say (90 ^..^ 120).map( {my $*TOLERANCE = .1; $_ =~= 100} )
camelia rakudo-moar 2126ed: OUTPUT«(True True True True True True True True True True True True True True True True True True True True True False False False False False False False False)␤»
Zoffix It uses $*TOLERANCE * 100 percent of the largest value 00:49
AlexDaniel m: my $*TOLERANCE = 0.1; say 111.1111111 =~= 100
camelia rakudo-moar 2126ed: OUTPUT«True␤»
AlexDaniel m: my $*TOLERANCE = 0.1; say 111.1111112 =~= 100
camelia rakudo-moar 2126ed: OUTPUT«False␤»
AlexDaniel ok, so =~= compares the numbers magically. You can't tell what's going to happen off the top of your head 00:50
timotimo yup 00:51
That's A Feature™
Zoffix It compares relative diff. ¯\_(ツ)_/¯ 00:53
MasterDuke_ but it's currently not very well documented
sortiz m: 00:54
AlexDaniel MasterDuke_: by “not very well documented” you mean not documented at all?
MasterDuke_ =~= and ≅ are in the unicode <-> texas table, but that's it 00:55
sortiz dinner&
MasterDuke_ not in the operator docs
i've thought about writing something up, but wanted to clarify the expected behavior first 00:57
AlexDaniel github.com/perl6/doc/issues/601
MasterDuke_ i also have some more tests written in my repo, but again, wanted to make sure i tested the "right" behavior 00:59
01:01 ssotka left 01:02 sortiz left
Zoffix m: "&[wat]" 01:04
camelia rakudo-moar 2126ed: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing infix inside []␤at <tmp>:1␤------> 3"&[7⏏5wat]"␤ expecting any of:␤ double quotes␤ infix␤ infix noun␤ infix stopper␤ term␤»
Zoffix Was it it doing?
AlexDaniel m: say "&[-](5, 2)" 01:06
camelia rakudo-moar 2126ed: OUTPUT«3␤»
AlexDaniel dunno
Zoffix m: "&say('meow')"
camelia rakudo-moar 2126ed: OUTPUT«meow␤»
Zoffix I see
Hotkeys is there a way to create a regex from a string? 01:07
Zoffix m: my $str = '\w+'; my $regex = rx/<$str>/; say 'foo bar ber' ~~ $regex 01:08
camelia rakudo-moar 2126ed: OUTPUT«True␤»
Zoffix .o( True? Where's the match :/ )
m: my $str = '\w+'; my $regex = rx/<$str>/; my $m = 'foo bar ber' ~~ $regex; say $m
camelia rakudo-moar 2126ed: OUTPUT«True␤»
Zoffix m: my $str = '\w+'; my $regex = rx/<$str>/; my $m = 'foo bar ber' ~~ /$regex/; say $m
camelia rakudo-moar 2126ed: OUTPUT«「foo」␤»
Zoffix There we go 01:09
m: my $str = '\w+'; say 'foo bar ber' ~~ m:g/<$str>/
camelia rakudo-moar 2126ed: OUTPUT«(「foo」 「bar」 「ber」)␤»
Hotkeys ah cool
m: my @foo = ["foo", "bar", "baz"]; my $pattern = @foo.join("|"); say "bar" ~~ rx/<$pattern>/ 01:10
camelia rakudo-moar 2126ed: OUTPUT«「bar」␤» 01:11
Hotkeys m: my @foo = ["foo", "bar", "baz"]; my $pattern = @foo.join("|"); say "bam" ~~ rx/<$pattern>/
camelia rakudo-moar 2126ed: OUTPUT«Nil␤»
Hotkeys neato
ty Zoffix
Zoffix m: my @foo = ["foo", "bar", "baz"]; say "bam" ~~ /@foo/
camelia rakudo-moar 2126ed: OUTPUT«Nil␤»
Zoffix m: my @foo = ["foo", "bar", "baz"]; say "baz" ~~ /@foo/
camelia rakudo-moar 2126ed: OUTPUT«「baz」␤»
Zoffix Hotkeys, ^
Hotkeys oh
01:11 molaf left
Zoffix (note that in my version, the contents of @foo are evaluated as strings, without any regex meta chars 01:12
)
Hotkeys m: my @foo = ["foo", "bar", "baz", "bazz"]; say "bazz" ~~ /@foo/
camelia rakudo-moar 2126ed: OUTPUT«「bazz」␤»
01:13 aborazmeh joined, aborazmeh left, aborazmeh joined
AlexDaniel 95 \o/ 01:14
timotimo windows 95?
AlexDaniel no, 95 doc issues 01:15
Zoffix I got 99 problems but a doc ain't one. 01:16
01:20 kurahaupo left, yqt left 01:24 molaf joined 01:31 FROGGS_ joined 01:35 FROGGS left 01:38 jack_rabbit joined 01:45 ilbot3 left 01:46 bjz left 01:47 kid51 left, ilbot3 joined 01:48 bjz joined 01:56 sufrostico left 01:57 Zero_Dogg left, Zero_Dogg joined, Zero_Dogg left, Zero_Dogg joined 02:00 user9 left 02:05 Hor|zon joined
johnjohn101 is the perl 6 project for .net dead? 02:10
AlexDaniel johnjohn101: you mean niecza? Yeah 02:17
02:26 noganex_ joined 02:29 noganex left 02:43 AlexDaniel left
dalek c: 6b0b678 | (Zoffix Znet)++ | doc/Language/testing.pod:
Make it clearer cmp-ok can take a Callable
02:50
02:56 Actualeyes left 02:57 skids left
lizmat . 02:59
yoleaux 16 Jun 2016 14:32Z <FROGGS> lizmat: this describes ac0dcdd very well: github.com/rakudo/rakudo/blob/nom/...angeLog#L9
lizmat FROGGS: thanks
dalek c: 9307750 | (Zoffix Znet)++ | doc/Language/testing.pod:
Expand/Clarify/Reword cmp-ok section
03:02
03:04 rgrinberg joined 03:10 Actualeyes joined 03:26 Ben_Goldberg joined, Ben_Goldberg left 03:30 lizmat left 03:33 BenGoldberg left 03:42 bjz_ joined 03:43 bjz left, huggable joined 03:46 BenGoldberg joined
dalek c: 71c3efb | (Zoffix Znet)++ | doc/Language/testing.pod:
Minor clarifification of Str form of throws-like
03:49
03:55 diakopter joined 03:58 kerframil left 04:01 rgrinberg left, aborazmeh left 04:08 Cabanossi left 04:11 Cabanossi joined 04:19 cooper joined 04:22 telex joined 04:23 kerframil joined 04:37 cooper_ joined 04:39 cooper left 04:42 khw left 04:47 ssotka joined
buharin hi :-) 04:49
04:53 llfourn_ joined, llfourn left 05:05 llfourn_ left 05:07 llfourn joined 05:13 fhorck joined 05:16 BenGoldberg left 05:20 cooper_ left, cooper joined, cooper left, cooper joined 05:28 lol joined 05:30 japhb joined 05:31 jrusso joined 05:34 MadcapJake left, fhorck left 05:38 teatime joined 05:43 mr-foobar left 05:44 lol left 05:54 FROGGS_ left 06:00 lizmat joined, wamba joined 06:08 ssotka left 06:26 jrusso is now known as MadcapJake 06:30 lizmat left 06:34 vendethiel left 06:42 firstdayonthejob left 06:49 pdcawley joined
nine ugexe: why did you close PR 729? 06:49
06:51 stmuk joined 06:52 stmuk left 06:53 domidumont joined 06:55 domidumont left, stmuk joined 06:56 domidumont joined 06:58 stmuk left, stmuk joined 06:59 CIAvash joined 07:08 _mg_ joined 07:10 rkr joined 07:12 abraxxa joined 07:18 patrickz joined, rurban_ joined 07:19 rurban joined 07:22 darutoko joined
buharin hey I find bug in documentation 07:24
grondilu tell us 07:25
buharin I was trying to figure what sign // mean
I looked for // infix 07:26
and here it is
doc.perl6.org/routine/%2F%2F
masak or "and here it isn't" :) 07:27
grondilu I'm not too surprised
buharin if I am trying to find something which is not exist I see error 404 no exist yet or something
but it looks like bugged url 07:28
grondilu using literal slashes in an url is probably a bad idea anyway
doc.perl6.org/language/5to6-perlop...Defined-Or
^here's what you were looking for 07:29
buharin anyway what does infix // mean is it somekind of or
07:29 Lucas_One__ is now known as Lucas_One
buharin m: say "HELLO" 07:30
camelia rakudo-moar 70c19d: OUTPUT«HELLO␤»
buharin m: $*FOO // 'foo'
camelia ( no output )
grondilu m: say $foo // "bar"
camelia rakudo-moar 70c19d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$foo' is not declared␤at <tmp>:1␤------> 3say 7⏏5$foo // "bar"␤»
grondilu oops
buharin m: say "$*FOO // 'foo'"
camelia rakudo-moar 70c19d: OUTPUT«Dynamic variable $*FOO not found␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
grondilu m: say my $ // "bar"
camelia rakudo-moar 70c19d: OUTPUT«bar␤»
buharin m: my $*FOO = 'suck'; say "$*FOO // 'foo'" 07:31
camelia rakudo-moar 70c19d: OUTPUT«suck // 'foo'␤»
grondilu notice that it's "defined or" not "declared or"
buharin ya I see 07:32
but I don't know why we need // not just or
m: my $*FOO = 'suck'; say "$*FOO || 'foo'"
camelia rakudo-moar 70c19d: OUTPUT«suck || 'foo'␤»
buharin m: say "$*FOO || 'foo'"
camelia rakudo-moar 70c19d: OUTPUT«Dynamic variable $*FOO not found␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
grondilu // is most often used with =
sub f { state $ //= do-stuff } 07:33
^very common idiom for caching
buharin grondilu: oh okay it is the same as or but additionaly you can add =
07:33 patrickz left
grondilu $foo //= $bar means $foo = $foo // $bar 07:35
C-style combination of binary operator, as in +=, *= etc 07:36
buharin yaya I understand
07:37 _mg_ left 07:41 finanalyst joined 07:43 huggable left 07:44 zakharyas joined
buharin m: @a = 1 ... 4 07:47
camelia rakudo-moar 70c19d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5@a = 1 ... 4␤»
masak random poll: if Python had a `my`-like keyword, how would it be spelled?
buharin m: my @a = 1 ... 4
camelia ( no output )
buharin m: my @a = 1 ... 4; say @a 07:48
camelia rakudo-moar 70c19d: OUTPUT«[1 2 3 4]␤»
buharin m: my @a = 1 ... *; say @a
camelia rakudo-moar 70c19d: OUTPUT«[...]␤»
masak buharin: you can also privmsg with camelia, to avoid noising the channel with partial results
buharin m: my @a = 1 ... *; say @a[3]
camelia rakudo-moar 70c19d: OUTPUT«4␤»
buharin m: my @a = 1 ... *; say @a[100]
camelia rakudo-moar 70c19d: OUTPUT«101␤»
buharin masak: okay :) 07:49
I got a deal to you masak
masak a deal? are you a Nigerian prince with lots of gold that needs to be transferred internationally? 07:50
buharin masak: unfortunately no :( 07:51
masak: just want to ask if it is good method, to copy API but provide own implementation while transfering Python lib to Perl 07:52
masak depends, I guess
have you considered working test-first?
buharin masak: ye, testing small parts of code is obligatory 07:53
DrForr What I did with Dancer2 was to just take the test files, add :from<Perl5> to the package names and then convert the perl5 tests to perl6.
I don't know if Inline::Python works similarly, but it'd be worth a look. 07:54
07:55 andreoss joined
buharin no I don't want to use Inline Python 07:56
andreoss m: my @fs = find(dir => '/'); for @fs -> $f { say $f ; last }
camelia rakudo-moar 70c19d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ find used at line 1␤␤»
andreoss m: use File::Find; my @fs = find(dir => '/'); for @fs -> $f { say $f ; last }
camelia rakudo-moar 70c19d: OUTPUT«===SORRY!===␤Could not find File::Find at line 1 in:␤ /home/camelia/.perl6␤ /home/camelia/rakudo-m-inst-1/share/perl6/site␤ /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤ /home/camelia/rakudo-m-inst-1/share/perl6␤ CompUnit::Re…»
07:56 Peter_R joined
buharin I want to rewrite something 07:56
with saving actual API
I think also that Inline Python will be slow as fuck 07:57
DrForr It may be, but at least you wouldn't have to rewrite the entire Flask (or whatever) stack at once. 07:58
07:58 flok420 joined 07:59 flok420 left
buharin DrForr: I should try first I think 08:00
andreoss is File::Find supposed to be lazy?
DrForr Good luck eating that elephant.
andreoss why is it so slow? 08:01
08:03 pecastro joined 08:07 rindolf joined 08:09 jack_rabbit left 08:10 vytas joined 08:11 ocbtec joined, finanalyst left 08:16 iH2O joined 08:17 iH2O left 08:20 baest joined 08:21 wtw_ joined, vytas left 08:22 vytas joined, a3r0 left 08:23 stmuk left 08:24 stmuk joined, arnsholt joined 08:29 a3r0 joined 08:31 melezhik joined 08:33 pdcawley_ joined 08:34 a3r0 left 08:35 pdcawley left, a3r0_ joined 08:37 tinita_ joined, yx_ joined, esh_ joined, mls_ joined 08:38 Amnez777- joined 08:39 cpage_ joined, m0ltar_ left, araujo joined, araujo left, m0ltar joined 08:40 xinming left, ZeroDogg joined, xinming joined 08:41 emdashcomma_ left 08:42 TakinOver left, a3r0 joined, araujo joined, araujo left, araujo joined, yubimusubi joined 08:43 emdashcomma joined, Zero_Dogg left, yx_ is now known as xnrand, ZeroDogg is now known as Zero_Dogg, a3r0_ left, TakinOver joined, k-man joined 08:45 gnull joined 08:46 gabiruh left 08:52 TEttinger left 08:53 gabiruh joined 08:59 g4 joined 09:04 labster left 09:07 mls_ is now known as mls
andreoss how to make IO::Handle.lines to work like cat rather than tail? 09:11
09:13 rkr left
andreoss *like tail rather than cat 09:15
09:15 finanalyst joined 09:20 _mg_ joined, rurban1 joined, rurban left
andreoss > my $h = "uni.txt".IO.open; $h.seek(10); $h.lines.elems 09:23
Malformed UTF-8
09:26 CIAvash left
nine I think .seek works in terms of bytes, not characters 09:27
andreoss what should i use in this case? 09:29
09:31 finanalyst left
DrForr .seek(0); .readchars(10); # ? 09:31
Though a .seekchars analogous to .readchars would be nice. 09:32
andreoss .readchars would read the file
DrForr In UTF-8 you can't advance the file pointer by 10 characters without knowing what each character is. 09:33
09:33 rurban1 left, xinming left
DrForr Remember that UTF-8 isn't fixed-width. 09:33
09:34 xinming joined 09:35 RabidGravy joined
DrForr Characters can be anything up to 4 bytes, and when you consider combining characters they can be practically any length. 09:35
dalek c: 1ad7597 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod:
improve capture parameters
09:36
09:39 _mg_ left
andreoss > loop { try { $h.getc(); last ; CATCH { default { $h.seek(1, SeekFromCurrent) } } }} 09:39
will this even work? 09:40
seems not 09:42
09:51 ChoHag joined 09:54 vibha joined 09:59 AlexDaniel joined 10:06 user9 joined
dalek c: 79b198d | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod:
add coercion types to signature
10:07
c: 85c37a8 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod:
add long names to signature
10:30
c: ae72862 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod:
signatures can be smart matched against a list
gfldex i am confident we will have complete docs shortly after Christmas 10:32
10:35 tinita_ is now known as tinita 10:43 darutoko left 10:48 kaare_ joined
RabidGravy does anyone else get this kind of stuff ? github.com/jonathanstowe/TermReadKey/issues/11 10:49
gfldex m: my %h = left => 1, right => 2; say %h ~~ :(Hash $top ($left, $right) ); 10:50
camelia rakudo-moar 70c19d: OUTPUT«False␤»
gfldex m: my %h = left => 1, right => 2; say %h ~~ :(%top ($left, $right) );
camelia rakudo-moar 70c19d: OUTPUT«False␤»
RabidGravy I have written/maintained/distributed quite a lot of software over the years and Term::ReadKey is almost unique in that I spend more time addressing the license than actively working on the software
10:51 user9 left
gfldex m: my %h = left => 1, right => 2; say %h ~~ :(Any:D $top ($left, $right) ); 10:52
camelia rakudo-moar 70c19d: OUTPUT«False␤»
gfldex jnthn: should that match?
10:52 user9 joined
AlexDaniel gfldex: the graph here is amazing github.com/perl6/doc/graphs/contributors 10:54
10:54 _mg_ joined
gfldex #3 is in reach :) 10:54
10:56 _mg_ left
gfldex m: my %h = left => 1, right => 2; say %h ~~ :(Any:D $top (:$left, :$right) ); 10:56
camelia rakudo-moar 70c19d: OUTPUT«False␤»
gfldex m: my %h = left => 1, right => 2; say %h ~~ :(%top (:$left, :$right) );
camelia rakudo-moar 70c19d: OUTPUT«False␤»
psch m: my %h = left => 1, right => 2; say \(%h) ~~ :(%top (:$left, :$right) ); 10:57
camelia rakudo-moar 70c19d: OUTPUT«True␤»
10:57 aries_liuxueyang joined
psch hm 10:57
10:57 jameslenz left
gfldex ACCEPT for Signature seams to be lacking, unless there are nasty side effects 10:58
psch m: my %h = left => 1, right => 2; say \(%h) eqv %h.Capture 10:59
camelia rakudo-moar 70c19d: OUTPUT«False␤»
psch so, Signature.ACCEPTS(%topic) calls %topic.Capture
but %topic.Capture isn't eqv to \(%topic)
m: my %h = left => 1, right => 2; say \(%h).perl; say %h.Capture.perl
camelia rakudo-moar 70c19d: OUTPUT«\({:left(1), :right(2)})␤\(:left(1), :right(2))␤»
psch aha
it's slipping 11:00
jnthn gfldex: A Hash, when coerced to a Capture, is a capture of named arguments
11:00 jameslenz joined, user9 left
psch m: my %h = left => 1, right => 2; say %h ~~ :(:$left, :$right); 11:00
jnthn gfldex: So m: my %h = left => 1, right => 2; say %h ~~ :(:$left, :$right)
m: my %h = left => 1, right => 2; say %h ~~ :(:$left, :$right) 11:01
11:01 user9 joined
camelia rakudo-moar 70c19d: OUTPUT«True␤» 11:01
jnthn So, that matches
Ah, psch beat me to it
That's the correct behavior, anyways.
m: my %h = left => 1, right => 2; say \(%h) ~~ :($top (:$left, :$right))
camelia rakudo-moar 70c19d: OUTPUT«True␤»
jnthn That is a Capture with a single positional arg which is a Hash, and it is then coerced to a Capture for unpacking by the nested signature 11:02
dalek c: 3c254d7 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod:
signatures do smartmatch against Hash
11:04
11:11 pdcawley_ left
AlexDaniel OK guys, if you have Microsoft Edge installed, please go to doc.perl6.org/type/Proxy#Methods 11:12
and try to reproduce this bug: github.com/perl6/doc/issues/252
11:13 Emeric joined 11:14 _mg_ joined
AlexDaniel basically if nobody can, then it is probably not an issue on our side 11:15
11:16 kid51 joined
Woodi why Captures and Signatures are different thing ? any prior art in other language for that ? 11:18
psch Woodi: Captures consist of arguments, Signatures consist of Parameters 11:19
well, Signatures also can consist of Signatures...
gfldex m: my $is-signature(Str $s when * ~~ "Woodi"); # a where clause would not make sense in a capture
camelia rakudo-moar 70c19d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3my $is-signature(Str $s7⏏5 when * ~~ "Woodi"); # a where clause wo␤ expecting any of:␤ constraint␤»
gfldex m: my $is-signature(Str $s where * ~~ "Woodi"); # a where clause would not make sense in a capture 11:20
camelia rakudo-moar 70c19d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤The () shape syntax in variable declarations is reserved␤at <tmp>:1␤------> 3 $is-signature(Str $s where * ~~ "Woodi"7⏏5); # a where clause would not make sense␤ expecting any of:␤ co…»
gfldex m: my $is-signature = :(Str $s where * ~~ "Woodi"); # a where clause would not make sense in a capture
camelia ( no output )
Woodi to me just same thing named differently on two sides of routine...
psch but they clearly are not 11:21
11:21 darutoko joined
psch i mean, the fact they exist on different sides of the routine already is a difference, isn't it? 11:21
Woodi "where" makes new type or subtype, so can be just: my Int $x where < 0; so on Capture side...
psch that's a declaration, which is closer to a Parameter than an Argument 11:22
Woodi psch: but it's just memcpy(struct)...
psch Woodi: and .map(&sub) is just goto..?
Woodi psch: no, it is for :)
psch ah, but for is while is goto 11:23
Woodi ok, then it's goto :)
psch that kind of thinking doesn't help, fwiw
like, a class can be translated to a struct with function pointers 11:24
but conceptionally they are not the same
Woodi I just don't see (so far) difference in Sig and Capture
11:24