»ö« 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
kurahaupo left
00:05
kurahaupo joined
00:07
pierre_ joined
00:09
n1lp7r left
00:11
mcmillhj joined
00:14
kurahaupo left
00:15
kurahaupo joined
00:19
kurahaupo left
00:20
rkazak left
00:28
MilkmanDan joined
00:29
cdg left,
cdg joined
00:33
cdg left
00:35
MilkmanDan left
00:49
cibs left
00:50
awwaiid left
00:51
cibs joined
00:55
mcmillhj left
00:57
mcmillhj joined
|
|||
tailgate | timotimo: I appreciate the effort. Hell of a language, too | 00:58 | |
01:02
mcmillhj left
01:05
BenGoldberg joined
01:06
grondilu joined
01:17
AlexDaniel left
|
|||
tailgate | m: gist.github.com/ahalbert/1b495ad9f...9fedc3ebe0 | 01:17 | |
camelia | rakudo-moar 1b898c: OUTPUT«([a a])([a b] [a b])([a c] [a c] [a c])» | ||
tailgate | this is more interesting. Maybe because @state is passed around, and needs to be made a new copy... | 01:18 | |
01:22
kalkin- left,
kalkin-_ joined
01:23
mvorg left
|
|||
SmokeMachine____ | Hi! is there any way to create a trait on a parameter on a sub/method? some thing like: sub bla($par is my-custom-trait){...} | 01:23 | |
m: multi trait_mod:<is> ($a, :$my-custom-trait!) {say $a.^name}; sub bla($par is my-custom-trait){...} | 01:27 | ||
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Can't use unknown trait 'is my-custom-trait' in a parameter declaration.at <tmp>:1 expecting any of: rw readonly copy required raw leading…» | ||
01:30
Calibellus joined
|
|||
SmokeMachine____ | I got it! thanks! | 01:35 | |
dataangel | In python 3 PathLib gives you path objects similar to IO::Path but they include an extra method called with_suffix that lets you conveniently change the extension. Is there something like that for IO::Path, and if not what is the most Perlish way to add it? | ||
SmokeMachine____ | m: multi trait_mod:<is> (Parameter $a, :$blablabla!) {say $a.^name}; sub bla($a is blablabla) {} | ||
camelia | rakudo-moar 1b898c: OUTPUT«Parameter» | ||
01:38
pierre_ left
01:43
pierre_ joined,
pierre_ left
01:44
pierre_ joined,
cibs left
|
|||
dataangel | Found the documentation for augment, but not sure if that's the way that I should do things | 01:44 | |
01:45
ilbot3 left
|
|||
SmokeMachine____ | Any way to get the function by the parameter? | 01:45 | |
01:46
cibs joined
01:48
ilbot3 joined
01:50
bjz joined
01:51
Actualeyes joined
|
|||
grondilu | augment is not something you should do on regular use indeed | 01:51 | |
01:52
itaipu left
|
|||
dataangel | I can just define a free function... But that doesn't seem Perlish either | 01:52 | |
grondilu | just try inheritance? | 01:54 | |
like class MyPath is IO::Path { method with_suffix {...} } or something. | 01:56 | ||
dataangel | I assume Perl 6 doesn't have any form of uniform function call syntax? Like that would let you define free functions taking a type but then call them with the method calling syntax on the object? | ||
grondilu | like the .&function syntax? | 01:57 | |
m: sub foo { say "Foo!!" }; say pi.&foo | |||
camelia | rakudo-moar 1b898c: OUTPUT«Too many positionals passed; expected 0 arguments but got 1 in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
dataangel | Maybe that's what I want | ||
grondilu | m: sub foo($_) { say "Foo!!" }; say pi.&foo | ||
camelia | rakudo-moar 1b898c: OUTPUT«Foo!!True» | ||
grondilu | you will have to explicitely put the ampersand though | 01:58 | |
I suspect it's better to use inheritance. | |||
or roles | |||
m: role Suffixable { method with-suffix {...} } | 01:59 | ||
camelia | ( no output ) | ||
grondilu | roles are very useful in Perl 6. I use them more than classes :) | 02:00 | |
dataangel | Inside the S/// operator how do I refer to a variable? | ||
grondilu | I'm not sure but {} always work | 02:01 | |
dataangel | grondilu: but then how do I attach that role to IO::Path? | ||
grondilu | not to the class itself, but to instances. | ||
m: say "/tmp".IO.WHAT | |||
camelia | rakudo-moar 1b898c: OUTPUT«(Path)» | ||
grondilu | m: say my $path = "/tmp".IO but role { method talk { say "hi" } }; $path.talk | 02:02 | |
camelia | rakudo-moar 1b898c: OUTPUT«"/tmp".IOhi» | ||
02:02
bjz left
02:03
bjz joined
02:04
labster left,
canopus left
02:08
Actualeyes left
|
|||
dataangel | Haven't seen but before @_@ | 02:08 | |
02:09
sufrostico left
02:10
canopus joined
02:13
noganex joined
02:14
bisectable left,
benchable left,
committable6 left
02:15
bjz left
|
|||
dataangel | 'but' is interesting but in order to use it you have to remember to do it on every single called to every single function that might produce a new IO::Path, so I suspect .& is still preferable | 02:16 | |
02:16
noganex_ left
|
|||
dataangel | m: sub with-suffix (IO::Path:D $p, Str:D $ext --> IO::Path:D) { (S/(\.<-[.]>)?$/{$ext}/ given $p).IO; } say "hello.c".IO.&with-suffix(".o"); | 02:18 | |
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Strange text after block (missing semicolon or comma?)at <tmp>:1------> 3 (S/(\.<-[.]>)?$/{$ext}/ given $p).IO; }7⏏5 say "hello.c".IO.&with-suffix(".o"); expecting any of: infix…» | ||
dataangel | m: sub with-suffix (IO::Path:D $p, Str:D $ext --> IO::Path:D) { (S/(\.<-[.]>)?$/{$ext}/ given $p).IO; }; say "hello.c".IO.&with-suffix(".o"); | ||
camelia | rakudo-moar 1b898c: OUTPUT«Type check failed in binding to $p; expected IO::Path but got "hello.c".IO(:SPEC(IO... in sub with-suffix at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
dataangel | Weird... Works for me locally | 02:19 | |
02:20
benchable joined
|
|||
dataangel | May be bot is on a different version? | 02:20 | |
02:21
bisectable joined
02:22
Actualeyes joined
|
|||
grondilu | maybe you want a parametric role? | 02:22 | |
or a trait. | 02:23 | ||
02:23
pierre_ left
|
|||
grondilu | wait | 02:23 | |
just a role with one attribute | |||
m: role Suffixed { has Str $.suffix; }; my $path = "hello.c".IO but Suffixed(".o"); | 02:24 | ||
camelia | ( no output ) | ||
grondilu | m: role Suffixed { has Str $.suffix; }; my $path = "hello.c".IO but Suffixed(".o"); say $path.suffix | ||
camelia | rakudo-moar 1b898c: OUTPUT«.o» | ||
grondilu | nah I got your semantics wrong I guess | 02:25 | |
sorry | 02:26 | ||
dataangel | p6: sub with-suffix (IO::Path:D $p, Str:D $ext --> IO::Path:D) { (S/(\.<-[.]>)?$/{$ext}/ given $p).IO; }; say "hello.c".IO.&with-suffix(".o"); | ||
camelia | rakudo-moar 1b898c: OUTPUT«Type check failed in binding to $p; expected IO::Path but got "hello.c".IO(:SPEC(IO... in sub with-suffix at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
dataangel | Thought I might get a different bot :p | ||
02:26
pierre_ joined
|
|||
dataangel | Still confused by that | 02:27 | |
grondilu | I'm not sure you can use the .& notation like that. Let me check. | ||
dataangel | Like I said works on my computer | ||
grondilu | m: sub f($a, $b) { "$a $b" }; say pi.&f(2); | 02:28 | |
camelia | rakudo-moar 1b898c: OUTPUT«3.14159265358979 2» | ||
grondilu | oh you can | ||
dataangel | camelia for some reason doesn't like it | ||
grondilu | what this uppercase S///? | ||
dataangel | Returns a copy instead of editing in place | ||
grondilu | consider using .subst | ||
m: sub with-suffix($p, $D) { $r.subst(/foo/, "bar").IO }; say "foo.c".IO.&with-suffix(*) | 02:29 | ||
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$r' is not declaredat <tmp>:1------> 3sub with-suffix($p, $D) { 7⏏5$r.subst(/foo/, "bar").IO }; say "foo.c"» | ||
grondilu | m: sub with-suffix($p, $D) { $p.subst(/foo/, "bar").IO }; say "foo.c".IO.&with-suffix(*) | 02:30 | |
camelia | rakudo-moar 1b898c: OUTPUT«"bar.c".IO» | ||
grondilu | m: sub with-suffix($p, $suffix) { $p.subst(/\.\w$$/, $suffix).IO }; say "hello.c".IO.&with-suffix(*) | ||
camelia | rakudo-moar 1b898c: OUTPUT«"hello*".IO» | ||
grondilu | m: sub with-suffix($p, $suffix) { $p.subst(/\.\w$$/, $suffix).IO }; say "hello.c".IO.&with-suffix(".o") | 02:31 | |
camelia | rakudo-moar 1b898c: OUTPUT«"hello.o".IO» | ||
dataangel | with-suffix changes the extension (or adds one if there isn't one) not the part before | ||
grondilu | yeah I was just simplifying to test the subst | ||
you ought to name your sub "change-suffix" instead of "with-suffix" though. | 02:32 | ||
or not. Not obvious. | 02:33 | ||
02:33
leego left
02:34
wamba joined
|
|||
ShimmerFairy | grondilu: it works if you read is as "I want a file with this name, but with suffix .o". But I agree it's a touch ambiguous, since you could also say "I want this filename with suffix .o added" | 02:44 | |
02:48
parabolize joined
02:55
finanalyst joined
|
|||
SmokeMachine____ | m: role param_injected[Str $name?] { has $.injected = True; has $.default = {"injected $name"}; }; multi trait_mod:<is> (Parameter $a, :$injected!) { $a does param_injected; }; sub bla(Str $a is injected) { say $a; }; bla(); | 02:56 | |
camelia | rakudo-moar 1b898c: OUTPUT«Unhandled exception: Cannot unbox a type object at <unknown>:1 (/home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm:print_exception) from gen/moar/m-CORE.setting:24486 (/home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.sett…» | ||
03:04
cpage_ left
03:23
cpage_ joined
03:26
pierre_ left
03:30
committable6 joined
03:32
pierre_ joined
03:34
wamba left
03:37
pierre_ left
03:38
skids left
03:42
pierre_ joined
|
|||
SmokeMachine____ | if I have a variable with a Signature, how can I define a sub with that signature? | 03:52 | |
dj_goku | SmokeMachine____: huh? | 03:55 | |
SmokeMachine____ | m: \cap = :(Int $a); sub bla(|cap) {say "worked?"}; bla(42); bla() | 03:56 | |
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Preceding context expects a term, but found infix = insteadat <tmp>:1------> 3\cap =7⏏5 :(Int $a); sub bla(|cap) {say "worked?"» | ||
geekosaur | I think they want a meta method | ||
03:56
LegalResale left
|
|||
geekosaur | or, no. it's a sub. so, hm, I think that "can be done" but only in NQP-land | 03:56 | |
SmokeMachine____ | geekosaur: what I really want is wrap a method taking off some parameters... | 03:57 | |
geekosaur | oh. you want .assuming | ||
(maybe) | 03:58 | ||
SmokeMachine____ | oh! method/sub | ||
geekosaur | m: my sub foo($a, $b) { $a + $b }; my sub bar(&f) { f(15) }; say bar(&foo.assuming(3)) | 03:59 | |
camelia | rakudo-moar 1b898c: OUTPUT«18» | ||
SmokeMachine____ | What I want to do is something like: sub my-func($par1, $par2 is injected) is injected {} # and it should wrap the my-func with a fund only wit the signature ($par1) | 04:01 | |
04:02
leego joined
|
|||
SmokeMachine____ | m: my sub foo($a, $b) { $a + $b }; my sub bar(&f) { f(15) }; say bar(&foo.assuming(nil, 3)) | 04:02 | |
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routine: nil used at line 1» | ||
dj_goku | SmokeMachine____: Not that i'll be able to answer your question. But why are you wanting/needing this? | 04:03 | |
SmokeMachine____ | I am writing a dependency injector... | 04:04 | |
dj_goku | oh. sounds complicated. :D | ||
what does a dependency injector do? | 04:05 | ||
geekosaur | there;s already a wrap thing | ||
BenGoldberg | m: my $diff = * - *; say $diff.assuming(3).(1); | 04:06 | |
camelia | rakudo-moar 1b898c: OUTPUT«Method 'assuming' not found for invocant of class 'WhateverCode' in block <unit> at <tmp> line 1» | ||
SmokeMachine____ | this is my old code (that Im rewriting) github.com/FCO/Injector | ||
BenGoldberg | m: my $diff = &[-]; say $diff.assuming(3).(1); | ||
camelia | rakudo-moar 1b898c: OUTPUT«2» | ||
BenGoldberg | m: my $diff = &[-]; say $diff.assuming(*, 3).(1); | ||
camelia | rakudo-moar 1b898c: OUTPUT«-2» | ||
BenGoldberg | m: my sub foo($a, $b) { $a + $b }; my sub bar(&f) { f(15) }; say bar(&foo.assuming(*, 3)) | 04:07 | |
camelia | rakudo-moar 1b898c: OUTPUT«18» | ||
SmokeMachine____ | hum!!! the whatever star! | ||
geekosaur | docs.perl6.org/routine/wrap but I don't think you can do much with the parameters | ||
there's nextwith... | |||
04:07
canopus left
|
|||
dj_goku | s: &infix:<eqv> | 04:07 | |
SourceBaby | dj_goku, Sauce is at github.com/rakudo/rakudo/blob/1b89...Mu.pm#L828 | ||
BenGoldberg | You might need to EVAL some text to create a sub with different parameters. | 04:08 | |
dj_goku | with sourcery are you able to find out what code is executed for an expression? | 04:10 | |
s: Any.WHAT | |||
SourceBaby | dj_goku, Something's wrong: ERR: Cannot resolve caller sourcery(Any); none of these signatures match: ($thing, Str:D $method, Capture $c) ($thing, Str:D $method) (&code) (&code, Capture $c) in block <unit> at -e line 6 | ||
04:10
labster joined
|
|||
dj_goku | s: Any, 'WHAT' | 04:11 | |
SourceBaby | dj_goku, Something's wrong: ERR: Type check failed in binding to &code; expected Callable but got Nil (Nil) in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42 in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33 in block <unit> at -e line 6 | ||
BenGoldberg | WHAT is a metamethod. It looks like a method, but is actually a macro. | 04:13 | |
04:14
Guest61331 left
|
|||
dj_goku | ahh ok | 04:14 | |
04:15
canopus joined
|
|||
geekosaur | m: sub foo($a, +@b) { $a <<+<< @b }; sub bar(|x) { nextwith(1, |x) }; &foo.wrap(&bar); say foo(4,5,6) | 04:17 | |
camelia | rakudo-moar 1b898c: OUTPUT«[5 6 7]» | ||
04:17
Cabanossi left
|
|||
BenGoldberg | It's documented here <docs.perl6.org/language/mop> and here <design.perl6.org/S12.html> | 04:17 | |
04:18
rkazak joined
|
|||
geekosaur 's first attempt at that used a pointy block instead of a separate sub; nextsame didn't like that | 04:19 | ||
04:20
Cabanossi joined,
rkazak left
04:41
MilkmanDan joined
04:55
MilkmanDan left
04:59
rkazak joined
05:06
khw left
05:09
grondilu left,
Calibellus left
05:11
pierre_ left
05:12
rkazak left
05:18
araujo_ left
05:23
webstrand left
05:30
brrt joined
05:38
MilkmanDan joined
|
|||
shantanu | how would I use a object from a classname that is stored in a variable | 05:39 | |
m: my $a = "Example"; class Example {}; my $b = $a.new; $b.^name; | 05:40 | ||
camelia | ( no output ) | ||
shantanu | m: my $a = "Example"; class Example {}; my $b = $a.new; say $b.^name; | ||
camelia | rakudo-moar 1b898c: OUTPUT«Str» | ||
shantanu | m: my $a = "Example"; class Example {}; my $b = $a.new; say $b.^methods; | 05:41 | |
camelia | rakudo-moar 1b898c: OUTPUT«(BUILD Int Num chomp pred succ simplematch match ords samecase samemark samespace word-by-word trim-leading trim-trailing trim encode NFC NFD NFKC NFKD wordcase trans indent codes chars uc lc tc fc tclc flip ord WHY WHICH Bool Str Stringy DUMP ACCEPTS chop…» | ||
05:42
BenGoldberg left
|
|||
brrt | shantanu: perl6 type objects are prototypes | 05:44 | |
m: 3.new.WHAT.say; | |||
camelia | rakudo-moar 1b898c: OUTPUT«(Int)» | ||
brrt | m: 3.new.defined.say; | ||
camelia | rakudo-moar 1b898c: OUTPUT«True» | ||
brrt | m: 42.new.say; | ||
camelia | rakudo-moar 1b898c: OUTPUT«0» | ||
brrt | so that doesn't do what you want | 05:45 | |
my guess is you have to lookup the type object explicitly, and i know that is possible but i've forgotten how | |||
shantanu | ohh so is there any way to get initialize a object of a class whose name you have in a variable? | ||
brrt | yeah | ||
shantanu | I am trying to implement a pluggable role. | ||
brrt | you have to get the type object from the namespace | ||
but as i said, i'm not100% sure how :-) | |||
m: my $a = 3; say $::<$a>; | 05:46 | ||
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$' is not declaredat <tmp>:1------> 3my $a = 3; say 7⏏5$::<$a>;» | ||
shantanu | ohh | ||
brrt | m: my $a = 3; say ::<$sa>; | ||
camelia | rakudo-moar 1b898c: OUTPUT«Nil» | ||
brrt | not yet | ||
shantanu | my $a = ; my $b = 'a'; say ::<$b>; | ||
m: my $a = ; my $b = 'a'; say ::<$b>; | 05:47 | ||
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Malformed initializerat <tmp>:1------> 3my $a =7⏏5 ; my $b = 'a'; say ::<$b>; expecting any of: prefix term» | ||
brrt | hmmm | 05:48 | |
m: my $a = 10; say $::<$a>; | 05:50 | ||
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$' is not declaredat <tmp>:1------> 3my $a = 10; say 7⏏5$::<$a>;» | ||
brrt | m: my $a = 10; say ::<$a>; | 05:51 | |
camelia | rakudo-moar 1b898c: OUTPUT«10» | ||
brrt | m: my $a = 10; my $b = '$a'; say ::{$b}; | ||
camelia | rakudo-moar 1b898c: OUTPUT«10» | ||
brrt | shantanu: docs.perl6.org/language/packages#Direct_lookup is what you want | ||
i think | |||
m: sub foo { $_*2; }; say foo 3 | 05:54 | ||
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Calling foo(Int) will never work with declared signature ()at <tmp>:1------> 3sub foo { $_*2; }; say 7⏏5foo 3» | ||
brrt | m: sub foo(|) { $_ * 2; }; say foo 3; | 05:55 | |
camelia | rakudo-moar 1b898c: OUTPUT«Use of uninitialized value of type Any in numeric context in sub foo at <tmp> line 10» | ||
brrt | m: sub foo { $^a * 3; }; say foo 3; | ||
camelia | rakudo-moar 1b898c: OUTPUT«9» | ||
brrt | hmm, that's actually quite cool | ||
m: sub foo { $^a * 3; }; say &foo.^signature; | |||
camelia | rakudo-moar 1b898c: OUTPUT«Method 'signature' not found for invocant of class 'Perl6::Metamodel::ClassHOW' in block <unit> at <tmp> line 1» | ||
brrt | m: sub foo { $^a * 3]; say &foo.signature; | 06:01 | |
camelia | rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Missing blockat <tmp>:1------> 3sub foo { $^a * 37⏏5]; say &foo.signature; expecting any of: statement end statement modifier statement modifier loop» | ||
brrt | m: sub foo { $^a * 3; }; say &foo.signature; | ||
camelia | rakudo-moar 1b898c: OUTPUT«($a)» | ||
brrt | m: sub foo ($a, $b where $b > 2*$a) { $a * $b * $b }; foo(1,2); foo(2,1); | 06:02 | |
camelia | rakudo-moar 1b898c: OUTPUT«Constraint type check failed for parameter '$b' in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
06:04
grondilu joined
06:05
grondilu left,
grondilu joined
06:07
Xliff joined
|
|||
Xliff | \o | 06:07 | |
brrt | hi Xliff | 06:08 | |
isn't there a bot here that can help me with the link to RT #127425 | 06:11 | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127425 | ||
brrt | good synopsebot6 :-) | ||
.hug synopsebot6 | |||
.botsnack | |||
synopsebot6 | om nom nom | ||
yoleaux | :D | ||
06:16
pmurias joined
06:22
brrt left
|
|||
Xliff | brrt: Isn't it nice when you can get answers out of the blue like that? | 06:25 | |
No effort solutions! | |||
Is there a way to get the SQL of an executed statement from DBIish? | 06:26 | ||
06:27
brrt joined
06:28
firstdayonthejob joined
|
|||
shantanu | m: my $a = 10; my $b = '$a'; say ::{$b}; | 06:29 | |
camelia | rakudo-moar 1b898c: OUTPUT«10» | ||
shantanu | brrt: Thanks! | ||
m: my $a = "Example"; class Example {}; my $b = ::{$a}.new; say $b.^methods; | 06:30 | ||
camelia | rakudo-moar 1b898c: OUTPUT«()» | ||
shantanu | m: my $a = "Example"; class Example {}; my $b = ::{$a}.new; say $b.^name; | ||
camelia | rakudo-moar 1b898c: OUTPUT«Example» | ||
06:34
brrt left,
firstdayonthejob left
|
|||
shantanu | m: my $a = "Example"; class Example {}; my $b = ::{"Example"}.new; say $b.^name; | 06:36 | |
camelia | rakudo-moar a2b4a2: OUTPUT«Example» | ||
06:39
TheLemonMan joined
06:42
trnh joined
06:44
MasterDuke left
06:53
RabidGravy joined
|
|||
TheLemonMan | 'morning #perl6 | 07:04 | |
lizmat | TheLemonMan o/ | 07:05 | |
nine | My brain really sucks at generating dreams that try to deal with the abstract challenges encountered during a heavy coding day... | 07:08 | |
07:08
zengargoyle joined
|
|||
ufobat | what happens during the night, nine? | 07:08 | |
sometimes i am dreaming of a solution for my coding problem, but usually it makes no sense in the morning :( | 07:09 | ||
nine | I...can't really say. It's so confusing. I just remember being half awake sometimes and just wishing it to stop. | 07:10 | |
07:10
lizmat left,
rkazak joined
07:11
sno left
07:13
lizmat joined
|
|||
ufobat | that doesn't sound good. | 07:13 | |
07:13
darutoko joined
|
|||
TheLemonMan | nine, are you sure you weren't just dreaming in APL ? | 07:16 | |
pmurias | TheLemonMan: in the pull request maybe it would make sense to have a 'if $valreg_kind {$valreg := $*REGALLOC.fresh_register($valreg_kind)}' to avoid repetition | ||
TheLemonMan | pmurias, absolutely, but the condition should be $valreg_kind ne $param_kind | 07:19 | |
pmurias | yes | 07:20 | |
nine | TheLemonMan: well I don't know APL, so yes, I'm sure :) | ||
pmurias | or even better the whole ugly if chain could be replaced with an array lookups in @trunc_op[$param_kind] and @trunc_kind[$param_kind] arrays | 07:24 | |
ufobat | .oO( how many ppl just googled APL now? ) |
07:27 | |
pmurias | turning into array lookup might be overkill, anyway just nitpicking ;) | 07:31 | |
TheLemonMan | pmurias, done! | 07:41 | |
arnsholt | People who have VPSes for things: What providers are good these days? | ||
pmurias | TheLemonMan: test file for your changes: gist.github.com/pmurias/4594138e3e...17fda164d2 | 07:44 | |
TheLemonMan: did you push? | 07:45 | ||
pmurias has to get afk& | |||
TheLemonMan | pmurias, force-pushed | 07:46 | |
07:46
pierre_ joined
07:49
rkazak left
07:51
danaj left
07:52
pmurias left
07:55
dakkar joined
08:05
zakharyas joined
08:07
lizmat left,
labster left,
espadrine joined
08:09
Wiertek joined
08:11
g4 joined
08:16
finanalyst left
08:20
sno joined
08:33
bjz joined
08:45
labster joined
08:46
jack_rabbit left
08:47
bjz left
08:48
TEttinger left
|
|||
TheLemonMan | interesting, NativeCall subs don't support default arguments, but RT#125523 shows it should | 08:58 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=125523 | ||
TheLemonMan | CALL-ME simply throws if the arguments don't match the arity | ||
09:05
bjz joined
09:08
webstrand joined
09:14
pierre_ left
09:15
AlexDaniel joined
09:17
rindolf joined
09:23
cpage_ left
09:30
mvorg joined
09:35
trnh left
09:37
RabidGravy left
|
|||
Xliff | (scrollbacked) - I used to know APL, but I think my brain's self-defense mechanisms have deleted those memories. | 09:45 | |
DrForr | I know enough APL to be dangerous, but that particular project is far down the queue of stuff... | 09:46 | |
TheLemonMan | m: say class :: {has uint16 $.x;}.new(x=>0xffff).x; | 09:47 | |
camelia | rakudo-moar 5f2818: OUTPUT«-1» | ||
TheLemonMan | ENOTCOOL | ||
Xliff | "class ::" o_O | 09:48 | |
09:50
trnh joined,
trnh left,
trnh joined
09:59
Matthew[m] left,
tadzik left,
M-Illandan left
|
|||
AlexDaniel | bye bye bisectable | 10:00 | |
10:01
benchable left,
bisectable left
10:03
committable6 left
10:04
committable6 joined,
bisectable6 joined
10:06
finanalyst joined
|
|||
AlexDaniel | hello bisectable6 :) | 10:09 | |
10:21
mcmillhj joined
10:27
mcmillhj left
10:29
Zoffix joined
|
|||
Zoffix | If nsvedberg 0racle Xliff dmaestro are here please add self to github.com/rakudo/rakudo/blob/nom/CREDITS if you want to be credited under a different name. Here's the full current list if you wanted to check yourself: gist.github.com/zoffixznet/c439bed...251fc4ba10 | 10:32 | |
(yeah, there are a couple of duplicated names ATM, which I'm working on) | |||
.tell sena_kun please add yourself to github.com/rakudo/rakudo/blob/nom/CREDITS if you don't want to show up as `Altai-man` in credits. | 10:36 | ||
yoleaux | Zoffix: I'll pass your message to sena_kun. | ||
Xliff | Zoffix: Done. \o/ | 10:37 | |
Zoffix | Merged. Thanks. | ||
Xliff is now playing: Eschaton - Euphonic (Original Mix) | 10:38 | ||
Xliff groves. | |||
10:40
zacts joined
|
|||
DrForr | "Uh, that's 'groove', sir, you're in the groove now." | 10:40 | |
10:40
tadzik joined
10:45
pmurias joined
10:50
labster left
|
|||
Xliff | DrForr: Not amongst the trees? Got it wrong again... | 10:52 | |
♪┏(°.°)┛┗(°.°)┓┗(°.°)┛┏(°.°)┓ ♪ | 10:53 | ||
DrForr | Sorry, 'twas a rather obscure ref to "Rappin' Ronnie" :) | 10:54 | |
11:04
heatsink joined
11:10
M-Illandan joined,
Matthew[m] joined
|
|||
masak | p'haps of interest: zero-cost futures (promises) in Rust: aturon.github.io/blog/2016/08/11/futures/ | 11:19 | |
(hi, #perl6) | |||
pmurias | hi masak | 11:29 | |
11:30
finanalyst left
|
|||
masak | pmurias: going to start writing the 007/JS backend now. | 11:30 | |
11:41
pierre_ joined
11:49
bjz_ joined,
AlexDaniel left
11:50
bjz left
12:00
n1lp7r joined
12:26
camelia left
12:27
camelia joined
12:28
ChanServ sets mode: +v camelia
12:29
finanalyst joined
12:34
zakharyas1 joined
12:36
zakharyas left,
pmurias left
12:39
mcmillhj joined
12:45
zacts left
12:46
pmurias joined
12:48
wamba joined
|
|||
unmatched} | .tell El_Che would you add yourself to github.com/rakudo/rakudo/blob/nom/CREDITS so the entiry shows up as you like in release announcement, please? | 12:50 | |
yoleaux | unmatched}: I'll pass your message to El_Che. | ||
unmatched} | .tell titsuki would you add yourself to github.com/rakudo/rakudo/blob/nom/CREDITS so the entiry shows up as you like in release announcement, please? | 12:51 | |
yoleaux | unmatched}: I'll pass your message to titsuki. | ||
12:52
ItayAlmog joined
|
|||
masak | pmurias: locally: | 12:58 | |
$ bin/007 --backend=javascript -e='say("OH HAI, JavaScript backend")' | nodejs | |||
OH HAI, JavaScript backend | |||
:) | |||
unmatched} | \o/ | ||
masak | (but hold your horses. it really only does `say` yet) | ||
and it passes four tests | |||
ItayAlmog | I redid all of my code so it will work with my parser, So now you can declare variables (which is uses a hacky way for now because in perl 6 every thing is a class but i don't have classes yet...) | 13:01 | |
dalek | c: 8ad489c | (Zoffix Znet)++ | CONTRIBUTING.md: Add note about CREDITS file Asking users to add selves, if they wish to use a name other than what the commit log gives. |
||
ItayAlmog | and you can also assign variables, now I am working on subroutines | ||
El_Che | off to a lego-like exposition (clics) with the kids | 13:02 | |
yoleaux | 12:50Z <unmatched}> El_Che: would you add yourself to github.com/rakudo/rakudo/blob/nom/CREDITS so the entiry shows up as you like in release announcement, please? | ||
El_Che | laters | ||
masak | ItayAlmog: what parser are we talking about? | ||
ItayAlmog | about my parser for compiling Perl 6 to assembly | 13:03 | |
masak | sounds... challenging :) | ||
ItayAlmog | This is the point :D | 13:04 | |
13:07
cdg joined,
bjz joined,
bjz_ left
13:08
andreoss joined
|
|||
andreoss | is there a way to define a class where all attributes is r/o? without specifing `is ro` for each attribute | 13:10 | |
13:10
bjz left,
bjz joined
|
|||
unmatched} | andreoss: that's the default behaviour. You don't need is ro | 13:10 | |
13:10
finanalyst left
13:11
andreoss left,
andreoss joined
|
|||
unmatched} | :/ | 13:11 | |
13:11
andreoss left,
andreoss joined
|
|||
unmatched} | heh | 13:11 | |
andreoss | it's not | ||
m: class Foo { has $.x } ; my Foo $x .= new; $x.x = 1 ; $x.x = 2; say $x.x | 13:12 | ||
camelia | rakudo-moar f5ed6b: OUTPUT«Cannot modify an immutable Any in block <unit> at <tmp> line 1» | ||
13:12
bjz left
|
|||
unmatched} | m: my $x = class { has $.foo }.new: :42foo; say $x.foo; $x.foo = 42; say $x | 13:12 | |
camelia | rakudo-moar f5ed6b: OUTPUT«42Cannot modify an immutable Int in block <unit> at <tmp> line 1» | ||
andreoss | m: class Foo { my $.x } ; my Foo $x .= new; $x.x = 1 ; $x.x = 2; say $x.x | 13:13 | |
camelia | rakudo-moar f5ed6b: OUTPUT«2» | ||
andreoss | i see | ||
13:13
bjz joined
|
|||
unmatched} | Ah, right, class attributes are rw | 13:13 | |
Then no, I'm unaware of a way to set class attributes to ro without is ro on each | 13:14 | ||
perlpilot | pretty sure it's class Foo is ro { ... } # or, it's intended to be. dunno if it's actually implemented | 13:18 | |
unmatched} | m: class Foo is ro { my $.x } ; my Foo $x .= new; $x.x = 1 ; $x.x = 2; say $x.x | 13:19 | |
camelia | rakudo-moar f5ed6b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>'Foo' cannot inherit from 'ro' because it is unknown.at <tmp>:1» | ||
perlpilot | now I'm pretty sure I've conflated a couple of memories ;) | ||
13:20
ItayAlmog left
|
|||
unmatched} | Why can't Perl 6 be parsed without executing some code? | 13:21 | |
Like, if I define sub infix:<+> { ... } does that get "run" or is it still ummm.. parsing time or whatever. | |||
unmatched} is trying to answer "Why is that functionality acceptable (or perhaps desirable) to you? From where I am sitting, a language that cannot be parsed without evaluating it would be a deal breaker." | |||
[Coke] | unmatched}: if you define that sub, it impacts the compilation of the unit it's in. | 13:23 | |
unmatched} | Right, but does anything get "evaluated"? | 13:24 | |
perlpilot | unmatched}: It's acceptable to me because that's one of the ways we warp the language to closer match the problem domain | 13:25 | |
unmatched} | perlpilot: so warping the language requires evaluation of some code, right? | ||
13:25
kjs_ joined
|
|||
perlpilot | most times. | 13:26 | |
13:27
skids joined
|
|||
perlpilot | unmatched}: What are you feelings about macros? | 13:27 | |
unmatched} | "I've no idea what they are" | 13:28 | |
perlpilot | strangelyconsistent.org/blog/macros...q-are-they | 13:29 | |
masak++ | |||
13:30
zacts joined
|
|||
perlpilot | although, I thought he also had some pointers to earlier non-perl6 stuff, but I don't see it in my quick search | 13:30 | |
anyway, reading all the stuff masak has written about P6 macros may prove instructive :) | 13:31 | ||
Just search strangelyconsistent.org/blog/list-of-posts for all the posts with "macro" in the title | 13:32 | ||
jnthn | Just declaring a new operator isn't really something that causes code evaluation. Much better examples (that are already implemented) are EXPORT subs and doing various bits of meta-programming. | ||
13:32
MilkmanDan left
|
|||
jnthn | For example, a MOP module that hooks add_method to wrap a method up would need to run as methods are added, and methods are added at compile time because otherwise we can't do stuff like compile time role composition. | 13:33 | |
moritz | .botsnack | ||
synopsebot6 | om nom nom | ||
yoleaux | :D | ||
13:34
kjs_ left
|
|||
unmatched} | jnthn++ thanks. That sounds very smarty-smart :D | 13:35 | |
13:35
mcmillhj left,
mcmillhj joined
|
|||
unmatched} just copy-pastes jnthn's answer to www.reddit.com/r/programming/comme..._6/d6nkc54 | 13:37 | ||
jnthn | Reddit'll find a way to make it a negative anyway :P | 13:38 | |
unmatched} | :D | 13:39 | |
13:40
kjs_ joined
13:41
telex left
13:42
telex joined
13:43
AlexDaniel joined
|
|||
mst | unmatched}: please check that my comment makes sense? | 13:43 | |
unmatched} | Seems to yeah | 13:44 | |
mst++ | |||
mst | it's easy for people to confuse themselves because it's the same language performing both roles, because the compiler's self hosting | 13:45 | |
13:45
zakharyas1 left
|
|||
mst | fortunately I've spent enough time in stuff like lisp that instead of going "wtf" it makes me "omg squeeee", but it's totally understandable | 13:46 | |
13:47
ItayAlmog joined
13:50
zakharyas joined
13:53
ItayAlmog left
13:56
ItayAlmog joined,
MilkmanDan joined
|
|||
TheLemonMan | are nativecalls subs supposed to accept default arguments like regular subs ? | 13:57 | |
13:57
ItayAlmog left
13:58
heatsink left
14:01
Wiertek left
14:02
kyclark_ joined,
ItayAlmog joined
14:03
kyclark_ left
14:04
ItayAlmog left
14:11
kyclark_ joined
14:14
g4 left
14:18
kyclark_ left,
sufrostico joined,
MilkmanDan left
14:31
acrussell joined
14:36
pierre_ left
14:37
smls joined
|
|||
skids | TheLemonMan: I don't know. That might just not be implemented yet, along with putting wrapper code around the {*} like in a proto. | 14:38 | |
m: proto sub foo ($s) { "OHAI".say; {*} }; multi foo ($s) { $s.say }; foo("THERE") | |||
camelia | rakudo-moar 1a16f6: OUTPUT«OHAITHERE» | ||
unmatched} | skids: did you want to appear as just "skids" in the credits? I forget if I asked you in past releases. | 14:39 | |
If not, please add self to github.com/rakudo/rakudo/blob/nom/CREDITS | |||
14:40
darutoko left
14:41
darutoko joined
14:43
darutoko left
14:45
MilkmanDan joined
14:46
cibs left
14:48
cibs joined
|
|||
skids | unmatched}: do you want to do the whole PR dance or just add me? | 14:48 | |
unmatched} | skids: I can add you, just let me know what to add | 14:50 | |
14:50
zacts left
14:52
mcmillhj left
14:53
mcmillhj joined
|
|||
skids wonders how long the nick list is for unmatched} :-) | 14:54 | ||
unmatched} | :} | 14:55 | |
smls | Hn, why does `zef install Inline::Python` say "Aborting due to build failure" | 14:57 | |
without giving more info | |||
unmatched} | Try with zef --debug | ||
14:57
rba_ joined
|
|||
unmatched} | "VERBOSITY LEVEL (from least to most verbose) -error, --warn, --info (default), --verbose, --debug" | 14:58 | |
14:58
sufrostico left
|
|||
smls | ah, thanks | 14:58 | |
it was the 'ol python2 vs 3 issue again | 15:00 | ||
needed to `sudo ln -sf python2 /usr/bin/python` | |||
nine | Have they still not given up on Python 3? | 15:01 | |
smls | ;) | ||
15:05
tailgate^2 joined
15:07
mcmillhj left,
wamba left
15:09
mcmillhj joined
15:11
jack_rabbit joined,
canopus left
15:14
mcmillhj left,
zacts joined
15:16
nowan_ joined
|
|||
harmil_wk | m: my \ℕ = ^Inf; say ℕ[^3]; for zip(ℕ, ^3) -> ($i, $n) { $i.say }; for ℕ -> $i { .say; last if (state $n = 0)++ >= 2 } | 15:17 | |
camelia | rakudo-moar dd5c28: OUTPUT«(0 1 2)012(Any)(Any)(Any)» | ||
harmil_wk | Those first two behave as I would expect. Why do I get Any from the last one? | ||
15:18
canopus joined
|
|||
unmatched} | harmil_wk: looks like you put the data in $i, yet are doing .say (which is on $_) | 15:18 | |
harmil_wk | Doh! | ||
Thanks | |||
15:19
nowan left
|
|||
El_Che | smls: are you sure you used spaced and no tabs in the command "zef install Inline::Python" | 15:20 | |
smls | ? | 15:21 | |
El_Che | bad joke :) | ||
15:21
mcmillhj joined
|
|||
smls | ah, I get it now :) | 15:21 | |
El_Che | :) | 15:22 | |
dj_goku | El_Che: haha zef install Inline::Python | 15:23 | |
El_Che | :) | ||
tadzik | hahah | 15:25 | |
El_Che | I have 2 computer jokes. The other one is 'have you tried to turn it on and off again', but it was less applicable :) | ||
skids | "You're not turning it off and on again fast enough, keep doing it faster till you see the sparks" | 15:26 | |
El_Che | hehe | ||
15:26
mcmillhj left,
jack_rabbit left
|
|||
lucs | And when quantum computers are a thing: "Have you tried turning it off and on at the same time?" | 15:27 | |
skids | Why not we already have quantum USB ports -- you can't tell which way on the plug is up until you actually observe it to collapse the state. | 15:28 | |
15:29
mcmillhj joined
15:32
itaipu joined
15:36
pierre_ joined
15:37
khw joined
|
|||
El_Che | haha | 15:38 | |
15:41
pierre_ left,
ufobat left
|
|||
crucialrhyme | does perl 6 support unicode identifiers? i'm very concerned with i18n and so would like to exclusively use emoji for variable names, to make sure code is understandable to non english speakers | 15:42 | |
nine | crucialrhyme: it does. Though it does restrict identifiers to what Unicode thinks are characters that should be used for identifiers. | 15:43 | |
unmatched} | m: sub term:<😹> { 42 }; say 😹 | ||
camelia | rakudo-moar dd5c28: OUTPUT«42» | ||
nine | /msg cameli: my $😹 = 1 ; say $😹; | 15:44 | |
Woah | |||
15:44
danaj joined
|
|||
unmatched} | m: sub term:<😹> is rw {$}; 😹 = 42; say 😹² | 15:44 | |
camelia | rakudo-moar dd5c28: OUTPUT«1764» | ||
nine | my irssi's input is considerably screwed by using emoji | ||
vcv | mine too. same with vim | 15:45 | |
crucialrhyme | this is legit though. tooling aside it's definitely only the cool languages that can do this | ||
nine | Or rather my terminal | 15:46 | |
TheLemonMan | nine, definitely your terminal | ||
unmatched} | TheLemonMan: you're a core irssi dev? | 15:47 | |
TheLemonMan | unmatched}, dev and evangelist heh | 15:48 | |
unmatched} | :) | ||
unmatched} hides his copy of weechat | |||
El_Che | Long live irssi! | ||
timotimo | weechat <3 | 15:53 | |
haven't looked back :P | |||
but irssi is still good | |||
TheLemonMan wonders if the nameless blocks are a feature (or just a bug ? :) | |||
15:54
zengargoyle left,
zacts left
|
|||
vcv | ffff~.~~~ | 15:55 | |
timotimo | the nameless blocks of what? | ||
vcv | sorry, terminal was frozen for a minute | ||
timotimo | know that feel ;( | 15:56 | |
maybe you forgot to hit return before your .~? | |||
TheLemonMan | timotimo, 'sub x () { my $x = 1; given $x { when Int { die 3; } } }; x()' the ones shown in the backtrace | ||
15:56
telex left
|
|||
timotimo | maybe we want to skip blocks that can't be called from anywhere else but the very place they're written down at? | 15:57 | |
15:57
kyclark joined
|
|||
TheLemonMan | wrong example, meh, it's what #125477 | 15:57 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=125477 | ||
El_Che | is weechat a fork or irssi? It look similar | ||
kyclark | How do I indicate that an sub should return an Array of Str? | ||
timotimo | no, it's a different codebase | ||
TheLemonMan | *what RT says | ||
15:57
telex joined
15:58
telex left
|
|||
timotimo | oh | 15:58 | |
that's fine, i think | |||
15:58
jeek left
16:00
telex joined,
rkazak joined
16:03
bpmedley left
16:05
bpmedley joined
|
|||
unmatched} | m: react { whenever IO::Socket::Async.connect('irc.freenode.net', 6667) -> $c { $c.print: "NICK NotZoffix\nUSER Z Z Z Z\nJOIN #perl6\nPRIVMSG #perl6 :Zoffix, stop messing around!!"; } } | 16:06 | |
camelia | ( no output ) | ||
16:06
rkazak left
|
|||
kyclark | gist.github.com/kyclark/767cb16372...b20c813502 | 16:06 | |
unmatched} | m: react { whenever IO::Socket::Async.connect('irc.freenode.net', 6667) -> $c { $c.print: "NICK NotZoffix\nUSER Z Z Z Z\nJOIN #perl6\nPRIVMSG #perl6 :Zoffix, stop messing around!!"; whenever $c.Supply -> $buf {say $buf }; } | ||
camelia | rakudo-moar dd5c28: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Missing blockat <tmp>:1------> 3henever $c.Supply -> $buf {say $buf }; }7⏏5<EOL>» | ||
unmatched} | bah | ||
timotimo | i didn't realize the irc server would let you send your stuff before you've received the appropriate amount of other stuff | 16:07 | |
smls | rosettacode.org/mw/index.php?title=...;limit=250 -- o.O does the author of the Sidef programming language ever rest? | 16:08 | |
unmatched} | timotimo: some servers don't would ignore join until they send you 001, but freenode's not one of them | ||
kyclark: ? The error message is correct | |||
smls | Interestingly, it seems Sidef has become more Perl 6-ish with this update, bowwowing the gather/take construct, @( ) contextualizer, etc. | 16:09 | |
*rr | |||
timotimo | kyclark: you can only pass that type check if you define an Array of Str and return that | ||
kyclark: we won't go through an array and check if all its elements match Str | 16:10 | ||
16:10
shlomif joined
|
|||
unmatched} | m: react { whenever IO::Socket::Async.connect('irc.freenode.net', 6667) -> $c { $c.print: "NICK NotZoffix\nUSER Z Z Z Z\nJOIN #perl6\nPRIVMSG #perl6 :Zoffix, stop messing around!!"; whenever $c.Supply { .say } } } | 16:10 | |
16:10
NotZoffix joined
|
|||
unmatched} | ah, damn, forgot the newline :) | 16:10 | |
16:10
NotZoffix left
|
|||
camelia | rakudo-moar dd5c28: OUTPUT«(timeout):barjavel.freenode.net NOTICE * :*** Looking up your hostname... | 16:10 | |
unmatched} | m: react { whenever IO::Socket::Async.connect('irc.freenode.net', 6667) -> $c { $c.print: "NICK NotZoffix\nUSER Z Z Z Z\nJOIN #perl6\nPRIVMSG #perl6 :Zoffix, stop messing around!!\n"; whenever $c.Supply { .say } } } | 16:11 | |
16:11
NotZoffix joined
|
|||
NotZoffix | Zoffix, stop messing around!! | 16:11 | |
unmatched} | :D | ||
16:11
lizmat joined,
NotZoffix left
|
|||
camelia | rakudo-moar dd5c28: OUTPUT«(timeout):barjavel.freenode.net NOTICE * :*** Looking up your hostname... | 16:11 | |
16:11
Actualeyes left
|
|||
unmatched} is writing an article... on the topic | 16:11 | ||
timotimo | i find it amusing to see the output from the IRC server appear on camelia's output | 16:12 | |
kyclark: does my explanation help? | |||
16:12
Actualeyes joined
|
|||
smls | unmatched}: If you know about this stuff, could you also review my rosettacode entry here? rosettacode.org/wiki/Chat_server#Perl_6 | 16:13 | |
I'm still slightly unsure if it's all thread-safe and correct. | 16:14 | ||
kyclark | Yes. If I lose the return type, I'm not getting the output I expect. gist.github.com/kyclark/767cb16372...b20c813502 | ||
I would expect each kmer (string) to be on a separate line | |||
timotimo | you're joining the kmers with \t instead of \n | 16:15 | |
kyclark | D'oh! | ||
16:15
kjs_ left
|
|||
timotimo | :) | 16:15 | |
unmatched} | smls: no, hash assignment like that is not thread safe | 16:16 | |
smls | even in react/whenever? | ||
timotimo | correct, because the hash can grow when you assign | ||
kyclark | This is ugly and I wouldn't do it for reals but I was curious if this would work (it doesn't) | ||
put map { $seq.seq.substr($_, $k) }, 0..^{ $seq.seq.chars - $k + 1}; | |||
16:16
shlomif left,
kurahaupo joined
|
|||
unmatched} | smls: right. It doesn't automatically lock it for you. | 16:16 | |
timotimo | kyclark: maybe you want to use a rotor over the .comb of your input sequence | 16:17 | |
kyclark | Hmm, I'll have to read some docs | ||
unmatched} | kyclark: this may be of help: perl6.party/post/Perl6-Comb-It perl6.party/post/Perl-6-.rotor-The-...nipulation | ||
smls | unmatched}: Doesn't the react make sure to only run one instance of the whenever at a time? | ||
timotimo | smls: one thought that comes to mind: use supply instead of react, "emit" every pair you want to assign to the hash, then .tap the resulting supply and mutate the hash from there | ||
smls | or something | ||
timotimo | smls: i've had this explained to me on multiple occasions, but i still always forget ... | 16:18 | |
16:18
iH2O joined
|
|||
unmatched} | smls: would that make it not concurrent? | 16:18 | |
s/would/wouldn't/; | |||
lizmat waves from Prague | 16:19 | ||
unmatched} | \o | ||
timotimo | hey lizmat! | ||
smls | unmatched}: I think it would make it like Supply.act instead of Supply.tap | ||
timotimo | that must have been a long bike ride! :) | ||
AlexDaniel | m: mkdir ‘test’ | ||
camelia | rakudo-moar dd5c28: OUTPUT«mkdir is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting line 1 in sub mkdir at src/RESTRICTED.setting line 8 in block <unit> at <tmp> line 1» | ||
lizmat | timotimo: yup, and sideways at that, at max 180km/hour :-) | ||
AlexDaniel | what should I do to make mkdir throw an excetion? | 16:20 | |
timotimo | holy hell | ||
smls | AlexDaniel: use the .IO.mkdir form | 16:21 | |
16:21
iH2O left
|
|||
AlexDaniel | smls: right | 16:21 | |
unmatched} | smls: then react { whenever { ... } } would be no different than loop { for { ... } } | ||
smls | hm... | 16:22 | |
16:22
trnh left
|
|||
unmatched} | smls: I'm gonna test it out and see | 16:22 | |
lizmat | afk until later& | ||
16:22
mcmillhj left
|
|||
AlexDaniel | alright, whatever… Do we have any module for file locks? | 16:24 | |
kyclark | Now with rotor. Comments? | 16:28 | |
gist.github.com/kyclark/767cb16372...b20c813502 | |||
unmatched} | m: my $c = Channel.new; my %h; react { whenever Supply.interval(.001) { %h{$_} = $_; $c.send: $_; done if 20 < (now - INIT now) } }; $c.close; dd [ +(keys %h), +($c.list) ] | 16:29 | |
camelia | rakudo-moar dd5c28: OUTPUT«Unhandled exception in code scheduled on thread 4Access denied to keep/break this Promise; already vowed in any at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1 in block at <tmp> line 1 in block at /home/cam…» | ||
unmatched} | What are those exceptions/access denied are about? | ||
nine | AlexDaniel: IO::Handle has lock and unlock | 16:30 | |
16:31
lostinfog joined
|
|||
unmatched} | m: Channel.new.list; | 16:32 | |
camelia | ( no output ) | ||
AlexDaniel | nine: how does it work? | 16:34 | |
16:36
El_Che left
|
|||
AlexDaniel | uhhhhhhhh github.com/MoarVM/MoarVM/blob/99bf.../io.c#L352 | 16:37 | |
timotimo | that's not what file locks mean :) | 16:40 | |
i don't think? | |||
depends on what the repr behind the IO::Handle things locking means | |||
16:40
zakharyas left
|
|||
geekosaur | how can you tell what it's doing? impl is the same as e.g. flush, all the real logic is in libuv | 16:42 | |
timotimo fails at searchign for it | |||
16:42
El_Che joined
16:44
mcmillhj joined
16:45
El_Che left
16:46
dakkar left
16:47
kjs_ joined
16:48
mcmillhj left
16:51
kjs_ left
17:02
mcmillhj joined
17:04
kyclark left
17:13
hankache joined,
mcmillhj left
17:14
sno left
17:18
El_Che joined
17:19
xiaomiao left
17:20
El_Che left,
El_Che joined
17:21
mcmillhj joined
17:23
xiaomiao joined,
sufrostico joined
17:24
kjs_ joined,
sena_kun joined
17:26
firstdayonthejob joined,
mcmillhj left,
El_Che left
17:27
El_Che joined,
kyclark joined
17:28
kjs_ left,
trnh joined,
trnh left,
trnh joined
|
|||
dalek | -six-help: 7ec6c7f | coke++ | summary.p6: track [MATH] |
17:31 | |
17:31
El_Che left,
El_Che joined,
mcmillhj joined
17:34
heatsink joined
17:35
pierre_ joined
17:36
mcmillhj left
17:39
acrussell left
|
|||
dalek | c: c082929 | titsuki++ | doc/Type/Signature.pod6: Add an index for ;; |
17:39 | |
c: 1966354 | titsuki++ | doc/Type/Signature.pod6: Merge pull request #842 from titsuki/fix-double-semicolon Add an index for ;; |
|||
17:39
El_Che left,
mcmillhj joined,
El_Che joined
17:40
pierre_ left
|
|||
unmatched} | smls: no idea. I can't think of a test that has a good chance to get a race condition whithout hitting a bug I've just discovered. Maybe someone smarter can tell whether react { whenever Supply } is like an .act or like a .tap ¯\_(ツ)_/¯ | 17:41 | |
17:41
sufrostico left
|
|||
unmatched} | (the docs do say "tap the supply", so if it's an .act, they should be amended) | 17:41 | |
sena_kun | 17:42 | ||
yoleaux | 10:36Z <Zoffix> sena_kun: please add yourself to github.com/rakudo/rakudo/blob/nom/CREDITS if you don't want to show up as `Altai-man` in credits. | ||
17:44
mcmillhj left
|
|||
sena_kun | Zoffix, I do want, so don't bother. (: | 17:45 | |
unmatched} | noted | 17:46 | |
dalek | -six-help: 1019430 | coke++ | summary.p6: track [REGEX] |
17:47 | |
17:48
kurahaupo left,
buggable left,
setty1 left
17:50
buggable joined
|
|||
unmatched} | buggable: rt | 17:50 | |
buggable | unmatched}, TOTAL: 1381, UNTAGGED: 471, BUG: 449, LTA: 108, JVM: 64, NYI: 42, CONC: 40, RFC: 36, SEGV: 34, UNI: 29, PERF: 25, REGEX: 21, @LARRY: 17, POD: 14, NATIVECALL: 14, PRECOMP: 12, TODO: 10, BUILD: 8, STAR: 5, GLR: 4, WEIRD: 3, BOOTSTRAP: 3, MOARVM: 2, MATH: 2, OSX: 2, WEB: 1, IO: 1, REGX: 1, LHF: 1, SPESH: 1, DOCS: 1, REPL: 1 Details: bug.perl6.party/1471629057.html | ||
dalek | c/revert-842-fix-double-semicolon: c882ef6 | titsuki++ | doc/Type/Signature.pod6: Revert "Add an index for ;;" |
17:52 | |
17:53
Actualeyes left,
mcmillhj joined
|
|||
dalek | c: c882ef6 | titsuki++ | doc/Type/Signature.pod6: Revert "Add an index for ;;" |
17:57 | |
c: 93cdcb6 | titsuki++ | doc/Type/Signature.pod6: Merge pull request #843 from perl6/revert-842-fix-double-semicolon Revert "Add an index for ;;" |
|||
17:57
setty1 joined
17:58
mcmillhj left
18:01
n1lp7r left
18:02
sno joined,
itaipu_ joined
18:03
sufrostico joined
18:05
labster joined,
itaipu left
|
|||
unmatched} modifies perl6advent.wordpress.com/ to close rt.perl.org/Ticket/Display.html?id=127127 | 18:06 | ||
dalek | c: 94b889e | titsuki++ | doc/Type/Signature.pod6: Fix a ;; index again (use C<<;;>>) |
18:07 | |
c: 6d26699 | titsuki++ | doc/Type/Signature.pod6: Merge pull request #844 from titsuki/fix-double-semicolon-again Fix a ;; index again (use C<<;;>>) |
|||
18:09
mcmillhj joined
18:11
setty1 left
18:13
mcmillhj left
18:16
cognominal left
18:18
mvorg left
|
|||
nine | AlexDaniel: it's really just flock(2) | 18:18 | |
AlexDaniel | nine: ah, so .lock on IO::Handle is flock, did I get that right? | ||
18:18
setty1 joined
|
|||
AlexDaniel | committable6: releases my @a[;]; | 18:19 | |
18:19
committable6 left
|
|||
AlexDaniel | whoah | 18:19 | |
bisectable6: good=2016.07 my @a[;]; | 18:20 | ||
18:20
bisectable6 left
|
|||
AlexDaniel | well | 18:20 | |
18:20
bisectable6 joined
|
|||
AlexDaniel | bisectable6: good=2016.07 my @a[;]; | 18:21 | |
18:21
bisectable6 left
|
|||
AlexDaniel | “Heap corruption detected: pointer 0x7f6130b132f0 to past fromspace” | 18:21 | |
unmatched} | past fromspace! :D | ||
future tospace! | |||
AlexDaniel | well, it does not look like my fault, right? | 18:22 | |
18:22
committable6 joined
|
|||
AlexDaniel | committable6: 2016.07 my @a[;]; | 18:22 | |
18:22
committable6 left
18:23
committable6 joined
|
|||
AlexDaniel | committable6: 2016.07 say ‘hello’ | 18:23 | |
committable6 | AlexDaniel, ¦«2016.07»: hello | ||
18:23
cdg left
|
|||
unmatched} | That doesn't error out on bleed | 18:23 | |
m: my @a[;]; | 18:24 | ||
camelia | ( no output ) | ||
unmatched} | Nothing sinister in REPL either, so seems like that ticket can be closed with tests | ||
AlexDaniel | committable6: 2016.07 ; | ||
committable6 | AlexDaniel, ¦«2016.07»: | ||
[Coke] | didn't I just comment on that ticket? | 18:25 | |
what's the ticket #, ad? | |||
AlexDaniel | #126979 | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=126979 | ||
[Coke] | it was still broken in 2016.07.01 | ||
checking. | |||
AlexDaniel | still, it makes bisectable and committable die… why? Whyyy? | 18:26 | |
committable6: HEAD my @a[;]; | |||
committable6 | AlexDaniel, ¦«HEAD»: | ||
unmatched} | Probably fixed by this one: github.com/rakudo/rakudo/commit/59...09aee6dbbf | ||
AlexDaniel | committable6: HEAD~50 my @a[;]; | ||
committable6 | AlexDaniel, ¦«HEAD~50»: | ||
[Coke] | yup, was fixed since 2016.07.1 | ||
AlexDaniel | committable6: HEAD~100 my @a[;]; | ||
committable6 | AlexDaniel, ¦«HEAD~10»: | ||
[Coke] | 'will update comment. | ||
AlexDaniel | committable6: HEAD~300 my @a[;]; | ||
18:26
committable6 left
|
|||
unmatched} | 'cause IIRC that fixed the barf with @[;] or whatever that short code was | 18:26 | |
18:27
mcmillhj joined
|
|||
AlexDaniel | unmatched}: yeah, I thought about it too | 18:27 | |
[Coke] | Done. | ||
AlexDaniel | unmatched}: have a commit hash that fixed it? | ||
unmatched} points up :) | |||
AlexDaniel | omg, I'm blind | ||
dalek | c/revert-844-fix-double-semicolon-again: ec8929a | titsuki++ | doc/Type/Signature.pod6: Revert "Fix a ;; index again (use C<<;;>>)" |
||
18:27
committable6 joined
|
|||
AlexDaniel | committable6: 59b7e51b34 my @a[;]; | 18:27 | |
committable6 | AlexDaniel, ¦«59b7e51»: | 18:28 | |
AlexDaniel | committable6: 59b7e51b34~1 my @a[;]; | ||
committable6 | AlexDaniel, ¦«59b7e51»: ===SORRY!===Unknown QAST node type BOOTInt «exit code = 1» | ||
AlexDaniel | committable6: 59b7e51b34~2 my @a[;]; | ||
dalek | c: 000a24d | smls++ | doc/Language/operators.pod6: Improve explanation of reduction operators * Fixed some incorrect/outdated info. * Made some sentences less confusing. * Linked to </routine/reduce>, made sure not to duplicate its info on reduction semantics, and instead focus on the syntactical details of the operator form. |
||
18:28
committable6 left
|
|||
18:28
jeek joined
|
|||
c: 234e846 | smls++ | doc/Language/operators.pod6: Remove the "user defined" example in the Reduction Operators section As far as I can see, this example does not belong here. Contrary to what it claims, it doesn't define a reduce operator - it merely defines a completely custom operator that happens to use square brackets in its symbol. Nor is is the functionality it implements related to reduce - rather, it seems to re-implement (part of) the functionality of the built-in `map` routine. |
|||
AlexDaniel | so there you have it ;) | ||
unmatched} | \o/ | ||
18:28
El_Che left,
El_Che joined
18:29
El_Che left,
MilkmanDan left,
El_Che joined
|
|||
Xliff | Have a weird SEGV in rakudo | 18:30 | |
Not golfed. I don't know how I would start to golf this. | |||
dalek | c: ec8929a | titsuki++ | doc/Type/Signature.pod6: Revert "Fix a ;; index again (use C<<;;>>)" |
||
c: 871ab84 | titsuki++ | doc/Type/Signature.pod6: Merge pull request #845 from perl6/revert-844-fix-double-semicolon-again Revert "Fix a ;; index again (use C<<;;>>)" |
|||
Xliff | I'll start writing up a gist. | ||
unmatched} | Xliff: on HEAD? and does it involve Proc::Async ? | ||
AlexDaniel | “Internal error: zeroed target thread ID in work pass”… | ||
18:31
MilkmanDan joined,
bisectable joined,
mcmillhj left
|
|||
AlexDaniel | bisectable: my @a[;]; | 18:31 | |
right, it will time out | 18:32 | ||
at least it does not crash /o\ | 18:33 | ||
ok stop | |||
18:33
bisectable left,
bisectable6 joined,
committable6 joined
18:35
El_Che left,
El_Che joined
18:37
andreoss left
|
|||
Xliff | unmatched}, not sure. Looks like it involves Inline::Perl5 | 18:37 | |
18:41
travis-ci joined
|
|||
travis-ci | Doc build failed. Itsuki Toyota 'Merge pull request #845 from perl6/revert-844-fix-double-semicolon-again | 18:41 | |
travis-ci.org/perl6/doc/builds/153639375 github.com/perl6/doc/compare/234e8...1ab84ea124 | |||
18:41
travis-ci left
|
|||
Xliff | gist.github.com/Xliff/a835c15ae283...d7b2b4ebc2 | 18:44 | |
^^ describes SEGV | 18:49 | ||
18:49
wamba joined
18:53
labster left
|
|||
[Coke] | your backtrace starts in a perl 5 function, so yes, Inline::Perl5 | 18:55 | |
what version of I::p5 are you using? | |||
unmatched} | And Rakudo. Recently my SEGV with Perl 5's Mojolicious went away... | 18:56 | |
So ensure you're using latest and greatest of everything | |||
18:57
mcmillhj joined
|
|||
[Coke] | unmatched}: This is Rakudo version 2016.07.1-225-g5f2818b built on MoarVM version 2016.07-17-g40948f6 | 18:58 | |
implementing Perl 6.c. | |||
unmatched} | m: | 18:59 | |
m: '' | |||
camelia | rakudo-moar 079da9: OUTPUT«WARNINGS for <tmp>:Useless use of constant string "" in sink context (line 1)» | ||
[Coke] | also, maybe, what version of perl 5? | ||
19:03
TakinOver joined
19:06
mcmillhj left
19:07
AndyBotwin left
19:08
AndyBotwin joined,
itaipu_ left,
Wiertek joined
|
|||
harmil_wk | Seeing Perl_yyparse in a backtrace... ah memories... and PTSD | 19:10 | |
AlexDaniel | “fatal: write failure on 'stdout': Connection reset by peer” | 19:11 | |
/o\ | |||
[Coke] | m: enum Suit <♠ ♥ ♣ ♦> is export; | ||
camelia | rakudo-moar 079da9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3enum Suit <♠ ♥ ♣ ♦>7⏏5 is export; expecting any of: infix infix stopper postfix statement end …» | ||
[Coke] | that's a change. | ||
harmil_wk | AlexDaniel: y u reset? :) | ||
AlexDaniel | committable6: releases enum Suit <♠ ♥ ♣ ♦> is export; | ||
committable6 | AlexDaniel, gist.github.com/7992880d5516a894a5...6b08008284 | ||
Xliff | OK. Updating Inline::Perl5 | 19:13 | |
harmil_wk | Is &?ROUTINE read-only? | ||
smls | m: enum Suit is export <♠ ♥ ♣ ♦>; # [Coke] | ||
camelia | ( no output ) | ||
19:14
rindolf left,
espadrine left
|
|||
AlexDaniel | arguably it is LTA because it could've suggested that | 19:14 | |
[Coke] | smls: huh. wonder when that changed. (digging up an old p6 project) | 19:15 | |
thanks | |||
masak | harmil_wk: I should hope so! :P | ||
harmil_wk: what are you trying to achieve, exactly? | |||
[Coke] | oh, and I also had this: | ||
m: enum Suit <a b c>; class Suit is { ... }; | 19:16 | ||
camelia | rakudo-moar 079da9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Invalid nameat <tmp>:1------> 3enum Suit <a b c>; class Suit is7⏏5 { ... };» | ||
[Coke] | m: enum Suit <a b c>; class Suit { ... }; | ||
camelia | rakudo-moar 079da9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Redeclaration of symbol Suitat <tmp>:1------> 3enum Suit <a b c>; class Suit7⏏5 { ... }; expecting any of: generic role» | ||
masak | [Coke]: those look right to me. | ||
harmil_wk | masak: Was trying to figure out if you could attach docs to a routine that way. If you were auto-translating Python, for example, the first sink-context string before code is the doc. | ||
Nominally, such a string shouldn't do any work, but it can in Python... kind of sketchy that way. | 19:17 | ||
19:17
rindolf joined
|
|||
masak | oh yes, those """ strings | 19:18 | |
well, "do any work" might be a bit of a stretch. it does have an effect, but it's definitely on the declarative side | |||
harmil_wk | Oh, I'm wrong. If you do any work, python will ignore it | ||
masak | harmil_wk: I guess you're already aware that one can attach Pod documentation to things? | 19:19 | |
[Coke] | masak: yes, I'm saying that I had working code before with both kinds of Suits. | ||
grondilu | I wonder why they used a string and not just comments. | ||
[Coke] now has to decide what he meant. | |||
masak | [Coke]: oh! you expected it to work having an `enum` and a `class` with the same name like that? | 19:20 | |
harmil_wk | masak: yeah, I was just trying to figure out what the minimal change would be. I think that's the right thing to do... it's a project for the back-back-burner, though. | ||
unmatched} | m: #`(some docs)sub foo {}say foo.WHY | ||
camelia | rakudo-moar 079da9: OUTPUT«(Any)» | ||
unmatched} | harmil_wk: FWIW, I forget the exact syntax, but Perl 6 does have a way of attaching docs to a sub. They'd be accessible via .WHY | ||
grondilu | you need #| | ||
[Coke] | masak: ... it USED TO WORK | 19:21 | |
Xliff | Wow! SEGV has been banished! | ||
unmatched} | m: #|some docssub foo {}say foo.WHY | ||
camelia | rakudo-moar 079da9: OUTPUT«(Any)» | ||
masak | [Coke]: yes, I hear you. | ||
unmatched} | m: #|(some docs)sub foo {}say foo.WHY | ||
camelia | rakudo-moar 079da9: OUTPUT«(Any)» | ||
grondilu | hum | ||
Xliff | Updating gist. | ||
masak | [Coke]: but I was still surprised at your expectation. I know Rakudo has bugs :) | ||
grondilu | m: #=(some docs)sub foo {}say foo.WHY | ||
camelia | rakudo-moar 079da9: OUTPUT«(Any)» | ||
[Coke] ponders just nuking this project from orbit and starting over. | |||
harmil_wk | Next question, more relevant to active work: I recall someone saying that some work was done at some point on importing the OEIS sequences, but that that was dropped. | ||
[Coke] | I only expected it to work in Dec 2014, apparently. | 19:22 | |
harmil_wk | Is there anything left of that, since I now have a module half-written, I don't want to step on anything that's already there. | ||
[Coke] | harmil_wk: yah, we're not doing that. | ||
moritz | harmil_wk: I don't think it was ever seriously planned for core | ||
harmil_wk: but for a module, that's a good idea | |||
unmatched} | m: gist.github.com/zoffixznet/1f0b59a...158cfc8035 | ||
camelia | rakudo-moar 079da9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Invalid typename 'Spell' in parameter declaration.at <tmp>:1------> 3sub cast(Spell7⏏5 $s)» | ||
unmatched} | m: #= some docssub foo {}say foo.WHY | 19:23 | |
camelia | rakudo-moar 079da9: OUTPUT«(Any)» | ||
unmatched} | Oh, damn | ||
m: #= some docssub foo {}say &foo.WHY | |||
camelia | rakudo-moar 079da9: OUTPUT«Nil» | ||
unmatched} | ~_~ | ||
harmil_wk | moritz: thanks. Yeah, I started with just wanting to have a more functional ℤ, ℕ and ℝ and then it got... out of hand :-) | ||
moritz | harmil_wk: the usual terminology is "that escalated quickly" :-) | 19:24 | |
harmil_wk | yes, exactly. only when dealing with OEIS "quickly" has lots of definitions :-) | ||
unmatched} | m: sub foo #= some docs {}say &foo.WHY | 19:25 | |
camelia | rakudo-moar 079da9: OUTPUT«some docs» | ||
unmatched} | There we go :) lol took awhile | ||
masak | harmil_wk: pretty sure there must've been a toggled "kidding" bit on that conversation | ||
harmil_wk | :) | 19:26 | |
19:26
TEttinger joined
|
|||
grondilu | so the #= must be just before the opening curly?? I had no idea. | 19:27 | |
makes sense, though. | 19:28 | ||
19:29
setty1 left
19:31
sno left
19:33
mcmillhj joined
|
|||
grondilu | hang on | 19:33 | |
unmatched} hangs off | 19:34 | ||
grondilu | #| { test } sub {}.WHY.say | ||
m: #| { test } sub {}.WHY.say | |||
camelia | ( no output ) | ||
unmatched} | m: #| { test } sub {}.WHY.say | ||
camelia | rakudo-moar 3c2e29: OUTPUT«{ test }» | ||
grondilu | not sure why the newline is required | 19:35 | |
m: (#| { test } sub {}).WHY.say | |||
camelia | rakudo-moar 3c2e29: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unable to parse expression in parenthesized expression; couldn't find final ')' at <tmp>:1------> 3(#| { test } sub {}).WHY.say7⏏5<EOL>» | ||
grondilu | m: #| { test } sub foo {}; say foo.WHY | ||
camelia | ( no output ) | ||
unmatched} | It just treats it as a comment, I presume | ||
m: #| { test } sub foo {}; say &foo.WHY | 19:36 | ||
camelia | rakudo-moar 3c2e29: OUTPUT«{ test }» | ||
unmatched} | m: #| meow sub foo {}; say &foo.WHY | ||
camelia | rakudo-moar 3c2e29: OUTPUT«meow» | ||
unmatched} | The reason it wasn't working for me above is 'cause I forgot the & on the sub | ||
grondilu | m: #= { test } sub {}.WHY.say | ||
camelia | ( no output ) | ||
19:37
smls left
|
|||
unmatched} | m: #=(test) sub {}.WHY.say | 19:37 | |
camelia | rakudo-moar 3c2e29: OUTPUT«Nil» | ||
grondilu | ^I suspect this not working is a bug | ||
19:37
mcmillhj left
|
|||
grondilu | unmatched}: if you don't end by newline you must use curlies | 19:38 | |
unmatched} | m: #={ test } sub {}.WHY.say | ||
camelia | rakudo-moar 3c2e29: OUTPUT«Nil» | ||
grondilu | m: #= { test } sub {}.WHY.say # <- this not working is suspicious | ||
camelia | ( no output ) | ||
grondilu | m: #= { test } sub {}.WHY.say; say "alive!" | ||
camelia | ( no output ) | ||
grondilu | oh | 19:39 | |
m: #={ test } sub {}.WHY.say; say "alive!" | |||
camelia | rakudo-moar 3c2e29: OUTPUT«Nilalive!» | ||
grondilu | Ic | ||
unmatched} | Well, I don't see a problem with that. It just it assumes it's a regular comment when there's space after |= or whatever | ||
grondilu | yeah I forgot that the space makes it ignore the opening curly | ||
I'm not familiar with those things | 19:40 | ||
19:42
trnh left,
domidumont joined
|
|||
Xliff | m: @a = <<a b c>>; say @a | 19:44 | |
camelia | rakudo-moar 3c2e29: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '@a' is not declaredat <tmp>:1------> 3<BOL>7⏏5@a = <<a b c>>; say @a» | ||
Xliff | m: my @a = <<a b c>>; say @a | ||
camelia | rakudo-moar 3c2e29: OUTPUT«[a b c]» | ||
Xliff | m: my @a = <<a b c>>; dd @a | ||
camelia | rakudo-moar 3c2e29: OUTPUT«Array @a = ["a", "b", "c"]» | ||
19:46
zengargoyle joined
19:47
domidumont left
19:48
domidumont joined,
mcmillhj joined
19:50
MasterDuke joined
19:53
mcmillhj left
19:57
itaipu joined
19:59
wamba left
20:02
mcmillhj joined
20:03
labster joined
20:06
mcmillhj left
|
|||
harmil_wk | Mathematical / philosophical / perhaps religious question... Should ℕ.elems give Inf or fail? I'm leaning toward Inf... | 20:08 | |
It's technically imprecise as I think it's something like 2^aleph0 but for all Perl really cares, I think Inf is fine. | 20:09 | ||
20:11
cdg joined,
Piotr joined
20:15
Wiertek left
20:16
MilkmanDan left
20:17
pyrimidine left
20:19
mcmillhj joined
|
|||
grondilu | m: constant ℕ = ^Inf; say ℕ[^10] | 20:20 | |
camelia | rakudo-moar 920295: OUTPUT«(0 1 2 3 4 5 6 7 8 9)» | ||
grondilu | that'd be a fun constant to define | ||
moritz | harmil_wk: we don't do different infiniteies :-) | ||
tailgate^2 | m: ℕ.elems | 20:24 | |
camelia | rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routine: ℕ used at line 1» | ||
20:24
mcmillhj left,
setty1 joined,
hankache left
|
|||
tailgate^2 | m: constant ℕ = ^Inf; say ℕ.elems | 20:24 | |
camelia | rakudo-moar 920295: OUTPUT«Inf» | ||
20:26
setty1 left,
domidumont left
20:27
setty1 joined
20:31
tailgate^2 left
20:34
mcmillhj joined
20:36
heatsink left
|
|||
harmil_wk | tailgate: Yeah, the default would definitely be Inf. I'm inclined to go that way | 20:36 | |
moritz: Not... yet ;-) | 20:37 | ||
grondilu: It's in the module I'm writing along with ℤ, ℝ and lots of OEIS sequences. | 20:38 | ||
20:39
cyphase left,
mcmillhj left
20:41
skrilax joined
20:42
pyrimidine joined
20:44
cyphase joined
|
|||
grondilu | ℝ can not be a sequence though, can it? | 20:44 | |
sena_kun | grondilu, it cannot. | 20:46 | |
harmil_wk | grondilu: it can. There are only limited things you can reason about it. It's essentially "-Inf, {fail "Not countable"} ... Inf" Same problem, to a lesser extent with the Integers | ||
But it's useful in a few contexts as a sentinel value, for assertions and a few other things. | 20:47 | ||
20:48
Wiertek joined
20:49
mcmillhj joined
20:51
Piotr left
20:52
skrilax left
|
|||
harmil_wk | One good example is you should be able to ask "is pi in ℝ" and get True, but "is 1i in ℝ" should give False. | 20:53 | |
20:53
mcmillhj left
|
|||
Xliff | Is there an easy way to currency print in P6 so that 1000 becomes "$1,000"? | 20:54 | |
grondilu | pi is defined as a Rat though, so it's not in R | 20:55 | |
20:55
cyphase left
|
|||
grondilu | Xliff: not builtin. But a module would be welcome | 20:55 | |
there may be a printf code for thousand separator though | 20:56 | ||
m: printf "%'d", 1e6 | 20:57 | ||
camelia | rakudo-moar 920295: OUTPUT«Directive 'd is not valid in sprintf format sequence %'d in any at /home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm line 1 in any panic at /home/camelia/rakudo-m-inst-2/share/nqp/lib/NQPHLL.moarvm line 1 in any statement a…» | ||
Xliff | m: my $a = "100000"; say $a.comb(3) | ||
camelia | rakudo-moar 920295: OUTPUT«(100 000)» | ||
Xliff | m: my $a = "100000"; say $a.comb(3).join(',') | ||
camelia | rakudo-moar 920295: OUTPUT«100,000» | ||
Xliff | m: my $a = "1000000"; say $a.comb(3).join(',') | ||
camelia | rakudo-moar 920295: OUTPUT«100,000,0» | ||
Xliff | D'oh | ||
20:58
Wiertek left
|
|||
grondilu | bash supports %' | 20:58 | |
Xliff | m: my $a = "1000000"; say $a.reverse.comb(3).reverse.join(',') | ||
camelia | rakudo-moar 920295: OUTPUT«Cannot resolve caller comb(List: Int); none of these signatures match: (Cool $: *%_) (Cool $: Regex $matcher, $limit = Inf, *%_) (Cool $: Str $matcher, $limit = Inf, *%_) in block <unit> at <tmp> line 1» | ||
Xliff | m: my $a = "1000000"; say $a.reverse.comb(3) | ||
camelia | rakudo-moar 920295: OUTPUT«Cannot resolve caller comb(List: Int); none of these signatures match: (Cool $: *%_) (Cool $: Regex $matcher, $limit = Inf, *%_) (Cool $: Str $matcher, $limit = Inf, *%_) in block <unit> at <tmp> line 1» | ||
Xliff | m: my $a = "1000000"; say $a.reverse | ||
camelia | rakudo-moar 920295: OUTPUT«(1000000)» | ||
Xliff | Humm... | ||
harmil_wk | grondilu: all rationals are real. You're talking types, I'm talking ranges. | ||
ℝ is not a type (even though the category theorists will try to assert that there's little difference) | 20:59 | ||
21:00
cyphase joined,
mvorg joined
|
|||
grondilu | well we do have Real, don't we? Or maybe I'm not sure what your point is. | 21:00 | |
21:00
ptolemarch left
|
|||
grondilu | m: say pi ~~ Real; say 1i ~~ Real | 21:00 | |
camelia | rakudo-moar 920295: OUTPUT«TrueFalse» | ||
harmil_wk | You're still talking about type comparisons. As you pointed out a Rat is not a Real, but the value you put in a Rat is a "real number". | 21:01 | |
grondilu | oh yeah. | ||
of course what I wrote above was inaccurate indeed | |||
harmil_wk | I find it interesting that pi is Real... I assumed it was a Rat too | 21:02 | |
grondilu | well Real is a Role implemented by Rats | ||
(IIRC) | |||
harmil_wk | I thought that was Rational and Rat was a class... maybe I have it backwards. | 21:03 | |
grondilu | Perl6's Real is the closest you can get from math's concept of Real numbers. | ||
MasterDuke | m: my $a = "1000000"; say $a.flip.comb(3).reverse.join(',') | 21:04 | |
camelia | rakudo-moar 920295: OUTPUT«1,000,000» | ||
harmil_wk | Yeah, it's definitely better than a machine float | ||
MasterDuke | Xliff: is that ^^^ what you were looking for? | ||
grondilu | it's a bit unfortunate that "Complex" is not the equivalent for complex numbers, if you ask me. | ||
geekosaur | Rat is class, Rational is role, Real is role (done by Rational) | ||
grondilu | m: say 1 ~~ Complex # arguably that should be true | 21:05 | |
camelia | rakudo-moar 920295: OUTPUT«False» | ||
harmil_wk | $a.flip.comb ... I find myself thinking it should say, "aaaayyyyy" after that. | ||
21:05
skids left
|
|||
kyclark | Is there a way to trigger the default USAGE from within a script? | 21:06 | |
21:06
skids joined
|
|||
kyclark | Also, could I add a statement to it? E.g., “k must be positive”? | 21:06 | |
21:06
mcmillhj joined
|
|||
timotimo | m: say USAGE | 21:07 | |
camelia | rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared name: USAGE used at line 1» | ||
timotimo | m: say &*USAGE | ||
camelia | rakudo-moar 920295: OUTPUT«Dynamic variable &*USAGE not found in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
timotimo | m: say $*USAGE | ||
camelia | rakudo-moar 920295: OUTPUT«Dynamic variable $*USAGE not found in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
timotimo | m: say $USAGE | ||
camelia | rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$USAGE' is not declaredat <tmp>:1------> 3say 7⏏5$USAGE» | ||
timotimo | i don't even know | ||
grondilu | $?USAGE exists in the source | ||
timotimo | ah, that one | ||
grondilu | m: say $?USAGE | ||
camelia | rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$?USAGE' is not declaredat <tmp>:1------> 3say 7⏏5$?USAGE» | ||
grondilu | lol | 21:08 | |
kyclark | So I’ve declared a “subset PosInt of Int where * > 0;” and then I have “PosInt $k” | ||
MAIN prints USAGE if I pass -k=-3, but it doesn’t say why | |||
21:08
Wiertek joined
|
|||
Xliff | MasterDuke, LOL! That's actually pretty close to what I came up with. | 21:08 | |
grondilu | kyclark: UInt exists in the core | ||
Xliff | m: "10000000".flip.comb(3).join(',').flip.say | ||
camelia | rakudo-moar 920295: OUTPUT«10,000,000» | ||
grondilu | m: say sub (UInt $) {} | ||
camelia | rakudo-moar 920295: OUTPUT«sub (Int $ where { ... }) { #`(Sub|69905928) ... }» | ||
Xliff | MasterDuke, I think I like yours better. | 21:09 | |
Thanks! | |||
MasterDuke | welcome | 21:10 | |
kyclark | Hmm, UInt is good, thanks! | ||
Xliff | Ack! | ||
MasterDuke... | |||
m: my $a = "10000000"; say $a.flip.comb(3).reverse.join(',') | |||
camelia | rakudo-moar 920295: OUTPUT«01,000,000» | ||
Xliff | Mine gets that right. | ||
*sob* -- the syntax of .flip.comb(3).reverse.join(',') sounds like it DWIM though! | 21:11 | ||
m: "10000000".flip.comb(3).join(',').flip.say | |||
camelia | rakudo-moar 920295: OUTPUT«10,000,000» | ||
21:11
mcmillhj left
|
|||
Xliff | m: "10000000".flip.comb(3).join(',') | 21:11 | |
camelia | ( no output ) | ||
Xliff | m: "10000000".flip.comb(3).join(',').say | ||
camelia | rakudo-moar 920295: OUTPUT«000,000,01» | ||
Xliff | LOL | ||
21:13
skids left
|
|||
kyclark | Can I “die” without the trace info? | 21:14 | |
masak | kyclark: you can "note" and then "exit" | 21:15 | |
kyclark | OK | ||
masak | probably exit(1) or some other nice non-zero exit code | ||
21:16
mcmillhj joined
|
|||
Xliff | m: "3859486323".flip.comb(3).join(',').say | 21:17 | |
camelia | rakudo-moar 920295: OUTPUT«323,684,958,3» | ||
Xliff | m: "3859486323".flip.comb(3).join(',').flip.say | ||
camelia | rakudo-moar 920295: OUTPUT«3,859,486,323» | ||
21:19
AlexDaniel left
|
|||
Xliff | ARGH! This gets complex with floating point. | 21:19 | |
m: "3859486323.81".flip.comb(3).join(',').flip.say | 21:20 | ||
camelia | rakudo-moar 920295: OUTPUT«3,859,486,323,.81» | ||
Xliff | m: "3859486323.81667".flip.comb(3).join(',').flip.say | ||
camelia | rakudo-moar 920295: OUTPUT«3,859,486,323,.81,667» | ||
perlpilot | why the spurious quotes? :) | ||
21:20
mcmillhj left
|
|||
MasterDuke | m: "3859486323.81667".flip.comb(3).join(,).flip.say | 21:21 | |
camelia | rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Preceding context expects a term, but found infix , insteadat <tmp>:1------> 3"3859486323.81667".flip.comb(3).join(,7⏏5).flip.say» | ||
MasterDuke | don't think any of the quotes are spurious? | 21:22 | |
geekosaur | quotes around the number are superfluous (Cool) | ||
grondilu | m: say 1i.im | ||
camelia | rakudo-moar 920295: OUTPUT«1» | ||
MasterDuke | m: 3859486323.81667 .flip.comb(3).join(',').flip.say | ||
camelia | rakudo-moar 920295: OUTPUT«3,859,486,323,.81,667» | ||
MasterDuke | m: 3859486323.81667.flip.comb(3).join(',').flip.say | 21:23 | |
camelia | rakudo-moar 920295: OUTPUT«3,859,486,323,.81,667» | ||
grondilu | since we were talking about it, couldn't we define Complex as a role and have Real implement it? Something like role Real does Complex { method im { 0 } } | ||
MasterDuke | only since the flip comes first, couldn't comb() directly after | 21:24 | |
m: 3859486323.81667.comb(3).join(',').flip.say | |||
camelia | rakudo-moar 920295: OUTPUT«Cannot resolve caller comb(Rat: Int); none of these signatures match: (Cool $: *%_) (Cool $: Regex $matcher, $limit = Inf, *%_) (Cool $: Str $matcher, $limit = Inf, *%_) in block <unit> at <tmp> line 1» | ||
MasterDuke | m: 3859486323.81667 .comb(3).join(',').flip.say | ||
camelia | rakudo-moar 920295: OUTPUT«Cannot resolve caller comb(Rat: Int); none of these signatures match: (Cool $: *%_) (Cool $: Regex $matcher, $limit = Inf, *%_) (Cool $: Str $matcher, $limit = Inf, *%_) in block <unit> at <tmp> line 1» | ||
21:25
sno joined
21:26
mcmillhj joined,
MilkmanDan joined
21:27
itaipu left
21:29
trnh joined
21:30
Wiertek left
21:31
mcmillhj left
21:32
trnh left
21:36
AlexDaniel joined,
MilkmanDan left
|
|||
perlpilot | btw, does RosettaCode have a commify routine? It probably should | 21:37 | |
(hint, hint :) | |||
21:37
pierre_ joined
|
|||
grondilu | what's "commify"? | 21:38 | |
perlpilot | docstore.mik.ua/orelly/perl/cookbook/ch02_18.htm | ||
It was actually an example in Programming Perl IIRC | 21:39 | ||
grondilu | all languages will probably use this very regex, though. | ||
so it's of relatively little interest for RosettaCode | 21:40 | ||
IMHO | |||
perlpilot | perhaps | ||
grondilu | feel free to make a draft task though. It's quite easy to do. | 21:41 | |
21:42
pierre_ left
21:43
perlpilot left
21:52
pmurias left,
cyphase left
|
|||
grondilu | m: role C {...}; role R does C { method b returns C { C } }; role C { method a returns R {...}; method b returns R {...} }; # testing if circularity | 21:55 | |
camelia | ( no output ) | ||
grondilu | .=trans(C => "Complex", R => "Real") | 21:56 | |
I mean I remember being annoyed when I had to explicity convert an Int to Complex when feeding a function that accepted Complex arguments. That should not be so. | 21:57 | ||
21:57
cyphase joined
|
|||
grondilu | m: sub (Complex $z) { say "$z" }(1) | 21:57 | |
camelia | rakudo-moar 920295: OUTPUT«Type check failed in binding to $z; expected Complex but got Int (1) in sub at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
grondilu | ^that's LTA if you ask me | ||
"expected Complex but got Int" <-- that's just embarassing, really. | 21:58 | ||
geekosaur | I think you just proved your point about having a Complex role | ||
masak | numeric types not matching type-wise the way they naturally embed math-wise continues to be a surprise to people at all levels of Perl 6... :) | 22:00 | |
geekosaur | it does seem not-Perl-ish | 22:01 | |
in Haskell it makes perfect sense | |||
grondilu | masak: yes TimToady once told me the same thing. I'm just not still convinced. | ||
masak | not trying to convince anyone of anything right now | 22:02 | |
just stating a fact about surprise | |||
22:02
TheLemonMan left
|
|||
grondilu | rather he told me that was a conscious decision not to nest numeric types as in maths or something. | 22:02 | |
22:03
rindolf left
|
|||
masak | well, I do think it's a very Liskov notion to say that an Int isn't a type of Rat | 22:03 | |
nor is a Rat a type of Num | |||
you might argue that Perl 6 comes at it from how the types are represented (efficiently), not how they nest mathematically | 22:04 | ||
El_Che | still about the errors: does rakudo only output utf8 errors? I am thinking of ⏏ (I tried using LANG C and stuff and it looks like utf8 only) | 22:05 | |
grondilu | one day, if I ever find time and courage, I'll rewrite the whole thing with roles and stuff, and see if that runs the spectests and if we lose any performance. | 22:06 | |
geekosaur | performance is likely to suffer, yes | 22:07 | |
masak | grondilu: also consider things like `if $n ~~ Rat`, but then it's actually an Int, but under your regime suddenly it matches True | 22:08 | |
22:09
MilkmanDan joined
|
|||
grondilu | not that I doubt there is any, but I'm struggling to see an example of use case where you really want to check that a variable is really a Rat and not an Int. | 22:11 | |
22:12
Wiertek joined
22:14
mcmillhj joined,
lizmat left
|
|||
masak | grondilu: I'm just pointing out that there's the risk of people writing `if $n ~~ Rat` while not considering that Int would be included in that check. | 22:15 | |
grondilu | also in any case you could write if $n.denominator !== 1 | ||
masak | yes, but you'd *have to*, that's my point | ||
grondilu | true | ||
masak | for all its faults, with the current factoring, you don't have to do anything like that | ||
you also don't have to live in a world where an Int has a .denominator :) | 22:16 | ||
grondilu | but they do :/ | ||
masak | I'm almost ready to classify that response as some kind of Stockholm syndrome | 22:17 | |
but let's call it a simple disagreement for now ;) | |||
grondilu | I do see how that's can be confusing though. To be frank none of the points of view entirely satisfy me. | 22:19 | |
22:19
mcmillhj left
|
|||
masak | fair enough | 22:22 | |
22:22
AlexDaniel left
22:23
firstdayonthejob left
22:28
mcmillhj joined
|
|||
[Coke] | (numeric types not the same hier as maths) could be done in a Math:: module. | 22:29 | |
22:33
mcmillhj left
|
|||
kyclark | I just wrote up a section on types. I’d appreciate any input. kyclark.gitbooks.io/metagenomics/c...types.html | 22:33 | |
grondilu | [Coke]: in order to be useful such a module would have to override literals. That can be tough to write. | 22:34 | |
22:35
Zoffix left
22:38
mvorg left
|
|||
masak | you could override literals in a slang | 22:39 | |
22:40
Piotr joined
22:41
skids joined
|
|||
grondilu | yes. I'll try that one of these days. | 22:43 | |
22:44
Wiertek left
22:45
mcmillhj joined
22:49
mcmillhj left
22:52
lostinfog left
22:56
lizmat joined
|
|||
harmil_wk | m: class Foo is Range { multi method new(:$min=0, :$max=10, :$excludes-min = True, :$excludes-max = False) { nextwith :$min, :$max, :$excludes-min, :$excludes-max } }; say Foo.new.excludes-min | 23:05 | |
camelia | rakudo-moar 920295: OUTPUT«False» | ||
harmil_wk | How can that be false? I'm setting it to True... | ||
geekosaur | m: my $s = Range.new(:min(0), :max(10), :excludes-min, :!excludes-max); say so $s.excludes-min | 23:11 | |
camelia | rakudo-moar 920295: OUTPUT«False» | ||
23:11
jack_rabbit joined
|
|||
masak | m: say Range.new(:excludes-min(True)).excludes-min | 23:11 | |
camelia | rakudo-moar 920295: OUTPUT«False» | ||
geekosaur | I suspect excludes-min is not a keyword parameter to the Range constructor, so does nothing when nextsame-d | ||
and theres no sane way to report "no constructor along the build plan used this keyword" | |||
(sadly) | 23:12 | ||
er nextwith-d | |||
23:12
kurahaupo joined
23:13
DrParis left
23:16
DrParis joined
|
|||
masak | 'night, #perl6 | 23:16 | |
japhb | Good night, masak! | 23:17 | |
Sleep well ... | |||
23:21
bjz left
23:28
MilkmanDan left
23:33
mcmillhj joined
23:34
Piotr left,
Wiertek joined
23:37
mcmillhj left
|
|||
timotimo | we alaread have a slang that lets you override literals | 23:38 | |
23:40
Wiertek left
23:57
kyclark left
|