»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by sorear on 25 June 2013. |
|||
00:20
ivanshmakov left
00:23
ivanshmakov joined
00:26
jnap left
00:30
ivanshmakov left,
ivanshmakov joined
00:45
smls left
00:46
rurban joined
00:51
rurban left
01:20
SamuraiJack joined,
beastd joined
01:29
PZt left
01:31
Su-Shee_ joined,
rurban joined
01:34
FROGGS left,
Su-Shee left
01:35
klapperl_ joined,
rurban left
01:38
klapperl left
01:40
beastd left
01:42
geekosaur left
01:44
geekosaur joined
01:46
FROGGS joined
01:53
troymc joined
01:54
troymc left
01:55
zengargoyle left
02:19
hoverboard joined
02:30
SriV joined
02:34
SriV left
02:41
xragnar left
02:42
xragnar joined
03:15
PZt joined
03:17
avuserow left
03:30
avuserow joined
03:36
avuserow left
03:37
thou left
03:40
SevenWolf joined
|
|||
dalek | ast: 91885f2 | (David Warring [email@hidden.address] | S26-documentation/10-doc-cli.t: adding DOC INIT {} test |
03:41 | |
03:50
avuserow joined
03:59
byte48 joined
04:03
rindolf joined
04:14
BenGoldberg left
04:16
BenGoldberg joined,
araujo left
04:24
kaare_ joined
04:44
hoverboard left
04:50
hoverboard joined
04:53
xenoterracide joined
04:54
BenGoldberg left
05:01
treehug88 joined
05:04
thou joined
05:07
bjz joined
05:08
thou left
05:22
treehug88 left
05:27
xenoterracide left
05:35
ponbiki left
05:43
ponbiki joined,
ponbiki is now known as Guest9496
05:49
jack_rabbit_ joined
05:55
rurban joined
06:00
rurban left
06:12
jack_rabbit_ is now known as jack_rabbit
06:29
uniejo joined
06:32
darutoko joined
06:34
uniejo left
06:37
cognominal left
06:44
rindolf left
06:54
anaeem1 joined
06:56
asuerhao joined
|
|||
asuerhao | perl6: say "What is this?" | 06:57 | |
camelia | rakudo-{parrot,jvm,moar} 28d672, niecza v24-109-g48a8de3: OUTPUT«What is this?» | ||
asuerhao | perl6: say "@INC"; | 06:58 | |
camelia | rakudo-{parrot,jvm,moar} 28d672, niecza v24-109-g48a8de3: OUTPUT«@INC» | ||
TimToady | p6: say "@*INC[]" | 07:00 | |
camelia | rakudo-moar 28d672: OUTPUT«/home/p6eval/.perl6/2014.05-149-g28d6725/lib /home/p6eval/rakudo-inst-2/languages/perl6/lib /home/p6eval/rakudo-inst-2/languages/perl6/vendor/lib /home/p6eval/rakudo-inst-2/languages/perl6/site/lib /home/p6eval/.perl6/2014.05-149-g28d6725 /home/p6eval/raku…» | ||
..rakudo-jvm 28d672: OUTPUT«/home/p6eval/rakudo-inst-1/languages/perl6/runtime /home/p6eval/rakudo-inst-1/languages/perl6/lib /home/p6eval/rakudo-inst-1/languages/nqp/lib /home/p6eval_eval/.perl6/2014.05-149-g28d6725/lib /home/p6eval/rakudo-inst-1/languages/perl6/lib /home/p6eval/raku…» | |||
..niecza v24-109-g48a8de3: OUTPUT«» | |||
..rakudo-parrot 28d672: OUTPUT«/home/p6eval/.perl6/2014.05-149-g28d6725/lib /home/p6eval/rakudo-inst-2/lib/parrot/6.1.0-devel/languages/perl6/lib /home/p6eval/rakudo-inst-2/lib/parrot/6.1.0-devel/languages/perl6/vendor/lib /home/p6eval/rakudo-inst-2/lib/parrot/6.1.0-devel/languages/pe…» | |||
07:03
asuerhao left
07:19
vike joined
07:21
denis_boyun_ joined,
hoverboard left
07:24
mr-foobar joined
07:28
vike left
07:31
spider-mario joined
07:34
denis_boyun_ left
07:35
denis_boyun_ joined
07:37
SamuraiJack left
07:49
telex left
07:50
telex joined
07:58
rurban joined
08:01
FROGGS left
08:02
rurban left,
denis_boyun_ left
08:03
denis_boyun joined
08:05
vike joined
|
|||
sergot | morning o/ | 08:14 | |
08:22
anaeem1 left,
anaeem___ joined
08:24
Rotwang joined
|
|||
masak | antenoon \o | 08:33 | |
08:34
hoverboard joined
08:36
hoverboard left
08:37
vike left
08:41
dmol joined
08:42
vike joined
08:55
SevenWolf left
08:58
PZt left,
ivan`` left,
rurban_ left,
sorear left,
xfix left,
dylanwh left,
japhb_ left,
cooper left,
clkaoud left,
mathw left,
profan left,
timotimo left,
atrodo left,
flussence left,
yogan_ left,
tokuhirom left,
risou left,
denis_boyun left,
darutoko left,
Util left,
apejens_ left,
obra left,
yakudzo left,
lue left,
haroldwu left,
[Sno] left,
chenryn left,
ribasushi left,
rjbs left,
baest left,
cibs left
08:59
denis_boyun joined,
darutoko joined,
PZt joined,
Util joined,
apejens_ joined,
obra joined,
yakudzo joined,
ivan`` joined,
rurban_ joined,
lue joined,
sorear joined,
xfix joined,
haroldwu joined,
[Sno] joined,
chenryn joined,
dylanwh joined,
japhb_ joined,
ribasushi joined,
rjbs joined,
baest joined,
cooper joined,
profan joined,
clkaoud joined,
mathw joined,
risou joined,
tokuhirom joined,
yogan_ joined,
flussence joined,
atrodo joined,
timotimo joined,
ivan`` left,
ivan`` joined,
ivan`` left,
ivan`` joined
09:00
SamuraiJack joined
09:01
geekosaur left,
FOAD left,
Pleiades` left,
pmichaud left,
hugme left,
jercos left,
Juerd left,
bowtie left,
hoelzro left,
amkrankruleuen left,
retupmoca left,
ggherdov left,
Bucciarati left,
simcop2387 left,
TimToady left,
lestrrat left,
raydiak left,
geekosaur joined,
Pleiades` joined,
FOAD joined,
pmichaud joined,
hugme joined,
jercos joined,
Juerd joined,
bowtie joined,
hoelzro joined,
amkrankruleuen joined,
retupmoca joined,
ggherdov joined,
Bucciarati joined,
simcop2387 joined,
TimToady joined,
lestrrat joined,
raydiak joined,
verne.freenode.net sets mode: +v hugme
09:02
denis_boyun left,
darutoko left,
Util left,
apejens_ left,
obra left,
yakudzo left,
lue left,
haroldwu left,
[Sno] left,
chenryn left,
ribasushi left,
rjbs left,
baest left
09:04
denis_boyun joined,
darutoko joined,
Util joined,
apejens_ joined,
obra joined,
yakudzo joined,
lue joined,
haroldwu joined,
[Sno] joined,
chenryn joined,
ribasushi joined,
rjbs joined,
baest joined
09:07
cibs joined
09:10
anaeem___ left
09:29
denis_boyun left
09:32
denis_boyun_ joined
09:40
denis_boyun___ joined
09:41
denis_boyun_ left
09:42
jack_rabbit left
09:49
denis_boyun___ left
|
|||
moritz | n\oo/n | 09:53 | |
09:59
rurban joined
|
|||
jnthn | aftern/oo\n | 10:03 | |
10:03
rurban left
10:06
anaeem1_ joined
10:13
SamuraiJack left
10:17
SamuraiJack joined
10:23
FROGGS[mobile] joined
|
|||
colomon | mo/rning | 10:38 | |
10:40
Rotwang left
|
|||
colomon | emmentaler broken again overnight | 10:47 | |
10:48
dmol left
10:49
dmol joined
|
|||
sergot | this was the worst problem when I wanted to generate modules.perl6.org in p6 with checking test passing. | 10:49 | |
github.com/sergot/modules.perl6.org | 10:50 | ||
colomon | I would say the emmentaler stage hasn't been the source of most of the issues over the last year of running this. But this will be the second issue with it this week. | 10:54 | |
10:54
dmol left
11:00
rurban joined
11:03
apejens_ is now known as apejens
11:06
rurban left
11:08
molaf joined
11:11
kurahaupo joined
11:16
kurahaupo left
11:18
Rotwang joined
|
|||
dalek | c: e7387c3 | sergot++ | lib/IO/FileTestable.pod: language fix |
11:28 | |
11:33
rurban joined
11:44
treehug88 joined
11:46
anaeem1_ left
11:49
uniejo joined
11:50
treehug88 left
11:52
uniejo left
12:03
uniejo joined,
uniejo left
12:04
uniejo joined,
uniejo left
12:09
ivanshmakov left
12:10
kurahaupo joined
12:11
ivanshmakov joined
12:17
thou joined
12:21
thou left
12:52
smls joined
12:53
xenoterracide joined
12:59
xinming_ left,
ivanshmakov left,
ivanshmakov joined
13:00
xinming joined
13:02
xenoterracide left
13:05
SamuraiJack left
13:14
xenoterracide joined
13:31
zengargoyle joined
|
|||
smls | I wonder, what are the long-term plans for Rakudo, architecture-wise? | 13:32 | |
Will NQP go away at some point, making Perl 6 completely self-hosting? | |||
jnthn | I've no plans for NQP to go away. | 13:34 | |
timotimo | TimToady mentioned something about perl 6 itself being so optimized that we can have rakudo self-hosting rather than on nqp | 13:35 | |
but i've kinda grown to liking nqp | |||
(stockholm syndrome?) | |||
jnthn | It may happen some day, but there's a lot of things that make it hard | ||
And there's just no particular win. | |||
At least, those that may exist today are massively outweighed by the downsides. | |||
smls | jnthn: does it affect start-up time? | ||
timotimo | aye. | ||
well, nqp runs a whole lot faster than perl6 on rakudo | 13:36 | ||
and it only takes 1/10 of the ram for starting up, because its core setting is much much slimmer | |||
jnthn | smls: Does what affect startup time, exactly? | ||
smls | being built on NQP | ||
or does it make no difference once the compiler itself is compiler | 13:37 | ||
*compiled | |||
jnthn | It most likely helps startup time that a bunch of the compiler is written in NQP, since it can currently generate simpler code and doesn't need to have, say, parameter and signature objects that are introspectable, or scalar containers...so there's less to deserialize too. | 13:38 | |
So we'd be worse off having those bits in full Perl 6. | |||
timotimo | aye, for performance reasons we already write big parts of the setting in "pseudo nqp" | 13:39 | |
jnthn | Of course, I expect we'll gradually get better at optimizing and narrow the gap. | ||
smls | Will we ever match perl' | 13:40 | |
s startup time of 0.00s? :P | |||
jnthn | No, but we probably don't need to :P | ||
I suspect we can get close enough that on modern hardware it doesn't matter. | |||
Anyway, the *real* killer for Perl 6 in Perl 6 will be the bootstrapping thing. | 13:43 | ||
13:43
dwarring left
|
|||
jnthn | NQP being smaller makes that a bit simpler. | 13:44 | |
But it's also that the smaller number of people hacking on NQP compared to Rakudo means there's not so many exposed to bootstrapping fun. | 13:45 | ||
We already have quite enough "argh X doesn't work in the setting". We can't, from a development perspective, afford to make that an issue for the entire codebase. | |||
moritz | jnthn: maybe we need a two-staged setting :-) | 13:46 | |
and stuff that doesn't work in stage 1 might work in stage 2 :-) | 13:47 | ||
timotimo | we kind of have a 100-staged setting | ||
jnthn | moritz: Yeah, gets us into issues with CORE:: wanting to be a single lexical scope, is all... | 13:49 | |
13:49
cognominal joined
|
|||
moritz | jnthn: I know (I've tried, in the past...) | 13:50 | |
timotimo | btw, is there a good way to make the repl not create a thousand nested scopes after a bit of usage? | ||
like, every singel evaluated line adds an OUTER:: to the chain | |||
jnthn | Possibly | 13:51 | |
You'd have to try and find a way to keep/compile a cumulative outer or something | |||
smls | jnthtn: On "narrowing the gap", how is it possible that NQP performs so much better than Rakudo in the perl6-bench microbenchmarks, for things like simple loops? | ||
Is it all the container dereferencing that Perl 6 requires, or what else is going on there in Rakudo? | |||
jnthn | Depends on which benchmark you're talking about. | 13:52 | |
timotimo | well, you can see that if you have a native loop, you get really, really close | ||
jnthn | Right, for native loops it's really close. Heck, for postwhile_nil I think Rakudo even wins... | ||
timotimo | but if you have a for loop with a range object you'll (in the past, not any more) run back and forth through the range iterator, for example | ||
jnthn | For the loops that are not native and doing $i++, that ++ is a multi-dispatch. | 13:53 | |
In NQP it's not. | |||
timotimo | ah, we don't compile-time dispatch that? | ||
jnthn | spesh is smart enough at this point to spot it can turn that into single dispatch. | ||
timotimo: no, we can't easily due to auto-viv | |||
But spesh never gets to do that yet because we've no OSR | 13:54 | ||
timotimo | ah | ||
jnthn | Anyway, in the next month or so we should be able to inline the ++ operator, and do the OSR, and that should close the gap a bit. | ||
timotimo | so, i've been thinking about strength reduction and putting it into optimizer vs spesh | ||
if we put it into spesh, that means that only moar will ever get that opt | 13:55 | ||
but if we only put it into the optimizer, we may miss a few run-time opportunities | |||
and if we put it into both, it'll be redundant work | |||
jnthn | Well, I think the JVM knows how to do strength reduce :P | 13:56 | |
timotimo | oh. well, it probably does, doesn't it. | 13:57 | |
jnthn | It knows quite a lot of opts :) | 13:58 | |
timotimo | will we at some point get escape analysis to tell us when we can replace series of string concats with a "string builder" instead? | ||
hm. at that point it'll probably not be as important any more when our ropes are actually functional :) | |||
jnthn | True, though it is a possible application of escape analysis. | 14:00 | |
The analysis is useful for a few things | |||
Though my intial goal for it is avoiding GC allocations | |||
timotimo | aye. | 14:01 | |
AFK | 14:02 | ||
smls | One more (stupid?) question: Why was Perl style reference counting abandoned in favor of GC? | 14:04 | |
tadzik | because refcounting is wrong, long story short :) | 14:05 | |
smls | The main argument against refcounting I've heard is that it can't detect reference cycles. But I never found that to be a problem in Perl 5. | ||
tadzik | well, some people did. It can be a PITA to solve sometimes, playing with weakrefs and all that | 14:06 | |
jnthn | smls: Fixes the circular reference problem, tends to perform better, and incrementing/decrementing reference counts with multiple threads involved has the risk of being quite costly. | ||
smls | But doesn't the GC also have to (potentially) put all threads on hold while it's doing its thing? | 14:07 | |
jnthn | smls: Also, with ref counting you have to make sure you tweak the counts right everywhere. While a GC does force some restrictions on your coding, the complexity of memory management is better isolated. | ||
smls: Yes, but we spend more time running than we do GCing. | |||
smls | ok | ||
jnthn | The other thing is that in some ways we don't have a choice that Perl 6 will be reference counted in some places, because we want to run on things like the JVM. | 14:10 | |
14:10
vendethiel left
|
|||
jnthn | One benefit of ref-counting is you can reason a little more easily about destruction time. | 14:10 | |
But you can't provide that at a language level if some VMs you want to run can't do it. | 14:11 | ||
masak | ...which is why DESTROY is never going to happen. | 14:14 | |
jnthn | Well, it can happen, but you won't be able to know when it will fire :P | 14:15 | |
masak | I can't think of any use I'd have for it beyond exactly that. | ||
jnthn | Yeah. I can't remember the last time I wrote a finalizer in Java or C# either. :) | 14:16 | |
It tends to be a last-gasp "well, if the programmer really doesn't manage resources well..." thing... | 14:18 | ||
xfix | Java at least has finalizers. JavaScript doesn't have any sort of destructors. | ||
jnthn | xfix: I can't remember a time when I was writing JavaScript and thought "omg I SO wish I had a destructor" :) | 14:19 | |
xfix | Destructors are rarely used even in languages they have them. | ||
But they are convenient in rare cases, just like goto. | |||
smls | they are used a lot in C++ though, right? | 14:20 | |
xfix | Well, yes. | ||
jnthn | Oh, for sure, but C++ is rather different memory management wise. | ||
xfix | In C++, destructors are memory management. | ||
(there is new/delete, but nobody should use that... I hope) | 14:21 | ||
However, there is a thing about C++. Unless the destructor is called explicitly, the destructor is called when the variable leaves the scope. | 14:22 | ||
Which also means you know when the destructor will be called - when you call it explicitly, or when you leave variable scope. If you assign the pointer to variable somewhere, and you leave the scope, you get undefined behavior, because RAII is memory management in C++. | 14:23 | ||
colomon | C++ destructors are pretty much the only C++ thing I miss in perl 6 | 14:24 | |
xfix | RAII is something not specific to C++. | 14:26 | |
It applies to all languages using reference counting. | |||
(for example, Perl 5) | |||
But well, sometimes the reference counting is not guaranteed. For example, CPython has reference counting, but Jython doesn't. | 14:27 | ||
Sadly, Java finalizers are so useless that you may as well call those destructors when the program finishes. I guess that if you do so, the memory won't be deallocated when GC calls, but it rarely matters. | 14:29 | ||
smls | An now for something completely different... :P | 14:35 | |
I share the concern behind this comment from ~2 weeks ago in the backlog: "<moritz> I'm increasingly worried by p6's choice of making rw accessors that use assignment <moritz> it makes it much harder to add validation logik later on" | |||
Although I don't think the solution is to stop providing «has $.foo is rw», but rather to provide an easier "upgrade path" to manually defined setters/getters. | 14:36 | ||
xfix | Ruby has methods like "property=". | ||
smls | Or in other words, it would be nice to have syntactic sugar for that, which could replace the "construct and return a Proxy object" boilerplate. | ||
xfix | Getters and setters should be here. Otherwise, you end with Java, and its getName() properties. | 14:37 | |
(who uses public properties in Java either way... it's all get* and set*) | |||
14:38
anaeem1_ joined
|
|||
jnthn | In my experience, getters/setters are way overused in most "OO" code. | 14:40 | |
(Scare quotes 'cus code that uses getters/setters heavily is typically procedural code dressed up to look OO.) | |||
masak | good OO is about behaviors. getters mostly help leak encapsulation internals. setters encourage breaking invariants and tends to lead to anemic APIs. | 14:42 | |
xfix | (right now our get* code looks like return property, but later it may expand, so we stay at set* and get*) | ||
Java is not a good example of OO in my opinion, but you are free to disagree. | |||
It also lacks basic features like lambdas. | |||
(even Smalltalk has these) | 14:43 | ||
jnthn | Well, Java 8 got lambdas :) | ||
But yeah, what masak++ said. | |||
masak | xfix: Java 8 was released in March. | ||
smls | masak: but sometimes you do want validation logic that exceeds what «has $.foo where ...» can provide, don't you? | ||
masak | smls: oh, absolutely. | 14:44 | |
smls: validation logic is a sign that you're doing things *right*. | |||
smls: I'm just saying there's no need for that validation logic to reside in *setters*. | |||
smls: instead of focusing on getters and setters, focus on what you want your object to *do*. | |||
focus on verbs. what are some rich, juicy verbs you can use to describe your object's behavior. (and you're not allowed to pick "update".) | 14:45 | ||
jnthn | These days I tend to design objects method-first. Heck, a bunch of the time I know what my methods should be before I know what my classes should be. Why? Because looking at the invariants helps identify consistency boundaries and responsibilities. Then attributes are just an implementation detail to me; they're the last thing I do. | ||
xfix | void public setCount(int count) { if (count < 0) { /* throw some exception because we use language without unsigned integers */ } this.count = count; } | ||
smls | I didn't mean setters/getters as separate methods, I meant adding getter/setter functionality behind-the-scenes to an exsisting $.foo attribute | ||
without changing the API of the class | |||
jnthn | Once I'm doing attributes, I've taken my architect hat off, and put my data-structure-aware programmer hat on. | ||
xfix | s/void public/public void/ | ||
masak | xfix: my point is: what's an outside consumer of the API doing setting the count in the first place? what's the user story behind having that setter? | 14:46 | |
jnthn | xfix: setCount is a weird example to me because, well, count of what, but also surely the count of something is heavily tied to the somethings.... | 14:47 | |
masak | right. | ||
colomon | IMO, masak and jnthn are describing a certain type of object, but by no means the only sort of object possible or desirable. | ||
for instance, look at Audio::Taglib::Simple | 14:48 | ||
masak | troo. | ||
github.com/avuserow/perl6-audio-taglib-simple/ | 14:49 | ||
colomon | yeah. the object there's job is exactly to look like a struct. | 14:50 | |
masak | a C lib wrapper. | ||
colomon | and the getters / setters are its entire reason for existing. | ||
it is a C lib wrapper, but that's not the point. | |||
I mean, it looks like a struct because it is one. | 14:51 | ||
(not necessarily really, but conceptually.) | |||
it's giving you access to the tags on a file. | |||
getting them and setting them are literally all you want it to be able to do | |||
colomon has been working on his scripts that use Audio::Taglib::Simple today, because he has also been working on cleaning up some of his MP3 files. | 14:52 | ||
jnthn | Yes, which is fair enough, but "looks like a struct" captures what's going on there. | 14:53 | |
masak | I was about to say that. | ||
but I wouldn't want it to come out as "that's not *real* OO" | |||
xfix | Programming is hard. | ||
colomon | it's a real, valid, and extremely useful use of an object | ||
masak | but fun! | ||
xfix | That too. | ||
masak | colomon: it's an object, without a doubt. | 14:54 | |
jnthn | colomon: Yes, I'm not saying it's badly designed. I'm just saying that too much software I see *only* has this kind of object. | ||
masak | colomon: and I struggle to see how it could be implemented otherwise. | ||
ah. what jnthn++ said. | |||
xfix | class LoginController { method login() { ... }; method logout() { ... } } # Because that's totally an object... | ||
masak | yes, it might be an "alternate hard and soft layers" kind of thing. | ||
xfix: at least that focuses on behaviors :) | 14:55 | ||
xfix | Yes, but I have a feeling this code comes from lack of namespaces, or something. | ||
colomon | jnthn: I'm not trying to say that should be the only kind of object -- far from it. Just that it is a valid kind of object | ||
jnthn | colomon: Yes, I agree. | 14:56 | |
14:56
c1sung joined,
vendethiel joined
|
|||
colomon | or in other words, just because some knobhead might misuse getters and setters is not a valid reason to not make creating them as easy as possible. ;) | 14:57 | |
jnthn | colomon: And we did: "has Type $.x [is rw]" :) | ||
I think it's not unreasonable to argue that the point at which enforcing the validation through the type system becomes unweildy might mark the point that this kind of object runs out of steam. | 14:58 | ||
colomon | I'm just pointing out that smls++'s suggestion that it might be worth providing an easy way of doing Proxys for getting / setting is not unreasonable. | 14:59 | |
smls | Using Audio::Taglib::Simple as an example, imagine if this: | ||
has Str $!title; method title() { return Proxy.new(FETCH => sub ($) {$!title;}, STORE => sub ($, Str $in) {taglib_tag_set_title($!taglib-tag, $in); $!title = $in; }, ); } | |||
could be written like this: | 15:00 | ||
has Str $!title is stored({ taglib_tag_set_title($!taglib-tag, $_); $_ }); | |||
or similar | |||
colomon | smls: hmmm… that probably can be implemented by a user. as an experiment and all. | ||
smls | maybe as a role rather than a traid_mod, but you get the idea | ||
masak | ooh, I'm all for making sugar for Proxy. | 15:02 | |
jnthn | I can see the arguments for it, but I think it can be explored in module space first... | ||
masak | +1 | 15:05 | |
15:06
cibs left,
askz joined
15:16
cibs joined
|
|||
colomon | hmmm, panda just failed to build for me. | 15:19 | |
t/installer.t .. Failed 1/8 subtests | 15:21 | ||
that's under the latest moar | |||
colomon is having a very lazy day | 15:22 | ||
eeek! | 15:24 | ||
ok 7 - git files not copied | |||
Segmentation fault (core dumped) | |||
jnthn | ugh | 15:25 | |
Is this with bleeding edge Moar, or MOAR_REVISION one, ooc? | |||
colomon | This is perl6 version 2014.05-149-g28d6725 built on MoarVM version 2014.05-18-g6b19b4b | 15:29 | |
(it's whatever rakudobrew gives you as of ten minutes ago) | |||
15:32
zakharyas joined
15:33
vendethiel left
|
|||
colomon | do we have a debug::Trace yet? | 15:35 | |
jnthn | I think "use Devel::Trace;" prints every statement. | 15:37 | |
r: use Devel::Trace; say 42; | |||
camelia | rakudo-{parrot,jvm} 28d672: OUTPUT«use Devel::Tracesay 4242» | ||
..rakudo-moar 28d672: OUTPUT«42use Devel::Tracesay 42» | |||
colomon realizes he cannot use panda to install Devel::Trace | |||
jnthn | No, it's build in to Rakudo | ||
colomon | \o/ | ||
…. errr, that doesn't seem to have done anything? | 15:38 | ||
jnthn | I think it'll only work for scripts, not if you have a pre-compiled module... | 15:39 | |
colomon | I'm trying it directly on t/installer.t | ||
and there is no additional input | 15:40 | ||
*output | 15:43 | ||
lizmat | m: {use Devel::Trace}; say "foo" # not lexically soped | 15:45 | |
camelia | rakudo-moar 28d672: OUTPUT«foo{use Devel::Trace}say "foo" # not lexically soped» | ||
15:45
anaeem___ joined
15:48
anaeem1_ left
|
|||
jnthn | Heading out for a while...back later tonight & | 15:50 | |
15:50
chenryn left
15:51
brrt joined,
chenryn joined
15:54
thou joined
15:58
thou left
16:01
MContagious joined,
guru joined
16:02
guru is now known as Guest41346,
Guest41346 is now known as ajr_
|
|||
MContagious | hi Folks... can I know how to run shell commands withing perl6 something like ... open (FH, "command |") in perl5 | 16:02 | |
16:02
vendethiel joined
|
|||
MContagious | I have to read a csv.gz file content... So, I thought of using zcat to read the file content... How can I achieve this in perl6 | 16:04 | |
masak | dinner & | 16:07 | |
16:12
mr-fooba_ joined
|
|||
TimToady | m: given open "/bin/ls", :p { .slurp.say } | 16:12 | |
camelia | rakudo-moar 28d672: OUTPUT«open is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting:2 in sub open at src/RESTRICTED.setting:5 in block at /tmp/AOtuSrdwsE:1» | ||
TimToady | unfortunately it doesn't scan PATH for you, so you might need to invoke a shell | 16:13 | |
(I would consider that a bug.) | 16:14 | ||
16:14
mr-foobar left
|
|||
MContagious | hi can anybody answer me ? | 16:15 | |
TimToady | I just did | 16:16 | |
Ulti | :P isnt a smilee but an option to open | 16:17 | |
TimToady | you want open "/bin/zcat", :p or some such | 16:18 | |
16:19
molaf_ joined
|
|||
TimToady | or you could turn rosettacode.org/wiki/LZW_compression#Perl_6 into a module :) | 16:20 | |
it's probably better to use a pipe on multicore | 16:22 | ||
16:22
molaf left
|
|||
MContagious | thanks | 16:25 | |
16:30
treehug88 joined
|
|||
vendethiel | isn't there something on Array to turn `<a b c>` to `a => 'a', b => 'b', 'c' => 'c'`? | 16:30 | |
16:32
rurban left
|
|||
lee__ | m: @a = <a b c>; (@a Z @a).hash # probably a better way | 16:33 | |
camelia | rakudo-moar 28d672: OUTPUT«===SORRY!=== Error while compiling /tmp/NW047lH8BuVariable '@a' is not declaredat /tmp/NW047lH8Bu:1------> @a⏏ = <a b c>; (@a Z @a).hash # probably a  expecting any of: postfix» | ||
lee__ | m: my @a = <a b c>; say (@a Z @a).hash # probably a better way | ||
camelia | rakudo-moar 28d672: OUTPUT«("a" => "a", "b" => "b", "c" => "c").hash» | ||
vendethiel | yeah, but you need to be predeclared then. You can't (^50).assoc; | 16:34 | |
lee__ | could always resort to map | 16:36 | |
16:36
btyler joined
|
|||
smls | (^50).map({ $_ => $_ }) | 16:36 | |
vendethiel | m: say (^5).map(* => *) | 16:37 | |
camelia | rakudo-moar 28d672: OUTPUT«Not enough positional parameters passed; got 1 but expected 2 in block at /tmp/xUxGg0RZl6:1» | ||
smls | the *=>* closure wants 2 arguments | 16:38 | |
vendethiel | yeah | ||
16:42
brrt left
|
|||
MContagious | with dir I am getting some IO::Path objects and I want to get the actual path of the file. Something like toString | 16:44 | |
16:44
brrt joined
|
|||
vendethiel | MContagious: .Str ? or prefix ~ | 16:44 | |
it works great. github.com/Nami-Doc/Sprockets.pl/b...or.pm6#L20 | 16:45 | ||
MContagious | very cool | ||
TimToady | "compiling a cumulative OUTER" sounds quite similar to what the REPL really wants to do to the current lexical scope | 16:52 | |
16:53
brrt left
|
|||
TimToady | sort of the tail recursion optimization for scopes | 16:53 | |
"turn my setting into a prelude" :) | 16:54 | ||
17:01
vendethiel left
17:03
rurban joined,
ivanshmakov left
17:05
rurban1 joined
17:06
sftp_ joined,
hoverboard joined,
ivanshmakov joined
17:07
treehug88 left,
sftp_ is now known as sftp,
rurban left
17:08
Su-Shee_ is now known as Su-Shee
|
|||
MContagious | $var =~ s/something(\d+)/$1/; # how to write this in perl6 | 17:10 | |
xfix | $var ~~ s/something(\d+)/$0/; | 17:11 | |
TimToady | =~ turns into ~~ and $1 turns into $0 | ||
MContagious | thanks | ||
TimToady | and be carefule with 'something' if it's not really alphanumeric, since all non-alphanum have to be quoted | ||
*ful | |||
timotimo | you can also do s/something )> \d+// | 17:12 | |
xfix | Yes, Perl 6 regexes are intended to be more consistent. In Perl 5, $0 contained name of program. In Perl 6, the regex variables start from 0, to be consistent with arrays. | ||
(and $0 is actually syntactic sugar for $/[0]) | 17:13 | ||
timotimo | i think <( and )> get way underused | 17:14 | |
at least by me. | 17:15 | ||
m: say "foo bar" ~~ / )> \w+ <( / # trololo | 17:16 | ||
camelia | rakudo-moar 28d672: OUTPUT«#<failed match>» | ||
TimToady | p6 has a lot of figure/ground reversals from "standard practice", and those tend to be underutilized | 17:17 | |
.comb vs .split is another | |||
timotimo | aye, in that case, you're just writing your cobol in p6 | ||
btyler | timo: what are <( and )>? | 17:18 | |
TimToady | inside-out lookbehind/lookahead | ||
timotimo | that's a cute way to put it | ||
TimToady | the set the returned start/end of the match | ||
*they | 17:19 | ||
timotimo | i wonder if rakudo should warn/throw an error when a <( or )> is quantified | ||
TimToady | well, could warn on any quantified known-zero-width | 17:20 | |
timotimo | isn't something like [ <( a ]+ a problem? | ||
smls | $var ~~= s/something (\d+)/$0/ # is this the canonical way to make it mutating (like MContagious' P5 statement)? | 17:21 | |
timotimo | another thing i find myself underusing; maybe "fortunately", is & in regex | ||
TimToady | it's already mutating | ||
use .subst for the non-mutating by default | |||
or .=subst for mutating | |||
smls | oh, good to know | 17:22 | |
TimToady | [ <( a ]+ would set the .from each time, so would leave it before the final 'a' | 17:23 | |
( <( a )+ otoh would set the .from for each submatch object | 17:24 | ||
uselessly, in this case | |||
timotimo | oh, that works in submatches if you have captures? | 17:25 | |
xfix | I actually like / something <( something else )> something different / | ||
timotimo | that's pretty neat actually | ||
xfix | But I didn't know I don't have to use both. Interesting. | 17:26 | |
TimToady | timotimo well, supposed to work that way | ||
timotimo | m: say "hey:what is:going on:here dude:bro" ~~ m/ ( \w+ \: <( \w+ )+ /; | ||
camelia | rakudo-moar 28d672: OUTPUT«「hey:what」 0 => 「what」» | ||
timotimo | m: say "hey:what is:going on:here dude:bro" ~~ m/ ( \w+ \: <( \w+ )+ % " " /; | ||
camelia | rakudo-moar 28d672: OUTPUT«「hey:what is:going on:here dude:bro」 0 => 「what」 0 => 「going」 0 => 「here」 0 => 「bro」» | ||
timotimo | yes, that *is* pretty cool! | ||
xfix | But I guess it makes sense. There is no ambiguity in `<(` and `)>` after all. They aren't real parenthesis. | 17:27 | |
Perl 5 has `<(` called `\K`, if I understand correctly. | |||
TimToady | sounds right | 17:28 | |
timotimo | i'm really glad all these weird backslash sequences were tossed | 17:29 | |
TimToady bows | 17:30 | ||
xfix | And `)>` is somewhat like `(?= )`. | ||
TimToady | A5 was the most revolutionary of the apocalypses, at least up till then | ||
xfix | Regexes needed improvements. | ||
`(?`)? I think that even extending `{` would have been better. | 17:31 | ||
timotimo | and IMO perl6 did very, very well. | ||
TimToady | well, they needed a complete rethink | ||
starting with "no, regexes aren't just funny strings" | 17:32 | ||
they are True Language | |||
xfix | \Q$variable\E was crazy. | ||
TimToady | yeah, string-think | ||
another thing we turned inside out | |||
and doing so also fixed the whole $1 vs \1 fiasco | 17:33 | ||
xfix | You don't go, and run mysql_query("SELECT * FROM users WHERE name = '$_GET[name]' AND password = '$_GET[password]'"). | ||
smls | xfix: I always use quotemeta() instead | ||
less WAT | |||
xfix | \Q is quotemeta. | ||
smls | yeah, but more confusing | 17:34 | |
TimToady | indeed, it really is underneath, it's not just like quotemeta | ||
xfix | Either way, quotemeta or \Q, it's still silly. | ||
TimToady bows for that too, in a more orz fashion | |||
but ya know, early Perl had to play the hand that it was dealt | 17:35 | ||
xfix | Perl 5 regexes had a problem with compatibility. | ||
You couldn't really extend syntax. | |||
17:35
eMBee joined
|
|||
TimToady | yes, there were cultural constraints that we threw off with P6 | 17:35 | |
xfix | So, there was barely any invalid syntax that could be used for extensions. | ||
I think it only had \<letter>, (?, (*, and (+. | 17:36 | ||
(I personally would have used `{` for this, but I guess it wasn't an option for some reason) | |||
TimToady | well, we wanted {} to almost always be closure in P6 | ||
and <> was available, if you squinted | 17:37 | ||
xfix | In previous versions of Perl, while preserving compatibility. | ||
TimToady | and <foo> was already like a lot of grammar engines | ||
right, sorry | |||
xfix | `{` has barely any valid syntax. `{X}`, `{X,}` and `{X,Y}`. | ||
TimToady | well, basically means you can't match digits inside {} | 17:38 | |
but for extensibility, woulda worked | |||
otoh people with certain keyboards woulda groaned | |||
I think some people have to type like 5 keys to get a brace | 17:39 | ||
xfix | On my keyboard, ( is Shift+9 and { is Shift+[. But I guess that on regional keyboards, it would have been differently. | ||
On the other hand, the programmers already had to deal with C braces somehow. | |||
TimToady | but closures don't happen as often as metathingies | ||
and people probably had macros for common C insertions in that case | 17:40 | ||
xfix | Well, I would think that blocks are quite common in Perl programs. Who doesn't write `sub name { }`, after all? | ||
TimToady | I think my vim still has a ^B macro to insert a block... | ||
17:40
MContagious left
17:41
rurban1 left
17:42
thou joined
|
|||
xfix | The regular expressions would be shorter if `{` would be used instead of `(?`. | 17:42 | |
Of course, that would mean no recursion syntax like `(?1)`, but that is syntactic sugar for `(?&1)` either way. | 17:43 | ||
timotimo | regular expressions were already too damn short in many cases :P | ||
xfix | (?:) is anything but short. | ||
dalek | ecs: ba919b5 | grondilu++ | S32-setting-library/IO.pod: adding missing =back |
||
xfix | (at least compared to `()`) | ||
timotimo | but (?: ) is not the same as (), it's the same as [] :) | 17:44 | |
i don't really know what we're arguing about and/or for at the moment | |||
TimToady | xfix is talking about P5 | ||
timotimo | mh | ||
TimToady | woulda coulda been P5 | ||
xfix | The enhancements in Perl 6 are nice, but I wonder how would Perl look if `{` was used instead of `(?`. | 17:45 | |
{:a|b} doesn't look as bad as (?:a|b) in my opinion. | |||
TimToady | $ perl6 -e 'slurp("STD.pm6").comb.Bag.pairs.sort.say' | ||
"\n" => 6374 " " => 64161 "!" => 444 "\"" => 1859 "#" => 1026 "\$" => 3363 "\%" => 480 "\&" => 119 "'" => 3406 "(" => 1652 ")" => 1616 "*" => 1123 "+" => 229 "," => 940 "-" => 182 "." => 1910 "/" => 323 "0" => 375 "1" => 284 "2" => 735 "3" => 122 "4" => 59 "5" => 92 "6" => 94 "7" => 125 "8" => 99 "9" => 148 ":" => 2157 ";" => 1582 "<" => 3642 "=" => 1627 ">" => 3980 "?" => 713 "\@" => 334 "A" => 646 "B" => 282 "C" => 531 "D" => 448 "E" => 989 "F" => 250 | |||
17:46
thou left
|
|||
xfix | Newlines and spaces are quite common, it appears. | 17:46 | |
TimToady | 3600 angles vs 1900 braces | ||
xfix | (but I wonder why it sorts so strangely here) | 17:47 | |
(oh, right, it sorts keys, not values) | |||
TimToady | so I'd say in this case it's better to hand the huffman award to <> than to {} | ||
xfix | I probably agree. `{` has too many overloads in Perl 5. | ||
TimToady | at least in STD, there's nearly twice as many extension brackets as there are closure curlies | ||
and that's with a lot of support methods that aren't regex at all | 17:48 | ||
xfix | It's for blocks. It's for hash references. It's for repetition. It's for scalar dereference. It's for functions. | 17:49 | |
TimToady | I think you left one out | ||
xfix | And it's for interpolating variables in strings. | ||
TimToady | there you go :) | ||
and for pick-you-own quotes, if you like :) | |||
*your | 17:50 | ||
xfix | And it's for accessing hashes. | ||
How I forgot about this. | |||
{a => "b"}->{a} | |||
q{} doesn't quite count :-). | 17:51 | ||
(but I agree I often use braces for regexes in qr syntax) | |||
TimToady | at least we managed to turn ${foo} into {$foo} to combine two of those | ||
at the "expense" of allowing closure interpolation | 17:52 | ||
which some people carped about at the beginning, but haven't heard much of that lately :) | |||
xfix | By the way, literal { in regexes is deprecated in Perl 5. Instead of /{/, you should write /\{/. | ||
I also forgot one usage of {, now that I think about it. They are used as delimiters for \ sequences, like \x{100}. | 17:53 | ||
TimToady | yes, that was the other thing, historically { } was literal, not reserved | ||
xfix | They deprecated literal { to allow additional extensions of regex grammar. | 17:54 | |
xfix .o( have they han out of `(?` sequences ) | |||
TimToady | we reserved all punctuation in P6 because we know we're not smart enough to figure it all in advance, and the users aren't smart enough to remember anyway | ||
17:55
molaf_ left
|
|||
xfix | s/han/ran/ | 17:55 | |
TimToady | that's like asking if the circus has run out of clowns | ||
xfix | But if I think about it, they use `(??` sequences now. | 17:56 | |
There is just one `(??` sequence right now, but they do use `(??` in rather generic way. | 17:57 | ||
(allowing for future expansions) | |||
17:58
vendethiel joined
|
|||
xfix | (and they use `(?*`) | 17:58 | |
I mean, `(*`. | |||
For example, `(*THEN)` behaves like `::` from Perl 6 according to the documentation. | |||
But at least Perl 5 regexes were consistent with escaping. To be honest, I don't know what should I escape in grep, and what I shouldn't. | 18:01 | ||
Documentation says that I have to escape `?`, `+`, `{`, `|`, `(` and `)` to get their special meaning. This is crazy. | 18:04 | ||
TimToady had some sanity even back then | |||
smls | `grep -P` FTW | 18:05 | |
geekosaur | xfix: that's a gnuism | ||
xfix | What is the impact on performance with `grep -P` option? | 18:06 | |
smls | faster, actually | ||
geekosaur | regular grep doesn't understand those metacharacters at all (try egrep / grep -E) | ||
smls | last time I checked | ||
xfix | It uses Perl regular expression, so I assume it kills grep optimizations. | ||
TimToady remembers seeing the term "GNU/Perl" and shuddering | |||
geekosaur | huh? any optimizations in grep would be in its regex engine. pcre has its own optimizations | ||
smls | maybe it uses PCRE, which does JIT? | ||
geekosaur | yes, grep -P is PCRE | 18:07 | |
xfix | GNU/Perl - we at GNU created Linux, Perl, Python, and everything free you use (hey, they use GPL license after all, so they are ours). | ||
smls | alias ?='grep -Pi' # in bashrc or zshrc | 18:09 | |
xfix | `fish: Illegal command name '?'` | 18:11 | |
heh | |||
smls | clearly an inferior shell ;) | ||
TimToady | below sea level is pretty low | 18:12 | |
xfix | I could modify it to allow `?` here, but why. | ||
I can define function called ?, but I need to call it with \? or '?' or "?". | |||
geekosaur | .oO { seems pretty fishy to me } | ||
actually that would be expected since it's a glob otherwise | 18:13 | ||
xfix | Actually, it seems that zsh doesn't accept '?' as function name, and fish doesn't have aliases. | 18:14 | |
But `set fish_user_abbreviations '?=grep -Pi'` seems to work. | 18:15 | ||
18:15
hoverboard left
|
|||
xfix | (abbreviations are like aliases, except automatically expanded on command line after aliasing them, it's also experimental feature, so it doesn't have nice API right now) | 18:15 | |
s/aliasing/entering/ | 18:16 | ||
18:26
btyler left
|
|||
vendethiel | .oO( Stallman-driven development ) |
18:30 | |
18:40
FROGGS joined
18:41
rurban joined
18:43
dayangkun left
18:46
rurban left
|
|||
vendethiel | github.com/LearnBoost/stylus/pull/1580 I think CSS preprocessor can NOT add every feature you need in other languages. | 18:49 | |
Perl 6 CSS. Not as a slang, just integrated into the main lang. | 18:54 | ||
18:55
raiph joined,
dayangkun joined
|
|||
nebuchadnezzar | hello | 19:10 | |
vendethiel | o/ | ||
nebuchadnezzar | I'm trying to package the moarvm backend for Debian and found that nqp with this backend put .moarvm files under /usr/languages | 19:12 | |
paste.debian.net/103880/ | |||
I'm not sure Debian will be happy with this :-/ | |||
vendethiel doesn't linux | 19:13 | ||
nebuchadnezzar | it may be like with parrot, moving /usr/languages/nqp under /usr/lib/moar/<moar_version>/languages/ | 19:15 | |
FROGGS | nebuchadnezzar: there already is an nqp issues about that | ||
we need to fix that | |||
19:16
btyler joined
|
|||
FROGGS | github.com/perl6/nqp/issues/154 | 19:16 | |
nebuchadnezzar | arf, sorry for noise and thanks for the hints | ||
FROGGS | no, please add your info to the ticket :o) | 19:17 | |
nebuchadnezzar | I'm doing to | 19:20 | |
19:21
btyler left
19:26
btyler joined
19:30
thou joined
19:33
itz joined
19:34
thou left
19:35
molaf joined
19:41
darutoko left
19:42
rurban joined
19:44
zakharyas left
19:47
rurban left
19:52
beastd joined
19:54
Rotwang left
|
|||
FROGGS | nebuchadnezzar++ | 20:07 | |
20:15
molaf left
20:18
hoverboard joined
20:20
rurban joined
20:22
dwarring joined
|
|||
cognominal | std.pm/ :) | 20:22 | |
20:23
kaare_ left
|
|||
[Coke] | . | 20:26 | |
timotimo | "if you don't know what std.pm is" | 20:27 | |
vendethiel | and giving 2 randoms link | ||
that don't explain which does what :/ | |||
xfix | I didn't knew there is .pm domain. | 20:28 | |
But technically it's std.pm6 :). | 20:29 | ||
moritz | specifically for perl mongers groups :-) | ||
xfix | (or well, STD.pm6) | ||
Perl 6 CSS would look suspiciously close to AWK in my opinion ;-). | 20:31 | ||
20:34
jack_rabbit joined
20:41
ajr_ left
|
|||
dalek | ast: 89ab348 | (David Warring [email@hidden.address] | integration/advent2011-day10.t: adding advent 2011 day 10 S26++ |
20:46 | |
dwarring short but sweet - perlcabal.org/syn/S26.html | 20:47 | ||
20:49
itz left
20:52
SevenWolf joined,
itz joined
|
|||
timotimo | i've been so useless the last few days >_< | 20:55 | |
vendethiel doesn't feel like answering "(as opposed to ?)", because he's in a good mood, and because he likes timotimo++ | 20:57 | ||
timotimo | d'aaw :) | 20:58 | |
vendethiel | .oO( Ah ! That was actually a brilliant reverse psychology message to get free karma ) |
20:59 | |
timotimo | thank you for calling something you attribute to me "brilliant" | ||
vendethiel | That was just a reverse psychological call to a pseudo reverse psychology message from you to compliment you again. | 21:00 | |
vendethiel takes a deep breath | |||
Sorry, it's just *TOO DAMN HOT* | 21:01 | ||
timotimo | i watched Tropic Thunder yesterday, and that was about as meta as your reverse psychology stuff right there :) | ||
21:02
carlin joined
|
|||
carlin | rakudo-jvm: say $*VM.config<nativecall.o>; say $*VM.config<nativecall.so>; | 21:06 | |
camelia | rakudo-jvm 28d672: OUTPUT«.oso» | ||
carlin | .o has a leading dot, but .so doesn't | ||
21:09
Su-Shee left
21:11
Su-Shee joined
21:18
thou joined
21:23
thou left
21:28
thou joined
21:29
pippo joined
|
|||
pippo | o/ #perl6 | 21:29 | |
timotimo | o{ | ||
pippo | m: my @strings = ("one,two,three", "one,two,three"); my @a; for @strings { @a.push: $(.split(',')) }; @a[0][1] = "four"; | 21:30 | |
camelia | rakudo-moar 28d672: OUTPUT«Cannot modify an immutable Str in method assign_pos at src/gen/m-CORE.setting:1796 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2496 in block at /tmp/LYP_VT8o8V:1» | ||
pippo | n: my @strings = ("one,two,three", "one,two,three"); my @a; for @strings { @a.push: $(.split(',')) }; @a[0][1] = "four"; | ||
camelia | ( no output ) | ||
pippo | p: my @strings = ("one,two,three", "one,two,three"); my @a; for @strings { @a.push: $(.split(',')) }; @a[0][1] = "four"; | ||
camelia | rakudo-parrot 28d672: OUTPUT«Cannot modify an immutable value in method assign_pos at gen/parrot/CORE.setting:1800 in method assign_pos at gen/parrot/CORE.setting:1798 in sub postcircumfix:<[ ]> at gen/parrot/CORE.setting:2500 in sub postcircumfix:<[ ]> at gen/parrot…» | ||
pippo | n: my @strings = ("one,two,three", "one,two,three"); my @a; for @strings { @a.push: $(.split(',')) }; @a[0][1] = "four"; say @a[0][1]; | 21:31 | |
camelia | niecza v24-109-g48a8de3: OUTPUT«four» | ||
pippo | timotimo: do you know why I cannot assign to @a except on niecza? | 21:32 | |
smls | pippo: You don't turn your inner lists into arrays | 21:38 | |
So they'll just be itemized lists of strings, without scalar containers around the strings | |||
which are immutable | |||
for @strings { @a.push: [ .split(',') ] }; # if you construct @a like this, it works | 21:40 | ||
timotimo | frankly, it confuses me that niecza will let you do that | 21:43 | |
m: my @strings = ("one,two,three", "one,two,three"); my @a; for @strings { @a.push: $(.split(',')) }; say @a.perl; say @a[0].perl | 21:44 | ||
camelia | rakudo-moar 28d672: OUTPUT«Array.new(("one", "two", "three").list.item, ("one", "two", "three").list.item)("one", "two", "three").list.item» | ||
timotimo | m: my @strings = ("one,two,three", "one,two,three"); my @a; for @strings { @a.push: $(.split(',')) }; say @a.perl; say @a[0].perl; say @a[0][1].perl; | ||
camelia | rakudo-moar 28d672: OUTPUT«Array.new(("one", "two", "three").list.item, ("one", "two", "three").list.item)("one", "two", "three").list.item"two"» | ||
timotimo | m: my @strings = ("one,two,three", "one,two,three"); my @a; for @strings { @a.push: $(.split(',')) }; say @a.perl; say @a[0].perl; say @a[0][1] = "hi"; | ||
camelia | rakudo-moar 28d672: OUTPUT«Array.new(("one", "two", "three").list.item, ("one", "two", "three").list.item)("one", "two", "three").list.itemCannot modify an immutable Str in method assign_pos at src/gen/m-CORE.setting:1796 in sub postcircumfix:<[ ]> at src/gen/m-CORE.se…» | ||
timotimo | it's because it's a list, not an array | ||
lists don't have containers in them | 21:45 | ||
ah, smls already said that | 21:46 | ||
smls++ :) | |||
21:50
spider-mario left
|
|||
pippo | smls: timotimo: thank you very much. | 21:54 | |
zengargoyle | openurl 7 | 21:57 | |
21:58
thou left
21:59
thou joined
22:12
virtualsue joined
22:18
BenGoldberg joined,
lizmat_ joined
22:21
lizmat left
22:28
water joined,
hoverboard is now known as Guest40203,
Guest40203 left,
water is now known as hoverboard
22:41
ivanshmakov left
22:42
Alina-malina left,
Alina-malina joined
22:44
ivanshmakov joined
|
|||
cognominal | r: %[ 'a', 'b' ] | 22:44 | |
camelia | rakudo-{parrot,jvm,moar} 28d672: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfileUnsupported use of %[ variableat /tmp/tmpfile:1------> <BOL>⏏%[ 'a', 'b' ] expecting any of: statement list prefix or term…» | 22:45 | |
cognominal | r: %([ 'a', 'b' ]) | ||
camelia | ( no output ) | ||
cognominal | r: say %([ 'a', 'b' ]) | ||
camelia | rakudo-{parrot,jvm,moar} 28d672: OUTPUT«("a" => "b").hash» | ||
22:47
anaeem___ left,
sftp_ joined
22:50
sftp left,
sftp_ is now known as sftp,
ivanshmakov left,
ivanshmakov joined
22:51
kurahaupo left
22:56
smls left
22:58
rurban left,
SevenWolf left
23:02
araujo joined
23:03
rurban joined
23:05
ivanshmakov left
23:07
mr-fooba_ left
23:09
ivanshmakov joined
23:16
ivanshmakov left,
ivanshmakov joined
23:23
pippo left,
sftp_ joined
|
|||
masak | r: say %( <a b> ) | 23:23 | |
camelia | rakudo-{parrot,jvm,moar} 28d672: OUTPUT«("a" => "b").hash» | ||
cognominal | In my real case the .hash was more elegant | 23:25 | |
23:25
sftp left,
sftp_ is now known as sftp
23:26
ivanshmakov left
23:29
sftp_ joined
23:30
sftp left
23:31
sftp joined
|
|||
cognominal | pour les 30 de tétris. Tétris on vodka : www.youtube.com/watch?v=2YHAM-K5SPE | 23:32 | |
23:33
sftp_ left,
hoverboard left
23:35
itz left
23:38
virtualsue left
23:41
ivanshmakov joined
23:43
ivanshmakov left,
ivanshmakov joined
23:47
BenGoldberg left
|
|||
masak | tonight, rather than sleeping, I found myself imagining a new control flow construct. | 23:48 | |
it's most similar to gather/take, so I've tentatively called it collect/accept. | 23:49 | ||
it's kind of an extension of the amb keyword. | |||
you do `collect { ...; my $var = accept @alternatives; ...; take $result }` | 23:50 | ||
and at each `accept`, control flow tries all alternatives, in order, backtracking when there are nested `accept`s. | 23:51 | ||
vendethiel is too tired to try and understand ;_; | 23:53 | ||
Tene | masak: why backtracking when you encounter another accept? | ||
masak | more like, each accept is another point that the collect block will backtrack to once it runs to the end of the block. | 23:54 | |
Tene | Ahh. Yeah, I get it. | ||
masak | in the above code, if @alternatives contains (1, 2, 3), then the block will run 3 times. | ||
Tene | Now, how is that different from for loops? | 23:55 | |
masak | thinking about it, I think I can emulate this with today's gather and recursion. | ||
masak tries | |||
Tene | Or is this a trivial isomorphism to for loops? | ||
Sometimes trivial isomorphisms are still useful, I'm just not sure if I'm missing something. | 23:56 | ||
masak | no, this is basically some kind of CPS transform, so it's not trivially isomorphic to for loops. | ||
imagine, for example, the `accept` sitting inside a bunch of loops already, interacting with `next`, `last` etc | 23:57 | ||
vendethiel is already trying to understand some C++ stuff and getting hammered down with masak's example | |||
Tene | Isn't that just a nested loop? | ||
masak | Tene: hold on, I'll put together a concrete example. | 23:58 | |
Tene | Sure. :) |