»ö« 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
BrassLantern joined
00:13
labster left
|
|||
Zoffix | It's so quiet.... You could download the sound of a pin dropping... | 00:18 | |
00:19
kurahaupo left
00:21
addison left
|
|||
TEttinger | sprint! | 00:23 | |
dj_goku | ........| | 00:34 | |
00:35
RabidGravy left
00:56
BrassLantern left
01:07
rgrinberg left,
cdg left
01:10
BenGoldberg_ joined
01:14
labster joined
|
|||
Zoffix | If you are "neuron", "ianmcb", and "LLFourn" wish to use their full names instead of nicknames in this month's Rakudo's contributors list, let me know. | 01:14 | |
llfourn, ping ^ | |||
01:22
silug left
01:31
huggable joined
01:35
molaf left
01:37
silug joined
01:45
ilbot3 left
01:47
molaf joined,
ilbot3 joined
|
|||
TEttinger | Zoffix, that's their real name, it's welsh | 01:51 | |
it's pronounced by wrapping your tongue around your left eye and sneezing | 01:52 | ||
01:54
kalkin- left,
kalkin-_ joined
|
|||
jdv79 | could you demonstrate? | 01:54 | |
TEttinger | I haven't made my sacrifice to Wlldrkrrl today | 01:57 | |
01:58
MasterDuke joined
|
|||
Zoffix | Ah :) OK then :) | 02:06 | |
02:11
Khisanth left
02:14
itaipu joined
|
|||
dalek | sectbot: 6f9e9a6 | (Daniel Green)++ | benchable.pl: Discard STDOUT and round timing results |
02:19 | |
02:25
itaipu left
02:26
_28_ria left
02:28
Khisanth joined
|
|||
dalek | sectbot: b56e519 | (Daniel Green)++ | benchable.pl: Add missing initial '|' from error output |
02:35 | |
02:43
Madcap^Jake^ joined,
Madcap^Jake^ is now known as MadcapJake
02:44
noganex_ joined
02:47
noganex left
|
|||
dalek | sectbot: f579c64 | (Daniel Green)++ | benchable.pl: Better associate errors with the commit they came from |
02:49 | |
02:57
Tonik joined
|
|||
Tonik | I write | 03:00 | |
my $a = 42; | |||
my $b := $a; | |||
... and I do some awesome stuff ... | |||
but then I want $b to become a happy free variable again, not bound to $a. How do I do that without touching $a? | |||
AlexDaniel | great question | 03:02 | |
Zoffix | Bind it to something else? | ||
geekosaur just tried Scalar.new but it doesn't like that | |||
Zoffix | m: my $a = 42; my $b := $a; $b = 72; say $a; my $z = 42; $b := $z; $b = 'meow'; say $a | ||
camelia | rakudo-moar e2ec35: OUTPUT«7272» | ||
AlexDaniel | Zoffix: what if you want $b = 42 without binding? | ||
Zoffix | TBH, there's likely a much better solution to Tonik's problem. | 03:03 | |
Tonik | Zoffix, $b wants to be on its own, not bound to anyone :( | ||
Zoffix | Tonik, why? | ||
Tonik | because if it can't, it will feel something is wrong with Perl 6 | 03:04 | |
Zoffix | :/ | ||
Very well then. | |||
konobi | yeah, you'd just use a different variable in real life, no? | ||
but it's probably doable | 03:05 | ||
geekosaur | hack alert | 03:07 | |
m: my $a = 4; my $b := $a; $b = 6; say $a; $b := $; $b = 2; say $a; say $b; | |||
camelia | rakudo-moar e2ec35: OUTPUT«662» | ||
Tonik | I've been trying to wrap my mind around the idea of binding in Perl 6, and I almost convinced myself it makes sense, until I found out you can rebind what's already been bound, and it all fell apart for me. Seems that every variable is in fact a pointer, but you don't get to enjoy the full power of pointers as in other languages, and these pointers are shoved down your throat whether you want it or not | ||
konobi | well, everything's a reference | ||
Tonik | except "my $a := 42" which is not, right? | 03:08 | |
AlexDaniel | wait, um… if you don't want to rebind then just don't? Doctor, it hurts when I do this… | ||
konobi | Tonik: github.com/rakudo/rakudo/blob/nom/...ariable.pm | 03:10 | |
so gotta be able to do it somehow =0) | 03:11 | ||
geekosaur points up at hack | |||
an alternative would be for Scalar.new to not produce Nil... | |||
well, actually, the hack will lose if it's used in a scope that gets re-entered at some point, since $ will use the same Scalar each time whereas $a will be a new one each time, so not 100% the same behavior | 03:13 | ||
Tonik | geekosaur, uh, what is $ ? | 03:15 | |
geekosaur | anonymous state variable | ||
(like a C `static`) | |||
konobi | geekosaur: seems to me like a lot of that sort of state management would be a pretty interesting pattern for IOC | 03:16 | |
Tonik | I see | ||
geekosaur | but since it's anonymous, every use of `$` is distinct; so if you did `$b := $; $c := $;` then each one gets its own `state` variable which will be reused every time the scope is re-entered | 03:17 | |
would have to figure out how to bind it to a new Scalar to avoid this (which currently throws) | 03:19 | ||
m: my $a = 4; my $b := $a; $b = 6; say $a; $b := Scalar.new; $b = 2; say $a; say $b; | |||
camelia | rakudo-moar e2ec35: OUTPUT«6Cannot call method 'BUILDALL' on a null object in block <unit> at <tmp> line 1» | ||
geekosaur | (I suspect it can be made to work but Scalar.new needs more information, which if I had to guess is an initial content --- but it also does not take positionals. so I'd have to dig into implementation of Scalar to see what to feed it) | 03:20 | |
konobi | could you apply a role to the instance of the Scalar and override the scope? | 03:21 | |
*blink* could do some crazy stuff | 03:23 | ||
03:24
adu joined,
kid51 joined
|
|||
geekosaur looks at Scalar impl and gets a headache --- need to create a Perl6::Metamodel::ContainerDescriptor, then the Scalar with named parameters descriptor and value | 03:25 | ||
gfldex | konobi: could can't get hold of an instance of scalar. There is no way to tell the compiler you are talking to the container. There is Proxy tho. | ||
adu | TimToady! | ||
Zoffix | Would be neat if bisectable could bisect hangs. | 03:28 | |
Can it take a gist? | 03:29 | ||
AlexDaniel | sure | ||
Tonik | if some of you guys have a sensible visual representation of what a scalar is and how binding works, please share it with me | 03:30 | |
or draw it on a piece of paper and show it to me | |||
Zoffix | ," gist.githubusercontent.com/zoffixz...tfile1.txt | ||
bisect: gist.githubusercontent.com/zoffixz...tfile1.txt | |||
bisectable | Zoffix: Successfully fetched the code from the provided URL. | 03:31 | |
Zoffix: Exit code is 1 on both starting points, bisecting by using the output | |||
Zoffix: bisect log: gist.github.com/1314ad2dec81edc86f...a94eb64bc8 | |||
Zoffix: (2015-12-25) github.com/rakudo/rakudo/commit/07fecb5 | |||
Zoffix | Tonik, there's Containers page on docs. It may be useful: docs.perl6.org/language/containers | ||
Tonik | nono, I want to know how *you* *visualize* it | ||
adu | Tonik: "scalar"? | ||
Zoffix | I don't use binding. | 03:32 | |
Tonik sighs | |||
adu | Tonik: my personal definition of scalar is "not deep" | ||
gfldex | Zoffix: you do use binding by calling subs and methods | ||
my personal definiton of scalar is "double indirection". Also somebody else wrote that scalars are object the forward pretty much all their methods to another object. | 03:33 | ||
Tonik | gfldex, double indirection sounds about right :( | 03:34 | |
geekosaur | the "natural" state of a name is to bind to something. if you bind it to a value, the name is readonly. if you bind it to a container, the name is read-write and you can store values in the container and replace them with new values. `=` stores a new value in a container (and throws if it's not bound to a container). `:=` binds to something else, which may be a container from some other place. | ||
gfldex | don't look so much at := and ::= to understand binding. Look at signatures and calls. | 03:35 | |
also, default values. | |||
Tonik | hm. what is ::= ? | ||
gfldex | compile time binding | 03:36 | |
Tonik | oh | ||
geekosaur | it makes a reasonable amount of sense to me, but then I program in Haskell so I have a clear distinction between the concepts to start with :) | ||
gfldex | m: my Int $i = Failure.new('Dude, I'm empty!'); say $i; | ||
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unable to parse expression in argument list; couldn't find final ')' at <tmp>:1------> 3my Int $i = Failure.new('Dude, I'7⏏5m empty!'); say $i; expecting any of: infix i…» | ||
gfldex | m: my Int $i is default Failure.new('Dude, I'm empty!'); say $i; | 03:37 | |
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3my Int $i is default7⏏5 Failure.new('Dude, I'm empty!'); say $i expecting any of: constraint infix infix stopper …» | ||
gfldex | m: my Int $i = 1is default Failure.new('Dude, I'm empty!'); say $i; | ||
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Confusedat <tmp>:1------> 3my Int $i = 17⏏5is default Failure.new('Dude, I'm empty!» | ||
gfldex | m: my Int $i = 1 is default Failure.new('Dude, I'm empty!'); say $i; | ||
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3my Int $i = 17⏏5 is default Failure.new('Dude, I'm empty expecting any of: infix infix stopper postfix statement…» | ||
Tonik | "::=" not yet implemented. Sorry. | ||
Tonik sighs | |||
gfldex | m: my Int $i is default Failure.new('Dude, I'm empty!') = 1; say $i; | ||
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3my Int $i is default7⏏5 Failure.new('Dude, I'm empty!') = 1; sa expecting any of: constraint infix infix stopper …» | ||
geekosaur | doesn't is default require some kind of parens/braces? (i.e. it is syntactically an adverb) | ||
Zoffix | It's a trait | 03:39 | |
m: my Int $i is default(Failure.new: 'Dude, Im empty!') = 1; | |||
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Default value '(HANDLED) Dude, Im empty! in any at src/Perl6/World.nqp line 2199 in any trait_mod:sym<is> at gen/moar/m-Perl6-Actions.nqp line 5056 in any trait_mod:sym<is> at src/Perl6/Grammar.…» | ||
gfldex | m: my Int $i is default(42); $i = 10; $i = Nil; say $i; | 03:40 | |
camelia | rakudo-moar e2ec35: OUTPUT«42» | ||
gfldex | m: my $i is default(Failure.new("Dude, I'm empty!")) = 1; say $i; | 03:41 | |
camelia | rakudo-moar e2ec35: OUTPUT«1» | ||
gfldex | m: my $i is default(Failure.new("Dude, I'm empty!")); say $i; | ||
camelia | rakudo-moar e2ec35: OUTPUT«===SORRY!===Dude, I'm empty!» | ||
gfldex | the type constraint seams to peek into the container and triggers the Failure | 03:42 | |
m: my Int $i is default(Nil); | 03:44 | ||
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Default value 'Nil' will never bind to a parameter of type Intat <tmp>:1------> 3my Int $i is default(Nil)7⏏5; expecting any of: constraint» | ||
gfldex | m: my $i is default(Nil); | ||
camelia | ( no output ) | ||
gfldex | m: my $i is default(Nil); dd $i; | ||
camelia | rakudo-moar e2ec35: OUTPUT«Nil $i = Nil» | ||
03:44
Zoffix left
|
|||
gfldex | ha! I finally found a way to hold onto Nil. :) | 03:44 | |
that leaves the question if that is sensible to allow | 03:45 | ||
03:45
rgrinberg joined
04:00
kid51 left
|
|||
dalek | sectbot: a8df0e3 | (Aleks-Daniel Jakimenko-Aleksejev)++ | benchable.pl: Oops, restore server |
04:00 | |
04:02
benchable joined,
jsimonet left,
jsimonet joined
04:08
khw left
04:12
skids left
04:13
BrassLantern joined
|
|||
MasterDuke | benchable: HEAD~50..HEAD my $a = "a" x 2**16;my $b = $a.chop($_) for ^1000 | 04:18 | |
04:18
cpage__ joined
|
|||
benchable | MasterDuke: gist.github.com/0d621f847cc2b80db1...e77d20c71b | 04:19 | |
04:19
cpage_ left,
cpage__ is now known as cpage_
|
|||
AlexDaniel | benchable: 2015.10,2016.02,2016.04,HEAD my $a = "a" x 2**16;my $b = $a.chop($_) for ^5000 | 04:20 | |
benchable | AlexDaniel: |«2015.10»:1.1509|«2016.02»:1.0659|«2016.04»:1.0590|«HEAD»:1.1272 | ||
04:23
djbkd left
04:24
djbkd joined
|
|||
dalek | sectbot: f763de7 | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (2 files): Fix encoding issue get_output should probably decode automatically, but for now this is enough. |
04:26 | |
04:27
adu left
|
|||
dalek | sectbot: 57bd995 | (Aleks-Daniel Jakimenko-Aleksejev)++ | committable.pl: Oops, missed “use” |
04:28 | |
04:29
bisectable left,
committable left,
bisectable joined,
committable joined
04:37
Cabanossi left
04:40
Cabanossi joined
04:57
holyghost left
04:58
holyghost joined
05:01
samb1 left
05:12
samb1 joined
05:20
AlexDaniel left
05:29
CIAvash joined
05:31
huggable left,
huggable joined
05:35
BrassLantern left
05:39
cpage_ left
05:40
cpage_ joined
05:42
wamba joined
05:48
BenGoldberg_ left
06:01
canopus left
06:05
furelypunctional joined
06:06
canopus joined
06:12
djbkd left
06:16
TreyHarr1 left
06:30
domidumont joined
06:34
domidumont left
06:35
domidumont joined
06:40
domidumont left
|
|||
masak | in a moment of weakness, I expected .prompt to be a method on $*IN, not just a global sub | 06:40 | |
now that I think about it, I'm not sure that was reasonable -- prompt() does involve both output and input | 06:41 | ||
but I will not that I did expect it :) | |||
note* | 06:42 | ||
no big deal either way -- I'll solve what I wanted to do in a different way ;) | 06:44 | ||
06:49
maddingue joined
06:58
darutoko joined
07:01
firstdayonthejob joined
07:03
donaldh joined
07:04
canopus left
|
|||
moritz | could $*OUT.prompt($message, :readfrom($*IN)) | 07:05 | |
or $*IN.prompt($message, :out($*OUT)) | |||
07:09
canopus joined
|
|||
Ulti | lizmat++ another tenth of a second saving on my tests | 07:18 | |
07:21
rgrinberg left,
domidumont joined
07:32
domidumont left
07:40
RabidGravy joined
07:49
donaldh left
07:51
wamba left
08:00
firstdayonthejob left
08:04
furelypunctional left
|
|||
Xliff_ | Will .defined return true if scalar is set to a type object? | 08:07 | |
Always thought it returned false. | |||
m: my $a = Str; say $a.defined; | 08:08 | ||
camelia | rakudo-moar e2ec35: OUTPUT«False» | ||
Xliff_ | And so it doesn't. Hmmm... | ||
m: use NativeCall; class A does Str { }; my $a = nativecast(A, Str); say $a.defined; | 08:09 | ||
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Str is not composable, so A cannot compose itat <tmp>:1» | ||
Xliff_ | m: use NativeCall; class A does Int { }; my $a = nativecast(A, Int); say $a.defined; | ||
camelia | rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Int is not composable, so A cannot compose itat <tmp>:1» | ||
Xliff_ | Hrm. | 08:10 | |
08:19
FROGGS joined
|
|||
FROGGS | o/ | 08:22 | |
08:35
rindolf joined
08:39
girafe joined
08:41
cpage_ left
|
|||
holyghost | »ö« | 08:53 | |
09:01
Ven joined
09:10
wamba joined
|
|||
masak | »ö« | 09:21 | |
09:24
setty1 joined
09:31
huggable left,
huggable joined
09:36
Senji left,
Senji joined
09:39
TreyHarr1 joined
09:49
wamba left
09:55
donaldh joined,
espadrine joined
10:02
rindolf left
10:03
TEttinger left
10:06
rindolf joined
10:16
donaldh left
10:19
labster left
|
|||
Xliff_ | FROGGS: \o | 10:53 | |
m: use NativeCast; class A is repr('CStruct') { }; class B does A { }; my $a = A; my $b = nativecast(B, $a); say $b.defined; | 10:55 | ||
camelia | rakudo-moar cd19db: OUTPUT«===SORRY!===Could not find NativeCast 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…» | ||
Xliff_ | m: use NativeCall; class A is repr('CStruct') { }; class B does A { }; my $a = A; my $b = nativecast(B, $a); say $b.defined; | ||
camelia | rakudo-moar cd19db: OUTPUT«5===SORRY!5=== Error while compiling <tmp>A is not composable, so B cannot compose itat <tmp>:1» | ||
Xliff_ | m: use NativeCall; class A is repr('CStruct') { has int32 $.a }; class B does A { }; my $a = A; my $b = nativecast(B, $a); say $b.defined; | 10:56 | |
camelia | rakudo-moar cd19db: OUTPUT«5===SORRY!5=== Error while compiling <tmp>A is not composable, so B cannot compose itat <tmp>:1» | ||
Xliff_ | m: use NativeCall; class A is repr('CStruct') { has int32 $.a }; class B is A { }; my $a = A; my $b = nativecast(B, $a); say $b.defined; | ||
camelia | rakudo-moar cd19db: OUTPUT«Internal error: unhandled target type in sub nativecast at /home/camelia/rakudo-m-inst-1/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 406 in block <unit> at <tmp> line 1» | ||
jnthn | Xliff_: At a guess, you'd need to mark B as "is repr('CStruct')" too for that to work | 10:57 | |
Xliff_ | m: use NativeCall; class A is repr('CStruct') { has int32 $.a }; class B is A is repr('CStruct') { }; my $a = A; my $b = nativecast(B, $a); say $b.defined; | ||
camelia | rakudo-moar cd19db: OUTPUT«False» | ||
Xliff_ | jnthn: Yep. Thanks. | ||
jnthn | Also, you can factor things out in to roles and compose those into classes marked "is repr('CStruct')" if you like | ||
Since composition is flattening, that should Just Work. | 10:58 | ||
Xliff_ | jnthn: Thanks! That's good to know. | ||
Right now I'm trying to figure out why certain routines seem to be returning type objects even though they've gone through a .defined check. | 10:59 | ||
So far every use case I've tried through camelia seems to work fine, but in my code it doesn't. Must be missing something. | |||
jnthn | Odd... Guess it's a case of trying to boil it down to the smallest possible test case... | 11:04 | |
11:04
avenj left
11:08
TreyHarr1 left
11:19
kid51 joined
11:20
girafe left
11:22
girafe joined
|
|||
timotimo | also, just to make sure it's not something wonky in spesh or something, try MVM_SPESH_DISABLE=yesplease | 11:23 | |
11:40
pmurias joined
|
|||
pmurias | .tell konobi using v8-profiler and loading the profiles in chrome turned out the thing I needed for profiling | 11:42 | |
yoleaux | pmurias: I'll pass your message to konobi. | ||
pmurias | do we have an API for profiling things? | ||
that is for turning profiling on from Perl6/NQP code? | 11:43 | ||
11:43
cpage_ joined
|
|||
timotimo | we do for moarvm | 11:46 | |
but it's just two ops | |||
11:48
girafe2 joined,
TreyHarr1 joined
11:50
girafe left
|
|||
masak | moritz: I'd argue that .prompt is "more" a method on $*IN than on $*OUT, since $message is optional but the .get is not ;) | 11:55 | |
pmurias | timotimo: how are they used? | 12:09 | |
jnthn | pmurias: I think the most natural way would be to nqp::getcomp('perl6').eval('some code', :profile(1)) or some such | 12:10 | |
pmurias: (Which already should work, or something close to it) | 12:11 | ||
See run_profiled in the MoarVM Backend.nqp in the NQP repo for how it's done | |||
In fact, you can probably use nqp::getcomp('perl6').backend.run_profiled($code_object) | |||
12:12
kaare_ left
|
|||
jnthn | (Note, method names from memory, may not 100% match reality ;)) | 12:12 | |
12:27
amoe_ joined
12:37
pmqs_ joined
12:41
pmqs_ left
12:46
kid51 left
12:52
pmurias left
12:56
BenGoldberg_ joined
13:01
avenj joined,
avenj left,
avenj joined
|
|||
dogbert17 | it's very quiet around here, is everyone out tapping their beer supplies | 13:01 | |
m: say 'a b' ~~ /a b/ | 13:02 | ||
camelia | rakudo-moar 88c35e: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at <tmp>:1 ------> 3say 'a b' ~~ /a7⏏5 b/Nil» | ||
dogbert17 | do we really need to list this as a trap when we get this warning? docs.perl6.org/language/traps#Regexes | 13:03 | |
13:05
sammers left
|
|||
MasterDuke | IMHO, yes. Perl 5 regexes are almost muscle memory now, but i have to stop and think about Perl 6 syntax. anything to warn people ahead of time is good | 13:10 | |
psch | the warning somewhat goes against /x as default | 13:12 | |
dogbert17 | MasterDuke: perl6 does warn you, but the text implies that is does not, perhaps it needs to be rephrased a bit | 13:13 | |
psch | and perl5 doesn't warn on 'say "foo" =~ / f o o /x' | ||
(yes, i had to check :P ) | |||
which is to say i'd rather like the warning to go and only keep it around in language/traps | 13:15 | ||
m: $ = quietly / a b / # especially as it's not quietly-able | 13:16 | ||
camelia | rakudo-moar 88c35e: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at <tmp>:1 ------> 3$ = quietly / a7⏏5 b / # especial…» | ||
dogbert17 | that's one way I guess. to me it seems that the warning was added after the text was written | ||
13:16
sammers joined
13:18
pmurias joined
|
|||
pmurias | are the situations where you want use /a b/ instead of /ab/ common? | 13:20 | |
13:21
holyghost left
|
|||
psch | matching any continuous over an (arbitrary) length of 40 chars in a regex is where it applies | 13:21 | |
i don't know how common that is, but i also don't think that "how common" matters for my argument | |||
13:22
holyghost joined
|
|||
psch | but i also don't really feel strongly about it | 13:22 | |
it just seems weird to me that we "force" /x on people and complain when they use it to its full extend | |||
jnthn | m: no worries; / a b / | ||
camelia | rakudo-moar 88c35e: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at <tmp>:1 ------> 3no worries; / a7⏏5 b /» | ||
jnthn | Hm, I'd have expected that to suppress it | ||
13:28
kurahaupo joined
13:30
holyghost left,
CIAvash left,
holyghost joined
13:31
huggable left,
huggable joined
|
|||
pmurias | psch: "how common" matters a lot for warnings, what the warning is IMHO intented to catch is people assuming :sigspace is in effect when it's not | 13:35 | |
psch | pmurias: as i said, i don't think that matters for my argument | 13:43 | |
13:43
skids joined
|
|||
psch | pmurias: i mean, the intend behind making all regexen assume /x semantic is to allow arbitrary whitespace | 13:43 | |
pmurias: and then we complain about arbitrary whitespace, which just seems weird | 13:44 | ||
but, as also said, i don't feel strongly about it | |||
13:48
cpage joined
13:49
cpage__ joined
|
|||
pmurias | psch: warnings are for things that are allowed but confusing/seem to be a mistake, for things that are not allowed we have errors | 13:49 | |
13:50
cpage_ left,
cpage__ is now known as cpage_
|
|||
psch | m: /a b+/ # i want to seperate, purposefully, for clarity | 13:51 | |
camelia | rakudo-moar 88c35e: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at <tmp>:1 ------> 3/a7⏏5 b+/ # i want to seperate, p…» | ||
psch | because ab+ is easily misunderstood as "ab"+ | ||
having to silence the warning by rewriting that just makes it worse | |||
granted, if we could silence it that particular case stops being valid | 13:52 | ||
but we can't | |||
m: say "foo" or "bar" # why aren't we warning here? | |||
camelia | rakudo-moar 88c35e: OUTPUT«foo» | ||
psch stops now | |||
i'm getting way to invested :) | |||
masak | because for all the compiler knows, `say` might return something falsy, which makes the rhs of the `or` run | 13:56 | |
14:02
TreyHarr1 left
14:05
TreyHarr1 joined,
kaare_ joined
14:08
canopus left
|
|||
dogbert17 | m: sub postfix:<!>(Int $x where { $x >= 0 }) { [*] 1..$x }; say 5! # oddball question, but why does this take almost one sec to parse | 14:12 | |
camelia | rakudo-moar cd4265: OUTPUT«120» | ||
14:13
rgrinberg joined
|
|||
moritz | dogbert17: adding new operators is fairly expensive, because rakudo has to re-calculate the finite statement machines for the regex engine | 14:15 | |
dogbert17: but it surprises me that it takes almost a second | |||
Xliff_ | timotimo, what is spesh? | 14:16 | |
14:16
Xliff_ is now known as Xlif,
Xlif is now known as Xliff
|
|||
moritz | Xliff: just-in-time specialization of code | 14:16 | |
things like eliminating unecessary type checks, containers etc. | 14:17 | ||
timotimo | yup | ||
Xliff | kk | ||
dogbert17 | moritz: on my machine, (old i5) it takes ~0.9 sec | ||
moritz | 0.5s here | 14:18 | |
dogbert17 | moritz: do you have an i7? | ||
moritz | dogbert17: I think so | ||
14:19
canopus joined
|
|||
dogbert17 | moritz: compare with this, takes 0.13 sec for me: ulti minfix:<+>(Int $x, "same") { 2 * $x }; | 14:19 | |
moritz | if I change it to a regular sub, it takes 0.17s instead | ||
dogbert17 | aha, interesting | ||
moritz | infix:<+> already exists, so no parser changes required there | 14:20 | |
dogbert17 | ah, didn't think of that | ||
Xliff | If I have a base class that has attributes, and a descendent class that wants to set them, how would I do that? | 14:26 | |
Example: class A { has $.a }; class B is A { setA { # Want to set class A's $!a here } } | 14:27 | ||
I think I've asked this before but... | |||
Right now both are repr('CStruct') so I can use nativecast() to access the super, but I don't think that's a wise long-term solution. | |||
timotimo | did someone recommend mixing in a role yet? :) | 14:28 | |
gfldex | m: class B {...}; class A { has $!foo = 42; trusts B; method say { put $!foo } }; class B is A { method m(){ $A::foo = "answer"; } }; B.new.m.say | 14:29 | |
camelia | rakudo-moar cd4265: OUTPUT«answer» | ||
gfldex | Xliff: ^^^ (there may be dragons) | 14:30 | |
Xliff | gfldex: Thanks. Will try. Would prefer to see an example without "has $!att" | 14:31 | |
And that doesn't need trust. | |||
But then again, beggars can't be choosers. | |||
gfldex | m: class A { has $.foo = 42; method say { put $!foo } }; class B is A { method m(){ $A::foo = "answer"; } }; B.new.m.say | ||
camelia | rakudo-moar cd4265: OUTPUT«answer» | ||
gfldex | there you go | ||
Xliff | LOL | ||
timotimo | does the attribute really have to be private? | ||
Xliff | My attributes are not private. | 14:32 | |
gfldex | :-> | ||
timotimo | in that case, why don't you just $.foo = 10? | ||
Xliff | Rakudo doesn't let me. | ||
Says attribute is not found. | |||
timotimo | please share the code where that errors? | ||
14:33
khw joined
|
|||
Xliff | Let me see if I can create a use case, timotimo | 14:33 | |
timotimo | thanks | 14:34 | |
because what you're describing sounds a bit like a bug | |||
14:36
ggoebel joined
|
|||
Xliff | Attribute $!intSubset not declared in class XML::LibXML::Document | 14:38 | |
But $!intSubset is declared in xmlDoc, and class XML::LibXML::Document is xmldoc. | 14:39 | ||
Er... | |||
class XML::LibXML::Document is xmlDoc. | |||
github.com/Xliff/p6-XML-LibXML/blo...cts.pm#L95 <- xmlDoc def | 14:40 | ||
github.com/Xliff/p6-XML-LibXML/blo...ent.pm#L18 <- XML::LibXML::Document def | 14:41 | ||
github.com/Xliff/p6-XML-LibXML/blo...nt.pm#L527 <- Line causing error. | 14:43 | ||
timotimo, sorry to be throwing the kitchen sink at you, but every time I've tried to pair this down to something small, it doesn't reproduce. | |||
14:43
kid51 joined
|
|||
Xliff | One moar time... | 14:43 | |
14:43
kid51 left,
kid51 joined
|
|||
timotimo | oh | 14:43 | |
it's a regular class and the derived class is a cstruct? | 14:44 | ||
Xliff | Both classes are CStructs | ||
timotimo | i don't see the CStruct for xmlDoc | ||
Xliff | One is barebones for some nativecall routines other is full object rep. | ||
timotimo | when you have the superclass p6opaque and the subclass cstruct, i don't know how that behaves | 14:45 | |
Xliff | timotimo: that is part of the predef... github.com/Xliff/p6-XML-LibXML/blo...cts.pm#L24 | ||
timotimo | oh, ok | 14:46 | |
14:46
mtj_ left
|
|||
timotimo | i haven't used derived classes with cstruct yet, but i thought it'd Just Work™ | 14:46 | |
Xliff | m class A { has $.a }; class B is A { setA($a) { $!a = $a } }; my $b = B.new; $b.setA(42); say $b.a; | 14:47 | |
m: class A { has $.a }; class B is A { setA($a) { $!a = $a } }; my $b = B.new; $b.setA(42); say $b.a; | |||
camelia | rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$a' is not declaredat <tmp>:1------> 3lass A { has $.a }; class B is A { setA(7⏏5$a) { $!a = $a } }; my $b = B.new; $b.se» | ||
Xliff | m: class A { has $.a }; class B is A { method setA($a) { $!a = $a } }; my $b = B.new; $b.setA(42); say $b.a; | ||
camelia | rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Attribute $!a not declared in class Bat <tmp>:1------> 3 B is A { method setA($a) { $!a = $a } }7⏏5; my $b = B.new; $b.setA(42); say $b.a; expecting any of: horizontal whitespace…» | ||
Xliff | ^^^ | ||
m: class A { has $.a }; class B is A { method setA($a) { $A::a = $a } }; my $b = B.new; $b.setA(42); say $b.a; | 14:48 | ||
camelia | rakudo-moar cd4265: OUTPUT«(Any)» | ||
Xliff | O_o | ||
What did I miss? | |||
14:48
ggoebel_ joined
14:49
mtj_ joined
|
|||
Xliff | m: class A { has $.a }; class B is A { method setA($a) { $A!a = $a } }; my $b = B.new; $b.setA(42); say $b.a; | 14:50 | |
camelia | rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$A' is not declared. Did you mean '$a'?at <tmp>:1------> 3$.a }; class B is A { method setA($a) { 7⏏5$A!a = $a } }; my $b = B.new; $b.setA(42» | ||
Xliff | m: class A { has $.a }; class B is A { method setA($a) { $A::a = $a; say $a; } }; my $b = B.new; $b.setA(42); say $b.a; | ||
camelia | rakudo-moar cd4265: OUTPUT«42(Any)» | ||
Xliff | m: class A { has $.a }; class B is A { method setA($a) { $A::a = $a; say $a; say $.a; } }; my $b = B.new; $b.setA(42); say $b.a; | ||
camelia | rakudo-moar cd4265: OUTPUT«42(Any)(Any)» | ||
Xliff | m: class A { has $.foo = 42; method say { put $!foo } }; class B is A { method m(){ $A::foo = "answer"; } }; my $b = B.new; $b.m; say $b.foo | 14:51 | |
camelia | rakudo-moar cd4265: OUTPUT«42» | ||
Xliff | Ah. And thus the dragon breathes fire. | ||
14:52
ggoebel left
|
|||
Xliff | The assignment to $A::foo is not setting the $.foo attribute. | 14:52 | |
14:53
ggoebel_ is now known as ggoebel
14:54
Ven left
14:55
Ven joined
14:56
holyghost left
|
|||
gfldex | m: class A { has $.a }; class B is A { method setA($a) { $A::a := $a; say $a; say $.a; } }; my $b = B.new; $b.setA(42); say $b.a; | 14:56 | |
camelia | rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Cannot use bind operator with this left-hand sideat <tmp>:1------> 3s B is A { method setA($a) { $A::a := $a7⏏5; say $a; say $.a; } }; my $b = B.new; $» | ||
gfldex | $A::a is the accessor method, not the container | 14:57 | |
timotimo | sorry, i'm quite distracted | 14:58 | |
why would you have to $A::a? the method is already public, so it's derived and can be called on self | 14:59 | ||
15:00
ggoebel left
|
|||
gfldex | m: class A is rw { has $.a = 42 }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a; | 15:00 | |
camelia | rakudo-moar cd4265: OUTPUT«42» | ||
gfldex | Xliff: also ^^^ | ||
15:00
ggoebel joined
|
|||
gfldex | m: class A { has $.a = is raw 42 }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a; | 15:00 | |
camelia | rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routines: is used at line 1 raw used at line 1» | ||
gfldex | m: class A { has $.a = is rw 42 }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a; | ||
camelia | rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routines: is used at line 1 rw used at line 1» | ||
gfldex | m: class A { has $.a = is rw; }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a; | 15:01 | |
camelia | rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routines: is used at line 1 rw used at line 1» | ||
gfldex | m: class A { has $.a is rw; }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a; | ||
camelia | rakudo-moar cd4265: OUTPUT«42» | ||
gfldex | ENEEDMORETEA | ||
Xliff | gfldex: Thanks! One of those might work. | 15:02 | |
timotimo: I was trying to set the attribute. Not access a method. | |||
15:04
kid51 left,
adu joined
|
|||
gfldex | Xliff: you may be aiming at your feed. Esp. if you intend to use threads to make your life harder. | 15:04 | |
threads are clearly the work of the devil | 15:05 | ||
pmurias | jnthn: re run_profiled it fits almost perfectly for the kind of profiling support I want to expose on the js backend | 15:07 | |
timotimo | but why don't you set the attribute via the method? | 15:08 | |
Xliff | timotimo: ??? | 15:09 | |
15:09
Ven left
|
|||
Xliff | timotimo: Via what method? | 15:09 | |
timotimo | well, make the attribute rw and set the value via the accessor? | ||
the method that has the same name as the attribute | |||
Xliff | Oh. Could do that, but sometimes we get "Cannot set an immutable object" so I'm forced to drop back to nqp and bindattr. | 15:10 | |
And in those situations I have to nativecast back to the superclass. | |||
And I'm worried that in some situations, when doing that I am confusing something in the model because test that should pass... aren't. | 15:11 | ||
timotimo | just "is rw" :) | 15:12 | |
Xliff | Even with "is rw" I get that "Cannot set an immutable object" error. | ||
Especially when dealing with structs that originate in libxml2. | |||
dogbert17 | m: gist.github.com/dogbert17/dcf078ff...5632b4ad63 | ||
15:12
kid51 joined,
camelia joined
|
|||
Xliff | ok 9 - DTD's system ID matches $htmlSystem | 15:12 | |
Cannot modify an immutable xmlDtdPtr | |||
timotimo | wtf? | ||
15:12
Ven joined
|
|||
Xliff | ^^ There's one. | 15:12 | |
dogbert17 | m: gist.github.com/dogbert17/dcf078ff...5632b4ad63 | 15:13 | |
timotimo | is that attribute rw? | ||
it doesn't seem like you're getting a container there | |||
Xliff | I changed xmlDoc to "is rw" | ||
dogbert17 | hmm, shouldn't that work, evaluating a gist that is | ||
15:13
ChanServ sets mode: +v camelia
|
|||
camelia | rakudo-moar cd4265: OUTPUT«Attempt to return outside of any Routine in block <unit> at <tmp> line 8» | 15:14 | |
Xliff | I can try changing that attribute to "is rw" as well. | ||
dogbert17 | why does the example fail with: Attempt to return outside of any Routine in block <unit> at <tmp> line 8 | ||
timotimo | is rw on the class should do that for you, but i'm not sure how stubbed classes and traits like that interact, really | ||
Xliff | Well I have done "is rw" on the class and the trait. | 15:15 | |
timotimo | OK | 15:16 | |
Xliff | FROGGS initially wrote most of this and was using nqp::bindattr to get around it. | ||
15:16
donaldh joined,
dvinciguerra_ joined
|
|||
gfldex | dogbert17: a pointy block is a Block, what is lower in the chain then A Routine. | 15:16 | |
Xliff | timotimo: Still getting same error. | ||
gfldex | dogbert17: IIRC nexsame and/or callwith fire control exceptions | 15:17 | |
dogbert17 | gfldex: dunno what it should look like but note that I took this from docs.perl6.org/language/functions | ||
gfldex | dogbert17: `return` basicylly _is_ a control exception, that's where the LTA error message comes from | ||
timotimo | are you sure nextsame and callwith work via control exceptoins? | 15:18 | |
... toins? | |||
dogbert17 | gfldex; so does that mean that the example is incorrect? | ||
Xliff | timotimo: github.com/Xliff/p6-XML-LibXML.git. Checkout 07dtd branch. Then run "perl6 -Ilib t/07dtd" to see what I am talking about. | ||
Gotta split for a bit. | |||
gfldex | dogbert17: since we don't got automatic testing on our examples and some of them are quite old, there will be broken examples | 15:19 | |
i know because I fixed a few already | |||
timotimo | i'm not sure i actually can figure that out now | ||
dogbert17 | gfldex: I've fixed a few too but in this case I don't know how it should look ;( | 15:20 | |
in order to do what the author intended | |||
gfldex | m: gist.github.com/gfldex/ecde10b59aa...dc4e74ddf0 | 15:22 | |
camelia | rakudo-moar cd4265: OUTPUT«20+2i» | ||
gfldex | dogbert17: ^^^ | ||
dogbert17 | gfldex++, do you want to fix the doc or should I? | 15:23 | |
gfldex | m: gist.github.com/gfldex/ecde10b59aa...dc4e74ddf0 | ||
camelia | rakudo-moar cd4265: OUTPUT«2NaN» | ||
gfldex | dogbert17: yes please, and this example doesn't need use soft; | ||
actually it does | |||
15:24
Ven left
|
|||
dogbert17 | gfldex: will fix, thx for helping | 15:24 | |
15:26
Ven joined,
skids left
15:27
CIAvash joined
15:28
adu left,
AlexDaniel joined
|
|||
dalek | c: fff09c0 | (Jan-Olof Hendig)++ | doc/Language/functions.pod6: Fixed broken code example. gfldex++ for providing working code. |
15:29 | |
15:30
kid51 left,
kid51 joined
15:31
pmurias left
|
|||
AlexDaniel | committable: HEAD gist.githubusercontent.com/gfldex/...tfile1.txt | 15:34 | |
committable | AlexDaniel: Successfully fetched the code from the provided URL. | ||
AlexDaniel: |«HEAD»: Attempt to return outside of any Routine in block <unit> at /tmp/C9ZdVrwfds line 8 exit code = 1 | |||
AlexDaniel | committable: 2015.12 gist.githubusercontent.com/gfldex/...tfile1.txt | ||
committable | AlexDaniel: Successfully fetched the code from the provided URL. | ||
AlexDaniel: |«2015.12»: Attempt to return outside of any Routine in block <unit> at /tmp/uNm2Cgpdkx line 8 exit code = 1 | |||
AlexDaniel | alright | ||
15:37
travis-ci joined
|
|||
travis-ci | Doc build failed. Jan-Olof Hendig 'Fixed broken code example. gfldex++ for providing working code.' | 15:37 | |
travis-ci.org/perl6/doc/builds/145226944 github.com/perl6/doc/compare/75a68...f09c0c9272 | |||
15:37
travis-ci left
15:38
firstdayonthejob joined
|
|||
AlexDaniel | “Cannot invoke this object (REPR: Null; VMNull)” – yay… | 15:38 | |
gfldex | is `sub trait_mod:<is>(Mu:U $type, :$rw!)` the trait in `class is rw Foo {}` | 15:39 | |
? | |||
15:50
espadrine left
|
|||
dogbert17 | must be a very recent commit which breaks htmlify.p6 | 15:52 | |
gfldex | it seams to fail while processing glossary.pod6 | 15:53 | |
15:55
jack_rabbit left
|
|||
dalek | c: c35be33 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6: doc `is rw` on class |
15:57 | |
16:03
donaldh left
|
|||
gfldex | the docs build fine locally | 16:05 | |
16:06
travis-ci joined
|
|||
travis-ci | Doc build failed. Wenzel P. P. Peppmeyer 'doc `is rw` on class' | 16:06 | |
travis-ci.org/perl6/doc/builds/145230176 github.com/perl6/doc/compare/fff09...5be332c02a | |||
16:06
travis-ci left
|
|||
dogbert17 | gfldex: are you running todays release? | 16:08 | |
gfldex | no | ||
dogbert17 | htmlify.p6 fails for me with: This is Rakudo version 2016.06-283-g76ce6d4 built on MoarVM version 2016.07 | 16:09 | |
gfldex | dogbert17: I may have a old module installed. | 16:12 | |
dogbert17 | gfldex: i suspect something has changed during the last 24 hours, it should narrow things slightly at least | 16:15 | |
gfldex | i will build rakudo next | ||
dogbert17 | perhaps Zoffix should wait with the release ? | 16:16 | |
gfldex | however, given what htmlify.p6 does, it should not trip over a null pointer | ||
dogbert17 | I ran htmlify earlier today, before upgrading, and then it went well. When going through glossary.pod6 htmlify logged 'does not have an =SUBTITLE' three times and then continued | 16:18 | |
gfldex | the =SUBTITLE thing is ok | 16:20 | |
16:26
TreyHarr1 left
|
|||
gfldex | dogbert17: i can reproduce. The regression happened in the last 2 days. We may be able to narrow it with travis logs on the docs. | 16:27 | |
dogbert17 | gfldex: good idea | ||
16:27
darutoko left
|
|||
dogbert17 | last working build is 19 hours old: Deletion of Hash definition, which is alraedy greatly described in Class sect | 16:29 | |
gfldex | dogbert17: i reported in #perl6-dev | ||
gfldex runs to the shop | |||
16:31
TreyHarr1 joined
16:32
Ven left
16:49
TreyHarr1 left
16:50
dvinciguerra_ left
16:55
susmus joined
16:57
jack_rabbit joined
|
|||
dalek | c: e93bd2a | (Zoffix Znet)++ | template/examples.html: Remove unused template/examples.html The redirect has been implemented via .htaccess in a3c7c99 |
17:00 | |
Xliff | FROGGS, you around? | 17:04 | |
17:06
kid51 left
17:08
travis-ci joined
|
|||
travis-ci | Doc build failed. Zoffix Znet 'Remove unused template/examples.html | 17:08 | |
travis-ci.org/perl6/doc/builds/145237269 github.com/perl6/doc/compare/c35be...3bd2a66fab | |||
17:08
travis-ci left
17:10
darutoko joined
17:12
marcel_ joined
|
|||
timotimo | the df chart of hack.p6c.org is worrying me | 17:14 | |
i was hoping it'd throw out the huge log files that happened when i was using the fuzzer and it spammed all the segfaults into the syslog | |||
hm, though that's not yet a full month old | |||
dalek | c: 91a6581 | (Zoffix Znet)++ | htmlify.p6: Remove attempt to copy templates/examples.html It was removed in e93bd2a |
17:18 | |
17:25
cyphase joined
17:26
travis-ci joined
|
|||
travis-ci | Doc build failed. Zoffix Znet 'Remove attempt to copy templates/examples.html | 17:26 | |
travis-ci.org/perl6/doc/builds/145240077 github.com/perl6/doc/compare/e93bd...a658105abd | |||
17:26
travis-ci left,
cooper left
17:28
adu joined
17:31
huggable left,
huggable joined
17:33
adu left
17:34
rgrinberg left
17:35
TreyHarr1 joined
17:50
TreyHarr1 left
17:57
darutoko left
|
|||
dalek | c: 6ebab29 | (Wenzel P. P. Peppmeyer)++ | lib/Pod/Htmlify.pm6: remove is cached, it was too experimental |
18:13 | |
gfldex | dogbert17: it's all good now | 18:14 | |
18:14
djbkd joined,
zacts joined
|
|||
dogbert17 | gfldex++ | 18:16 | |
18:21
TreyHarr1 joined
18:30
zacts left,
travis-ci joined
|
|||
travis-ci | Doc build passed. Wenzel P. P. Peppmeyer 'remove is cached, it was too experimental' | 18:30 | |
travis-ci.org/perl6/doc/builds/145247588 github.com/perl6/doc/compare/91a65...bab29430c2 | |||
18:30
travis-ci left
18:40
MadcapJake left
18:45
djbkd left
18:49
kaare_ left
18:53
RabidGravy left
18:54
TreyHarr1 left
|
|||
dalek | c: 42d01d0 | (Wenzel P. P. Peppmeyer)++ | lib/Pod/Htmlify.pm6: implement cache on url-rewriter because more speed is more better |
18:58 | |
18:58
BenGoldberg_ left
18:59
zacts joined
19:03
setty1 left
19:06
labster joined,
Madcap^Jake^ joined,
Madcap^Jake^ is now known as MadcapJake
19:09
rgrinberg joined
19:10
Sigyn joined
19:12
tomaw joined
19:15
cdg joined
19:34
cdg left,
TreyHarr1 joined
|
|||
gfldex | m: class A { has $.a }; &trait_mod:<is>(A, :rw); | 19:36 | |
camelia | ( no output ) | ||
gfldex | m: class A { has $.a }; &trait_mod:<is>(A, :rw); dd A.new.a = 1; | ||
camelia | rakudo-moar bc722a: OUTPUT«Cannot modify an immutable Any in block <unit> at <tmp> line 1» | ||
gfldex | m: class A { has $.a }; trait_mod:<is>(A, :rw); dd A.new.a = 1; | 19:37 | |
camelia | rakudo-moar bc722a: OUTPUT«Cannot modify an immutable Any in block <unit> at <tmp> line 1» | ||
19:45
djbkd joined
19:46
TreyHarr1 left
19:50
djbkd left
19:56
dwarring joined
20:20
espadrine joined
20:30
yqt joined
|
|||
dalek | frastructure-doc: cecd958 | (Zoffix Znet)++ | hosts/hack.p6c.org.pod: List Zoffix as possessing sudo |
20:35 | |
20:38
TreyHarr1 joined
20:41
CIAvash left,
Tonik left
20:49
TEttinger joined
20:55
zacts left,
zacts joined
21:00
rgrinberg left,
marcel_ left
21:01
sjn_ joined
21:05
sjn_ is now known as sjn
21:09
zacts left
21:10
espadrine left
|
|||
timotimo | gfldex: yeah, that has to be set before composition happens | 21:15 | |
21:16
djbkd joined
|
|||
dalek | c: 2ef1eba | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6: better index entry on is rw for class |
21:17 | |
gfldex | m: my &ieq = &lc o &infix:<eq>; say so 'abc' [&ieq] 'abd'; | ||
camelia | rakudo-moar bc722a: OUTPUT«True» | ||
gfldex | m: my &ieq = &infix:<eq> o &lc; say so 'abc' [&ieq] 'abd'; | 21:18 | |
camelia | rakudo-moar bc722a: OUTPUT«Too many positionals passed; expected 1 argument but got 2 in block <unit> at <tmp> line 1» | ||
gfldex | that can't work I think | ||
do we have a way chain a postfix (method call i case of .lc) and a infix? | 21:19 | ||
timotimo | hm, can you write *.lc there? otherwise it'd have to be { .lc } instead | 21:21 | |
21:21
djbkd left
|
|||
gfldex | the anon sub returned by infix:<o> got 1 positional | 21:21 | |
timotimo | oh | 21:22 | |
right, it should derive that from the right-hand argument | |||
gfldex | and $a [&foo] $b if just $a.&foo($b) | ||
timotimo | well, it's &foo($a, $b) | 21:23 | |
gfldex | m: my &ieq = &infix:<eq> o:2 &lc; say so 'abc' [&ieq] 'abd'; | ||
camelia | rakudo-moar bc722a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Malformed radix numberat <tmp>:1------> 3my &ieq = &infix:<eq> o:27⏏5 &lc; say so 'abc' [&ieq] 'abd'; expecting any of: number in radix notation» | ||
timotimo | which is the same thing i suppose, unless you have an invocant argument in there, or if it's a method object | ||
gfldex | it is the same thing | 21:24 | |
m: my method oi(Int:D: Mu:U){ say 'oi!' }; 42.&oi(Any); | 21:25 | ||
camelia | rakudo-moar bc722a: OUTPUT«oi!» | ||
rindolf | What happened to TimToady ? | ||
gfldex | as any prophet he has to meditate every now and then | 21:26 | |
.seen TimToad | |||
yoleaux | I haven't seen TimToad around. | ||
gfldex | .seen TimToady | ||
yoleaux | I saw TimToady 13 Jul 2016 16:48Z in #perl6: <TimToady> usually the browser does better than the terminal, but in this case it's worse | ||
21:27
zacts joined
21:31
huggable left,
huggable joined
|
|||
gfldex | multi sub infix:<∘> (&f, &g --> Block) { (&f).count > 1 ?? -> |args { f |g |args } !! -> |args { f g |args } } | 21:44 | |
timotimo: ^^^ it only looks at the left function | |||
timotimo | oh, huh | 21:45 | |
Roamer` | hmm, the sequence operator seems to be - only in some cases - a bit smarter than its documentation suggests... but not in other cases | 21:50 | |
"If the endpoint is not *, it is smart-matched against each generated element, and the sequence is terminated when the smart-match succeeded." | |||
m: say 1,2,4...64 | |||
camelia | rakudo-moar bc722a: OUTPUT«(1 2 4 8 16 32 64)» | ||
Roamer` | so far so good | ||
m: say 1,2,4...100 | 21:51 | ||
camelia | rakudo-moar bc722a: OUTPUT«(1 2 4 8 16 32 64)» | ||
Roamer` | this one seems to be a bit smarter than the docs would suggest | ||
m: say 1,1,-> $a, $b { $a + $b }...10 | |||
camelia | rakudo-moar bc722a: OUTPUT«(1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 433494437 7014087…» | ||
Roamer` | but this one... isn't. | ||
(it's exactly as smart as the docs suggest) | |||
timotimo | m: say 1, 9, 11 ... * > 100 | ||
camelia | rakudo-moar bc722a: OUTPUT«Unable to deduce arithmetic or geometric sequence from 1,9,11 (or did you really mean '..'?) in block <unit> at <tmp> line 1» | ||
nine | Roamer`: for arithmetic or geometric squences it can indeed detect when it should end | 21:52 | |
timotimo | m: say 1, 9, 10 ... * > 100 | ||
camelia | rakudo-moar bc722a: OUTPUT«Unable to deduce arithmetic or geometric sequence from 1,9,10 (or did you really mean '..'?) in block <unit> at <tmp> line 1» | ||
timotimo | hm | ||
m: say 1, 9, 11, 19 ... * > 100 | |||
camelia | rakudo-moar bc722a: OUTPUT«===SORRY!===Unable to deduce arithmetic or geometric sequence from 9,11,19 (or did you really mean '..'?)» | ||
timotimo | why are those errors different :D | ||
Roamer` | nine, yep, exactly... so I assumed it would also work for others, and I went ahead and tried to demonstrate this to somebody with the Fibonacci sequence... and the assumption turned out to be wrong :) | ||
I'm not complaining, mind | |||
21:53
BenGoldberg joined
|
|||
timotimo | yeah, only arithmetic and geometric sequences will be auto-deduced | 21:53 | |
nine | Roamer`: it knows what arithmetic or geometric sequences are. With the Fibonacci sequence you essentially give it code which generates the next value. The sequence operator cannot understand this code, it just executes it. So it cannot say whether the sequence will return to the given end value or not | ||
timotimo | oh! | 21:54 | |
i didn't even see what they meant | |||
nine | m: say 1, { $_ > 10 ?? $_ - 1 !! $_ + 2} ... 10 | ||
camelia | rakudo-moar bc722a: OUTPUT«(1 3 5 7 9 11 10)» | ||
nine | Roamer`: like in this case ^^^ | ||
MasterDuke | why did one of the errors have '===SORRY!===' and the others didn't? | 21:57 | |
timotimo | yes, why? | ||
Roamer` | different phases of compilation? (wild guess) | ||
MasterDuke | ahh, that one had one more value before the ... than the others | ||
timotimo | yup | 21:58 | |
but that's no good reason to blow up differently :D | |||
AlexDaniel | m: say 2,4,8 ... 100 | 21:59 | |
camelia | rakudo-moar bc722a: OUTPUT«(2 4 8 16 32 64)» | ||
AlexDaniel | m: say 2,4,8 ... * > 100 | ||
camelia | rakudo-moar bc722a: OUTPUT«(2 4 8 16 32 64 128)» | ||
Roamer` | timotimo, I'd assume (although we've seen how far assumptions got me just now) that it has something to do with the fact that three values are enough to determine whether it's a geometric sequence | ||
so when you give it three values, it finds out that it's neither an arithmetic nor a geometric one and blows up "normally" | 22:00 | ||
gfldex | MasterDuke: it's a compile time error, there are also compile time errors that (for now) suck | ||
Roamer` | and then you give it *four* values, which is more than enough | ||
(no idea why that would matter, just another wild guess) | |||
MasterDuke | the error is from X::Sequence::Deduction | 22:01 | |
which is only thrown in one place | |||
timotimo | the ... operator might be compile-time-evaluated by the static optimizer, though | 22:02 | |
MasterDuke | ahh, seems plausible | 22:03 | |
gfldex | m: gist.github.com/gfldex/54d37646585...baf536d86e | 22:04 | |
camelia | rakudo-moar bc722a: OUTPUT«[True True False]» | ||
gfldex | timotimo: ^^^ does what I want from infix:<o> | ||
22:05
RabidGravy joined
|
|||
gfldex | m: gist.github.com/gfldex/54d37646585...baf536d86e | 22:12 | |
camelia | rakudo-moar bc722a: OUTPUT«[True True False]» | ||
gfldex | updated with more readability | ||
22:13
mr-foobar joined
|
|||
timotimo | sorry, very distracted again | 22:15 | |
gfldex | m: say [eq] <Abc abc>>>.lc | 22:16 | |
camelia | rakudo-moar bc722a: OUTPUT«True» | ||
22:20
BenGoldberg left,
_28_ria joined,
BenGoldberg joined
22:21
wamba joined
22:22
Zoffix joined
22:28
zacts left
|
|||
gfldex | m: sub f($) {}; sub g($,$) {}; my &infix:<fg> = &f o &g; say 1 fg 2; | 22:31 | |
camelia | rakudo-moar fd1be3: OUTPUT«Nil» | ||
gfldex | :o | ||
did we doc `my &infix:<> = sub {};` ? | 22:32 | ||
m: my &infix:<ieq> = -> |l { [eq] l>>.lc }; say so "abc" ieq "Abc"; | 22:34 | ||
camelia | rakudo-moar fd1be3: OUTPUT«True» | ||
22:35
Zoffix left
|
|||
gfldex | i better stop before the mind boggle overwhelms me | 22:35 | |
i wonder if the code golfers would accept a task that starts with: "Define a infix operator that ..." | 22:37 | ||
22:45
firstdayonthejob left
22:47
zacts joined
|
|||
dalek | c: 187e0c0 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Callable.pod6: remove extra space resulting in bad index entry/link |
22:55 | |
22:55
rindolf left
|
|||
BenGoldberg | m: my &infix<ieq> = -> \list { [eq] list>>.fc }; say "abc" ieq "ABC" ieq "aBc"; | 22:58 | |
camelia | rakudo-moar fcfe3c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Shaped variable declarations not yet implemented. Sorry. at <tmp>:1------> 3my &infix<ieq>7⏏5 = -> \list { [eq] list>>.fc }; say "abc» | ||
BenGoldberg | m: my &infix<ieq> = -> |list { [eq] list>>.fc }; say "abc" ieq "ABC" ieq "aBc"; | ||
camelia | rakudo-moar fcfe3c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Shaped variable declarations not yet implemented. Sorry. at <tmp>:1------> 3my &infix<ieq>7⏏5 = -> |list { [eq] list>>.fc }; say "abc» | ||
BenGoldberg | . o O (What am I doing wrong?) | 22:59 | |
timotimo | you're forgetting the : after the "infix" | 23:00 | |
BenGoldberg | m: my &infix:<ieq> = -> |list { [eq] list>>.fc }; say "abc" ieq "ABC" ieq "aBc"; | ||
camelia | rakudo-moar fcfe3c: OUTPUT«False» | ||
BenGoldberg | m: my &infix:<ieq> = -> |list { [eq] list>>.fc }; say "abc" ieq "ABC"; | ||
camelia | rakudo-moar fcfe3c: OUTPUT«True» | ||
BenGoldberg | m: say 1 == 2 == 4; | ||
camelia | rakudo-moar fcfe3c: OUTPUT«False» | ||
BenGoldberg | m: say 4 == 4 == 4; | 23:01 | |
camelia | rakudo-moar fcfe3c: OUTPUT«True» | ||
23:08
djbkd joined
|
|||
wamba | m: my &f= *+1; my &g= *+*; sub postfix:<₂> (&f) {-> $a, $b {&f($a),&f($b)}}; say (&g o &f₂)(1,2) | 23:09 | |
camelia | rakudo-moar fcfe3c: OUTPUT«5» | ||
23:09
kurahaupo left
|
|||
dalek | c: 12d28f5 | (Zoffix Znet)++ | doc/Type/Int.pod6: Clarify .polymod behaviour when divisors are given as a lazy list |
23:15 | |
gfldex | lölibloggedalittle gfldex.wordpress.com/2016/07/17/i-...ls-either/ | 23:18 | |
23:26
girafe2 left
23:28
yqt left
|
|||
Frameless | FWIW, .fc, not .lc, should be used for case-insensitve comparison | 23:31 | |
gfldex | Frameless: ENOSUCHDOC | 23:32 | |
Frameless | m: my &infix:<ieq> = { [eq] @_».lc }; say "SS" ieq "ß" | ||
camelia | rakudo-moar 980f49: OUTPUT«False» | ||
Frameless | m: my &infix:<ieq> = { [eq] @_».fc }; say "SS" ieq "ß" | ||
camelia | rakudo-moar 980f49: OUTPUT«True» | ||
Frameless | gfldex: seems to be here: docs.perl6.org/routine/fc | 23:33 | |
gfldex | i take that back | ||
fat finger syndrom | |||
Frameless | :) | ||
gfldex | i better update the blogpost before anyone reads it (changes are good) | ||
Frameless | gfldex: oh, then there's also a typo "arguments of it’s first operand" should be "its" | 23:34 | |
m: say "SS" ~~ m:i/"ß"/ | 23:39 | ||
camelia | rakudo-moar 980f49: OUTPUT«False» | ||
Frameless | I kinda expected that to be True | ||
wamba | m: sub postfix:<₂> (&f) {-> $a, $b {&f($a),&f($b)}}; my &infix:<ieq> =&infix:<eq> o &fc₂; say "abc" ieq "Abc"; | 23:40 | |
camelia | rakudo-moar 980f49: OUTPUT«True» | ||
23:41
djbkd left
|
|||
gfldex | m: multi sub fc(*@a){ @a>>.lc }; my &infix:<ieq> =&infix:<eq> o &fc; say "abc" ieq "Abc"; | 23:42 | |
camelia | rakudo-moar 980f49: OUTPUT«True» | ||
gfldex | what leaves the question if the buildin sub fc should have (+@a) as a signature | ||
it's defined as `sub fc(Cool $s) { $s.fc }` | 23:44 | ||
m: <abß deö>.fc.say | 23:45 | ||
camelia | rakudo-moar 980f49: OUTPUT«abss deö» | ||
23:46
edehont joined,
b2gills left
23:51
b2gills joined
23:59
wamba left
|