»ö« 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:06
_28_ria left
00:07
_28_ria joined
00:11
Herby_ left
00:17
tomboy64 left,
tomboy64 joined
00:31
tomboy64 left
00:32
tomboy64 joined
00:33
jjido joined
00:34
Actualeyes left,
Actualeyes joined
00:35
lizmat joined,
pierre_ joined
00:45
BenGoldberg joined
00:58
lizmat left
01:00
lizmat joined
01:04
lizmat left
01:06
jjido left
01:11
molaf left
01:14
skink left
01:18
kaare_ joined
01:23
molaf joined
01:30
pierre_ left
01:38
kaare_ left,
astj joined
01:55
kid51 left
02:03
jjido joined
02:16
avenj left
02:23
avenj joined
02:29
noganex joined
02:31
noganex_ left
02:37
jjido left
02:38
Herby_ joined
02:39
jack_rabbit joined
02:43
_28_ria left,
_28_ria joined
02:52
kurahaupo left
|
|||
Herby_ | newbie question here... If I'm retrieving a JSON webpage, what's the best way to save the JSON data for later retrieval? use a json module to decode the json, then spurt it to a .json file? | 02:58 | |
or just save the entire webpage, and then later slurp the page and decode it | |||
or is one pretty much the same as the other | |||
MadcapJake | Best section header: "So you're on Windows" lol | 03:05 | |
Herby_: if it's JSON you're retrieving, there's nothing that decoding it will do but make it usable within your program. | 03:07 | ||
Herby_ | just learned that the hardway :) | ||
think i got it now | |||
MadcapJake | decoding larger json files is still a bit expensive, if you do need just bits of the data, you could pull it out and spurt into an easier delimited format (commas, \0 or \t) | 03:10 | |
wrt generator discussion the other day: www.perl6.org/archive/rfc/31 | 03:28 | ||
03:33
jjido joined
03:34
pierre_ joined
|
|||
grondilu | how do I get the name of a class? | 03:38 | |
m: my $class = class {}; sub () returns $class { $class.new }() | 03:40 | ||
camelia | rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/l9d8TrD9ddMalformed traitat /tmp/l9d8TrD9dd:1------> 3my $class = class {}; sub () returns7⏏5 $class { $class.new }()» | ||
grondilu | m: say class A {}.Str | 03:41 | |
camelia | rakudo-moar f05c77: OUTPUT«Use of uninitialized value of type A in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/U61mbTMQWJ line 1» | ||
grondilu | m: say class A {}.WHAT | ||
camelia | rakudo-moar f05c77: OUTPUT«(A)» | ||
grondilu | m: say class A {}.WHAT.Str | ||
camelia | rakudo-moar f05c77: OUTPUT«Use of uninitialized value of type A in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/xamaLRrTvT line 1» | ||
03:47
Herby_ left
03:52
BenGoldberg left
03:53
BenGoldberg joined
03:59
dolmen joined
04:03
Actualeyes left
04:08
jjido left
04:09
BenGoldberg left
04:10
BenGoldberg joined
04:13
pierre_ left
04:14
infina_ left
04:16
khw left
04:19
BenGoldberg left,
matiaslina left
04:20
BenGoldberg joined
04:21
dolmen left
04:22
infina_ joined,
infina_ left,
infina_ joined
04:25
Actualeyes joined,
BenGoldberg left
04:30
Cabanossi left
04:32
Cabanossi joined
04:58
sno left
05:04
jjido joined
05:06
cognominal left
05:07
cognominal joined
05:09
CIAvash joined
05:13
perturbation left
05:18
neuron joined
|
|||
neuron | Hi | 05:18 | |
Is there a way for class instance to detect which roles have been applied to it? | |||
CIAvash | grondilu: .^name gives you the name | 05:23 | |
05:23
pierre_ joined
|
|||
neuron | CIAvash: Oh, I'm not sure you replied to me, but certainly .^name seems to help me. Thanks! :) | 05:27 | |
CIAvash | No, it wasn't a reply to you :) | 05:30 | |
m: role R {}; class C does R {}; say so C.new.does(R); | |||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
CIAvash | neuron: ↑ | 05:31 | |
neuron | Oh, that seems even better! | 05:32 | |
Hmm, how about parametrized roles, can I test them too? | 05:33 | ||
CIAvash | the `so` part is not needed, it returns a Bool. | 05:34 | |
neuron: yeah, I think you can | 05:36 | ||
neuron | Oh, yes, I made a typpo, parametrized works the same - just fine | ||
Many thanks! | |||
05:38
jjido left,
neuron left
05:41
pierre_ left
05:43
mr-foobar left
05:45
mr-foobar joined
05:50
kurahaupo joined
05:55
kurahaupo_ joined
05:57
kurahaupo left
05:58
sno joined,
kurahaupo joined
06:00
kurahaupo_ left
06:02
kurahaupo_ joined
06:04
kurahaupo left
06:05
wamba joined
06:09
kurahaupo_ left,
domidumont joined
06:12
_mg_ joined
06:14
domidumont left
06:15
domidumont joined
06:27
_mg_ left
06:28
_mg_ joined
|
|||
Xliff | Is there a way to get a list of all roles that have been applied to an instance? | 06:29 | |
<CIAvash> m: role R {}; class C does R {}; say so C.new.does(R); | |||
06:31
Xliff left
06:32
Xliff joined
06:34
jjido joined,
abraxxa joined
|
|||
Xliff | ↑ I get what CIAvash said here, but what if you don't know the specific role you wish to test against, and just want a list from an instance variable? | 06:36 | |
06:39
pierre_ joined,
abraxxa left,
abraxxa joined
|
|||
MadcapJake | Xliff: ClassName.^roles_to_compose is supposed to work but it just returns an empty list for me :\ | 06:43 | |
m: role R {}; class C does R {}; say C.^roles_to_compose | 06:46 | ||
camelia | rakudo-moar f05c77: OUTPUT«()» | ||
06:48
pierre_ left,
RabidGravy joined
06:49
jjido_ joined
06:50
jjido left
06:52
pierre_ joined
|
|||
MadcapJake | if you use .^add_role it works: | 06:52 | |
m: role R {}; my class C {}; C.^add_role(R); say C.^roles_to_compose | |||
camelia | rakudo-moar f05c77: OUTPUT«((R))» | ||
MadcapJake | Xliff: ↑ | 06:53 | |
06:55
jjido_ left
07:01
brrt joined
|
|||
Xliff | Thanks, MadcapJake | 07:14 | |
That helps, but is slightly bothersome. | 07:15 | ||
m: role A{}; role B{}; my class C does A {}; C.^roles_to_compose(); | |||
camelia | ( no output ) | ||
Xliff | m: role A{}; role B{}; my class C does A {}; say C.^roles_to_compose(); | ||
camelia | rakudo-moar f05c77: OUTPUT«()» | ||
Xliff | m: role A{}; role B{}; my class C does A {}; C.^add_role(B); say C.^roles_to_compose(); | 07:16 | |
camelia | rakudo-moar f05c77: OUTPUT«((B))» | ||
Xliff | ↑ So that result is incomplete. | ||
But accurate, according to the docs: doc.perl6.org/routine/roles_to_compose | 07:17 | ||
CIAvash | ^.roles_to_compose returns the list of roles that are not yet composed | ||
m: role R {}; my class C {}; C.^add_role(R); say C.^roles_to_compose; say C.does(R); C.^compose; say C.^roles_to_compose; say C.does(R) | |||
camelia | rakudo-moar f05c77: OUTPUT«((R))False()True» | ||
Xliff | CIAvash, Ah... OK. | ||
m: role A{}; role B{}; my class C does A {}; C.^add_role(B); say C.^roles_to_compose(); C.^compose; say C.^roles_to_compose | 07:18 | ||
camelia | rakudo-moar f05c77: OUTPUT«((B))()» | ||
Xliff | Makes sense now. | ||
07:18
zakharyas joined
|
|||
Xliff | CIAvash: But is there a way to retrieve a list of roles from an instance variable? | 07:18 | |
CIAvash | I don't know | 07:19 | |
Xliff | Fair enough. Thanks for the explanation. | ||
CIAvash | m: Role R {}; class C does R {}; say C.new.^roles; | 07:21 | |
camelia | rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bhuhLLsuRFInvalid typename 'R'at /tmp/bhuhLLsuRF:1------> 3Role R {}; class C does R7⏏5 {}; say C.new.^roles;» | ||
CIAvash | m: role R {}; class C does R {}; say C.new.^roles; | ||
camelia | rakudo-moar f05c77: OUTPUT«((R))» | ||
Xliff | Oh, excellent. | 07:22 | |
m: role A{}; role B{}; my class C does A {}; C.^add_role(B); say C.^roles_to_compose(); C.^compose; say C.^roles | |||
camelia | rakudo-moar f05c77: OUTPUT«((B))((A) (B))» | ||
Xliff | Of course, I am poking through the docs in all the wrong places and it was something simple. *sigh* | ||
ufobat | good morning :) | 07:23 | |
Xliff | \o ufobat | ||
MadcapJake | wow nice! yeah that needs to be documented | ||
Xliff | I would expect that to be a part of the Mu object, but I could be wrong. | 07:24 | |
MadcapJake | Xliff: Metamodel::ClassHOW | ||
github.com/rakudo/rakudo/blob/nom/...W.nqp#L168 | |||
Xliff | doc.perl6.org/type/Metamodel::ClassHOW | 07:25 | |
↑ Not here | |||
MadcapJake | yep, that's why I said "needs to be" :) | ||
Xliff | Oh. No fair going to the source. :P | ||
MadcapJake | B-) ohhh yeaaaahh | 07:26 | |
Xliff | Heh! | ||
(•_•) | |||
MadcapJake really needs to go to sleep | |||
Xliff | ( •_•)>⌐■-■ | ||
(⌐■_■) | |||
MadcapJake | hahaha | ||
that's awesome, it's like a text-based gif :D | 07:27 | ||
Xliff | Yeah. Stole it from someone in hear when I first joined. | ||
CIAvash | :) | 07:28 | |
masak | good (⌐■_■) morning, #perl6 | ||
Xliff | HAH! | ||
Speak of the devil. How goes, masak? | |||
masak | oh, you know. just my diabolic usual. | ||
masak .oO( within one standard deviation of my own peculiar little average ) | 07:29 | ||
Xliff | Oh wow! I've been here over a month, now. | ||
MadcapJake, irclog.perlgeek.de/perl6/2016-03-24#i_12233003 | |||
Time flies | |||
MadcapJake | lol, masak | 07:30 | |
irclog renders those glasses really well :P | 07:31 | ||
gotta go to bed now! See ya Sixians! | 07:32 | ||
brrt | good morning masak | 07:33 | |
07:34
abraxxa left
07:35
abraxxa joined
07:41
grassass left
|
|||
Xliff | gist.github.com/Xliff/54c7b2f1661b...b1b6c1bc87 | 07:42 | |
Any thoughts? It's the last bit I need to complete read testing using libvorbis. | 07:43 | ||
07:43
abraxxa left
07:44
abraxxa joined
|
|||
Xliff | Gist updated with results. | 07:45 | |
07:46
ufobat left
|
|||
Xliff | *sigh* "Str" in that context is not getting interpreted as NULL. Does that only work with pure NativeCall types? | 07:46 | |
07:51
lizmat joined
|
|||
psch | m: use NativeCall; my @a := CArray[Str].new(["foo", "bar"]); say @a[2].defined | 08:00 | |
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
08:07
matt_ joined,
matt_ is now known as Guest5255
08:10
pmurias joined,
_mg__ joined
08:11
darutoko joined,
_mg_ left,
_mg__ is now known as _mg_
08:12
Guest5255 left
|
|||
Xliff | HAH! | 08:14 | |
The code in the updated gist did the trick. | |||
jeek | ^5 | 08:15 | |
masak | jeek: 0 1 2 3 4 | ||
Xliff | psch: That was exactly the strategy I went with. Thanks. | ||
Gist updated. | 08:17 | ||
i think I will just start keeping gists and will then clean 'em all up and try to port them to the proper place in the P6 docs. | |||
psch | ++Xliff | 08:18 | |
08:20
mtj_ left,
petercommand left,
agentzh left
08:21
sunnavy_ left,
wamba left,
au left
08:27
rindolf joined
08:29
dakkar joined,
luiz_lha joined
08:30
luiz_lha is now known as Guest27664
08:31
Guest27664 is now known as luiz_lha
08:32
sunnavy joined,
au joined
|
|||
Xliff | Now the write ogg-vorbis test. *sigh* | 08:32 | |
08:34
mtj_ joined
08:37
petercommand joined
08:44
agentzh joined,
agentzh left,
agentzh joined
08:53
au left
08:54
petercommand left
08:55
mtj_ left,
agentzh left,
sunnavy left
08:58
mtj_ joined
09:00
wamba joined,
au joined
09:01
agentzh joined,
agentzh left,
agentzh joined,
petercommand joined,
sunnavy_ joined
09:02
matt_ joined
09:03
matt_ is now known as Guest12417
09:05
Guest12417 is now known as matT_,
matT_ is now known as matt_
09:13
abraxxa left
09:14
abraxxa joined
09:20
ufobat joined,
kerframil joined
|
|||
pmurias | If QAST::CompUnit has only a .load and not a .main does the load get run when it's used as the main program? | 09:21 | |
09:23
abraxxa left,
abraxxa joined
|
|||
jnthn | pmurias: load is only if it's loaded as a module, rather than top-level | 09:23 | |
If there's no main we default to running the top-level block | 09:24 | ||
Xliff | m: my $f = False; say $f; $f = True; if $f { say "F!" } | 09:32 | |
camelia | rakudo-moar f05c77: OUTPUT«FalseF!» | ||
psch | m: my $f = True but False; if ~$f { say $f } | 09:34 | |
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
psch | what i actually was wondering is what exactly "but $value" overrides | ||
pmurias | jnthn: even if the top level block is *NOT* an immediate? | 09:35 | |
psch | m: my $f = 1 but False; say ~$f; my $g = True but False; say ~$g | ||
camelia | rakudo-moar f05c77: OUTPUT«1False» | ||
09:35
g4 joined
|
|||
psch | it seems to depend on the lhs on some level... | 09:35 | |
m: enum foo <A B>; my $f = A but B; say ~$f | 09:38 | ||
camelia | rakudo-moar f05c77: OUTPUT«A» | ||
09:42
M-Illandan left
09:43
pierre_ left,
tadzik left,
M-matthew left
09:48
M-Illandan joined,
vendethiel- joined,
Relsak joined
09:49
vendethiel left
|
|||
jnthn | pmurias: Sure. immediate vs. declaration is really a description of what code-gen should happen in the enclosing block anyway | 09:49 | |
pmurias: So blocktype isn't really relevant for the outermost block | 09:50 | ||
09:51
M-tadzik joined
09:52
M-matthew joined
09:56
donaldh joined,
pmurias left
10:05
pmurias joined
10:18
xiaomiao is now known as DrEeevil
10:19
novavis joined
|
|||
Xliff | m: my $s = "two WORDS"; say $s.tc | 10:23 | |
camelia | rakudo-moar f05c77: OUTPUT«Two WORDS» | ||
lizmat | m: my $s = "two WORDS"; say $s.tclc | ||
camelia | rakudo-moar f05c77: OUTPUT«Two words» | ||
yoleaux | 24 Apr 2016 19:10Z <moritz> lizmat: running a single spectest file through make fails: perlpunks.de/paste/show/571d1a03.5018.199 | ||
lizmat | moritz: afaik, I fixed that late last night using leont++ advisement | 10:24 | |
Xliff | m: my $s = "two WORDS"; say $s.wordcase | ||
camelia | rakudo-moar f05c77: OUTPUT«Two Words» | ||
10:24
Actualeyes left
|
|||
Xliff | There we go. | 10:24 | |
10:28
Actualeyes joined
|
|||
lizmat | m: my $s = "two WORDS"; say $s.split(/\s+/,:v)>>.tclc.join # alternate | 10:30 | |
camelia | rakudo-moar f05c77: OUTPUT«Two Words» | ||
10:35
abraxxa left,
abraxxa joined
10:39
M-tadzik is now known as tadzik
10:43
pierre_ joined
10:45
pierre_ left,
pierre_ joined
|
|||
Xliff | lizmat++ -- nice alternate, but more wordy =) | 10:49 | |
10:49
TEttinger left
|
|||
lizmat | more general :-) | 10:49 | |
Xliff | Really? Is there a case where yours would work and .wordcase wouldn't? | 10:50 | |
lizmat | my point is that you can use split to split on anything, *and* still get the values you've split on with :v | ||
Xliff | Oooh. | 10:51 | |
lizmat | so you can .join afterwards and get the original back | ||
m: my $s = "two WORDS"; say $s.split(/\s+/,:v)>>.tclc.join # alternate | |||
camelia | rakudo-moar f05c77: OUTPUT«Two Words» | ||
lizmat | m: my $s = "two WORDS"; say $s.split(/w/,:v)>>.tclc.join # alternate | ||
camelia | rakudo-moar f05c77: OUTPUT«TWO words» | ||
Xliff | OK. Gotcha. Thanks for the explanation. | ||
Xliff is still used to ">>" meaning something entirely different. | 10:52 | ||
lizmat | what do you think it means? | 10:53 | |
moritz | bit shift? | 10:54 | |
\o | |||
masak | clearly ">>" means "send to cout" :P | 10:55 | |
masak probably got that one wrong | |||
Xliff | LOL! | 10:56 | |
masak sees my point, exactly. Except ">>" also means "append" in a similar context :P | 10:57 | ||
>> and » are the same in Perl6, right? | |||
At least in lizmat's example. | 10:58 | ||
lizmat | yes | 10:59 | |
Xliff | kk | 11:00 | |
11:01
tomboy64 left,
Actualeyes left,
Actualeyes1 joined
|
|||
jast | masak: yeah, it's for input streams, e.g. using cin | 11:02 | |
11:03
tomboy65 joined
|
|||
timotimo | aye, the out or in goes on the left side of the stream | 11:04 | |
that's why it's cout << "foo", or cin >> bar | |||
masak | right. | ||
taking a discussion from p6l (back in January, gasp!) to here: I avoid `try` in production-level code nowadays | 11:06 | ||
it catches too much, including exceptions you don't know you're getting | |||
11:07
tomboy65 left
|
|||
masak | it's as if you're telling your body "keep on walking, even if it hurts" -- and you *think* this is just about your feet hurting a little, but in actual fact one leg and two ribs are broken and you really, really should stop walking | 11:07 | |
`try` keeps on walking in that case | |||
I had a couple of these in 007, and it did indeed bite eventually. here's the commit that eliminates them: github.com/masak/007/commit/c062bc...027a4ce2ad | 11:08 | ||
11:09
tomboy64 joined
|
|||
timotimo | we might want a try variant that explicitly mentions the exception type it would like to defuse | 11:09 | |
masak | I'm slightly dismayed to see that there are ~800 instances of `try` in the ecosystem. | 11:10 | |
11:10
leont_ joined
|
|||
masak | a significant fraction of those are likely to be susceptible in the way I outline above. | 11:10 | |
timotimo | mhm | ||
masak | this smells like a blog post in the making | ||
timotimo | sadly, a catch block that no-ops a given type of exception is very wordy | ||
and if you want to limit it to just one expression, it's even worse, because then you've got a do-block on your hands, and extra curlies | 11:11 | ||
moritz | masak: well, look for error handling after the try | ||
masak | moritz: well, yes and no. | ||
moritz: it's possible to do that right, and re-throw any unknown exception types. | 11:12 | ||
moritz: but my guess is it's rare, because the default is suppress-everything. | |||
and people focus on the happy case, or more to the point, only the expected exceptions :) | |||
jnthn | It's horses for courses. Sometimes "it failed in some way" is eough information. | 11:14 | |
*enough | |||
timotimo | greetings jnthn | ||
jnthn | o/ timotimo | 11:15 | |
brrt | \o jnthn | ||
timotimo | o/ brrt | ||
jnthn | hi brrt :) | ||
moritz | looking for very specific exceptions also has its dangers | ||
brrt | hi timotimo :-) | ||
masak | jnthn: yes, horses for courses, agreed. | ||
11:16
pierre_ left
|
|||
masak | jnthn: I guess the next step is to check those ~800 uses and categorize them :) | 11:16 | |
brrt | har har.... har | ||
masak | moritz++ # that "search the ecosystem" thing | ||
moritz | in python, folks tend to write things like foo = bar['baz'].quox() and catch AttributeError | ||
masak | brrt: you think I'm not serious? :) | ||
moritz | what about AttributeError thrown from quox()? | ||
lizmat | PSA: I'll be travelling for most of the rest of the day, and probably won't be in a state to finish the P6W tonight | ||
brrt | all the same to a python programmer moritz | ||
masak | moritz: even there, the problem is lack of specificity, not over-specificity | ||
lizmat | so most likely the P6W will appear tomorrw | 11:17 | |
brrt | masak: it just reminds me of my own problems with OSM data | ||
'i just categorise the 800 different ways that this data can fail, and patch them up' | |||
moritz | masak: right; but no language I know of offers this kind of specifity | ||
timotimo | moritz: that's not actually syntax, right? "and catch AttributeError"? | ||
brrt | now i have to implement a minimum-cost-spanning-tree classifier in plpgsql, figure that | ||
moritz | masak: so it's better siimply check for 'baz' in bar foirst | 11:18 | |
timotimo: no, it's except AttributeError: pass | |||
timotimo | right | ||
brrt | actually, now that i'm here, do any of you know of a better classification algorithm; | ||
lizmat | commute home& | ||
11:18
lizmat left
|
|||
RabidGravy | I have 24 try in 51 modules | 11:19 | |
brrt | i have a M tuples and N classes, I need to find N tuples that represent the consensus of values | ||
11:19
kid51 joined
|
|||
brrt | i intend to classify them based on tuple-to-tuple proximity using, well, minimum-cost-spanning-tree | 11:19 | |
i want this to be repeatable, so k-means is out | 11:20 | ||
then after classification, figuring out the consensus value is easy | |||
RabidGravy | 8 of those are in one module | ||
11:20
donaldh left
11:21
kaare_ joined
|
|||
jnthn | masak: Another thing to keep in mind when you're doing analysis of try: it's entirely possible to use CATCH without a try | 11:21 | |
masak: So just looking at how people use try won't be representitive of how robustly people handle exceptions. | |||
RabidGravy | two are in modules whose explicit purpose is to determine whether doing something would infact throw an exception | 11:22 | |
timotimo | we could write a "fuzzer" of sorts that replaces exceptions with different types and analyzes paths taken in response | ||
masak | jnthn: well, what I want to check is how people mis-use `try` | ||
timotimo | RabidGravy: the way you write it "would" makes it sound like you've solved the halting problem :D | ||
RabidGravy | I didn't know there was any other way of spelling would | 11:24 | |
brrt | otoh, sometimes you do want 'catch all the things' | 11:25 | |
RabidGravy | I'm actually surprised I only have one "try require ::($module)" | ||
timotimo | i meant to refer to the whole sentence structure :) | ||
jnthn | masak: Ah, so the CATCH cases aren't even that interesting for you. OK :) | ||
masak | brrt: I think that's rather rare. | ||
brrt: my thesis is that people *think* they want that way more often than it's actually good to do that. | 11:26 | ||
moritz | masak: interesting exercise: submit 5 PRs to make some of these trys more specific | ||
brrt | antithesis: people think they want that more often than *you* think they should want that | ||
masak | moritz: ooh | ||
moritz | masak: and count how many you visited until you got to the five | 11:27 | |
masak | brrt: that doesn't feel very anti- :) | ||
brrt | well, its subtly anti | 11:28 | |
masak | brrt: I think they do it too often because there's a real reason not to | ||
timotimo | so maybe it's the dualthesis? | ||
masak | it's not opinion, it's grounded in reality and actual bugs | ||
timotimo | sidethesis? | ||
brrt tries to get out of the grunt-industrial-programmer mental mode | |||
11:28
jjido joined
|
|||
masak | brrt: I'd give you more credit for that point if it weren't for the fact that I *was* bitten by exactly this | 11:29 | |
so my blog post would count as a warning to others, based on hard-school-of-life experience | |||
anyways | |||
brrt | masak: you are absolutely right, in a way that is going to be completely unconvincing to the mentality of a grunt programmer | ||
masak goes back to writing more code that can blow up in various ways | |||
timotimo | hard-school-of-life sounds much less fun than, say, Video Game High School | 11:30 | |
pmurias | masak: isn't catching too match a general problem rather then something Perl 6 specific? | ||
RabidGravy | actually that's 13 in 48 modules if I exclude one which I haven't released | ||
masak | brrt: you're saying there are people out there who refuse to listen/adapt when someone says a practice is dangerous? ok -- as long as they're not on my team. | ||
11:30
araujo joined
|
|||
masak | pmurias: yes. | 11:30 | |
brrt | :-D | ||
i'm saying i'm working too much with people who will do exactly that | 11:31 | ||
(refuse to adapt) | |||
masak | not to put too fine point on it -- change jobs. :) | ||
brrt | point taken | 11:32 | |
masak | I have absolutely no basis for saying that | ||
except "my colleagues won't learn", which would make *me* do a 180 and run | |||
brrt | hmm, now that i think of it, it is kind of bad | 11:33 | |
11:33
vytas joined
|
|||
timotimo | well, if your daily experiences would make for a good post on thedailywtf, you know something's up :) :) | 11:34 | |
masak .oO( dear diary: today I made someone on IRC quit his job ) | |||
brrt | masak: that wouldn't have been just on you anyway | ||
masak | :) | ||
moritz | brrt: do you need a good job? Where are you located? :-) | 11:36 | |
.oO( "asking for a friend" ) |
|||
brrt | moritz: yes, well, it's complicated; i'm in the finishing months of my study, i don't really have that much time on offer right now; i might be starting a PhD afterwards | 11:38 | |
masak | brrt: ...we're hiring too! :D | ||
brrt | well, make it more difficult will you | ||
masak | that's what we're here for | ||
brrt: many fine p6 people already work with us, so why not you as well? :) | 11:39 | ||
jast | reminds me, I've got to spend more time looking for jobs... not while I'm at work, though :} | ||
brrt | masak, moritz: it will be considered | ||
:-) | |||
RabidGravy | I have one module that has four try of which two could be removed completely because I actually catch the one exception I care about, one is associated with an open RT and one is "try and coerce something and *shrug* if it doesn't work" | 11:41 | |
masak | RabidGravy: the last one, does it call a function or a method? | 11:42 | |
RabidGravy | function | ||
masak | and that function will never, ever throw an exception for any reason whatsoever? | 11:43 | |
(or call something that does) | |||
11:43
leont_ left
|
|||
RabidGravy | but the outcome is the same, "that didn't work" | 11:44 | |
masak | ok | 11:45 | |
11:47
kid51 left
|
|||
RabidGravy | In a whole category of cases I have an attempt at coercion and leave the value as it was if it fails, thereby delegating the failure to a type constraint | 11:47 | |
which is actually what, for the most part, I want to happen as it makes more sense | 11:48 | ||
pmurias | node rakudo.js --setting=NULL -e 'nqp::say "Hello World"' just worked (locally with a bunch of hacks, including support for running code with --setting NULL), will now work on having it work in a commitable way | 11:53 | |
RabidGravy | pmurias++ # nice one | 11:54 | |
11:55
smls joined
|
|||
smls | I found another interesting Rakudo concurrency failure mode: | 11:56 | |
«No such symbol 'primers' at /path/to/my/script/EVAL_19:4 ------> $self(primers⏏.list[0], |{ %ahash, %chash }); # |{} wo» | |||
Note that the code is not from my script (nor does my script use EVAL). | |||
So that's some sort of Rakudo internals leaking out... :P | |||
11:57
pierre_ joined
|
|||
timotimo | what is |{ %ahash, %chash } all about? o_O | 11:57 | |
brrt | jnthn: is there some reason why writing a return value in the last bits of ->work would be invalid? | 11:58 | |
in the reframe branch, i mean | 11:59 | ||
masak | pmurias++ # woot! | 12:00 | |
RabidGravy: even in the cases where you reliably fail no matter what the cause, the `try` has thrown away all the details about the cause. | 12:01 | ||
(or, it hasn't -- the details are in $! -- but if you're not checking $! then that makes no difference) | 12:02 | ||
RabidGravy | I'm really not seeing the problem | 12:04 | |
m: my Int $a; my $b = "foo"; try $b = Int($b); $a = $b | 12:05 | ||
camelia | rakudo-moar f05c77: OUTPUT«Type check failed in assignment to $a; expected Int but got Str ("foo") in block <unit> at /tmp/DGzCo_urxY line 1» | ||
RabidGravy | or | 12:06 | |
m: my Int $a; my $b = "foo"; $b = Int($b); $a = $b | |||
camelia | rakudo-moar f05c77: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏) in block <unit> at /tmp/gufsuetL8L line 1Actually thrown at: in block <unit> at /tmp/gufsuetL8L line 1» | ||
RabidGravy | *shrug* | ||
12:07
pierre_ left
12:08
pierre_ joined
|
|||
masak | it all depends on how much machinery you're hiding away in the `try` | 12:09 | |
if it's just a coercion, then fine | |||
(probably) | |||
smls | timotimo: Looks like it's from Block.assuming (Which my script does call.) | ||
12:09
pierre_ left
|
|||
timotimo | ah | 12:09 | |
smls | src/core/Block.pm | ||
timotimo | holy hell, that's a long piece of code | 12:10 | |
RabidGravy | no, it *is* fine | ||
timotimo | looks like there's a , missing in there? | 12:11 | |
"primers |{..., ...}" isn't correct | 12:12 | ||
smls | timotimo: I think what's going on is that I have different *clones* of the same closure on different threats, and calling .assuming on them at the same time. | ||
Is that not allowed? | |||
12:13
uruwi left
|
|||
timotimo | oh, depends on capwrap | 12:13 | |
smls | ? | ||
timotimo | if they share lexicals they've closed over, that could be problematic | ||
but what you have there is a parse error | |||
isn't it? | |||
12:14
araujo left
|
|||
smls | a parser error inside the EVAL that .assuming does, yeah | 12:14 | |
timotimo | the assuming method doesn't write to $! attributes at least | 12:15 | |
and also doesn't call anything much on $self | |||
so it'd surprise me if it's not reentrant, so to speak | |||
you could try doing the .assuming up front and see if it makes any difference | |||
smls | timotimo: Unfortunately I can't reliably reproduce it. It has only happened twice so far. | 12:16 | |
timotimo | ah, of course :( | 12:17 | |
there's also a cross-thread-write error log thingie for moarvm that'd yell at you when you do things that may be troublesome; no clue how noisy that usually is with regards to false-positives | |||
smls | Sound useful, how can I activate that? | 12:18 | |
Also, is there a non-mutating form of .assuming? | 12:19 | ||
(The name suggests it would return a new closure anyway. The mutating form should have been called .assume) | |||
timotimo | give me a second. | 12:21 | |
MVM_CROSS_THREAD_WRITE_LOG Log unprotected cross-thread object writes to stderr | |||
^- from moar --help | |||
smls | thanks | ||
12:24
pierre_ joined,
kerframil left
12:25
uruwi joined
|
|||
smls | m: for (^200).race(batch=>1) { ({ 1 + $_ }).assuming(10)() } | 12:28 | |
camelia | rakudo-moar f05c77: OUTPUT«Parameter '$a' requires a type object of type Int, but an object instance was passed. Did you forget a 'multi'?Parameter '$a' requires a type object of type Int, but an object instance was passed. Did you forget a 'multi'?Parameter '$a' requi…» | ||
timotimo | github.com/rakudo/rakudo/pull/756 - review please; it's just about how the rakudo usage help output should look. | ||
smls | timotimo: This golfed code pretty much always fails, and one of the rarer failure modes is the one discussed above. | ||
timotimo | huh! | ||
smls | I guess .assuming on clones of the same closure is really not allowed then. | 12:29 | |
timotimo | am i allowed to say the error message confuses me? | ||
[Coke] waves. | |||
timotimo | greetings, coke | ||
smls | timotimo: Run it a few times, you'll get different error messages... :P | ||
awwaiid | hoelzro (or anyone interested in REPLness): I updated github.com/rakudo/rakudo/pull/738 so it now works with jvm. I haven't tried on windows yet to see if that is different. | 12:32 | |
Ulti | cool | 12:35 | |
is the JVM version of Rakudo also 6.c ? | 12:36 | ||
jnthn | brrt: Well, the end of ->work is used for arg passing | ||
awwaiid | As far as I know that's a goal, though I think there are still some issues. It's working better this month than previously for me :) | ||
jnthn | brrt: And the GC scans its content by looking at the callsite used to pass args | 12:37 | |
brrt: So you can't just stash a value in the end slot really. | |||
brrt | hmmm | ||
thing is | |||
i've been reusing that slot in the jit for the return address of istrue in the if_o to istrue-lowering | 12:38 | ||
now, when we're calling Bool(), we have no args except perhaps the callee | |||
ehn, invokee | |||
timotimo | ideally, we'd already turn an if_o or istrue_o(?) into the call at spesh time when we know the STable, invocation mode, etc etc | 12:39 | |
same with some other things that have that kind of mode | |||
brrt | that has worked without problems for a long time, it may be so that there is something wrong there in the reframe-jit | ||
jnthn | brrt: Oh, so you're just stashing a value in there? | ||
brrt | aye | ||
jnthn | You'd likely get away with that... | ||
brrt | well, i'd think so | 12:40 | |
jnthn | I don't see why you'd stop being able to get away with it | ||
brrt | thing is, we're clearly running into an infinite loop | ||
in reframe-jit, in QRegex EXPR method, somewhere... | |||
12:40
perlpilot joined
|
|||
brrt | it's not the new invoksih check, that one works well | 12:41 | |
jnthn | And you got rid of all the FRAME references? | ||
timotimo | have you been able to find the bounds of that infinite loop? | 12:42 | |
12:42
pierre_ left
|
|||
jnthn | :P | 12:42 | |
timotimo | that's clearly the wrong way to spell that :D | 12:43 | |
i meant: what values does the IP reach? | |||
brrt | re FRAME, pretty sure yes | 12:44 | |
timotimo, i should get that from my debugger | |||
12:44
pierre_ joined
|
|||
ilmari | haha, my file(1) says t/harness6: OS/2 REXX batch file, ASCII text | 12:44 | |
brrt | but it is limited | ||
timotimo | fantastic %) | 12:47 | |
[Coke] | Ulti: the ideal of the rakudo-j implementation is 6.c; the reality is far behind that. | ||
12:50
Sgeo_ left
|
|||
brrt | this reminds me that JIT debugging options are still pretty il | 12:52 | |
limited | |||
timotimo | agreed :( | ||
(and profiling with perf and other such tools is also difficult) | |||
12:53
jjido left
|
|||
smls | m: for (^50).race(batch=>1) { EVAL(q[ ({1 + $^a}) ]).assuming(10)() } | 12:54 | |
camelia | rakudo-moar f05c77: OUTPUT«(signal ABRT)*** Error in `/home/camelia/rakudo-m-inst-2/bin/moar': double free or corruption (fasttop): 0x00000000049f23e0 ***======= Backtrace: =========/lib64/libc.so.6(+0x730bf)[0x7ffec6d5b0bf]/lib64/libc.so.6(+0x7892e)[0x7ffec6d6092e]/lib6…» | ||
smls | timotimo: ^^ Fails even when I use EVAL to make sure each thread has a different closure. | 12:55 | |
(That moar crash seems to be camelia-specific; locally it fails with the same failure modes as the previous examples.) | |||
12:56
jack_rabbit left
|
|||
timotimo | oh, very interesting | 12:56 | |
i don't have time to look into it right now, though | |||
smls will RT | 12:57 | ||
12:59
nightfrog left,
aindilis` left,
khagan left
13:00
khagan joined,
jameslenz joined,
jameslen_ left
|
|||
masak | getting spectest failures in t/spec/S06-other/main-usage.rakudo.moar and t/spec/S32-num/power.rakudo.moar today | 13:01 | |
13:02
huf left,
Khisanth left,
RabidGravy left,
Possum left,
Possum joined
13:03
RabidGravy joined,
mattp_ left
|
|||
moritz | masak: I got the main-usage failure as well | 13:03 | |
masak: the power one, is that really a failure, or passing TODOs? | |||
masak | moritz: oh! passing TODOs. | ||
the framework told me so, and then I forgot. | |||
13:03
huf joined
13:04
nightfrog joined
13:07
mattp_ joined
13:08
domm__ left
13:09
kerframil joined
|
|||
Xliff | "…expect that there will be no release of Perl 6 suitable for everyday use by regular developers in the foreseeable future." - chromatic, 2013 | 13:11 | |
Oh what a difference 3 years makes. | |||
[Coke] | sixfix doesn't need to be using say in the REPL, btw. | ||
13:12
larion joined,
larion left
|
|||
pmurias | chromatic had a pretty precise definition of that, it's interesting if have met it (or how far we are from it) | 13:13 | |
13:13
ribasushi joined
13:14
felher left
13:15
felher joined,
Khisanth joined
|
|||
masak | pmurias: can that definition be found publicly somewhere? | 13:15 | |
13:18
domm joined
|
|||
Xliff | On the whole try/catch issue. Is it the implementation of try/catch that's the problem or how it is used? | 13:19 | |
RabidGravy | we'd all better stop writing software using perl 6 then | ||
Xliff | Because I believe that you test by exception type and then rethrow everything else in the default case. | ||
timotimo | it's only "try" without catch | 13:20 | |
putting try inside an expression | |||
Xliff | o_O | ||
What's the point of "try without catch"? | |||
RabidGravy | Xliff, try on its own because it may inadvertently hide errors you do care about | ||
Xliff | O_o | ||
brrt | Xliff: to not die in the face of errors | 13:21 | |
Xliff looks at the sky and screams "whhhyyyyy" | |||
brrt | it has to do with the psychology of a creature called 'the normal person' | ||
the kind of people who hit an electrical device to make it work | |||
Xliff | brrt: I am a fan of "die if this specific error", but "die on any error" is something that very rarely will work as expected. | ||
I speak from experience. | |||
geekosaur | a spherical person of uniform density? | ||
brrt | incidentally, i do that for devices when i don't want to understand its details | 13:22 | |
geekosaur | and, sadly, most people do *not* think that way | ||
Xliff | geekosaur, I may vaguely resemble that remark. =P | ||
geekosaur may also :p | |||
timotimo | Xliff: do you have your nots reversed there? | ||
Xliff | vaguely spherical, vaguely uniform. | ||
brrt | i *think* the issue here may be that perl6 makes this case really easy, and you shouldn't use it | ||
RabidGravy | if you *shouldn't* use it then it *shouldn't* be in the language | 13:23 | |
timotimo | --no-preserve-root shouldn't be in rm :) | 13:24 | |
Xliff | Perl6 - giving you enough rope to succeed almost invariably means giving you enough rope to hang yourself. | ||
13:24
uruwi left
|
|||
RabidGravy | in a lot of cases it is probably not what you want to do | 13:24 | |
smls | I believe TimToady did argue once for making 'try' only catch X::AdHoc by default | ||
Xliff | Me personally, that's a thin line. However I prefer the flexibility and the responsibility to use things correctly rather than not having it at all. | ||
13:25
g4 left
|
|||
RabidGravy | yes, but y'know people just love their absolute rules based on opinion | 13:25 | |
13:26
donaldh joined
|
|||
Xliff | I do so love irclogs. | 13:27 | |
irclog.perlgeek.de/perl6/2015-12-29#i_11795340 | |||
RabidGravy: Oh. I have all of the read tests done against my (hacky) bindings for libogg and libvorbis. | 13:28 | ||
Now comes write tests with libvorbisenc, libvorbis andlibogg.. *_* | |||
Once those are done I will write p6 interface in Audio::OggVorbis | 13:29 | ||
13:29
abraxxa left,
domm left
13:30
domm joined,
domm left
|
|||
RabidGravy | cool :) | 13:30 | |
Xliff++ # making those things so I don't have to :) | |||
Xliff | I have it on GitHub, now but the project is a long way to being ecosystem-ready. | 13:31 | |
github.com/Xliff/p6-audio-oggvorbis | |||
Comments/Suggestions welcome. | |||
13:32
domm joined
13:36
uruwi joined
13:40
donaldh left
|
|||
Xliff | timotimo, LOL - you are correct, sir. I meant "but 'not die on any error'", above. | 13:40 | |
13:43
mcsnolte joined,
abraxxa joined
13:49
khw joined
13:50
cognominal left
13:51
cdg joined
13:56
cdg left
|
|||
takadonet | morning all | 13:56 | |
13:56
cdg joined
13:57
cschwenz1 joined,
cschwenz1 left
14:00
cschwenz joined
|
|||
MadcapJake | Xliff: why not Audio::OggVorbis instead of Audio::LibOggVorbis ? | 14:02 | |
RabidGravy | well it is entirely possible someone could come up with a completely different implementation :) | 14:03 | |
MadcapJake | just seems lengthy and "Lib" seems superfluous | 14:04 | |
14:07
leont_ joined
|
|||
RabidGravy | well the same reason I called Audio::Encode::LameMP3 | 14:13 | |
MadcapJake | I don't see a problem with that one, seems well categorized | 14:14 | |
14:15
tharkun left
|
|||
RabidGravy | it's still early days, I'd go with names that don't preclude making alternative implementations | 14:16 | |
14:17
tharkun joined
|
|||
grondilu | m: my %h; %h<foo> := %h<bar>; %h<bar> = "bar!"; say %h<foo>; | 14:22 | |
camelia | rakudo-moar f05c77: OUTPUT«(Any)» | ||
grondilu was hoping the result would be "bar!" | |||
14:22
ptolemarch joined
|
|||
dalek | ar: c9e9516 | (Steve Mynott)++ | modules/MODULES.txt: Comment File::Find since its embedded with panda. Oddly error only |
14:22 | |
jnthn | grondilu: You'd need to force vivification of %h<bar> before binding it, otherwise you get a throwaway container that's bound nowhere | 14:24 | |
grondilu | ok | ||
14:25
uruwi left
14:33
leont_ left
14:34
cognominal joined
14:37
Khisanth left,
brrt left
14:38
kerframil left
14:39
domidumont left
|
|||
dalek | ar: 0e7dbb2 | (Steve Mynott)++ | / (2 files): no unix type PATH under windows |
14:41 | |
14:41
jack_rabbit joined
14:42
pierre_ left
|
|||
RabidGravy | tadzik, or anyone else with commit on panda github.com/tadzik/panda/pull/309 would be a great boon as half my modules are failing right now | 14:43 | |
moritz | RabidGravy: merging right now | 14:44 | |
stmuk_ | github doesnt like multi line commit logs :/ | ||
RabidGravy | fabulous! moritz++ | ||
ilmari | do you mean commit messages without a separate subject line? | 14:45 | |
moritz | stmuk_: it does, if you follow the convention of putting an empty line after the first one | ||
stmuk_ | ah | ||
14:45
uruwi joined,
kerframil joined
14:47
nebuchadnezzar joined
|
|||
RabidGravy | I think vim even has a quite smart syntax highlighter for git commit messages, which give a clue how they might wind up | 14:47 | |
Xliff | MadcapJake, I'm in the process of renaming it to just that. The GitHub repo implies just that. | 14:48 | |
14:48
aries_liuxueyang left
|
|||
MadcapJake | Xliff: oops, didn't even notice that :P | 14:50 | |
14:50
Khisanth joined
|
|||
BooK | m: my @a=1,2; say @a; say @a X @a; # what's the difference between () and [] ? | 14:51 | |
camelia | rakudo-moar f05c77: OUTPUT«[1 2]((1 1) (1 2) (2 1) (2 2))» | ||
Xliff | MadcapJake, it's OK. I forgive you. =) | ||
14:52
tomboy64 left
|
|||
Xliff re-reads line at 10:48:02 and shakes head at the repitition. | 14:52 | ||
14:52
jack_rabbit left
|
|||
sjn | m: my @a=1,2; say @a.WHAT; say (@a X @a).WHAT; | 14:53 | |
camelia | rakudo-moar f05c77: OUTPUT«(Array)(Seq)» | ||
takadonet | where do you report bug for rakudo? | ||
is it still rt.perl.org/Public/Dist/Display.ht...a359312be6 ? | 14:54 | ||
RabidGravy | BooK, [] is an array, () is a list (or a seq in this case) | ||
sjn | takadonet: rakudo.org/tickets/ | ||
takadonet | sjn: thanks | 14:55 | |
dalek | ar: f281cd4 | (Steve Mynott)++ | modules/panda: panda with new JSON::Fast dep |
||
ar: e873b77 | (Steve Mynott)++ | modules/doc: newer docs should be safe |
|||
BooK | RabidGravy: I assume in most cases (e.g. for loops) I can use them indifferently | 14:56 | |
14:56
novavis left
|
|||
BooK | m: my @a=1,2; say @a.WHAT; say (my @b=@a X @a).WHAT; | 14:56 | |
camelia | rakudo-moar f05c77: OUTPUT«(Array)(Array)» | ||
BooK | mkay | ||
RabidGravy | interchangeably yes | 14:57 | |
you can use them indifferently if you want but meh ;-) | |||
14:57
domidumont joined
14:59
tomboy64 joined
|
|||
moritz | ... but I don't care if you do :-) | 14:59 | |
15:04
aries_liuxueyang joined
|
|||
stmuk_ | I'm starting to think R* should just include p6doc, panda and maybe zef :/ | 15:04 | |
and just be called "perl 6" | 15:06 | ||
Xliff | BooK: I think any List or Seq is coerced into an Array when assigned to a variable. | ||
m: my @a = (1,2,3,4); say @a.WHAT | 15:07 | ||
camelia | rakudo-moar f05c77: OUTPUT«(Array)» | ||
jnthn | Note quite | ||
*not | |||
Xliff | m: (1,2,3,4).WHAT | ||
camelia | ( no output ) | ||
jnthn | An Array is something you can store things into | ||
And assignment is copying | |||
Xliff | m: say (1,2,3,4).WHAT | ||
camelia | rakudo-moar f05c77: OUTPUT«(List)» | ||
jnthn | my @a = 1..5; my @b = @a; @a[3] = 42; say @b; | ||
ilmari | my $a = (1,2,3,4); say $a.WHAT | ||
jnthn | m: my @a = 1..5; my @b = @a; @a[3] = 42; say @b; | 15:08 | |
camelia | rakudo-moar f05c77: OUTPUT«[1 2 3 4 5]» | ||
Xliff | m: say ((1,2,3,4) X (3, 6)).WHAT | ||
ilmari | m: my $a = (1,2,3,4); say $a.WHAT | ||
camelia | rakudo-moar f05c77: OUTPUT«(Seq)» | ||
rakudo-moar f05c77: OUTPUT«(List)» | |||
jnthn | Note that @b doesn't reflect the change in @a because assignment works that way | ||
ufobat | is there a problem with nativecall and filehandles? i am just wondering why Net::PCAP (in perl5 as well) doesn't have pcap_fopen_offline | ||
Xliff | ufobat, what do you mean? | 15:09 | |
jnthn, I meant to imply the assignment. Sorry if that was unclear. | |||
ufobat | both Net::PCAP in perl5 and perl6 have not implemented the pcap function "pcap_fopen_offline" and i am wondering why | ||
Net::Pcap, sorry | 15:10 | ||
jnthn | Xliff: np, it's just that "coerce" is a tad under-specific :) | ||
So figured I'd try to clarify a bit :) | |||
Xliff | Ahh... | 15:12 | |
And here I was trying to sound knowledgeable. | 15:13 | ||
m: my @a = [(1, 2), (3, 4), (5, 6, 7)]; say @a[2].WHAT; | |||
camelia | rakudo-moar f05c77: OUTPUT«(List)» | ||
Xliff | m: my @a = [(1, 2), (3, 4), (5, 6, 7)]; say @a[2].WHAT; my @b = a[1]; say @b.WHAT | 15:14 | |
camelia | rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/i2XsKrGCWEUndeclared routine: a used at line 1» | ||
Xliff | m: my @a = [(1, 2), (3, 4), (5, 6, 7)]; say @a[2].WHAT; my @b = @a[1]; say @b.WHAT; | ||
camelia | rakudo-moar f05c77: OUTPUT«(List)(Array)» | ||
RabidGravy | ufobat, it could be implemented, there isn't a particular problem it's just fiddly | ||
Xliff | OK. So the behavior I was expecting was correct. | 15:15 | |
ufobat | good to know | ||
15:15
leont_ joined
15:18
ZoffixW joined
|
|||
ZoffixW | m: my $text = "### Perl 5\nSome code\n## Perl 6\nMoar code\n"; my @titles = $text.comb(/^^ <?after '#'+ \s> (.+?) $$/); .say for @titles; | 15:18 | |
camelia | ( no output ) | ||
ZoffixW | Why doesn't this match, yet if I remove '^^' then it works? | ||
moritz | ZoffixW: because of the \n | 15:20 | |
ZoffixW | moritz, doesn't it make a new "line", hence the start/end of line anchors would work? | 15:21 | |
moritz | ZoffixW: <?after '#'> doesn't match, because the previous character was a \n, not a # | ||
ZoffixW | The docs also say "The ^^ assertion matches [...] either at the start of the string, or after a newline character." | ||
moritz | ZoffixW: maybe you want <?before> instead? | 15:22 | |
ZoffixW | Nah, I want <?after .. but now I see why it's failing. <after is zero-width. But then, why does this fail too, if I put the ^^ inside the <?after? | 15:23 | |
m: my $text = "### Perl 5\nSome code\n## Perl 6\nMoar code\n"; my @titles = $text.comb(/<?after ^^ '#'+ \s> (.+?) $$/); .say for @titles; | |||
camelia | ( no output ) | ||
moritz | ZoffixW: what do you want to achieve? | ||
ZoffixW | moritz, I want the result to be @titles = 'Perl 5', 'Perl6'; | 15:24 | |
Xliff | 'Perl 5', 'Perl 6' | ||
Xliff knows what its like to suffer from a defective space bar. | 15:25 | ||
ZoffixW | right | ||
moritz | m: my @lines = "### Perl 5\nSome code\n## Perl 6\nMoar code\n".lines; for @lines.rotor(2 => -1) { say .[1] if .[0] ~~ /^'#'/ } | 15:26 | |
camelia | rakudo-moar f05c77: OUTPUT«Some codeMoar code» | ||
ZoffixW | heh. But I want with .comb | ||
moritz | and it's not what you want, right? | ||
ZoffixW | Right. | ||
moritz | m: say "### Perl 5\nSome code\n## Perl 6\nMoar code\n".comb(/^^'#'+\s* <( \N+ /).perl | 15:27 | |
camelia | rakudo-moar f05c77: OUTPUT«("Perl 5", "Perl 6").Seq» | ||
moritz | ZoffixW: better? :-) | ||
ZoffixW | Yeah, thanks. Now I juse need to read up on what <( and \N+ are :) | 15:28 | |
moritz | <( starts the match | ||
\K if you know p5 regexes | |||
and \N is the opposite of \n | 15:29 | ||
a non-newline character | |||
ZoffixW | Though I'm still curious why my version with <?after didn't work. | ||
moritz, thanks. That makes sense | |||
m: my $text = "### Perl 5\nSome code\n## Perl 6\nMoar code\n"; my @titles = $text.comb(/<?after ^^ > (.+?) $$/); .say for @titles; | |||
camelia | rakudo-moar f05c77: OUTPUT«Some code## Perl 6Moar code» | ||
ZoffixW | ^ first line is missing :S | ||
psch | m: say +("\n" ~~ / ^^ /) | 15:33 | |
camelia | rakudo-moar f05c77: OUTPUT«0» | ||
psch | m: say +("a\nb" ~~ / ^^ /) | ||
camelia | rakudo-moar f05c77: OUTPUT«0» | ||
psch | m: say +("a\nb\n" ~~ / ^^ /) | ||
camelia | rakudo-moar f05c77: OUTPUT«0» | ||
psch | oh duh | 15:34 | |
ZoffixW | ? | ||
psch | not capturing anything of course reports 0 captures... :) | ||
ZoffixW | Ah | ||
psch | m: say +("\n" ~~ / (^^) /) # not sure we *can* capture that..? | ||
camelia | rakudo-moar f05c77: OUTPUT«0» | ||
15:35
sno left
|
|||
Xliff | m: my @a = ("a\nb\n" ~~ m:g/ ^^ /); say @a | 15:35 | |
camelia | rakudo-moar f05c77: OUTPUT«[「」 「」]» | ||
Xliff | Ooorrr... | ||
psch | m: say +("\n" ~~ / [^^ (<?>)]+ /) # not sure we *can* capture that..? | ||
Xliff | m: say ("a\nb\n" ~~ m:g/ ^^ /); | ||
camelia | rakudo-moar f05c77: OUTPUT«Memory allocation failed; could not allocate 94656 bytes» | ||
rakudo-moar f05c77: OUTPUT«(「」 「」)» | |||
psch | well, yeah, that should be a timeout i guess | ||
i mean, it makes sense | |||
psch slowly steps away from the zero-width assertions | 15:36 | ||
ZoffixW | :D | ||
Xliff | They would be useful if I could ever get them to work like want them to! | ||
psch .oO( "sir, please put down the kleene star!" ) | 15:37 | ||
tadzik | moritz++ | ||
Xliff | s/like/like I/ | ||
psch | i just occassionally braino, like above :S | 15:38 | |
dalek | osystem: 71e841b | RabidGravy++ | META.list: Rename META file for AccessorFacade |
15:54 | |
15:55
_mg_ left
16:00
telex left
|
|||
MadcapJake | tadzik: how do I keep separate my panda for rakudobrew and one for rakudo? | 16:01 | |
16:02
telex joined
|
|||
takadonet | m: for 1..8 -> $core { next if $core %4 !=0; say $core;} | 16:04 | |
camelia | rakudo-moar f05c77: OUTPUT«Cannot modify an immutable Int in block <unit> at /tmp/ltAhBcPWVO line 1» | ||
takadonet | m: for 1..8 -> $core { my $temp = $core; next if $temp %4 !=0 ; say $core;} | 16:05 | |
camelia | rakudo-moar f05c77: OUTPUT«Cannot modify an immutable Int in block <unit> at /tmp/q_mOvqF1an line 1» | ||
takadonet | what I am missing? | 16:06 | |
ZoffixW | m: for 1..8 -> $core { next if $core % 4 != 0; say $core;} | ||
camelia | rakudo-moar f05c77: OUTPUT«48» | ||
ZoffixW | takadonet, spaces :) | ||
takadonet | ZoffixW: ..... bloody hell! | ||
thanks | |||
ZoffixW | I wonder what it's being interpreted as... | 16:07 | |
m: my $x; say $x !=0; | |||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
ZoffixW | m: my $x; say $x != 0; | ||
camelia | rakudo-moar f05c77: OUTPUT«Use of uninitialized value of type Any in numeric context in block <unit> at /tmp/vmuw7mllk0 line 1False» | ||
takadonet | Was just about to report it as a bug | 16:09 | |
awwaiid | $core % 4 != 0 ---> $core !%% 4 # I think | 16:12 | |
%% means "even multiple of", and thus !%% means "not an even multiple of" | 16:13 | ||
ZoffixW would just use unless ... %% | |||
awwaiid | m: for 1..8 -> $core { next if $core !%% 4; say $core } | ||
camelia | rakudo-moar f05c77: OUTPUT«48» | ||
ZoffixW | Well, it might be a bug that !=0 is doing something weird. It almost like it's trying to do the same type of stuff as +=, except with the ! operator. | 16:14 | |
ZoffixW reports it | |||
16:16
uruwi left
16:17
zakharyas left
|
|||
ZoffixW | Ah, $a !=$b, behaves as $a = $b and returns !$b as result | 16:17 | |
stmuk_ | pl6anet.org/drop/rakudo-star-2016.04-RC3.tar.gz | ||
ZoffixW | stmuk_++ | ||
stmuk_ | testing on Windows welcomed - if nothing serious pops up I'm planning on releasing that in 12 hrs or so | ||
awwaiid | ZoffixW: I looked at perl6 --target=parse -e 'my $x; say $x !=0', and ... yep. | 16:18 | |
!==0 works in that case :) | 16:20 | ||
gregf_ | m: (1..8).grep: { next unless $_ %% 4; .say } | ||
camelia | rakudo-moar f05c77: OUTPUT«48» | ||
ZoffixW | Reported: rt.perl.org/Ticket/Display.html?id=127988 | ||
m: (1..8).grep(* %% 4)>>.say | 16:21 | ||
camelia | rakudo-moar f05c77: OUTPUT«48» | ||
16:21
wamba left
|
|||
gregf_ | oh, that next is not needed :| | 16:22 | |
m: (1..8).grep: { $_ %% 4 && .say } | |||
camelia | rakudo-moar f05c77: OUTPUT«48» | ||
gregf_ | heh.. ZoffixW++ | ||
16:22
uruwi joined
16:23
wamba joined
|
|||
gregf_ | refactoring++ | 16:23 | |
takadonet | gregf_: original script little more complex then that :) | ||
16:27
dakkar left
|
|||
Xliff | Can you make Buf/Blob/Array mimic a file stream in Perl6? | 16:28 | |
stmuk_, Can Rakudo Start live in harmony with Strawberry Perl? | 16:30 | ||
s/Start/Star/ | |||
ZoffixW | m: (0, 4 ... * > 100).say | 16:31 | |
camelia | rakudo-moar f05c77: OUTPUT«(0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104)» | ||
moritz | Xliff: what do you mean by "mimic"? | ||
stmuk_ | Xliff: currently that's just a source distro with basic windows support - its likely some of the nativecall modules like linenoise might not work depending on compiler | 16:32 | |
Xliff | Well, ideally I want to write one entry point into an interface I am writing. | ||
stmuk_ | Xliff: if you could try building with strawberry and report any issues of a gist posted here that would help | ||
s/of/on | |||
Xliff | So I want to be able to run this Bufs, Blobs, Arrays and file streams. | 16:33 | |
stmuk: OK. Rebuilding now. | |||
moritz | Xliff: sounds like you want something like p5's IO::All | ||
I don't think such a thing has been written yet for Perl 6 | 16:34 | ||
16:35
ZoffixW left
|
|||
stmuk_ | Xliff: I'm travelling shortly but will read this scrollback later | 16:36 | |
16:37
jjido_ joined
16:39
sno joined
16:43
_mg_ joined
|
|||
Xliff | moritz++ # Thanks! | 16:45 | |
16:52
abraxxa left
16:55
ponbiki joined
|
|||
Xliff | The hurdles I have to go through to get rakudobrew to work on Windows. | 16:55 | |
grondilu | m: say (class {}) // "not defined?" | 16:58 | |
camelia | rakudo-moar f05c77: OUTPUT«not defined?» | ||
grondilu | m: say Int.defined | 16:59 | |
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
grondilu needs to review the semantics of &[//] | |||
moritz | &[//] probably doesn't short-circuit | 17:00 | |
smls | moritz: TimToady made [ ] with || // and friends short-circuit, shortly before the 6.c release | 17:02 | |
m: say [//] 42, (say "here") | |||
camelia | rakudo-moar f05c77: OUTPUT«42» | ||
moritz | smls: rakudo disagrees with you | 17:03 | |
smls | ? | ||
It did not execute the (say "here") | 17:04 | ||
ilmari | m: say [&&] 42, (say "here") | 17:05 | |
camelia | rakudo-moar f05c77: OUTPUT«hereTrue» | ||
ilmari | m: say [&&] False, (say "here") | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
17:05
Khisanth left
|
|||
MadcapJake | m: [//] Nil, Nil, (say 'here'); | 17:05 | |
camelia | rakudo-moar f05c77: OUTPUT«here» | ||
17:05
jjido_ left
17:07
cschwenz left
|
|||
MadcapJake | m: say (class {}).defined; say (class{}).new.defined; # grondilu | 17:07 | |
camelia | rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7p4QP88AkjWhitespace required after keyword 'class'at /tmp/7p4QP88Akj:1------> 3say (class {}).defined; say (class7⏏5{}).new.defined; # grondilu» | ||
MadcapJake | m: say (class {}).defined; say (class {}).new.defined; # grondilu | ||
camelia | rakudo-moar f05c77: OUTPUT«FalseTrue» | ||
[Coke] | stmuk: what do you mean, no PATH under windows? | 17:08 | |
geekosaur | yeh, I was wondering about that... a class would be a type object | ||
thought they said "unix-like".. .which would mean :-separated | 17:09 | ||
Xliff | Error while building. Detailes here: gist.github.com/Xliff/83bddb9af82e...b330811ff8 | 17:10 | |
17:12
pmurias left,
pmurias joined
|
|||
MadcapJake | Why do I keep getting "IO::Path requires named arguments only" error when it clearly allows you to provide a single string/IO argument | 17:14 | |
17:14
maybekoo2 joined,
jjido_ joined
|
|||
smls | m: say IO::Path.new(5); say IO::Path.new(5, 10) | 17:15 | |
camelia | rakudo-moar f05c77: OUTPUT«IO::Path is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting line 1 in method new at src/RESTRICTED.setting line 32 in block <unit> at /tmp/Rh2thN3Apr line 1» | ||
MadcapJake | that even works smls, it just concats it onto $*CWD | 17:16 | |
oh but the second one doesn't and gives the same named args only error | |||
hmmm | |||
17:16
firstdayonthejob joined
|
|||
smls | It's an LTA error message. Might be worth to RT it. | 17:16 | |
dalek | c: 26bd494 | (Jan-Olof Hendig)++ | doc/Type/Dateish.pod: Added documentation for the weekday-of-month method |
17:17 | |
MadcapJake | smls: rt.perl.org/Ticket/Display.html?id...6818e5712c | 17:19 | |
smls | MadcapJake++ | ||
17:19
jjido_ left,
Ricimer joined
17:20
Ricimer left
17:24
uruwi left
17:25
smls_ joined,
smls left
17:28
kerframil left
17:39
dha joined
17:40
ZoffixW joined,
Actualeyes1 left
|
|||
pmurias | hmm, when we reach 100 nqp test how should they be numbered? | 17:41 | |
[Coke] | can't we just keep going | ||
? | |||
llfourn | unicode! | 17:42 | |
RabidGravy | I wrote a script to renumber tests spaced out by 100 and left padded with zeroes the other day | 17:43 | |
ZoffixW | rename 's/^(\d+\d+)(?!\d)/0$1/' * | 17:44 | |
m: my %things = 'moo=meow ping=pong'.comb(/(\w+) '=' (\w+)/, :match).map({ $_[0] => ~$_[1] }); say %things | |||
camelia | rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}» | ||
ZoffixW | Is there a more concise way to write the above? Preferably with .comb, but I'll take other methods too? | 17:45 | |
Err... \d\d not \d+\d+ | |||
mst | maybe some sort of .flatten.pairs_to_hash type thing? | 17:46 | |
maybe not conciser but prettier, maybe | |||
17:46
zakharyas joined
|
|||
ZoffixW | .comb is itching for a :captures flag... Where it returns a list of all the $0, $1, $2 ... etc captures | 17:46 | |
17:46
Khisanth joined
|
|||
ZoffixW | m: my %h = 'moo=meow ping=pong'.comb(/(\w+) '=' (\w+)/, :match)>>.flat.flat>>.Str; say %h | 17:48 | |
camelia | rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}» | ||
ZoffixW | mst++ | ||
Still, kinda roundabout, especially when you compare it to Perl 5's: my %h = 'moo=meow ping=pong' =~ /(\w+)=(\w+)/ | |||
m: my %h = 'moo=meow ping=pong'.comb(/(\w+) '=' (\w+)/, :match)>>.Slip.>>.Str; say %h | 17:50 | ||
camelia | rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}» | ||
mst | ZoffixW: you missed a 'g' on the perl5 version, I think | 17:52 | |
ZoffixW | Yeah, I did | ||
It's still much shorter even with /g :) | |||
mst | how come it needs all of >>.flat.flat>..Str ? | 17:53 | |
that's a bit beyond my current comprehension | |||
ZoffixW | .comb with :match returns a bunch of Match objects. | ||
And apparently when you coerce them into a list, you get a list of captures. | |||
MadcapJake | mst: .map(.flat).flat.map(.Str) | 17:54 | |
llfourn | m: 'moo=meow ping=pong'.comb(/(\w+) '=' (\w+)/, :match).say | ||
camelia | rakudo-moar f05c77: OUTPUT«(「moo=meow」 0 => 「moo」 1 => 「meow」 「ping=pong」 0 => 「ping」 1 => 「pong」)» | ||
dha is still waiting for a programming language that can handle having just one instruction: DWIM | |||
MadcapJake | >>.method equivalent to .map(*.method) | 17:55 | |
mst | ah, right, so the first .flat just turns it into one list per match and the recond one flattens it entirely? | 17:56 | |
ZoffixW | Yeah | 17:57 | |
But you still get Match objects, so that's why .Str is there too | |||
17:58
Actualeyes joined
|
|||
smls_ | MadcapJake: Isn't >>.method closer to .deepmap(*.method) ? | 18:03 | |
18:03
jack_rabbit joined
|
|||
llfourn | m: my %h = q|moo=meow ping=pong|.comb(/$<key>=\w+ "=" $<value>=\w+/, :match).map({.<key> => .<value>.Str}); say %h.perl # clearer | 18:04 | |
camelia | rakudo-moar f05c77: OUTPUT«{:moo("meow"), :ping("pong")}» | ||
CIAvash | m: say 'moo=meow ping=pong'.split([' ','=']).hash | ||
camelia | rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}» | ||
ZoffixW | CIAvash, that's incorrect. Your `ping` key is ` ping` key. | ||
Oh | 18:05 | ||
Sorry, I missed the ' '. But still. | |||
mst | oh hey something that does have a hash form ;) | ||
ZoffixW | :D | ||
MadcapJake | smls_: yeah you're right | ||
18:06
perlawhirl joined
|
|||
perlawhirl | Zoffix: this is how i've always done string pairs to hashes... | 18:06 | |
m: my %things = [=>] 'moo=meow ping=pong'.split('='); say %things; | 18:07 | ||
camelia | rakudo-moar f05c77: OUTPUT«{moo => meow ping => pong}» | ||
ZoffixW | m: dd [=>] 'moo=meow ping=pong'.split('=') | ||
camelia | rakudo-moar f05c77: OUTPUT«:moo("meow ping" => "pong")» | ||
perlawhirl | or... just in case separators are in your 'value' string ... .split('=', 2) | ||
hmm... .words too then :D | 18:08 | ||
ZoffixW | I guess that's another way to go, but it's not the equivalent of the Perl 5's version [and doesn't use .comb]... | 18:09 | |
ZoffixW is writing an article, so those two bits are more important than they should be :) | |||
perlawhirl | m: dd 'moo=meow ping=pong'.words.map({ [=>] .split('=') }); | 18:10 | |
camelia | rakudo-moar f05c77: OUTPUT«(:moo("meow"), :ping("pong")).Seq» | ||
perlawhirl | ahh... didn't see you say 'preferably with comb' | 18:11 | |
ZoffixW | Hm. I started writing a proposal to add :captures, but can't come up with any sane behavior (should it return a List for each set? What about named captures?): Here's what I wrote so far, if anyone wants to take the torch: gist.github.com/zoffixznet/b88f63a...9eb86b0c54 | 18:12 | |
18:12
uruwi joined
|
|||
ZoffixW | ».Slip.».Str ain't too bad | 18:12 | |
vendethiel- | (why not map?) | 18:13 | |
psch | ZoffixW: Match exists to deal with ambiguity of having positional and named captures... :) | 18:14 | |
ZoffixW | Right, which makes :captures pointless :P | 18:15 | |
psch | +the | ||
ZoffixW | vendethiel-, more typing? :) | ||
vendethiel- | .map(*.Slip.Str) isn't that bad, really :P | ||
ZoffixW | ».Slip».Str both shorter and sexier :) | ||
vendethiel- politely disagrees | |||
ZoffixW | :D | 18:16 | |
vendethiel- | the good thing is, both work :). | ||
psch | and a .Slip.Str is fast either way, amirite | 18:17 | |
dalek | osystem: f11e8db | RabidGravy++ | META.list: Rename META file for XDG::BaseDirectory |
||
18:17
molaf left
18:18
smls_ is now known as smls
18:22
_mg_ left,
Actualeyes left
|
|||
perigrin | /w 74 | 18:25 | |
18:26
Ven joined
18:27
zakharyas left
18:28
cdg left,
cdg joined
18:30
molaf joined
18:33
cdg left
18:38
Ven left
|
|||
dha | So... If I wanted to know what directory my program thinks it's in at the moment, I would think I would use - from what I can find searching for "dir" at doc.perl6.org - IO::Spec::curdir | 18:42 | |
RabidGravy | $*CWD | ||
dha | But It's not working in any way I can think of using it. | ||
Ah. So, does curdir actually work at all? | |||
RabidGravy | m: say $*SPEC.curdir | 18:43 | |
camelia | rakudo-moar f05c77: OUTPUT«.» | ||
dha | Ah. So IO::Spec methods would be used via $*SPEC? | ||
RabidGravy | yes, but it doesn't mean pwd, it returns '.' to mean "who do I talk about the current directory" :) | 18:44 | |
ZoffixW | dha, yeah, $*SPEC is the appropriate IO::Spec::* object for the current OS | ||
RabidGravy | or how even | 18:45 | |
similarly | |||
m: say $*SPEC,updir | |||
camelia | rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/t7J7yKgGLRUndeclared routine: updir used at line 1. Did you mean 'chdir', 'indir', 'mkdir', 'pair', 'tmpdir'?» | ||
RabidGravy | m: say $*SPEC.updir | 18:46 | |
camelia | rakudo-moar f05c77: OUTPUT«..» | ||
dha | Ah, ok, $*SPEC is covered in the full IO::Sped doc. | ||
RabidGravy | yeah | ||
dha | but if you search for curdir, it just gives you the curdir parts of IO::Spec. Hm. that looks like a problem I don't see an easy solution for. | 18:47 | |
ZoffixW | dha, what problem? | 18:49 | |
m: $*CWD.say | |||
camelia | rakudo-moar f05c77: OUTPUT«"/home/camelia".IO» | ||
18:49
tharkun left,
tharkun joined
|
|||
dha | The problem is that searching for that is problematic if one doesn't already know to look for it. | 18:50 | |
18:50
domidumont left,
jack_rabbit left
|
|||
dha | And that, if you search for curdir, you don't see the bit in the full IO::Spec doc that says you need to access IO::Spec methods via $*SPEC | 18:50 | |
ZoffixW | I s'pose. It's listed under Variables: docs.perl6.org/language/variables#D..._variables | ||
dha | So, not a problem in how it works, but a problem for people looking for things. | 18:51 | |
ZoffixW | Yeah | ||
RabidGravy | maybe "are you looking for $*CWD?" could help | ||
dha | ZoffixW - right, but again, you need to know you're looking for a variable, not a function/method | ||
18:52
hankache joined
|
|||
dha | RabidGravy - if we could make that work in a useful way, sure. :-) | 18:52 | |
RabidGravy | just in the curdir pod | ||
hankache | good evening #perl6 | 18:53 | |
ZoffixW | \o | ||
dha | Hm. Yeah, that could work. except there are several OS-specific curdirs that come up if you search for curdir, so I'm not sure how that would work. that, though, is more me not knowing how the doc.perl6.org search works than anything, I imagine. | 18:54 | |
RabidGravy | I don't know how it works either :) | 18:56 | |
leont_ | There are various algorithms, with various edge cases | 18:57 | |
[Coke] | When the site is built, all the searchable things are put into a static JS block. | ||
dha | RabidGravy - that's somehow comforting. :-) | ||
ZoffixW | For one, you can use X<foo|section,explanation> tags to index bits. I think a good way to solve the above problem would be to use that form for all the special variables. Alas, looking at the page, it seems like POD tags inside the table aren't parsed | 18:58 | |
RabidGravy | no I could never work out how to fix that | ||
19:00
ecocode joined
|
|||
CIAvash | m: say 'moo=meow ping=pong'.comb(/\w+/).hash | 19:03 | |
camelia | rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}» | ||
CIAvash | ZoffixW: Does this count? ↑ | 19:04 | |
ZoffixW | CIAvash, sure :D Thanks | 19:05 | |
dalek | c: 3b7440d | (Jan-Olof Hendig)++ | doc/Type/Dateish.pod: Added documentation for method week-number and wrote some code examples for is-leap-year and days-in-month |
19:08 | |
19:09
skids joined
19:13
ecocode left
19:14
mr-foobar left
19:18
mr-foobar joined
19:24
ufobat left
|
|||
ZoffixW | New blog post: "Perl 6: Comb It!" blogs.perl.org/users/zoffix_znet/20...mb-it.html | 19:25 | |
mst | "Your code is a tangle, might I suggest .comb, sir?" | 19:27 | |
Xliff | Hummm…... | 19:28 | |
Looks like jnthn beat me with Audio::Sndfile | |||
Ah well. I've started. I may as well finish. | 19:29 | ||
psch | Xliff: not jnthn, RabidGravy | 19:31 | |
Xliff | Oh. LOL! Same name. | ||
Any idea when (un)?pack will move out of the experimental phase? | 19:32 | ||
RabidGravy | audio::sndfile doesn't do compressed audio | ||
Xliff | RabidGravy, Ahhh. | ||
RabidGravy | the most complex it does is flac | ||
timotimo | Xliff: it'll need an implementation first :) | 19:33 | |
Xliff | timotimo, you're kidding me? That's still NYI (Not yet implemented) | 19:34 | |
Juerd | timotimo: And before that, perhaps some specification :) | ||
Xliff | Aaieee! | ||
Juerd | Xliff: pack/unpack is unspecified, perhaps mostly an oversight. | ||
Xliff wonders how he's going to do WAV header parsing without it. | |||
Juerd | Xliff: Well, there's something in place, just not feature complete. | ||
RabidGravy | it's partially implemented, no-one likes the way it works | ||
Xliff | I could always cheat and use Inline::Perl5 | ||
timotimo | yes, partially implemented, but that implementation will (hopefully) go away before the feature goes non-experimental | 19:35 | |
Xliff | >.> | ||
RabidGravy | Xliff, you can use Audio::Sndfile :) | ||
Xliff | <.< | ||
Juerd | If you're interested in pack/unpack, could you read gist.github.com/Juerd/ae574b87d40a66649692/ and comment if you have any thoughts on that design? | ||
Xliff | RabidGravy, yes. And that is on my list of possibilities. However using a module that can read/write Ogg/Vorbis to test one that will read/write Ogg/Vorbis seems rather...err... meta. | 19:36 | |
19:36
ZoffixW left
|
|||
Xliff | I'd like Audio::OggVorbis to have as few dependencies as possible. | 19:36 | |
Xliff goes to read Juerd's gist | |||
CIAvash | ZoffixW: You can also use the match method instead of matching with comb: `'moo=meow ping=pong'.match(/(\w+) '=' (\w+)/, :g)` | 19:37 | |
RabidGravy | Sndfile can't read/write ogg vorbis | ||
Xliff | RabidGravy, says so here -> www.mega-nerd.com/libsndfile/#Features. There's a footnote right after the table that states: "From version 1.0.18, libsndfile also reads and writes FLAC and Ogg/Vorbis." | 19:39 | |
dha | ZoffixW - nice article. Also, that's a big comb. | 19:40 | |
Xliff | Juerd: By "byte-prefixed" do you mean "<byte> <data>" where <byte> is the length of the data? | 19:41 | |
Juerd | Xliff: Line number? | 19:42 | |
Xliff | 44 | ||
Juerd | Oh, byte *length* prefix. That's the length in number of bytes, prefixed as some number | 19:43 | |
timotimo | does the byte length prefix also have a byte length prefix length prefix? | ||
Juerd | This number could have any encoding, e.g. uint32 or uint8. The length prefix itself can thus be one or multiple bytes. | ||
RabidGravy | Xliff, well I never, I must have had an older version when I first made it :) | ||
Xliff | OK. I am reading this right, then. | ||
Juerd | timotimo: Templates can be nested, so that is possible. | ||
timotimo | OK | ||
oh, that's your design from back then! | 19:44 | ||
Xliff | RabidGravy, LOL! | ||
Juerd | timotimo: Yes, that I never had time for to implement. | ||
Not that I know enough low-level p6/nqp to even dare... | |||
RabidGravy | I'd just make it in Perl 6 in the first place | 19:45 | |
pack & unpack are | |||
Juerd | Yes, and that makes them unusably slow. | ||
19:46
CIAvash left
|
|||
RabidGravy | well there's the problem | 19:46 | |
Juerd | One of several :) | ||
timotimo | Juerd: my ($s, $i) = $blob.decode([ "latin1", uint16 ]); # FAILS - btw, why does this fail? why doesn't it just find the first null byte and then unpack a uint16 | ||
Juerd | timotimo: Because I didn't want to specify that latin1 cannot include null bytes. Instead, null-termination will need to be indicated explicitly. | 19:47 | |
Xliff | timotimo, I was just about to ask that. | ||
timotimo | ah | ||
Juerd | timotimo: Good point, though! I only considered \0 strings for encoding, and thought that Nil could perfectly handle that. But for decoding, something else is needed. | 19:48 | |
Xliff | Juerd: So how does the other one work, then? "my ($n, $s) = $blob.decode([ num, "latin1" ]);" | ||
Juerd | Xliff: That reads to the end of the input | ||
Xliff: Non-length-specified types can be specified at the end of the template | |||
RabidGravy | but to go back to the original question pack/unpack aren't going anywhere | ||
Xliff | So "my ($n, "latin1", $n) = $blob.decode([num, "latin1", num])" will fail? | 19:49 | |
Juerd | Xliff: Yes. | ||
Xliff | kk | ||
RabidGravy | there is software that uses them *which was made before everyone moaned them into being marked experimental* | 19:50 | |
19:50
_ramix_ joined
|
|||
Xliff | BUT! "my ($n, $s, $n) = $blob.decode([num, uint8 => "latin1", num])" is valid? | 19:50 | |
Juerd | RabidGravy: It had to be made experimental because there's no way the current design could be repaired without breaking compatibility. | ||
Xliff: Indeed. | |||
Xliff | RabidGravy, Oooh! So the "experimental" stuff is the result of groaning? | 19:51 | |
RabidGravy | yeah | ||
Xliff | I'm SAVED! | ||
Juerd | Why 'moaning' and 'groaning'? | ||
Xliff | Still will need to taint my module with "use experimental" but I don't feel so bad about it, now. | 19:52 | |
Juerd | Xliff: It's just an indication that your software *will* break once these features are touched. | 19:53 | |
Practically any change to this will be incompatible. | |||
Xliff | And I will just have to accept the responsibility to fix it when that happens. | ||
RabidGravy | well, that's what it was. there isn't an alternative implementation, and the functionality is required | ||
Xliff | Because parsing binary headers will be a bitch without it. | 19:54 | |
Juerd | RabidGravy: So should we have gone with the broken and unfixable thing we have now, without indicating that it will break? | ||
19:54
_4d47 joined
|
|||
Juerd | You could argue that the release was rushed because the spec and implementation were incomplete, but imho a release is a mostly symbolic thing anyway. | 19:55 | |
No piece of software has ever been perfect, especially at 1.0 | 19:56 | ||
RabidGravy | so how come Net::AMQP was working fine for a year using it before all that? | ||
Juerd | Oh, really? How can something be broken if it worked for a particular purpose? | ||
19:57
hankache left
|
|||
RabidGravy | er, you've lost me | 19:57 | |
dogbert2 | o/ #perl6 | ||
Juerd | RabidGravy: Your argument seems to be that Net::AMQP having workend, means that pack/unpack is sufficient to not be experimental. | 19:58 | |
_ramix_ | Hi. We have the Spanish version of perl6intro: es.perl6intro.com. Enjoy it! | ||
dogbert2 | doc question | ||
19:59
dotnessv joined
|
|||
Juerd | It's a stub at best. Useful and it would suck if we didn't have it, but not anything we can build future versions on. Not a weird situation, considering that it was built without specification. | 19:59 | |
dha | yay! someone other than me has a doc question! :-) | ||
dogbert2 | the 'write' method in IO::Socket has the following documentation 'Writes the supplied buffer to the socket, thus sending it to other end of the connection. The string version is method send.' | ||
RabidGravy | my argument is that it does what it does sufficiently well for something quite complicated to work | 20:00 | |
[Coke] | RabidGravy: are you saying it's not experimental? | ||
dogbert2 | There is no method 'send' in the source as far as I can tell. Should it in fact be 'print'? | ||
Juerd | RabidGravy: Yes, but that doesn't necessarily mean it's good enough to take forward. There are many things that it doesn't do, but cannot be made to do without breaking compatibility. | ||
[Coke] | dogbert2: Channel has a send, FWIW. | 20:01 | |
Juerd | RabidGravy: That a specific example doesn't exercise those missing features doesn't mean a thing. Obviously, it if needed those features, the module might not have existed. | ||
dha | Perhaps we should encourage people not to think "experimental" doesn't mean "doesn't actually work"... | ||
dogbert2 | [Coke]: yup, but there's no suck thing in src/core/IO/Socket.pm | 20:02 | |
RabidGravy | I'd actually go for something completely different, which isn't pack/unpack at all | ||
dogbert2 | *such | ||
[Coke] | dha: some docs on "is experimental" are probably in order if we don't have them, sure. | ||
Juerd | RabidGravy: So would I. Have you seen my gist at gist.github.com/Juerd/ae574b87d40a66649692/ yet? I went with encode and decode, just like character encodings, because that's what number encodings are: encodings. | ||
RabidGravy | as it is, I've stopped the MIDI file module because of the uncertainty | 20:03 | |
Juerd, I saw it before. | |||
Juerd | NB: if someone has a git account and can add a comment that terminator-specified decoding is a required feature, that would be welcome | 20:04 | |
I don't have my phone with me and I need that to login at github... | |||
timotimo | OK | 20:05 | |
Juerd | Thanks :) | ||
timotimo | there you go | 20:06 | |
Juerd | I'll think up some way to fit it into the design | ||
First thought is "\0" => "latin1" | 20:07 | ||
But I'll think about it some more because I don't like that. | |||
timotimo | will we have something like "\r\n\r\n" => "latin1" for HTTP header section, too? | 20:08 | |
Juerd | I think HTTP headers should be approached as text, not binary :) | ||
RabidGravy | yeah | ||
Juerd | I like "latin1\0" better, but it might be nice to support arbitrary delimiters, maybe even bracketing ones. | 20:09 | |
Xliff | That will make it…interesting…to parse. | 20:10 | |
timotimo | yes | 20:11 | |
well, we'd really like to have something fast and short to type to split a buffer at a multi-element delimiter | |||
Xliff | Juerd: also encode/decode are already used in Buf and Str. | ||
Juerd | Xliff: Yes, my design intends to extend that | 20:12 | |
Xliff: The rationale behind this is that string encodings and number encodings can be treated as one thing. | 20:13 | ||
Xliff | Ahh. | ||
Makes sense. | |||
Juerd | Both are ways of encoding numbers anyway | ||
timotimo: Er... I think we already have that: .split | |||
timotimo | on blobs? | 20:14 | |
Juerd | If it doesn't exist, it should :) | ||
m: my $b = Blob.new(65, 13, 10, 65); say $b.split(Blob.new(13, 10)) | |||
camelia | rakudo-moar f05c77: OUTPUT«Use of uninitialized value of type Any in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/eGPvlvvg_t line 1Cannot call split(Blob, Blob); none of these signatures match: in bl…» | ||
20:15
darutoko left
|
|||
Juerd | Meh :( | 20:15 | |
RabidGravy | it should, it's usually implemented with some subbuf thing | ||
20:16
dotnessv left,
cdg joined
20:17
AlexDaniel joined,
grondilu left
|
|||
AlexDaniel | psch: rt.perl.org/Ticket/Display.html?id=127980 | 20:25 | |
20:25
dha left,
dha joined
|
|||
tailgate | how does perl perl6 look for modules? If I want to import a module in the directory lib/foo/bar.pm6 how would I do that? Does it have to be under "lib"? | 20:26 | |
20:27
dolmen joined
|
|||
Xliff | Juerd, looks good. I've made a comment on your gist. | 20:27 | |
AlexDaniel | tailgate: what about perl6 -Ilib/foo/ | ||
timotimo | shouldn't -Ilib work just as well? then you'd have to use foo::bar | ||
Xliff | It's much easier to understand than pack/unpack. | 20:28 | |
And would work for my use-case. | |||
With one issue, which I bring up in the comments. | |||
20:28
_4d47 left
20:29
_ramix_ left
|
|||
Juerd | Xliff: Thanks for your time | 20:29 | |
20:29
kaare_ left
|
|||
Xliff | Juerd, no problem. Thanks for your thoughts! ;) | 20:30 | |
moritz fails to Apache | 20:31 | ||
Xliff wonders if Apache had it's head scalped... or if Apache was the one doing the scalping. | |||
moritz was unclear. | |||
moritz | Xliff: it's the one not doing the redirect :( | 20:32 | |
Xliff | What are you trying to redirect? | ||
mod_rewrite? | |||
moritz | perlpunks.de/paste/show/571e7eda.3187.86 | ||
yes | |||
I'm trying to redirect all HTTP traffic to HTTPS, except for the URLs that the lets-encrypt/ACME protocol uses for domain verification | 20:33 | ||
AlexDaniel | dogbert2++ for working on documentation | ||
moritz | and it doesn't redirect anything | 20:34 | |
and I'm using pretty much exactly the same code for a different domain, where it works | |||
timotimo | ugh, is there some tool that outputs the exact configuration that applies with all things that come from other sources, too? | 20:35 | |
like the "calculated css" thing inside chrome's dev tools for css rules | |||
psch | AlexDaniel: well, i'm pretty sure that can be a really interesting discussion | 20:36 | |
moritz | timotimo: well, firebug does it too | 20:37 | |
AlexDaniel | psch: yea! | ||
psch | i'm not quite sure if i know enough arguments to stick with my position though... | ||
moritz | timotimo: but outside the browser? I'm not aware of any tools | ||
psch | m: say 2 ~~ %( 0 => 1, 2 => 3 ) | ||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
psch | m: say <a b c> ~~ (**, "c") | ||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
Xliff | moritz: For this I wonder if your RewriteCond is off. You might want "RewriteCond %{HTTPS} off", instead | ||
timotimo | how do people debug apache without something like that :\ | ||
psch | AlexDaniel: note that design.perl6.org/S03.html#Smart_matching didn't speculate on $item ~~ $list at all | ||
moritz | Xliff: this is only the virtualhost for port 80, so no need for that | 20:38 | |
Xliff | timotimo, we read log files.... LOTS AND LOTS of log files. | ||
[Coke] | so does sawyer X hang out on freenode anywhere? | ||
psch | i think that's the strongest argument i have. $item ~~ $list does not have any meaningful behavior, it's just False out of principle it feels | ||
Xliff | moritz, then drop the RewriteCond? | ||
AlexDaniel | psch: I'd love to have M metaop though | ||
Xliff | If that's the only host for port 80 then the rewrite is implicit. | 20:39 | |
moritz | Xliff: no, that's needed for the lets-encrypt domain verification URLs | ||
psch | AlexDaniel: what does that do? | ||
Xliff | So that's why !well-known is there? | ||
moritz | Xliff: it's not the only host | ||
Xliff | Coz I couldn't find it in the mod_rewrite docs. | ||
moritz | Xliff: ! is just a negation | ||
psch | AlexDaniel: i don't quite grasp your snippets in the comment... :) | ||
AlexDaniel | psch: well, it's for comparing lists | 20:40 | |
moritz | Xliff: and well-known is a regex I match against the URLs that I want to exclude from the redirect | ||
the URLs I want to exlude look like /.well-known/acme-challenge/evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA | |||
AlexDaniel | psch: with an explicit op to do comparisons. Much like you do in “$x eq any(…)” case | 20:41 | |
Xliff | moritz: "RewriteCond %{REQUEST_URI} /^\.well-known/" | 20:42 | |
Your regexp isn't in that paste. | |||
I'm running on guesswork here. | |||
moritz | Xliff: "well-known" *is* the regex | 20:43 | |
Xliff | But it sounds like your Cond isn't matching. Have you turned up the LogLevel? | 20:44 | |
psch | AlexDaniel: what's the general semantics? i mean, you mention that your example doesn't account for different length of lists, how does the propose metaop M deal with that? | ||
+d | |||
oh, and why doesn't hyper do that? | 20:45 | ||
m: my @a = ^4; my @b = ^6; say (@a xx *) == (@b xx *) | |||
camelia | rakudo-moar f05c77: OUTPUT«Cannot .elems a lazy list in block <unit> at /tmp/yZrxAIhv8W line 1Actually thrown at: in block <unit> at /tmp/yZrxAIhv8W line 1» | ||
psch | err | ||
Xliff | moritz: OIC. | ||
moritz | Xliff: the rewritecond is a red herring; even if I remove it, no rewrite happens | ||
psch | m: my @a = ^4; my @b = ^6; say (@a) <<[==]>> (@b) | ||
camelia | rakudo-moar f05c77: OUTPUT«[True True True True False False]» | ||
Xliff | moritz: Turn up your LogLevel and see what's actually going on. | ||
When (what should be) common sense fails, log everything. | 20:46 | ||
I hate debugging crazy rewrite rules. | |||
psch | AlexDaniel: well, i don't think i understand the need nor the intent behind a list-comparison metaop... :) | ||
Xliff | Mainly because logging is the only debugging tool you have. | ||
moritz | argl | 20:47 | |
and mod_rewrite "of course" dropped RewriteLog | 20:48 | ||
Xliff | It's LogLevel, now | ||
moritz | yes, and will log all the other noise that I'm not interested in | ||
HATE | |||
timotimo | well, just replace the apache setup with a few hundred lines of node.js code | ||
RabidGravy | I worked at a certain large media organization where everything was rewrite rules, did my head in | 20:49 | |
timotimo | node.js outperforms apache anyway, because apache was developed before async was discovered | ||
Xliff | timotimo, o_O | ||
psch | AlexDaniel: don't take this as shooting down, though. i'm fairly sure i just don't understand what exactly you're proposing... :/ | ||
timotimo | Xliff: that comes from a pretty funny internet video | 20:50 | |
ugexe | al gore discovered async in 2001 | ||
psch | oh boy, the $item ~~ $hash case can make for a wonderful $item ~~ $list idiom, actually | 20:51 | |
m: my @a = <foo bar baz>; say "foo" ~~ %(@a.antipairs) | |||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
psch | there, "is the item in the list" with smartmatch | ||
moritz | is there some weird magic that if you have a .htaccess file that rewrite stuff in the virtual host config isn't applied? | 20:52 | |
20:53
ptolemarch left
|
|||
Xliff | Are there rewrite rules in the .htaccess file? | 20:53 | |
moritz | yes | ||
Xliff | Can you paste those? | 20:54 | |
moritz | Xliff: github.com/moritz/perlgeek.de/blob.../.htaccess | ||
psch | AlexDaniel: in any case, i'll reply properly to the ticket tomorrow which at least my arguments, even if i'm not sure i'll actually be able to argue a specific position... | ||
Xliff | "RewriteRules" before "RewriteEngine on" :/ | 20:55 | |
moritz | ... and it doesn't error out | 20:56 | |
wow | |||
Xliff | moritz: Is this a devel server or production? | 20:57 | |
If devel, then move the .htaccess file out of the way so you can debug your problem in the clear. | |||
moritz | Xliff: prod | ||
Xliff | Then move the .htaccess file back in and see if it still breaks. | ||
moritz: :/ | |||
moritz | or I just move the redirect to the .htaccess file | ||
Xliff | Always best to move other shit out of the way when debugging a specific RewriteCond/RewriteRule block. | 20:58 | |
OOps! Sorry about the language. | |||
Getting tired I am. | 20:59 | ||
dha | Yeah, I mean... mentioning DEBUGGING. | ||
Xliff | I know rite! | ||
Xliff washes mouth out with Raid. | |||
Xliff dies. | |||
mst | pretty sure #perl6 cares a lot more about you not being an asshole than not saying the word, on the whole | ||
Xliff: yeah, lvm is not designed for human ingestion | |||
21:00
Relsak left
|
|||
moritz | seems to work in the .htaccess file | 21:01 | |
well, mystery unsolved, problem solved | |||
timotimo | yay | ||
Xliff | Wow | ||
moritz | time for sleep | ||
Xliff | moritz++ | ||
timotimo | it was because of the wrong location of RewriteEngine on? | 21:02 | |
AlexDaniel | psch: yeah, thanks :) | ||
moritz | timotimo: I have no idea. Probably not | ||
timotimo | oh, OK | ||
moritz | I guess it inherited the RewriteEngine On from the vhost config, or something | ||
Xliff | timotimo, No. I think if there is an .htaccess file with Rewrite directives it ignores anything in the virtual host config. | ||
moritz | there are days when I think I shouldn't software. | ||
timotimo | urgh! | ||
good rest, moritz :) | |||
Xliff | Or it could just be the presence of the .htaccess file | 21:03 | |
I haven't Apache'd since 2.2 | |||
moritz | thanks everybody | ||
Xliff | Good night, moritz | ||
timotimo | what do you webserver these days, Xliff? | 21:04 | |
nginx has risen up in popularity over the last years i hear | |||
teatime | paste.debian.net/plain/440861 ← halp. fails at the "Function Composition" example with "Preceding context expects a term, but found infix = instead" (@:43) | ||
timotimo | but i've kind of liked lighttpd in the mean time | ||
teatime: i think it wants you to terminate the "sofar" | 21:06 | ||
with just =finish it works | |||
but clearly the error message is bogus as hell | 21:07 | ||
teatime | wat... I only did that to separate out the rest of the stuff from the other examples | ||
to golf for reporting purposes... and created new error, hooray me :/ | |||
Xliff | timotimo, I don't! I've webservered maybe 2 things in the past 3 years and it was Apache 2.2 because they couldn't upgrade to 2.4 because...breakage! | ||
timotimo | :) | ||
21:08
perlawhirl left
|
|||
timotimo | is apache 2.2 still being bugfixed and securityfixed? | 21:08 | |
Xliff | Sometimes I miss it. | ||
teatime | how did you get it to work? I added =finish to the end of the file, also tried =end, getting same error? | ||
Xliff | Then it passes. | ||
timotimo | not the end of the file | ||
replace =begin sofar with =finish | 21:09 | ||
teatime | aye yeah just figured that out | ||
21:11
polyfloyd left
21:13
polyfloyd joined
|
|||
timotimo | and the error you're getting is probably just because you've not specified a value for s in your A.new | 21:17 | |
21:17
dolmen left
|
|||
teatime | timotimo: heh, I'm trying to figure out how to. should I have a new() or a BUILD ? | 21:22 | |
21:22
rindolf left
|
|||
timotimo | the default new you'll get just passes on all named parameters to the BUILDs | 21:22 | |
if you want to get by entirely without new and BUILD, you'd "has $.s" instead of "has $!s" | 21:23 | ||
geekosaur | BUILD. new should only be overridden in very special cases sinceyou need to handle superclass building and iirc roles yourself | ||
teatime | timotimo: and that makes the attribute directly rw from outside the class ? | ||
timotimo | no | 21:24 | |
for that you have to "is rw" | |||
private attributes are mostly about "this isn't part of the API" | |||
we've always said if you set the value of "s" directly from the constructor and even give its name, why is it private in the first place? | 21:25 | ||
21:27
sortiz joined
|
|||
masak | I'm not sure I fully buy that argument | 21:27 | |
partly because the one who creates the object and the one who uses it might be two different consumers with different access to its innards | 21:28 | ||
timotimo | you can rent the argument if you want to | ||
after 3 months i'll let you decide if you want to continue renting, buy it properly, or drop the deal altogether | 21:29 | ||
(of course in the latter case you'll have to return the argument, and pay for any repairs necessary to restore it to what it was when you started renting) | |||
masak | another consideratum: object construction sort of happens at the *edge* of the object's life cycle, technically before it starts being all encapsulation...y and stuff | 21:30 | |
timotimo | good point | 21:31 | |
jnthn | The best argument, to me, is the simple one that we decided we'd like to aid refactorability by making sure that you can refactor any $!foo without having to consider anything outside of the class body. | 21:33 | |
Private methods work out the same | 21:34 | ||
masak | yes, that is still a strong argument | ||
mst | timotimo: what masak said about different consumers | 21:35 | |
if I want to expose an interface object to the outside world with a reference to a guts object, I need to pass the guts object in at construction time | 21:36 | ||
in perl5 I usually do "has _foo => (is => 'ro', init_arg => 'foo');" | |||
timotimo | nothing prevents you from making the constructor private and "trusts" for something else :) | ||
we do have an ecosystem module that provides the equivalent of init_arg if i'm not mistaken | |||
mst | sure, but a private constructor doesn't affect the "if you set it directly, why is it private" question | 21:37 | |
timotimo | mhh, OK | ||
jnthn | If you want to have a non-accessor'd attribute assigned from a named parameter, it's just a BUILD submethod away. There's even a parameter binding syntax to let you do it declaratively. | 21:38 | |
mst | I'm not expressing a specific opinion, just poking holes in an argument I don't believe holds water in practice | ||
timotimo | right, that's incidentally what teatime is using in their code right now - what jnthn just mentioned | ||
21:38
zakharyas joined
|
|||
mst | jnthn: yep, and I have no problem with that. you're assuming I was making a stronger argument than what I actually said, I think | 21:38 | |
pattern matching a nuanced position to a more absolutist version you've argued against before is such an annoying failure mode of brains (mine included) | 21:39 | ||
jnthn | mst: I was actually reacting to "we have an ecosystem mdoule to do X" :P | ||
mst | jnthn: init_arg isn't the same thing as that. | 21:40 | |
jnthn | Ah, fair enough | ||
mst | the specific use I put it to is basically equivalent | ||
jnthn | What other uses can it have? | ||
mst | apart from the action-at-a-distance-ness, depending on how you look at it | ||
init_arg => undef lets you have a public attribute that isn't settable via the constructor | 21:41 | ||
and sometimes you're emulating somebody else's new() protocol | |||
are the two that immediately spring to mind | |||
jnthn | In the latter, you want to take a different name than your attribute? | 21:42 | |
mst | right | ||
it's not honestly something you want very often | |||
jnthn | submethod BUILD(:it's-name($!my-name)) { } | ||
:) | |||
uh, *its | |||
timotimo | jnthn: did you notice i put more work into the "create code from a buildallplan" branch? any chance you'd know when you could have a look at it? since it's failing in a hard-to-debug way for me ;( | ||
jnthn | Damn, I am tired :P | ||
mst | ah, well, in that case it's just aesthetics as to whether you prefer it in BUILD or as an annotation on the attribute | 21:43 | |
timotimo | hm. maybe it'd be a good idea to just dump the qast of the code i generate for later inspection | ||
jnthn | timotimo: Sometimes after I've finished banging my head against the GC bugs my torture testing turned up, maybe :) | ||
mst | I suspect but cannot yet confirm that BUILD will be fine for me | ||
timotimo | yeah, let's dump a blob of qast for pretty much every class in the core setting | ||
that doesn't sound like a firehose of information at all | |||
jnthn | timotimo: Just check if an env var is set and only dump in that case? | 21:44 | |
timotimo | well, loading the core setting fails, so i can't run any simpler code than the core setting through this yet | 21:46 | |
i can, however, turn off actually installing the method when an env var isn't set | |||
21:46
ZoffixWin joined,
ZoffixWin left,
ZoffixWin joined
|
|||
jnthn | Right :) | 21:46 | |
timotimo | also, can you explain to me what code 13 does? it seems to just call a getattr; is it to trigger autovivification of attributes? | 21:47 | |
it's a no-op in BUILDALL, but it does that in BUILD_LEAST_DERIVED | |||
tony-o | ZoffixWin : for Data::Dump - you do realize that Match.gist doesn't output the same as .perl ? | ||
ZoffixWin | m: say ('foobar' ~~ m/foo/).gist | 21:48 | |
camelia | rakudo-moar f05c77: OUTPUT«「foo」» | ||
jnthn | timotimo: Yeah, it just does a getattr | ||
ZoffixWin | m: say ('foobar' ~~ m/foo(bar)/).gist | 21:49 | |
camelia | rakudo-moar f05c77: OUTPUT«「foobar」 0 => 「bar」» | ||
jnthn | timotimo: If you git blame the line that added it, you'll see a commit message describing the bug it fixed | ||
ZoffixWin | tony-o, I guess... the above .gist is what I'd want it to output like with the proposed option enabled. I think the same applies to Pair objects too | ||
jnthn | It was in the crazy run-up-to-Christmas bugfixing, which is a bit of a blur :) | ||
ZoffixWin | Or maybe I'm thinking of something else that barfs up a whole ton of methods when Dumped | ||
jnthn goes for sleep :) | 21:50 | ||
'night all | |||
ZoffixWin | night | ||
timotimo | OK | ||
timotimo isn't totally sure when we BUILD_LEAST_DERIVE; it seems to me like we almost always BUILDALL | |||
timotimo greps the source | |||
oh, mostly for role mixination | 21:51 | ||
21:51
spider-mario joined
21:58
tomboy64 left
|
|||
masak | 'night, #perl6 | 21:58 | |
timotimo | gnite masak | 22:00 | |
22:01
shadowpaste left
|
|||
teatime | how can I get the class's name from inside new() | 22:03 | |
self.^name says "Cannot look up attributes in a type object" | |||
22:04
ponbiki left,
xinming left,
pierrot left,
kid51 joined
|
|||
teatime | :8 | 22:04 | |
22:05
ponbiki joined
|
|||
timotimo | well, inside new you don't have a self | 22:05 | |
22:05
xinming joined
|
|||
timotimo | er, what am i saying | 22:05 | |
22:05
ponbiki is now known as Guest99506
|
|||
timotimo | m: say Str.^name | 22:05 | |
camelia | rakudo-moar f05c77: OUTPUT«Str» | ||
timotimo | why wouldn't that work? | ||
sortiz | m: class Foo { method new { say ::?CLASS.^name } }; Foo.new; | 22:06 | |
camelia | rakudo-moar f05c77: OUTPUT«Foo» | ||
22:06
TEttinger joined
|
|||
teatime | timotimo: I thought self would be the class inside new() (instead of the instance) | 22:07 | |
timotimo | yeah, it is | 22:08 | |
how it depends on what you want in the case of derived classes | |||
because they will inherit "method new" unles they override it | |||
22:08
shadowpaste joined
|
|||
teatime | m: m: class Foo { method new { say self.^name } }; Foo.new; | 22:08 | |
camelia | rakudo-moar f05c77: OUTPUT«Foo» | ||
22:08
vike left
|
|||
teatime | wtf | 22:09 | |
timotimo | if you use ::?CLASS, you'll get the class that the method was derived from; if you use self.^name, you'll get the name of the class that ended up being called | ||
tony-o | ZoffixWin: are you looking for that to happen by default for just those two types or do you want to pass in :gist or :perl when you do the data dump? | 22:10 | |
22:10
vike joined
22:12
Sgeo joined
|
|||
ZoffixWin | tony-o, I want to pass :gist so all objects would be dumped with .gist. A name of an object is enough for me, I don't need to see all of its methods. I imagine some folks like the current behaviour, hence I propose an option, not default | 22:12 | |
tony-o | okay, cool - i'm coming up with a test file for it and i'll update you in a bit - estimated 10 to 15 minutes | ||
ZoffixWin | No rush :) I'm about to go gaming or movies | 22:13 | |
timotimo | what do you game these days? | 22:14 | |
ZoffixWin | timotimo, ummm.. hard to say: i.imgur.com/uwiDHc2.png | 22:16 | |
timotimo | haha | ||
do you have any go-to games these days? | |||
dalek | c: 616ac07 | (Jan-Olof Hendig)++ | doc/Type/IO/Socket.pod: Changed reference from method send (removed in 2015) to method print |
||
22:17
smls left
|
|||
ZoffixWin | not really. I'm just playing through a bunch | 22:17 | |
timotimo | steam says i have 183 games | 22:18 | |
ZoffixWin | Doing `Wolfstein: The New Order`, the first `Bioshock`, `South Park: The stick of truth`... then I'll probably start 2nd Witcher. Though I pre-ordered the newest DOOM and it comes out on May 13th... And No Man's Sky comes out some time in summer | ||
Xliff | Yikes! | ||
22:18
leont_ left
|
|||
Xliff | I drool for No Man's Sky | 22:18 | |
ZoffixWin | Oh, and I got "Singularity" yesterday that looks interesting too | ||
Xliff | I drool badly. | ||
ZoffixWin | Me too :) | ||
teatime | paste.debian.net/plain/440871 ← This prints 'D(D(D(D(0))))', but I was hoping for 'D(C(B(A(0))))' | 22:19 | |
Xliff | I will probably need to EOL my 2 SLI'd GTX 550 for it. | ||
*sob* | |||
timotimo | i'm frightened it'll really end up only being Walking Around Simulator 2016 | ||
Spore Edition™ | |||
ZoffixWin | hah | ||
Xliff | LOL, "timo" x 2 | ||
ZoffixWin | I think I'd be OK with that. The only thing I'm worried about (looking at the trailers) is your walking speed is super slow.. I don't want to feel like I'm moving through molases :/ | 22:20 | |
teatime | wait, BUILD is supposed to be a submethod | ||
22:20
avenj left
|
|||
ZoffixWin | teatime, yeah | 22:20 | |
teatime | I wanted this in new(), but I don't know how to set private attributes from new() | ||
tony-o | ZoffixWin: update has been sent to DD with a [currently] undocumended flag of :gist | ||
timotimo | teatime: the thing is, you don't have "self" as the instance inside new yet. you'll have to bless first to create the instance | 22:21 | |
Xliff | timotimo, It depends on the conflict and the crafting. If they do both right, the game will be epic. | ||
teatime | right | ||
timotimo | mhm | ||
Xliff | I mean. I grok crafting. I play Factorio fer crissakes. | ||
22:21
avenj joined
|
|||
Xliff | I was addicted to it for two months, then I haven't played it again. | 22:22 | |
timotimo | my top games by time spent playing them are natural selection 2 (420 hours, haha), starbound (98 hours), mass effect 2 (73 hours), portal 2 (53 hours), and planetary annihilation (44 hours) | ||
Xliff | Natural Selection 2? | 22:23 | |
Starbound, ME2, P2 are classics. | |||
timotimo | i'm surprised i played as much PA as i did. i don't enjoy its economy stuff much | ||
haven't played NS2 in a long while, though | |||
22:23
lizmat joined
|
|||
Xliff | Planetary Annihilation had such promise, but it didn't deliver. | 22:23 | |
timotimo | it's an asymmetric team-based shooter + RTS | ||
tony-o | ZoffixWin: it's also documented, now - lmk what you think pls | ||
timotimo | yeah, and titans doesn't do enough to make up for it | ||
tony-o | (when you've time, obviously) | 22:24 | |
Xliff | Nope. | ||
Xliff looks up Singularity | |||
timotimo | oh, the game where you're an AI that has become sentient and has to evade getting detected/deleted? | ||
ZoffixWin | Don't think so: store.steampowered.com/app/42670/ | 22:25 | |
timotimo | oh, that one | ||
Xliff | 2010 | ||
ZoffixWin | Yeah, it's dated | ||
Xliff | I thought there was a more recent game named that. | ||
ZoffixWin | :) | ||
timotimo | where the main character has a time manipulation "gun" thingie | ||
Xliff | That's Quantum Break | 22:26 | |
22:26
frobisher joined
|
|||
Xliff | Which I am totally not interested in. Since it is artificially limited to Windows 10 because.... DX12! | 22:26 | |
timotimo | as soon as wine gets DX12 support that translates to vulkan or opengl, you can run it on windows 8 :P | 22:27 | |
Xliff | Which MS could have brought to Win7, but... it's Microsoft. Artificially induced obsolescence! | ||
Please. I puke when I look at anything Metro-based. | |||
Why would I want to tolerate MORE of it? | 22:28 | ||
timotimo | OK, win 7 then | ||
22:28
tomboy64 joined
|
|||
Xliff | =) | 22:28 | |
22:28
grondilu joined
|
|||
grondilu | m: say 1 !== 2 !== 1 | 22:28 | |
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
grondilu | m: say 1 !== 2 !== 3 | ||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
Xliff | I'd do Ubuntu if support for my SLI'd 550's wasn't so unstable. | ||
grondilu | m: say [!==] 1, 2, 3, 1, 5 | 22:29 | |
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
22:29
dha left,
frobisher is now known as dha
|
|||
timotimo | if you ever have people over to play, towerfall: ascension and assult android cactus are great; AAC also works very well with just one player | 22:29 | |
teatime | paste.debian.net/plain/440876 ← getting closer. how do I bless though. | 22:30 | |
timotimo | self.bless(*%args) | ||
er, |%args | |||
grondilu | how can I test that all elements of an array are different? @a == @a.unique would work I guess but it's a bit dull | ||
teatime | I want to mutate their value first | ||
timotimo | you could have just used your BUILD and supplied a default value for the :$!s parameter :) | ||
22:31
zakharyas left
|
|||
timotimo | oh, good point | 22:31 | |
grondilu | somehow I was hoping [!==] would do the job | ||
timotimo | it sadly can't do the job, as it doesn't go across all elements | ||
22:31
dha is now known as frobisher
|
|||
Xliff | Wow! Assault Android Cactus is bullet-hell at its most basic! :p | 22:31 | |
timotimo | only the bosses are actually bullet hell, the rest just spams random bullets :P | ||
22:32
frobisher is now known as dha
|
|||
timotimo | and it has the nice twist with the "battery" mechanic | 22:32 | |
also has fantastic music | |||
teatime | hrm, I'd've expected [==] ($a, $b, $c) ≡ $a == $b == $c | ||
ZoffixWin | tony-o, hmm... I guess it's my fault for forgetting that in Perl 6 everything is an object... Now, the methods are gone, which is good, but readability of the output also decreased because, well.. an Array and Hash are objects in Perl 6: gist.github.com/zoffixznet/b3db53a...6c3d397f39 | ||
tony-o, in my mind, I envisioned something more like this: metacpan.org/pod/Acme::Dump::And::...r#SYNOPSIS | |||
teatime | timotimo: can you tell me what's wrong w/ my new()'s :/ | 22:33 | |
timotimo | let's see | ||
grondilu | m: say "123415" ~~ / (\d)+ <?{ $0 == $0.unique }> /; | ||
camelia | rakudo-moar f05c77: OUTPUT«「5」 0 => 「5」» | ||
ZoffixWin | You get all your basic structures like normal and objects just named. No giant lists of methods or guts. | ||
Not sure if that's even possible in Perl 6 though (unless you check against all of the built in types or something) | |||
timotimo | you'll still need a build submethod to grab the s named parameter passed to bless and put it into the private attribute | ||
grondilu | m: say "123415" ~~ / (\d)+ /; | 22:34 | |
camelia | rakudo-moar f05c77: OUTPUT«「123415」 0 => 「1」 0 => 「2」 0 => 「3」 0 => 「4」 0 => 「1」 0 => 「5」» | ||
grondilu | m: say "123415" ~~ / (\d)+ <?{ $0[] == $0[].unique }> /; | ||
camelia | rakudo-moar f05c77: OUTPUT«「5」 0 => 「5」» | ||
AlexDaniel | m: say 42[] | ||
camelia | rakudo-moar f05c77: OUTPUT«42» | ||
tony-o | ZoffixWin: i need to think about how to accomplish that without just hardcoding 'when * ~~ Match, ignore XYZ methods' | ||
teatime | timotimo: isn't there a default one that does that? | ||
AlexDaniel | m: say (42[]).WHAT | ||
camelia | rakudo-moar f05c77: OUTPUT«(Int)» | ||
Xliff | timotimo: Last word from me on %topic<games>. Nothing will ever beat the System Shock series. They might come close, but best sci-fi game ever. | ||
timotimo | only for public attributes, no? | ||
teatime | aha | 22:35 | |
timotimo | i've only played 90% of system shock, never system shock 2 | ||
but i did play bioshock | |||
Xliff | They don't 'em like that anymore. | ||
Bioshock didn't give me the same feel. I just didn't get into the setting. | |||
timotimo | btw, there's #perl6-gaming for games discussion (and also perhaps game development) | ||
Xliff | Ooh! Might join. Later. | ||
grondilu | m: say .all ~~ .one given <1 2 3 1> | 22:36 | |
camelia | rakudo-moar f05c77: OUTPUT«Ambiguous call to 'infix:<===>'; these signatures all match::(Int:D \a, Int:D \b):(Str:D \a, Str:D \b --> Bool) in block <unit> at /tmp/VDLbu2jVQx line 1» | ||
Xliff | Or now. Now is good. | ||
grondilu | m: say .all == .one given <1 2 3 1> | ||
camelia | rakudo-moar f05c77: OUTPUT«all(one(True, False, False, True), one(False, True, False, False), one(False, False, True, False), one(True, False, False, True))» | ||
Xliff | <- Nap | ||
grondilu | m: say so .all == .one given <1 2 3 1> | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
22:36
Xliff is now known as XliffNap
|
|||
grondilu | m: say so .all == .one given <1 2 3 6> | 22:36 | |
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
grondilu | m: say so .all == .one given <1 2 3 3 6> | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
22:36
pmurias left
|
|||
grondilu | m: say so .all == .one given <1 2 3 7 6> | 22:36 | |
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
teatime | does that look like: submethod BUILD { :$!s } | 22:37 | |
grondilu | m: say "123415" ~~ / (\d)+ <?{ $0.all == $0.one }> /; | ||
22:37
tomboy64 left
|
|||
camelia | rakudo-moar f05c77: OUTPUT«「23415」 0 => 「2」 0 => 「3」 0 => 「4」 0 => 「1」 0 => 「5」» | 22:37 | |
teatime | it keeps saying "Cannot look up attributes in a type object" at the line w/ bless. | ||
AlexDaniel | m: say 2..8 ~~ 1.5..8 | ||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
grondilu | .all == .one looks like a hack. Not sure I can do that reliably. | 22:38 | |
timotimo | teatime: can you give me your guaranteed latest code? | ||
teatime | yes | ||
timotimo | 'k | 22:39 | |
teatime | paste.debian.net/440878/ | ||
timotimo | OH! | ||
you're using "$!s => self" | |||
that's not going to work | |||
the self doesn't matter | |||
the $!s on the LHS of the => does | |||
teatime | self.^name is looking for 'A' | ||
XliffNap | m: say 1.5...8; | 22:40 | |
camelia | rakudo-moar f05c77: OUTPUT«(1.5 2.5 3.5 4.5 5.5 6.5 7.5)» | ||
AlexDaniel | so… thot's a bug? | ||
that* | |||
grondilu | m: say so .one == .all given <1 2 3 7 6 > | 22:41 | |
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
grondilu | m: say so .one == .all given <1 2 3 7 6 2> | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
AlexDaniel | grondilu: what are you trying to do? | ||
grondilu | checking if all elements are different | ||
AlexDaniel | m: say [==] <1 2 3 7 6 2> | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
AlexDaniel | m: say [==] <1 2 3 7 6> | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
timotimo | if not @a == @a.unique, i'd've @a == @a.Set | ||
AlexDaniel | m: say [!=] <1 2 3 7 6> | 22:42 | |
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
AlexDaniel | m: say [!=] <1 2 3 7 6 2> | ||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
teatime | timotimo: if you call A.new("0"), I'm wanting that to set $!s to 'A(0)'. | ||
AlexDaniel | hmm | ||
right… | |||
timotimo | yeah, and $!s => blah is not the way to d oit | ||
because that'll try to get the value of $!s and put it as the .key of the Pair | |||
22:42
tomboy64 joined
|
|||
teatime | then how. tell me the right way. I've tried like 12 different iterations of attempts :) | 22:42 | |
timotimo | and on top of that, it won't be a named argument at all, it'll be a Pair in a positional argument | ||
s => blah | 22:43 | ||
teatime | ok | ||
timotimo | for named arguments, all the sigils are dropped for you | ||
so when you have :$!s in your signature (as is the case in BUILD), you'll just pass a named argument with the name "s" | |||
teatime | omfg it finally works | 22:44 | |
timotimo++ | |||
AlexDaniel | m: say so <1 2 3 7 6>.Bag.values.any > 1 | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
AlexDaniel | m: say so <1 2 3 7 6 2>.Bag.values.any > 1 | ||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
grondilu | yeah I was considering Bag as well | ||
m: say "123415" ~~ / (\d)+ <?{ $0.Bag.values.none > 1 }> /; | |||
camelia | rakudo-moar f05c77: OUTPUT«「5」 0 => 「5」» | ||
grondilu | m: say "123415" ~~ / (\d)+ <?{ $0[].Bag.values.none > 1 }> /; | 22:45 | |
camelia | rakudo-moar f05c77: OUTPUT«「5」 0 => 「5」» | ||
22:45
jjido joined
|
|||
grondilu | m: "123415" ~~ / (\d)+ <{ say $0.Bag.values }> /; | 22:46 | |
camelia | rakudo-moar f05c77: OUTPUT«(6)(6)(6)(6)(6)(6)(5)(5)(5)(5)(5)(4)(4)(4)(4)(3)(3)(3)(2)(2)(1)» | ||
grondilu | wth | ||
teatime | timotimo: inside methods, when do you use $.a and when $!a | ||
or anyone; sorry :) | |||
timotimo | depends on whether you wish derived classes to be able to change what you get | ||
XliffNap | $.a if it is defined as "$.a" and you are reading. | ||
"$!a" otherwise. | |||
timotimo | well, yeah, you can write to $!a even if the accessor isn't "rw" | 22:47 | |
teatime | timotimo: that's interesting... expound? | ||
timotimo | $.a is sugar for "self.a" | ||
AlexDaniel | m: say $_ eqv .unique given <1 2 3 7 6 2> | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
AlexDaniel | m: say $_ eqv .unique given <1 2 3 7 6> | ||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
timotimo | and accessors are also just methods generated for you by default for $.foo | ||
XliffNap | timotimo, yeah. jnthn++ explained that to me. | ||
grondilu | I use $!a everywhere even when defined as $.a, caus' it makes things easier if I want to change my mind about it being public. | ||
tony-o | timotimo: how would i tell if the method is public? | 22:48 | |
timotimo | it's public if and only if it doesn't start with a ! | 22:49 | |
22:49
tomboy64 left
|
|||
tony-o | does ^methods report private methods? | 22:50 | |
i don't think it shows !methods | |||
timotimo | probably not, no | ||
but i assume .^private_methods exists | 22:51 | ||
tony-o | ah, DD is only doing .^methods | ||
AlexDaniel | psch: it feels like 42 ~~ (42,) should be true according to S03 | 22:52 | |
psch: unless I'm reading that incorrectly | |||
psch: “The Any entries in the first column indicate a pattern that either doesn't care about the type of the topic” and then it goes “Any Positional lists are comparable $_[] «===» X[]” | 22:53 | ||
22:53
firstdayonthejob left
|
|||
AlexDaniel | psch: this has no practical value though | 22:53 | |
psch: another interesting one is “Positional Regex attempted any/all/cat FAIL, point user to any/all/cat/join for LHS” | 22:55 | ||
psch: so perhaps $item ~~ list should do the same thing – point user to any/all | |||
timotimo | that'd be a good solution, i think | 22:56 | |
except it's dreadfully slow :) | |||
AlexDaniel | timotimo: good solution? Then what about “Any Hash hash contains object X{$_}:exists” | 22:57 | |
according to that we can similarly have $item ~~ list with the same semantics | |||
timotimo | *shrug*, language design of smartmatch is a topic i'm not willing to dabble in :) | 23:00 | |
23:01
tomboy64 joined,
wamba left
|
|||
teatime | paste.debian.net/plain/440883 ← ok, this works, and does what I want. am I still doing anything wrong? :) | 23:06 | |
timotimo | you could write o => $o as :$o instead | 23:07 | |
and you could give $o in the method new a ? so it'll allow users to call .new() instead of having to .new(Any) to get the '_' | 23:08 | ||
teatime | .new() seems work | 23:09 | |
but I'm assuming it's the default one | |||
timotimo | ah, because you defined it multi, yeah, ok | 23:10 | |
23:12
_28_ria left
|
|||
AlexDaniel | grondilu: want some craziness? :) | 23:13 | |
m: my @a = <2 3 7 6 2 5>; say ?any((for @a -> $x { @a ~~ (**,$x,**,$x,**) })) | |||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
AlexDaniel | m: my @a = <2 3 7 6 9 5>; say ?any((for @a -> $x { @a ~~ (**,$x,**,$x,**) })) | ||
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
timotimo | oh lord :D | 23:14 | |
beautiful | |||
23:14
_28_ria joined
|
|||
timotimo | i didn't know ~~ does backtracking when a list is on the RHS | 23:14 | |
.u 🐈 | 23:16 | ||
yoleaux | U+1F408 CAT [So] (🐈) | ||
teatime finally settles on paste.debian.net/plain/440886 | 23:17 | ||
TEttinger | .u FAP | 23:18 | |
yoleaux | U+A0D4 YI SYLLABLE FAP [Lo] (ꃔ) | ||
dalek | c/hash-block: 0712be4 | (Dabrien 'Dabe' Murphy)++ | doc/ (2 files): Document "Hash vs. Block" Gotcha my %fruits = apple => 'McIntosh', pear => 'Bartlett'; given (%fruits) { my $fails = { red => $_<apple>, green => $_<pear> }; say $fails.WHAT; # Block say $fails<red>; # ERROR: Type Block does not support associative indexing } |
23:19 | |
teatime | which prints 'D $d = D.new(C.new(B.new(A.new(Any))))' and that's a suitable demo. | ||
23:22
sue joined
|
|||
AlexDaniel | m: my @a = <2 3 7 6 8 5>; say ?@a.map(->$x {@a~~(**,$x,**,$x,**)}).any | 23:22 | |
camelia | rakudo-moar f05c77: OUTPUT«False» | ||
AlexDaniel | m: my @a = <2 3 7 6 2 5>; say ?@a.map(->$x {@a~~(**,$x,**,$x,**)}).any | ||
camelia | rakudo-moar f05c77: OUTPUT«True» | ||
teatime | paste.debian.net/plain/440889 ← now, less important, but is there an easy way to make the method chaining example (line just above =finish) actually work ? | 23:23 | |
to somehow coerce $a.one() into one($a) | |||
timotimo | yeah, you just have to $a.&one | ||
then you can also drop the parens | |||
23:25
BenGoldberg joined
|
|||
teatime | sick. | 23:25 | |
23:25
atweiden joined
23:26
cognominal left
23:27
cognominal joined
|
|||
AlexDaniel | ZoffixWin: “Supply an integer and you'll get a list of strings at most that many characters long, receiving a shorter string when there are not enough characters left.“ | 23:27 | |
ZoffixWin: hmmm… wrong? | 23:28 | ||
ah, it's correct | |||
timotimo | yeah, it's rotor where you'd have to :partial | ||
AlexDaniel | :/ | 23:29 | |
23:30
pdcawley left,
Herby_ joined
|
|||
Herby_ | Afternoon, #perl6! | 23:31 | |
o/ | |||
timotimo | yo | ||
AlexDaniel | well it's understandable. I guess that if someone is using rotor then he may rely on indexes, which may result in weird things if accidentally he gets a list that is not quite the right size | ||
timotimo | yeah | ||
23:32
verzit left
|
|||
grondilu | what is the best style: Foo::CompoundWord or Foo::Compound-Word ? | 23:33 | |
23:33
travis-ci joined
|
|||
travis-ci | Doc build passed. Dabrien 'Dabe' Murphy 'Document "Hash vs. Block" Gotcha | 23:34 | |
travis-ci.org/perl6/doc/builds/125709617 github.com/perl6/doc/commit/0712be40fcc9 | |||
23:34
travis-ci left
|
|||
AlexDaniel | m: dd ‘Hello world’.comb(‘’) | 23:34 | |
camelia | rakudo-moar f05c77: OUTPUT«("", "", "", "", "", "", "", "", "", "", "", "").Seq» | ||
23:34
verzit joined
|
|||
atweiden | is it possible for a token/regex in a grammar to read from a grammar attribute? | 23:34 | |
e.g m: grammar Sample { has Str @.tokens; token sample { <{ say '[DEBUG] @.tokens ', @.tokens.perl; {| $_ for @.tokens} }> } }; my Str @tokens = '/John\sDeere.*/', '/:i computer.*/'; @tokens .= map({ .substr(1, *-1) }); my Str $content = 'John Deere'; say Sample.new(:@tokens).parse($content, :rule<sample>); | 23:35 | ||
grondilu | m: 13 ~~ / :my $var = 13; (\d+) <?{ $0 == $var }> /; | ||
camelia | ( no output ) | ||
grondilu | m: say 13 ~~ / :my $var = 13; (\d+) <?{ $0 == $var }> /; | ||
camelia | rakudo-moar f05c77: OUTPUT«「13」 0 => 「13」» | ||
atweiden | m: grammar Sample { has Str @.tokens; token sample { <{ say '[DEBUG] @.tokens ', @.tokens.perl; {| $_ for @.tokens} }> } }; my Str @tokens = '/John\sDeere.*/', '/:i computer.*/'; @tokens .= map({ .substr(1, *-1) }); my Str $content = 'John Deere'; say Sample.new(:@tokens).parse($content, :rule<sample>); | ||
camelia | rakudo-moar f05c77: OUTPUT«[DEBUG] @.tokens Array[Str].new()Nil» | ||
grondilu | m: say 12 ~~ / :my $var = 13; (\d+) <?{ $0 == $var }> /; | ||
camelia | rakudo-moar f05c77: OUTPUT«Nil» | ||
teatime | heh, ==> $a doesn't work... should have seen that coming. | 23:37 | |
AlexDaniel | m: dd ‘’.comb(‘’) # i1.kym-cdn.com/photos/images/origin...42/069.jpg | ||
camelia | rakudo-moar f05c77: OUTPUT«("",).Seq» | ||
23:38
frobisher joined
|
|||
timotimo | feed operators operate with slurpy positional arguments, they probably want to have an @foo at the end | 23:38 | |
teatime | right | 23:39 | |
23:39
dha left
23:40
frobisher is now known as dha,
vike left,
spider-mario left
23:41
tardisx joined,
mcsnolte left
23:43
Actualeyes joined
23:46
pdcawley joined
|
|||
dalek | ar: 6bfd13c | (Steve Mynott)++ | tools/star/release-guide.pod: note 2016.04 release in release-guide.pod |
23:50 | |
BenGoldberg | m: sub foo { say $^y, $^x }; foo( 1, 2 ); | 23:53 | |
camelia | rakudo-moar f05c77: OUTPUT«21» | ||
23:53
RabidGravy left
23:55
cognominal left,
cognominal joined
|
|||
BenGoldberg wonders, does any language other than perl6 have anything resembling $^foo? | 23:59 |