»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by masak on 12 May 2015. |
|||
TimToady | m: class Foo { method foo(--> self) {}}; Foo.new.foo.say | 00:00 | |
camelia | rakudo-moar de8024: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CerzdjtmP3Type 'self' is not declaredat /tmp/CerzdjtmP3:1------> 3class Foo { method foo(--> self7⏏5) {}}; Foo.new.foo.say» | ||
TimToady | awww | ||
maybe we should special-case that for the people who inexplicably like fluent programming | 00:01 | ||
me, I can't stand methods that don't know which way the data is flowing through them | 00:02 | ||
TimToady is not particularly interested in making fluent programming easy though, but --> self is pretty good documentation that you've got a mutator | 00:03 | ||
I wonder if it's possible to move the declaration of self up a little... | 00:05 | ||
00:05
mattprelude left
|
|||
skids | .oO(maybe an alternate method dispatcher to '.') |
00:05 | |
TimToady | like, say, .= | ||
which could probably optimize more if it sees a --> self | 00:06 | ||
well, self isn't exactly a compile-time value, so just declaring it earlier won't help, likely | 00:07 | ||
00:09
salv0 left
|
|||
ShimmerFairy | I think chaining mutating method calls is really only useful where you find your self writing a lot of methods that don't return anything, because there you can say "why not return C<self>?". Otherwise, useful return values tend to trump fancy method chaining, I feel :) | 00:09 | |
00:10
mr_ron left
00:12
salv0 joined
|
|||
pink_mist | well of course if you're returning something else that trumps method chaining ... method chaining is for when you aren't returning something else | 00:14 | |
ShimmerFairy | TimToady: another issue could be if someone tried method foo(Class \SELF: $param --> SELF) { ... } , so the initial impulse to just special-case 'self' there is obviously not adequate :) | 00:16 | |
m: my @a = 1,2,3; my $s = @a; for $s { say "A" }; $s.map: { say "B" } | 00:18 | ||
camelia | rakudo-moar de8024: OUTPUT«ABBB» | ||
ShimmerFairy | huh, I thought single-arg was supposed to fix that :( | ||
00:18
yqt left
|
|||
TimToady | the GLRR pays attention to $ there | 00:19 | |
so you need @$s or so | 00:20 | ||
m: class Foo { method foo(\SELF: --> SELF) {}}; Foo.new.foo.say | |||
camelia | rakudo-moar de8024: OUTPUT«===SORRY!===No compile-time value for SELF» | ||
TimToady | well, when we get --> $reval that should fall out pretty easily | 00:21 | |
ShimmerFairy | that's unfortunate. I understand that $ protection was the sanest way to handle the problems people were having, but on the other hand I still think people should've been using given $s { } instead, in this one case :) | 00:22 | |
00:24
kanishka left
00:28
kanishka joined
00:30
leont left
|
|||
TimToady | it wasn't just that one case | 00:30 | |
@array.push: $element | 00:31 | ||
we're not gonna define two different method names for every method that has the issue | |||
ShimmerFairy | Like I said, making $ protect against single-arg certainly seems like the best solution to the problem. If it means losing perfect for $s <-> $s.map equivalence, then oh well :) | 00:33 | |
00:39
adu left,
sufrostico joined
|
|||
zostay | m: sub f(Pair:D $v) { ++$v.value }; my $x = 10; say f('x' => $x); say f('y' => 42); | 00:44 | |
camelia | rakudo-moar 0024b0: OUTPUT«11Parameter '$a' expected a writable container, but got Int value in sub f at /tmp/kYON57D75i:1 in block <unit> at /tmp/kYON57D75i:1» | ||
zostay | how do i tell if $v.value has been bound to an immutable value or to a variable? | ||
ShimmerFairy | m: sub f(Pair:D $v) { $v.value.VAR.WHAT }; my $x = 10; say f('x' => $x); say f('y' => 42); # you probably shouldn't check like this, though | 00:47 | |
camelia | rakudo-moar 0024b0: OUTPUT«(Scalar)(Int)» | ||
zostay | yeah, that probably doesn't work well... i think i'd catch the failure and react instead | 00:49 | |
i'll go with that unless someone has a better answer | 00:50 | ||
ShimmerFairy | zostay: I think the best solution would be to do { ++$v.value; CATCH { #`(handle error here) } } | 00:51 | |
00:53
TEttinger left
01:05
adu joined
|
|||
awwaiid | m: use MONKEY-TYPING; augment class List { method first { self[0] } } ; (1, 2, 3).first # muahaha | 01:06 | |
camelia | ( no output ) | ||
awwaiid | m: use MONKEY-TYPING; augment class List { method first { self[0] } } ; say (1, 2, 3).first # muahaha | ||
camelia | rakudo-moar 0024b0: OUTPUT«1» | ||
01:12
dnmfarrell left
01:30
vendethiel joined
01:33
tokuhiro_ joined
01:37
tokuhiro_ left
|
|||
zostay | whoo it even has a nice neat X::Assignment::RO exception to work from ++ | 01:46 | |
01:54
vendethiel left
02:09
espadrine left
02:10
sufrostico left
02:19
nightfrog left
02:24
nightfrog joined,
adu left
02:33
aborazmeh joined
02:34
aborazmeh left,
aborazmeh joined,
tokuhiro_ joined
|
|||
flussence | .oO( I see in the backlog I'm not the only one interested in gentoo integration :D ) |
02:38 | |
02:39
tokuhiro_ left
|
|||
ShimmerFairy | flussence: I couldn't even begin to actually _do_ it, mind you, but I do think it'd be neat if from the gentoo angle we could say "_our_ module system doesn't make gentoo use an external tool" :P | 02:39 | |
02:40
noganex_ joined
|
|||
flussence | it'd be pretty neat to have a CUR::Local::VDB or something along those lines to make p6 aware of system-installed stuff - but I've no idea where to begin with something like that either. | 02:43 | |
02:43
noganex left
|
|||
JimmyZ | .tell lizmat Do we need s/trait_mod/trait-mod/g too? I see a lot of trait_mod:<x> used. | 02:43 | |
yoleaux | JimmyZ: I'll pass your message to lizmat. | ||
02:46
adu joined
|
|||
Timbus_ | is `x` in this case any verb? or are we still limited to is, does, etc | 03:23 | |
03:29
kanishka left
|
|||
dalek | osystem: ce32c76 | (Sterling Hanenkamp)++ | META.list: Remove KnottyList from the Perl6 ecosystem Since Perl 6's own Pair know handles binding, KnottyPair is mostly redundant. |
03:41 | |
c: 8e3c7d4 | (David Farrell)++ | lib/Type/Iterable.pod: fix typos |
03:50 | ||
c: 4801399 | (David Farrell)++ | lib/Type/Iterable.pod: Merge pull request #135 from dnmfarrell/master fix typos |
|||
03:51
zostay left,
zostay joined
04:02
rurban joined
|
|||
dalek | kudo/nom: c8ec299 | TimToady++ | src/core/Rat (2 files): speed up Rat addtion by reducing lazily About 20% faster when adding a bunch of things with the same denominator. We do this by being lazy about reducing the fractions till we need them reduced, that is, when we're about to display them in a way that reveals the .nude bits, or compare them in a way which needs to know integer status. |
04:11 | |
04:23
Sgeo left
04:26
rurban left
04:30
pat_js` left
|
|||
dalek | kudo/nom: 0132b65 | TimToady++ | src/core/StrDistance.pm: bit of GLR residue |
04:31 | |
04:34
telex left
04:36
tokuhiro_ joined,
telex joined
04:40
tokuhiro_ left
|
|||
dalek | ast: 90c84b8 | skids++ | S02-literals/heredocs.t: Add tests for RT#117705 |
04:45 | |
TimToady | couple of mysterious failures with tr/// that might or might not be my fault, though they look susiciously GLRish | 04:52 | |
but backing out various of my patches doesn't seem to fix it, so I dunno... | |||
04:58
jack_rabbit_ joined
05:09
Sgeo joined,
yuvipanda left
05:11
BenGoldberg left
05:14
Sgeo left
05:22
Sgeo joined
05:29
tokuhiro_ joined
05:33
adu left,
tokuhiro_ left
|
|||
ShimmerFairy | blog post! shimmeryfairy.wordpress.com/2015/0...ally-done/ | 05:34 | |
05:34
TEttinger joined
|
|||
JimmyZ | oh, long post/gist, ShimmerFairy++ | 05:35 | |
but, why STRING? not String? | 05:40 | ||
ShimmerFairy | JimmyZ: that just takes advantage of the ::T syntax for using the same type as a constraint later on (as I understand it). | 05:41 | |
m: sub foo(Real ::R $a, R $b) { say 'OK!' }; foo(1, 2); | |||
camelia | rakudo-moar 0132b6: OUTPUT«OK!» | ||
ShimmerFairy | m: sub foo(Real ::R $a, R $b) { say 'OK!' }; foo(1, 2.0); | ||
camelia | rakudo-moar 0132b6: OUTPUT«Type check failed in binding $b; expected Int but got Rat in sub foo at /tmp/CEZJ2A8OTX:1 in block <unit> at /tmp/CEZJ2A8OTX:1» | ||
JimmyZ | oh ,it is a type. | ||
*type name | 05:42 | ||
ShimmerFairy | I used all-caps because the single-letter usage does, and because it makes it look like a funny type (so you're not so quick to think it's a "real" type) :) | ||
JimmyZ: basically, I tried being as explicit as possible in writing those function signatures, so a potential implementor reading could see what the function expects to get and what it should return :) | 05:46 | ||
JimmyZ | ShimmerFairy: fair enough :) | 05:50 | |
05:56
skids left
06:18
szabgab joined
|
|||
szabgab | Good time! | 06:18 | |
rakudo: my %h; say %h{'a'}.elems; | |||
camelia | rakudo-moar 0132b6: OUTPUT«1» | ||
szabgab | what did I do there ? Why is that return 1 ? | 06:19 | |
rakudo: my %h; if not %h{'a'}:exists { %h{'a'} = [] }; say %h{'a'}.elems; | 06:22 | ||
camelia | rakudo-moar 0132b6: OUTPUT«0» | ||
szabgab | and probably this is what I wanted... | ||
06:25
rindolf joined
|
|||
ShimmerFairy | m: my %h; say %h<a>.perl | 06:26 | |
camelia | rakudo-moar 0132b6: OUTPUT«Any» | ||
06:31
helloworldlang joined
|
|||
helloworldlang | p6: my $lastval = 4; sub lastval is rw { $lastval }; dd $lastval; lastval() = 5; dd $lastval | 06:33 | |
camelia | rakudo-moar 0132b6: OUTPUT«Int $lastval = 4Int $lastval = 5» | ||
helloworldlang | p6: my $lastval = 4; sub lastval is rw { return $lastval }; dd $lastval; lastval() = 5; dd $lastval | ||
camelia | rakudo-moar 0132b6: OUTPUT«Int $lastval = 4Cannot assign to a readonly variable or a value in block <unit> at /tmp/tmpfile:1» | ||
06:38
_mg_ joined
|
|||
ShimmerFairy | helloworldlang: you currently need return-rw to make the explicit return work right if you want is rw (and yes, it's not optimal) | 06:38 | |
helloworldlang | p6: my $lastval = 4; sub lastval is rw { return-rw $lastval }; dd $lastval; lastval() = 5; dd $lastval | 06:40 | |
camelia | rakudo-moar 0132b6: OUTPUT«Int $lastval = 4Int $lastval = 5» | ||
06:45
_mg_ left
06:49
szabgab left
07:06
aborazmeh left
|
|||
JimmyZ | .tell Timbus_ is/does/of/returns/ etc, see traits.pm | 07:20 | |
yoleaux | JimmyZ: I'll pass your message to Timbus_. | ||
07:29
darutoko joined
07:31
tokuhiro_ joined
07:35
tokuhiro_ left
|
|||
Timbus_ | JimmyZ, design.perl6.org/S14.html#line_389 | 07:37 | |
yoleaux | 07:20Z <JimmyZ> Timbus_: is/does/of/returns/ etc, see traits.pm | ||
07:38
vendethiel joined
|
|||
Timbus_ | 'feels like' it implies anything can be declared, but i guess it doesn't say it. | 07:40 | |
07:46
araujo_ left
07:49
araujo joined
08:06
bjz left,
bjz joined
08:18
espadrine joined
08:22
domidumont joined
08:28
domidumont left
08:29
domidumont joined
09:00
vendethiel left,
spider-mario joined
09:04
jack_rabbit_ left
|
|||
masak | antenoon, #perl6 | 09:12 | |
DrForr | Mere *minutes* after noon here... | 09:18 | |
09:21
samarkand joined
|
|||
samarkand | Hi, how can I add a dependency (third-party library) to my perl 6 project? | 09:22 | |
09:24
nowan joined
|
|||
moritz | samarkand: I don't think non-Perl 6 dependencies are tracked | 09:28 | |
samarkand: nor have I heard of a good way to do it yet | |||
samarkand | so if there's a perl 6 library, there's no way to use it in my perl 6 project, is that what you're saying? | 09:29 | |
@moritz | 09:30 | ||
moritz | samarkand: oh no, I misunderstood | 09:31 | |
samarkand: sorry, I thought you meant non-Perl6 dependencies by "third-party" :-) | |||
DrForr | Oh, third-party library as in other perl6 library. Isn't that just a dependency line in META.info? | ||
samarkand | only perl 6 | ||
moritz | samarkand: you can specify dependencies in your META.info | ||
see doc.perl6.org/language/modules | 09:32 | ||
samarkand | in META.info, is that it? and how to make them actually installed? like in ruby you'd say "bundle install" | ||
DrForr | panda track the dependencies. | ||
*tracks | 09:33 | ||
samarkand | thank you, understood. | ||
moritz | github.com/tadzik/Bailador/blob/ma.../META.info for an example | ||
samarkand | thanks. | ||
09:33
samarkand left
09:35
samarkand joined
|
|||
samarkand | I've forgotten to ask. Is that only modules.perl6.org? How about installing from github? | 09:36 | |
or from CPAN? Possible? | |||
09:38
nowan left
|
|||
JimmyZ | samarkand: github.com/perl6/ecosystem | 09:38 | |
samarkand | thx | 09:39 | |
09:39
samarkand left
09:41
nowan joined
09:43
leont joined
|
|||
ShimmerFairy | moritz: it's META6.json, not META.info, though | 09:47 | |
helloworldlang | panda can install module from git://* uri | 09:55 | |
can perl6 run faster then perl5 in futrue ? | 10:00 | ||
DrForr | That's the hope... | 10:01 | |
10:04
AlexDaniel joined
10:05
xfix joined,
xfix left,
xfix joined
10:08
helloworldlang left
|
|||
Woodi | hi today :) | 10:09 | |
just this hit me - could we define here some small, simple, easy to implement language and name it PerlScript ? ;) | 10:11 | ||
DrForr | Just take JavaScript and add sigils? | 10:13 | |
Woodi | but about "fluent programming" or APIs... I'm a bit surprised discussions about it do not mention other discusions on "Do not use method chaining!" topic | ||
DrForr: I don't know, just idea was flying by ;) | |||
DrForr | The key would be to get it installed in browsers. | 10:15 | |
Woodi | and looks "fluent APIs" are just method chaining but spirit of it it/quality of API is decided in domain space, not syntax or things like that... | ||
maybe I should just learn JavaScript :) | 10:16 | ||
DrForr | That was ovid's talk? I haven't seen the talk, I was ... somewhat occupied. | 10:17 | |
Woodi | what is purpose of "is raw" or "is Storable", from user perspective ? passing some data-blob via 2+ calls ? | 10:19 | |
DrForr | Simpler way to serialize attributes? | 10:23 | |
Woodi | if it helps somehow I think ppls buy 2x more sliced&packed bread ;) | ||
DrForr: oops, probably is raw and Storable/is rw are 2 separate things... | 10:24 | ||
DrForr | Yep, 'raw' has no relation to 'rw' as far as I know. | 10:29 | |
10:31
zakharyas joined
10:36
leont left
10:53
spider-mario left
|
|||
timotimo | "is raw" causes no re-containerization at all, "is rw" causes no "readonly-recontainerization" | 10:54 | |
Woodi | timotimo: but why user wants to use .raw ? at least examples needed... | 10:56 | |
psch | Woodi: "is raw" is the trait-equivalent of using a sigilless parameter | 10:57 | |
"sub f(\a) { ... }" <=> "sub f($a is raw) { ... } " | |||
Woodi | actually, \a is very sigil-full ;) | 10:58 | |
timotimo | only in declaration, not in use | 10:59 | |
you use "is raw" if you want to pass something through without imposing anything container-ish on it | |||
Woodi | timotimo: why anything need to be artificially packed in additional container ? | 11:00 | |
I know that it is VM and everything is kind of PMC... but one or the other is strange :) | 11:01 | ||
jnthn | Because $[1,2,3] shouldn't lose its itemization. | ||
yoleaux | 25 Sep 2015 20:29Z <nine> jnthn: the Slang.new failure started appearing in the range 94bc1a9..65129cf | ||
25 Sep 2015 20:45Z <nine> jnthn: or...not. When I checkout 94bc1a9 and rebuild nqp/Moar I still get "Method 'new' not found for invocant of class '$?CLASS'". But with rakudo from this afternoon it worked. | |||
25 Sep 2015 22:40Z <lizmat> jnthn: please read gist.github.com/lizmat/f3807956c354c14902a3 for first stab at CURLI revival | |||
Woodi | jnthn: ah, to pass something by. | 11:02 | |
11:02
TEttinger left
|
|||
timotimo | scalar containers is kind of how we do things | 11:04 | |
jnthn | .tell nine Note that 663e71a4e0 and later in Moar require the change done in 44ad04a88 in Rakudo | ||
yoleaux | jnthn: I'll pass your message to nine. | ||
jdv79 | RabidGravy: oddly www.punoftheday.com/cgi-bin/todayspun.pl hangs up H::UA | 11:08 | |
but it finished. i think after an wait or sommething... | |||
*finishes | |||
11:09
RabidGravy left
|
|||
jnthn | .tell lizmat Read it, will ponder, thanks. :) | 11:12 | |
yoleaux | jnthn: I'll pass your message to lizmat. | ||
lizmat | messages! | 11:19 | |
yoleaux | 25 Sep 2015 23:09Z <tony-o> lizmat: does this mean that i'm open to putting whatever i want in a CURLI manifest file? how does CURLF store information about multiple modules with :auth and :ver? how do i handle *not* being able to write to a precomp directory, is that a total failure for installing the module? this doesn't seem to imply that a CURLF and CURLI should have the same interface, does the loader behave differently depending on | ||
which on | |||
25 Sep 2015 23:11Z <ShimmerFairy> lizmat: left a comment on your gist, hope it helps! :) | |||
02:43Z <JimmyZ> lizmat: Do we need s/trait_mod/trait-mod/g too? I see a lot of trait_mod:<x> used. | |||
11:12Z <jnthn> lizmat: Read it, will ponder, thanks. :) | 11:20 | ||
nine | Surprise: trying to turn Bool into a proper Enumeration is full of bootstrap issues | 11:32 | |
yoleaux | 11:04Z <jnthn> nine: Note that 663e71a4e0 and later in Moar require the change done in 44ad04a88 in Rakudo | ||
psch | S99:Circularity_saw | 11:33 | |
psch stops snarking | |||
nine: i've poked at that as well, quite some time ago | 11:34 | ||
nine | psch: any pointers at what cannot possibly work? | ||
11:34
tokuhiro_ joined
|
|||
masak | "hopefully in a way that the resulting splice will be very difficult for the end-user to notice in day-to-day use." -- I think the general landscape of hope is slightly better than this description implies. | 11:36 | |
the place where the circularity saw cuts matters a lot to the implementor, but for the user it can usually be made either 100% invisible or very nearly so. | 11:37 | ||
psch | nine: nothing helpful comes to mind, unfortunately | ||
masak | (I liked the rest of design.perl6.org/S99.html#circularity_saw -- nicely done, whoever wrote it) | ||
11:39
tokuhiro_ left
|
|||
lizmat commented on gist.github.com/lizmat/f3807956c354c14902a3 ShimmerFairy tony-o nine | 11:43 | ||
JimmyZ: I think at least at the Perl 6 level, it would need to be called trait-mod | 11:44 | ||
but this is one of the things all the way down into nqp itself | 11:45 | ||
jnthn will not be happy with such a change | |||
m: say +StrDistance.new(:before("foo"),:after("zoo")) # shouldn't that just work ? | 11:48 | ||
camelia | rakudo-moar 0132b6: OUTPUT«Cannot make a Block object using .new in block <unit> at /tmp/RPwa8ZBCR8:1» | ||
11:49
FROGGS joined
|
|||
FROGGS | lizmat: will read now | 11:50 | |
yoleaux | 25 Sep 2015 21:11Z <hoelzro> FROGGS: that S26 example you posted that looked buggy is fine; you need a whitespace between '#|' and your comment | ||
25 Sep 2015 22:40Z <lizmat> FROGGS: please read gist.github.com/lizmat/f3807956c354c14902a3 for first stab at CURLI revival | |||
FROGGS | lizmat: I very much disagree about the statements about CURLF | 11:51 | |
Woodi just found R* 2015.09.tgz ! o/ # impatience-tortures: off :) | |||
lizmat | FROGGS: could you leave it as a comment? | ||
FROGGS | lizmat: and I think we already agreed on a need of an install method of CURLF, which also implies that it should support precomp | 11:52 | |
lizmat: will do | |||
lizmat | okidoki! :-) | ||
[Tux] | has RT#124082 been resolved? Really? WOW | 11:53 | |
This one is new: | 11:54 | ||
Parameter '$self' expected a writable container, but got Str value | |||
$name ~~ s{"-"} = "_"; | 11:55 | ||
psch | m: my $n = "foo"; $n ~~ s{"f"} = "F"; say $n | 11:56 | |
camelia | rakudo-moar 0132b6: OUTPUT«Foo» | ||
psch | m: my $n := "foo"; $n ~~ s{"f"} = "F"; say $n | ||
camelia | rakudo-moar 0132b6: OUTPUT«Parameter '$self' expected a writable container, but got Str value in block <unit> at /tmp/ZiVu90D9Gc:1» | ||
lizmat | afk for a few hours& | 12:09 | |
12:13
yqt joined
|
|||
FROGGS | .tell lizmat I commented: gist.github.com/lizmat/f3807956c35...nt-1582671 | 12:25 | |
yoleaux | FROGGS: I'll pass your message to lizmat. | ||
12:26
spider-mario joined
12:31
aristotle joined
|
|||
aristotle | TimToady: a thought I had recently is that one day it may become a good idea to remove all the then-formerly helpful error message hints à la “where you trying to write Perl 5 here?” | 12:35 | |
c.f. nntp.perl.org/group/perl.perl5.porters/231036 | |||
(the thread is about a bug in the Perl 5 regexp compiler’s attempt to parse patterns for a POSIX regexp construct solely to warn that it isn’t supported) | 12:37 | ||
FROGGS | moritz: HTTP::Easy needed a fix, which is already in | ||
aristotle: yes, I also think that the P5ism catchers can go away at some point | 12:39 | ||
ShimmerFairy | I don't think they're quite useless just yet, but they definitely aren't meant to be forever :) | 12:40 | |
aristotle | certainly not useless now | ||
FROGGS nods | |||
moritz | fwiw some of the (like for =~, and . for string concatenation) are often useful to me | 12:41 | |
because I switch a lot between 5 and 6, and sometimes my brain lags behind | |||
FROGGS | aye | 12:42 | |
let's just rethink their usefulness in two decades :o) | |||
ShimmerFairy | None of them are useful for me :P | 12:43 | |
aristotle | as I said, this is about one day someday in the future. Perl 5 is far that point in its cycle; for Perl 6 it’s a long ways off. that’s what I wrote in the post I linked to | ||
ShimmerFairy | The only ones I have an issue with, though, are where they break things out of superstitious worry of P5isms. The thing I'm thinking of: | ||
m: say <> | |||
camelia | rakudo-moar 0132b6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/OSyuRs0jnuUnsupported use of <>; in Perl 6 please use lines() to read input, ('') to represent a null string or () to represent an empty listat /tmp/OSyuRs0jnu:1------> 3say <7⏏5>» | ||
ShimmerFairy | m: my %h; say %h<> | 12:44 | |
camelia | rakudo-moar 0132b6: OUTPUT«» | ||
ShimmerFairy | Even better considering the zen slice. I don't see any good reason <> should be more severe than a warning. | ||
masak | nine: re turning Bool into an enumeration: the reason it isn't one this late in the game is that it's been full of bootstrap issues this whole time. | ||
FROGGS | .tell hoelzro I agree that there is whitespace missing afetr the #|, but why does the absence of the #| change anything? | ||
yoleaux | FROGGS: I'll pass your message to hoelzro. | ||
masak | nine: I also don't have any answers, but I will consider the day we succeed in making it one a fairly big watershed moment :) | 12:45 | |
aristotle | FROGGS: I’m bringing it up because it seems that it hasn’t crossed anybody’s mind when it comes to Perl 5 – or maybe the people who thought of it at the time are longer around –, so those porting aids and their usefulness never did get revisited (/cc TimToady) | 12:47 | |
FROGGS | yeah, long forgotten probably | 12:48 | |
12:48
rurban joined
|
|||
[Tux] | test 50000 34.845 34.738 | 12:49 | |
test-t 50000 35.543 35.436 | |||
RT#124082 looked fixed because the error message changed | 12:52 | ||
psch | m: Num.range.say | 12:57 | |
camelia | rakudo-moar 0132b6: OUTPUT«Method 'range' not found for invocant of class 'Num' in block <unit> at /tmp/fqWlgOlyDj:1» | ||
psch | m: Num.Range.say | ||
camelia | rakudo-moar 0132b6: OUTPUT«-Inf..Inf» | ||
12:58
mr_ron joined
|
|||
psch | [Tux]: unless you're about Inf !~~ Int..? | 12:58 | |
+talking :l | 12:59 | ||
[Tux] | tux.nl/Talks/CSV6/test-t.png | 13:00 | |
13:01
rurban left
|
|||
[Tux] | m: my Int $i; $i = Int.Range.max; | 13:01 | |
camelia | rakudo-moar 0132b6: OUTPUT«Type check failed in assignment to $i; expected Int but got Num in block <unit> at /tmp/I1RROPjblb:1» | ||
[Tux] | the error changed from "expected 'Int' but got 'Num'" to "expected Int but got Num" | 13:02 | |
the quotes were dropped | |||
13:02
Begi joined
|
|||
psch | [Tux]: so the actual bug is RT #61602, not RT #124082? | 13:03 | |
Begi | Hey ! What is the easiest way to code a chat application? | ||
ShimmerFairy | Yeah, that's the infamous Inf problem right there (and the Int.Range.max example isn't even that new :P) | 13:04 | |
moritz | Begi: the easiest way is to use an existing one | 13:05 | |
Begi | moritz: educational purposes, I'd build my own | 13:06 | |
btyler_ | Begi: here's a non-blocking TCP chat* server in ~20 lines: gist.github.com/kanatohodets/8ffb1...04c80225cc | ||
[Tux] | psch, maybe. That got rejected though | ||
btyler_ | * preferred chat client: telnet | ||
13:07
zakharyas1 joined,
zakharyas left
|
|||
btyler_ | (I hacked that up for a lightning talk at YAPC::EU; you might want to do something more elaborate, like using a real chat protocol instead of bytes on TCP :)) | 13:07 | |
ShimmerFairy | [Tux]: it's a mistake that it's rejected; it's an issue, stalled as it may be | ||
psch | [Tux]: it got moved to the specs github issue, i agree with ShimmerFairy that it shouldn't be outright rejected, but i don't know if RT has "stalled" or something similar | 13:08 | |
oh | |||
ShimmerFairy | psch: it does, actually. I think it was the only stalled ticket left (or at least one of them) :) | ||
psch | RT has stalled, yeah | ||
i just saw [Coke] changing it from stalled to open to rejected | |||
[Tux] | I had several discussions about it with lizmat and masak and I *do* understand the problem | 13:09 | |
I'll change the RT number in my bug tester to prevent future confusion | |||
ShimmerFairy | .tell [Coke] I believe it's a mistake for you to reject RT #61602 -- it may not have a solution in the foreseeable future, but rejection should apply to tickets we _know_ are invalid, not tickets about the still-decided. 'stalled' is more appropriate for it, like it was | 13:10 | |
yoleaux | ShimmerFairy: I'll pass your message to [Coke]. | ||
13:11
zakharyas1 left
13:14
Begi left
13:17
rurban joined
13:24
diana_olhovik joined
13:25
brrt joined
|
|||
masak | "The main concern among us Angular developers recently has been the future of our existing Angular 1 apps." -- p5:p6 :: ng1:ng2 -- www.codelord.net/2015/09/10/angular...t-we-know/ | 13:31 | |
moritz | m: gist.github.com/moritz/5cda6371ab3cfec3254e | ||
camelia | rakudo-moar 0132b6: OUTPUT«ProxyMethod» | ||
moritz | why does the last line print Method here? | 13:32 | |
and not Int? | |||
masak | good question. | 13:33 | |
does just `$mv.varies` print 6? | |||
moritz | masak: no, it says <anon> | ||
13:34
kaare__ left,
RabidGravy joined
|
|||
ShimmerFairy | moritz: Well, it's because you mapped those keys to Method objects, no? | 13:34 | |
masak | sounds wrong to me. | 13:35 | |
ShimmerFairy: isn't that the way you implement a Proxy, though? | |||
ShimmerFairy | masak: I've never seen the method keyword used with it, I don't think. Just plain closures | ||
masak | you give FETCH and STORE a callable each. doesn't mean they get exposed. | ||
ShimmerFairy: the presence of the `method` keyword there is practically irrelevant. | 13:36 | ||
13:36
tokuhiro_ joined
|
|||
moritz | ShimmerFairy: the 'method' keyword just means they get an invocant | 13:36 | |
masak | m: my &c1 = sub ($obj, $x) { say "$obj: $x" }; my &c2 = method ($obj: $x) { say "$obj: $x" }; say c1("OH HAI", 42); say "OH HAI".&c2(42) | 13:37 | |
camelia | rakudo-moar 0132b6: OUTPUT«OH HAI: 42TrueOH HAI: 42True» | ||
masak | m: my &c1 = sub ($obj, $x) { say "$obj: $x" }; my &c2 = method ($obj: $x) { say "$obj: $x" }; c1("OH HAI", 42); "OH HAI".&c2(42) | ||
camelia | rakudo-moar 0132b6: OUTPUT«OH HAI: 42OH HAI: 42» | ||
masak | ShimmerFairy: ^ | ||
it's only a matter of intent, not a matter of differing semantics. | |||
moritz | huh | 13:38 | |
but changing it to a sub instead helps indeed | |||
wtf? | |||
masak | ok, bug | ||
masak submits rakudobug | |||
it's probably special-cased where it oughtn't be | |||
moritz | lib/NativeCall/Types.pm also uses Proxy with method | 13:39 | |
jdv79 | i think i ran into that a few months ago and just ignored it when someone showed me the working one | ||
masak | let's fix it instead :P | ||
moritz | does that mean the ones in Nativecall::Types are also broken? And why has nobody noticed that, if true? | ||
masak | ++moritz # for finding out | 13:40 | |
13:40
tokuhiro_ left
13:50
brrt left
|
|||
hoelzro | FROGGS: are you talking about your class Foo { method bar { } #= baz}; say Foo.^find_method('bar')[0].WHY example? | 13:58 | |
yoleaux | 12:44Z <FROGGS> hoelzro: I agree that there is whitespace missing afetr the #|, but why does the absence of the #| change anything? | ||
hoelzro | m: class Foo { method bar { } #= baz}; say Foo.^find_method('bar')[0].WHY | ||
camelia | rakudo-moar 0132b6: OUTPUT«(Any)» | ||
moritz | hoelzro: fwiw a nice syntax would be Foo.WHY('bar') | ||
hoelzro | I don't know why that doesn't work with camelia, but it works on a local Perl 6 | ||
moritz: that's not a bad idea | 13:59 | ||
jdv79 | ok, so a .pm file with no use v6 and no modeline | ||
is it acceptable to not consider that p6? | |||
13:59
brrt joined
|
|||
jdv79 | Algorithm::Elo for instance | 13:59 | |
moritz | jdv79: well, I think that's a pretty simple heuristic, but often good enough | 14:00 | |
brrt | .tell jnthn using nqp i can make a reliable inlined-notinlined pair using a getlex to another frame | ||
yoleaux | brrt: I'll pass your message to jnthn. | ||
jdv79 | i'm asking when its not | ||
brrt | .tell jnthn i can't repeat the issue outside of the compiler yet, and can't see anything obviously wrong with it | 14:01 | |
yoleaux | brrt: I'll pass your message to jnthn. | ||
jdv79 | context is cpanish things but i think in general its a valid question | ||
hoelzro | jdv79: what's this heuristic for? | 14:02 | |
jdv79 | determining if a file is p6 pod extractable | ||
14:02
diana_olhovik_ joined
|
|||
jdv79 | in this very specific case | 14:02 | |
but is it a bad thing, i guess i'm asking roudabout, to enforce the simple heuristics | 14:03 | ||
14:03
diana_olhovik left
|
|||
moritz | well, if a repo has a META.info, you could look into is "provides" section | 14:03 | |
jdv79 | huh? | 14:04 | |
hoelzro | ah | 14:05 | |
well, S02 says that use v6 is an indicator, or if the first non-comment non-empty line has /'unit'? ['module' || 'class' || 'grammar' || 'role']/ | |||
I think that listing is flexible | |||
if the first non-comment, non-empty line of a file contains a module, class, grammar, or role declaration | |||
you can consider it Perl 6 | |||
jdv79 | oh right, forgot about that. duh. | ||
thanks | 14:06 | ||
hoelzro | np | ||
moritz | jdv79: github.com/tadzik/Bailador/blob/ma.../META.info if you look into "provides", it lists all Perl 6 modules there | 14:07 | |
that way you don't need a heuristic at all | |||
colomon | moritz++ | ||
14:07
samarkand joined
|
|||
moritz | it won't work for separate .pod files, but then the "use v6;" heuristic doesn't work for those either | 14:08 | |
also we could add references to documentation files in META.info too | |||
jdv79 | yeah, its just a matter of how certain things poke at files in isolation | ||
samarkand | Hi, how can I do this? | ||
$my_template_str = "My string $var1 something"; | |||
# some stuff..... | |||
# and then applying some variable to $my_template_str | |||
$var11 = "aaabbb"; | |||
$my_template_str.apply($var1 => $var11); | |||
# => "My string aaabbb something"; | |||
sorry for the bad formatting | |||
14:08
brrt left
|
|||
jdv79 | trying to avoid large changes | 14:08 | |
moritz | samarkand: there's a very simple way: use a subroutine | 14:09 | |
hoelzro | FROGGS: interestingly enough, a newline between { and method fixes the problem | ||
samarkand | @mortiz, I mean, string interpolation or something | ||
moritz | samarkand: my $template = sub (:$var1) { " string $var1 something" } | ||
ShimmerFairy | moritz: as I understand, it's not called META.info. Or did I miss something? | ||
moritz | samarkand: and then my $result = $template( var1 => 'abc') | ||
jdv79 | hoelzro: where is that in S02 again? i'm blind. | 14:10 | |
moritz | ShimmerFairy: could also be META.json or so | ||
samarkand | thanks, is that the only way? | ||
hoelzro | jdv79: I have misquoted, looking | ||
ShimmerFairy | moritz: I wish we would settle on one name (I thought we had with META6.json). It's kinda annoying, honestly :/ | ||
14:10
diana_olhovik joined
|
|||
jnthn | m: my $template = { "My string $:var1 something" }; say $template(var1 => 'eats') # another way | 14:10 | |
yoleaux | 14:00Z <brrt> jnthn: using nqp i can make a reliable inlined-notinlined pair using a getlex to another frame | ||
camelia | rakudo-moar 0132b6: OUTPUT«My string eats something» | ||
yoleaux | 14:01Z <brrt> jnthn: i can't repeat the issue outside of the compiler yet, and can't see anything obviously wrong with it | ||
samarkand | jnthn, mortiz - that's it, thx | ||
jnthn | samarkand: That ways (wht $:foo placeholder params) is perhaps the least repetitive way I can think of :) | 14:11 | |
moritz | ShimmerFairy: aye; though the list in ecosystem points to the file directly, so it's only half bad | ||
14:11
FROGGS_ joined,
diana_olhovik_ left
|
|||
ShimmerFairy | moritz: for as long as we use the ecosystem over CPAN, at least :P | 14:11 | |
hoelzro | jdv79: design.perl6.org/S01.html#line_104 | ||
jnthn | .tell brrt Ugh...I think we may really have to catch the mis-lookup under the debugger to actually figure this one out, or just dump a crapload of debugging output | 14:12 | |
yoleaux | jnthn: I'll pass your message to brrt. | ||
moritz | ShimmerFairy: well, there's an easy fix: submit pull requests to all modules to change the name | ||
jdv79 | cpan uses META6.json as specced | ||
pink_mist | jnthn++ that template example was great! awesomely powerful feature of perl6 =) | ||
jdv79 | hoelzro: thanks | 14:13 | |
hoelzro | sure thing! | ||
moritz | ah yes, the good old $:foo trick | 14:14 | |
Math::Model uses that for good measure | |||
14:15
FROGGS left
14:18
diana_olhovik left
14:19
samarkand left
14:21
zakharyas joined
14:25
zakharyas left
|
|||
jdv79 | still stuff in the ecosystem that doesn't compile | 14:26 | |
14:32
diana_olhovik joined
|
|||
jdv79 | because of unit i mean | 14:33 | |
a little surprising | |||
[Coke] | ShimmerFairy: it's a bug in the spec, not a bug in rakudo. | 14:34 | |
yoleaux | 13:10Z <ShimmerFairy> [Coke]: I believe it's a mistake for you to reject RT #61602 -- it may not have a solution in the foreseeable future, but rejection should apply to tickets we _know_ are invalid, not tickets about the still-decided. 'stalled' is more appropriate for it, like it was | ||
[Coke] | once the spec issues are resolved, if the answer is "yes, we need that", then sure, we reopen the ticket. | ||
14:37
diana_olhovik left
|
|||
moritz | anybody want to discuss the security implications of NFG? | 14:37 | |
friends of mine organize a capture-the-flag contest, and I foolishly promised to write an exploitable service for them | 14:38 | ||
in Perl 6, no less :-) | |||
so, I thought about having a secret flag in a file that's in a decomposed form, and blacklist that name, but make is accessible via the composed form, or something | 14:39 | ||
or maybe that the character length of the file name is limited, and in NFG it's shorter than the limit because it's more compactly composed, or something | 14:40 | ||
anybody have any good ideas on an NFG-exploitable service that looks plausibly secure to somebody not familiar with NFG? | |||
14:43
skids joined
14:46
diana_olhovik joined,
yqt left
14:49
samarkand joined,
felher left
|
|||
samarkand | I wonder, what's the default or most popular naming convention? | 14:49 | |
Is it | |||
a) my-metho | |||
b) my_method | |||
It seems it's "a", doesn't it? But I do keep seeing "b" | |||
14:51
khw joined
|
|||
jdv79 | there's seems some sort of bent for kebabing | 14:52 | |
i don't get it - maybe because it can be done | 14:53 | ||
14:53
diana_olhovik_ joined
14:54
diana_olhovik left
|
|||
samarkand | I wonder, what's the default or most popular naming convention? | 14:54 | |
Is it a) 'my-method' or b) 'my_method' | |||
It seems it's "a", doesn't it? But I do keep seeing "b" as well. | |||
jdv79 | a | ||
aka kebab casing | |||
samarkand | ok | ||
14:55
samarkand left
|
|||
jdv79 | design.perl6.org/S99.html#kebab_case | 14:55 | |
awwaiid | yay new rakudo star! | 14:57 | |
14:57
diana_olhovik joined,
diana_olhovik_ left
|
|||
awwaiid | I offered to show rakudo off to some people here at StrangeLoop (all of you should be here, btw), but haven't had takers. I might start tackling people. I REALLY wish I had hit the deadline and had a chance of presenting here... this is definitely a prime target audience | 14:58 | |
14:59
mn080202 joined
|
|||
mn080202 | hey guys can I call methods on action object from lambda inside of grammar? | 15:00 | |
*or girls | |||
so I want inline action in a grammar to call method on action object when parsing | 15:01 | ||
is that possible | |||
or do I have to have a method on the grammar to do it like <.methodIwanttocall> | |||
moritz | mn080202: iirc the actions object is in $*ACTIONS, so you can just call a method on it | 15:02 | |
mn080202 | thanks moritz you are the man | 15:03 | |
moritz | mn080202: you're welcome | 15:04 | |
15:04
mattprelude joined,
diana_olhovik left
|
|||
confuseAcat | wouldn't it be cool if rakudo.org/how-to-get-rakudo/ reflected the latest release? | 15:05 | |
[Coke] | RT: 1,024; GLR: 4, WEIRD: 12, LTA: 78; testneeded: 9; xmas: 98 | 15:06 | |
[ptc] sometimes wonders if [Coke] is a bot... | |||
[Coke] | That's interesting. Please continue. | 15:07 | |
15:08
skids left
|
|||
[ptc] gets eliza flashbacks from the 90's | 15:08 | ||
15:09
diana_olhovik joined
|
|||
[Coke] | Why do you think that? | 15:10 | |
raydiak | good morning, #perl6 | 15:11 | |
15:12
mn080202 left
|
|||
[Coke] | regarding stress test chat from the other day - we might want to re-evaluate the stress tests and see if we can pull any into spectest. | 15:12 | |
given speed improvements, it might be possible for us to get better coverage in the common case. | |||
15:13
felher joined
15:15
yqt joined
15:17
diana_olhovik_ joined,
mn080202 joined,
diana_olhovik left,
ggoebel2 left
15:18
pmurias joined
|
|||
pmurias | hi | 15:18 | |
mn080202 | @moritz the thing you showed me before where can one find doc's for it | ||
hoelzro | m: class Foo { method bar { } #= baz}; say Foo.WHY | 15:20 | |
camelia | rakudo-moar 0132b6: OUTPUT«baz» | ||
hoelzro | ah ha | ||
it's all clear now | |||
"Declarator blocks that start with #= attach to the declarator declared at the start of the line immediately before them." | 15:21 | ||
it *is* up to spec it seems, but definitely LTA | |||
[Coke] | stresstest failures in t/spec/S02-types/WHICH.t and t/spec/S05-transliteration/trans.t | 15:22 | |
nine | [Coke]: there are certainly stresstess that are not that stressfull at all | 15:23 | |
15:27
_mg_ joined
|
|||
pmurias | hoelzro: what would be the awesome choice here? warn in such cases? | 15:35 | |
[Coke] | timtoady, lizmat: t/spec/S16-io/quoting-syntax.t - this appears to be testing something that isn't in the specs any more. might be removable. | ||
hoelzro | pmurias: that's a good question =/ | ||
lately, I often find myself divided between warnings in the compiler and having a really nice linter | 15:36 | ||
15:37
tokuhiro_ joined
|
|||
pmurias | tools support for Perl 6 is lacking at the moment :( | 15:38 | |
dalek | ast: 7666314 | moritz++ | S12-attributes/mutators.t: Clean up S12-attributes/mutators.t |
15:39 | |
15:39
kaare__ joined
15:40
ggoebel joined
15:42
tokuhiro_ left
|
|||
[Coke] | t/spec/S03-operators/shortcuts.t looks dodgy. | 15:43 | |
15:48
brrt joined
15:51
zed_ joined
|
|||
masak | hoelzro: just to be clear, what is it that's LTA about that formulation? is it the "start of the line" bit? | 15:58 | |
(and yes, I think I agree. that goes against expectations, and isn't very considerate to one-liners) | |||
[Coke] | how often are you using docs on a one liner? | 16:02 | |
16:03
diana_olhovik joined
16:04
diana_olhovik_ left
|
|||
TimToady | the main thing you're declaring on a line is usually the first thing; otherwise you'll be attaching stuff to the last item in the signature, if it's on the same line | 16:05 | |
16:06
pmurias left
16:08
pmurias joined
16:14
_mg_ left
16:17
ShimmerFairy left
|
|||
masak | I agree with TimToady, but if I saw such a doc-comment right after a method, I would probably assume it was for the method, not the class. if it was for the class, I'd expect it to occur after the class. | 16:17 | |
*mumble mumble* Least Surprise | |||
16:18
rurban left
|
|||
TimToady | maybe #= can't see inside parens? | 16:18 | |
zostay | m: my %x = foo => 1, bar => 2; baz => 3, qux => 4; dd %x; # DANGER DANGER WILL ROBINSON | 16:22 | |
camelia | rakudo-moar 0132b6: OUTPUT«Hash %x = {:bar(2), :foo(1)}» | ||
16:22
spider-mario left
|
|||
TimToady | that oughta warn about Useless use of...something... | 16:23 | |
16:24
spider-mario joined
16:26
Begi joined
|
|||
Begi | I'm using the simple code of doc.perl6.org/type/IO::Socket::INET. I've this error : Failed to connect : connection refused. I don't think this is my firewall. An ideas ? Thanks | 16:29 | |
16:30
ShimmerFairy joined
|
|||
dalek | p: 0198475 | (Pawel Murias)++ | src/vm/js/ (9 files): [js] Store the contents of hashes in a separate inner object. Support elems on hashes. |
16:30 | |
p: 7914bf6 | (Pawel Murias)++ | t/nqp/18-associative.t: Test calling nqp::elems on hashes. |
|||
nine | Ok, I successfully created an EnumHOW based Boolean class in BOOTSTRAP that has a gist method. Now if I try to give it a proper multi method gist, things get difficult. If I just do that, the build complains about the missing proto. But I've not found a way to create that proto | 16:34 | |
[Coke] has trouble running the profile html in chrome. keeps asking me if I want to kill it. | 16:37 | ||
brrt | know i know why there are so many germans in #perl and #perl6. in german, there is also more than one way to do it | 16:39 | |
yoleaux | 14:12Z <jnthn> brrt: Ugh...I think we may really have to catch the mis-lookup under the debugger to actually figure this one out, or just dump a crapload of debugging output | ||
nine | brrt: so you say that Perl is a good fit for a German native brain? | 16:40 | |
or Germanic probably | |||
brrt | seems like a decent hypothesis | 16:41 | |
in translating, i was thinking to myself 'but why didn't they use this other construct for consistency' | |||
dalek | osystem: 53f978b | timotimo++ | META.list: i've renamed a bunch of META.info to META6.json |
16:44 | |
osystem: d54bd92 | timotimo++ | META.list: another rename of META.info to META6.json |
|||
flussence facepalms (no wonder they mysteriously stopped working the first time I tried that in the code repo...) | 16:45 | ||
dalek | k-simple: 1aaee2b | timotimo++ | META (2 files): rename META.info -> META6.json |
16:47 | |
p: b9d9198 | (Pawel Murias)++ | src/vm/js/nqp-runtime/serialization.js: [js] serialize hashes |
16:48 | ||
[Coke] | fired up the profile in firefox, getting a lot of inclusive times of Inf & NaN. :( | 16:49 | |
16:50
Begi left
|
|||
timotimo | [Coke]: yes, i've seen things like that, too ... and i don't really have an idea why that happens ;( | 16:50 | |
dalek | p: dc5da29 | (Pawel Murias)++ | src/vm/js/QAST/Compiler.nqp: [js] Implement nqp::bindpos_s. |
16:51 | |
16:51
travis-ci joined
|
|||
travis-ci | NQP build failed. Pawel Murias '[js] serialize hashes' | 16:51 | |
travis-ci.org/perl6/nqp/builds/82316551 github.com/perl6/nqp/compare/7914b...d9198dd36e | |||
16:51
travis-ci left
|
|||
timotimo | 362 META.info, 12 META6.json | 16:51 | |
in the ecosystem META.list | |||
flussence | [Coke]: might be something to do with 32-bit number cutoffs in JS and microseconds? That would cause problems for values around 35 or 70 minutes depending on if it's signed or not | 16:54 | |
16:54
travis-ci joined
|
|||
travis-ci | NQP build failed. Pawel Murias '[js] Implement nqp::bindpos_s.' | 16:54 | |
travis-ci.org/perl6/nqp/builds/82316931 github.com/perl6/nqp/compare/b9d91...5da29a855b | |||
16:54
travis-ci left
16:56
colomon left
|
|||
flussence | (that doesn't seem right though, I'm pretty sure JS silently promotes ints to floats on overflow...) | 16:56 | |
16:57
brrt left
|
|||
AlexDaniel | how can I "break" multiple loops? | 16:58 | |
flussence | m: outer: loop { loop { say 1; last outer; } }; say 2 | 16:59 | |
camelia | rakudo-moar 0132b6: OUTPUT«12» | ||
AlexDaniel | ok, what about "break 2;" ? | ||
TimToady | why do you want to break things? | 17:01 | |
AlexDaniel | I mean, it is a frequent problem when you want to break out of multiple loops, and creating a label (or whatever it is called) is too difficult to type! | ||
I wish I could just say "break 2" to get out from two loops, that would be great | |||
TimToady | no it wouldn't, what if you miscount? | 17:02 | |
AlexDaniel | then I'd expect some awesome error message | ||
TimToady | how would it detect that you miscounted? | ||
flussence | .oO( I usually use «return» for that, keeps my subs from growing to insane complexity ) |
17:03 | |
AlexDaniel | I don't know? "torture the implementor on behalf of the user"… | ||
TimToady | and should it count hidden loops in closures and such? | ||
does it count the implicit loop in grep and map? | |||
labels are really much saner | 17:04 | ||
AlexDaniel | maybe! That being said, I think that I can count up to two… Sometimes I can count up to 3, when I really need that. But that happens tops 1 time in a year… | 17:06 | |
And if it was implemented, I'd expect it not to count anything besides explicit loops that I've typed | 17:07 | ||
I don't think that I've ever wanted to jump out of anything like that | 17:08 | ||
but jumping out of two of my own explicit loops is pretty frequent | |||
m: outer: loop { loop { say 1; last owter; } } say 2; | 17:13 | ||
camelia | rakudo-moar 0132b6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/rWqzRE7lHWStrange text after block (missing semicolon or comma?)at /tmp/rWqzRE7lHW:1------> 3er: loop { loop { say 1; last owter; } }7⏏5 say 2;» | ||
AlexDaniel | m: outer: loop { loop { say 1; last owter; } }; say 2; | ||
camelia | rakudo-moar 0132b6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/UQoYbSSvXaUndeclared routine: owter used at line 1» | ||
AlexDaniel | shouldn't it say “undeclared label”? | ||
masak | arguably, yes. | 17:14 | |
AlexDaniel | m: my $test = 'outer'; outer: loop { loop { say 1; last $test; } } say 2; | 17:15 | |
camelia | rakudo-moar 0132b6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_fbuLShMhqStrange text after block (missing semicolon or comma?)at /tmp/_fbuLShMhq:1------> 3er: loop { loop { say 1; last $test; } }7⏏5 say 2;» | ||
masak | also, Levenshtein. | ||
AlexDaniel | m: my $test = 'outer'; outer: loop { loop { say 1; last $test; } }; say 2; | ||
camelia | rakudo-moar 0132b6: OUTPUT«1Cannot call last(Str); none of these signatures match: () (Label:D \x) in block <unit> at /tmp/lKSxzLUfcw:1» | ||
masak | I'm glad that one doesn't work :) | 17:17 | |
17:17
yqt left
17:19
rindolf left
|
|||
AlexDaniel | m: say Label.Int | 17:20 | |
camelia | rakudo-moar 0132b6: OUTPUT«46809168» | ||
AlexDaniel | m: say Label.Int | ||
camelia | rakudo-moar 0132b6: OUTPUT«68591696» | ||
AlexDaniel | m: Label.last | 17:22 | |
camelia | rakudo-moar 0132b6: OUTPUT«control exception without handler in block <unit> at /tmp/7X8ICvNxsN:1» | ||
17:24
_mg_ joined
17:25
brrt joined
|
|||
timotimo | arguably, those shouldn't work on undefined labels, eh? | 17:26 | |
m: say Label.defined | |||
camelia | rakudo-moar 0132b6: OUTPUT«False» | ||
17:27
rindolf joined
|
|||
AlexDaniel | timotimo: I've no idea. This is just so weird… | 17:27 | |
timotimo: I will not submit a report just because I don't get it… :) | 17:28 | ||
timotimo | what exactly is weird to you about this? | 17:29 | |
AlexDaniel | I mean, Label.Int – what is this and why would anybody want to do that? | 17:30 | |
timotimo | you'd not really likely want to do that | ||
.Int returns the nqp::where of the label | |||
AlexDaniel | should that even be accessible for regular users? | 17:32 | |
timotimo | well, that's kind of how you differentiate them, i guess? | ||
hm | 17:33 | ||
well, there's .gist which shows more info | |||
AlexDaniel | m: outer: loop { loop { say 1; last last last last last; } }; say 2; | 17:34 | |
haha | |||
camelia | rakudo-moar 0132b6: OUTPUT«(timeout)11111111111111111111111111111111111111111111111111111111111111…» | ||
timotimo | i don't think "last last" works | ||
AlexDaniel | of course not | 17:35 | |
timotimo | what does that even do? %) | ||
the same as "last" would do? | |||
AlexDaniel | yeah | ||
timotimo | because last returns .. Any? | ||
Nil? | |||
AlexDaniel | doesn't really matter? | ||
timotimo | right | ||
AlexDaniel | but that's an interesting question, why would anybody want to use last in non-void context? | 17:36 | |
maybe in ?? !! | |||
17:39
rindolf left,
tokuhiro_ joined
17:43
tokuhiro_ left
17:46
rindolf joined
|
|||
flussence | m: my $r = do loop { loop { last; } }; say $r | 17:48 | |
whoops | |||
m: my $r = outer: do loop { loop { last outer; } }; say $r | |||
camelia | rakudo-moar 0132b6: OUTPUT«(timeout)» | ||
rakudo-moar 0132b6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_THUJPl5NBConfusedat /tmp/_THUJPl5NB:1------> 3my $r = outer:7⏏5 do loop { loop { last outer; } }; say $ expecting any of: colon pair» | |||
flussence | well that answers that... | ||
moritz | m: my $r = do { outer: loop { loop { last outer } }; say $r.perl | 17:55 | |
camelia | rakudo-moar 0132b6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/FF5DUgkj69Missing blockat /tmp/FF5DUgkj69:1------> 3oop { loop { last outer } }; say $r.perl7⏏5<EOL> expecting any of: postfix statement end statement modifier…» | ||
moritz | m: my $r = do { outer: loop { loop { last outer } } }; say $r.perl | ||
camelia | rakudo-moar 0132b6: OUTPUT«Label.new» | ||
[Coke] | "my $x = last;" kills the REPL. | 17:58 | |
moritz | it probably last()s the L in repL :-) | 17:59 | |
mr_ron | moritz: You revised S12-attributes/mutators.t. Should I close github.com/perl6/roast/issues/71? | 18:00 | |
moritz | mr_ron: yes please | 18:01 | |
18:02
FROGGS_ is now known as FROGGS
|
|||
mr_ron | done | 18:02 | |
FROGGS | .tell jnthn I try to implement 'my $a; "a" ~~ /$a=[.]/' and fail to do that in P6::A... is that something I should be able to do in the actions? | 18:03 | |
yoleaux | FROGGS: I'll pass your message to jnthn. | ||
mr_ron | Just a last grumble. FETCH for the proxy is sort of an accessor method for an attribute. Normal accessor methods for attributes only get called once to get the value why should we allow the FETCH method to be called multiple times to get the value once? | 18:05 | |
brrt | .tell jnthn (poor jnthn for all the spam) i've created a gist with dynvar log results: gist.github.com/bdw/992dfd5b69b7d42f2239 | 18:11 | |
yoleaux | brrt: I'll pass your message to jnthn. | ||
brrt | i'm pretty sure he's going to see the same interesting thing :-) | ||
moritz | mr_ron: the compiler needs the value for type-checking, for example | 18:13 | |
mr_ron: it's not about return values; it's being allowed to read values; and proxies are special in that reading a value can have a side effect | 18:14 | ||
mr_ron | ... checking whether the same could be said for ordinary custom object attr accessors ... | 18:16 | |
m: class C{has $.a = 0; method a{ return 42 + ++$!a }}; my $o = C.new; say $o.a; say $o.a; | 18:19 | ||
camelia | rakudo-moar 0132b6: OUTPUT«4344» | ||
mr_ron | m: class C{has Int $.a = 0; method a returns Int { return 42 + ++$!a }}; my $o = C.new; say $o.a; say $o.a; | 18:21 | |
camelia | rakudo-moar 0132b6: OUTPUT«4344» | ||
18:26
brrt left
18:30
domidumont left,
larion left
18:32
yqt joined
|
|||
mr_ron | It still doesn't make sense to me so maybe I'll do more research on Proxies and take up the question in that context ... | 18:32 | |
18:46
aristotle left
|
|||
timotimo | For more information, see the perl6(1) man page. | 18:46 | |
do we actually have that? | 18:47 | ||
raydiak | mr_ron: I've looked at it like this: a method *returns* a value (in normal use), but a Proxy *is* a value (albeit a special one). If you take an ordinary value and pass it around, ordinary stuff happens. If you take a Proxy and pass it around, it does special stuff for every read or write (even internal to rakudo), because that's what it's designed to do. | 18:49 | |
18:50
leont joined
|
|||
raydiak | mr_ron: iow the difference is that an accessor runs the code once and returns a value that you use, while a Proxy is re-called for every access and (possibly) returns a new value every time | 18:54 | |
mr_ron | just got back ... | 18:55 | |
Sort of the heart of the problem I see is that if you want an object attribute mutator you need a Proxy which gives you a FETCH accessor which may now be called more than once to get the value of the attribute once. A mutator by proxy seems to mean a potentially difficult or broken attr accessor. | 19:00 | ||
timotimo | huh why? | ||
mr_ron | why what? | 19:01 | |
psch | Seq in a Proxy is something that immediately comes to mind as "weird" | ||
or "from a Proxy" | 19:02 | ||
timotimo | why would that mean "a potentially difficult or broken attr accessor"? | ||
psch | although i'd question the design decision behind putting a Seq into an Attribute | ||
AlexDaniel | timotimo: I don't think that there is a man page, but there is going to be one eventually, I guess | 19:03 | |
timotimo: where can you see that message? | |||
timotimo | perl6 --help | ||
AlexDaniel | timotimo: I mean, is it going to be displayed if you're using for example windows? | ||
timotimo | i was looking for the name of the module debug env var | ||
AlexDaniel | I'm not sure that there is “man” for Windows… | ||
psch | rakudo-specific env vars are terribly underdocumented :/ | 19:04 | |
RAKUDO_ERROR_COLOR is the worst offender, in my opinion | |||
'cause it checks for "%*ENV<RAKUDO_ERROR_COLOR> // !$is-win;" | |||
which is assigned to $color | 19:05 | ||
which in turn is treated as "do we want color" | |||
so it needs RAKUDO_ERROR_COLOR to exist but be False... | |||
AlexDaniel | “--optimize=[level] use the given level of optimization (0..3)” – which value is default? | ||
FROGGS | AlexDaniel: 3 | 19:06 | |
AlexDaniel | nice | ||
FROGGS | and 'off' is also a valid level | ||
timotimo | hold on | ||
no, 2 is normal, 3 is used for the setting | |||
FROGGS | ahh, interesting | ||
mr_ron | Accessors can have side effects, even ordinary accessor methods. Ordinary object attr accessor methods only run once to get their results. The FETCH version may run more than once. | ||
AlexDaniel | hm | ||
psch | mr_ron: auto-generated accessors can have side-effects? | 19:07 | |
mr_ron | not auto-generated but custom ones yes | ||
psch | oh, yeah custom ones are just methods after all | 19:08 | |
mr_ron | m: class C{has Int $.a = 0; method a returns Int { return 42 + ++$!a }}; my $o = C.new; say $o.a; say $o.a; | ||
camelia | rakudo-moar 0132b6: OUTPUT«4344» | ||
psch | i'm not sure i'd still call that an accessor, fwiw | 19:09 | |
but maybe that's Java-damage, 'cause accessor is pretty much getter for me, which should just return the value | |||
...which is of course an implicit contract, but seems useful enough to me to assume | |||
mr_ron | An accessor could fetch a web page and have a side effect on the remote web server for example. | 19:10 | |
I guess we don't actually have working object attr mutators yet and the question isn't urgent. | 19:11 | ||
raydiak | if it's not meant to re-fetch the page every time, you might want to cache the result inside the FETCH, e.g. with a state var | 19:12 | |
raydiak thinks of side-effects in FETCH as falling under the "enough rope to hang yourself" category :) | |||
psch | raydiak: i pretty much agree | ||
an accessor that needs to fetch a remote value isn't an accessor to me | |||
if the object needs the remote value, i'd fetch it in &new or &BUILD | 19:13 | ||
that's of course preference :) | |||
mr_ron | An example that just popped into my head - fetching from a sequence generator in a database ... | 19:16 | |
dalek | rl6-roast-data: a0d610d | coke++ | / (9 files): today (automated commit) |
19:17 | |
psch | but that'd be something like "method getNextId { $db.getCurrentId + 1 }", which is not a value inherent to the object | ||
(plus neccessary async precautions etc) | 19:18 | ||
psch is probably mostly arguing that accessors *should* be side-effect free by definition | |||
which means the language is not at fault when someone builds something that *has* side-effects and calls it an accessor | 19:19 | ||
19:19
nowan left
|
|||
mr_ron | What if the accessor needs to access a remote resource that has a limit on the number of accesses per minute/hour etc. | 19:22 | |
yes you can code around it | |||
It still looks to me like you coded a class with an ordinary custom attribute accessor and then when you recoded for a mutator and put the accessor code in the FETCH method the multiple accesses could cause trouble. | 19:25 | ||
psch | mr_ron: i'm sorry, this looks to me like "if you stuff that it's safe it might be blow up" | ||
mr_ron: that's not saying you can't have a point there | |||
mr_ron: i just don't see it | |||
err | 19:26 | ||
"if you code stuff that isn't safe" | |||
psch suspicously eyes the keyboard | |||
mr_ron | In regular Perl accessor methods can have side effects. I think that's true of most languages. Give me an example of a major programming language where you can't? | 19:29 | |
psch | now we're back at semantics. i'm coming from a Java-POV, where an accessor is a getter, which is a method that accessed and returns a value that's internal to the class | 19:31 | |
19:31
FROGGS left,
nowan joined
|
|||
psch | if an accessor can have side-effects, it's not a getter | 19:31 | |
if it's not a getter, none of the things i said apply, because i am working under the assumption that it is a getter | |||
if it is a getter, it can't have side-effects, otherwise it's not a getter | |||
the important phrase here is "internal to the class", i suppose | 19:32 | ||
19:32
apotheon left
|
|||
psch | if you have a method that returns a value that's not internal to the class *i* *personally* wouldn't call that an accessor | 19:32 | |
19:33
apotheon joined,
kaare__ left
|
|||
psch | wikipedia calls an accessor method a "[method] which returns the value of the private member variable" | 19:33 | |
to clarify: it's not about "you can't write a method that returns and changes a value" it's about "you can't call a method that changes an accessor" | 19:35 | ||
at least that's where i see the communicative dissonance | 19:36 | ||
19:37
cognominal joined
|
|||
raydiak | has $!id; method id { Proxy.new: FETCH => { $!id //= $db.getNextID }, STORE => -> $, $v { $!id = $v } } looks pretty usable to me | 19:38 | |
19:38
mn080202 left
19:39
pmurias left
|
|||
psch | raydiak: again, agreed. i'd struggle to call it an accessor though | 19:39 | |
mr_ron | Now it looks like you can only get one sequence number from the database for the object ever, which doesn't look right ... | ||
my $first = $obj.id; my $second = $obj.id; | 19:40 | ||
looks like they get the same value which doesn't look right | 19:41 | ||
raydiak | ah I see, thought you meant an id for the object with the id method...then perhaps this is what you want: method id { my $id; Proxy.new: FETCH => { $id //= $db.getNextID }, STORE => -> $, $v { $id = $v } } | ||
19:41
pmurias joined
|
|||
raydiak | every call to .id will return a new proxy with it's own $id | 19:41 | |
now, with that said, I do see what you're saying, and it would be nice to have a way to write it without the Proxy/caching complication...have often wished the rval could be part of the signature, myself | 19:42 | ||
mr_ron | I think you may be right about the sequence example but I have to leave for an appointment now. BBL. | 19:43 | |
raydiak | np, good luck | ||
lizmat | messages ? | 19:45 | |
yoleaux | 12:25Z <FROGGS> lizmat: I commented: gist.github.com/lizmat/f3807956c35...nt-1582671 | ||
raydiak | is it too late to add rval(s) to the signature, separated from the normal params list by a '=', complete with multidispatch? :) | ||
psch | ...i'm not sure i can imagine what that's supposed to look like or do | 19:47 | |
20:04
telex left
20:06
telex joined
|
|||
moritz | raydiak: uhm, you do know that = introduces a default value? | 20:08 | |
20:09
pmurias left
20:13
xfix left
|
|||
masak | I have jotted down a few notes about macros and the direction I think we should take them in Perl 6. the gist is called "three types of macros": gist.github.com/masak/13210c51f034f931af0c | 20:14 | |
comments are greatly appreciated and warmly welcomed, etc. etc. | 20:15 | ||
grondilu | m: say (1/3).base-repeating | 20:16 | |
camelia | rakudo-moar 0132b6: OUTPUT«(0. 3)» | ||
masak | I still don't have all the answers, but things are becoming much clearer since YAPC::EU. | ||
lizmat | .tell FROGGS I commented on your comment on gist.github.com/lizmat/f3807956c354c14902a3 | ||
yoleaux | lizmat: I'll pass your message to FROGGS. | ||
masak | m: say (1/7).base-repeating | 20:17 | |
camelia | rakudo-moar 0132b6: OUTPUT«(0. 142857)» | ||
psch | masak: the ordering for "ex1 compute()" seems confusing? | ||
masak: that is, the commented/to-be-expected-output | |||
masak | psch: arguments are evaluated before they are sent to ex1 | ||
psch | masak: yes, but &compute doesn't &say | 20:18 | |
masak | hm, yes. | ||
fixing. | |||
fixed, hopefully: gist.github.com/masak/13210c51f034f931af0c | 20:19 | ||
psch++ | |||
psch | m: my $x = -> { say "foo" }; $x; | ||
camelia | rakudo-moar 0132b6: OUTPUT«WARNINGS:Useless use of variable $x in sink context (line 1)» | ||
psch | m: my $x = sub { say "foo" }; $x; | ||
camelia | rakudo-moar 0132b6: OUTPUT«WARNINGS:Useless use of variable $x in sink context (line 1)» | ||
psch | masak: ^^^ that still kind of throws a wrench in there, i think? | 20:20 | |
unless macros in SINK always .CALL-ME() (or something like that...) | |||
masak | well, let's work this out. | ||
in the ex1 case, compute() is called in the mainline, so we're fine there. | 20:21 | ||
psch | ah, right | ||
masak | in the ex2 case, `compute()` is *sent* in that form as a Qtree, and then evaluated in the quasi. | ||
psch | and ex2 also calls explicitely | ||
yeah | |||
masak | so we're fine there :) | ||
psch | i didn't pay enough attention to the calls to ex{1,2} there :) | ||
masak | *nod* | ||
talking about macros is confusing by default :) | 20:22 | ||
psch | oh, but | ||
sub ex1($value) { ... $arg; ... } | |||
masak | heh | ||
fixing | |||
psch | :) | ||
20:24
darutoko left
|
|||
masak | fix'd: gist.github.com/masak/13210c51f034f931af0c | 20:24 | |
psch | the "Unhygiene" section is wonderful, masak++ | 20:25 | |
masak | :D | ||
20:26
rurban joined
|
|||
timotimo likes it, too | 20:34 | ||
masak | maybe I should have a motivating example of unhygiene, too. | ||
grondilu | m: printf "%s(%s)", |(355/113).base-repeating | ||
camelia | rakudo-moar 0132b6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LGMytANGEQVariable '%s' is not declaredat /tmp/LGMytANGEQ:1------> 3printf "%s(7⏏5%s)", |(355/113).base-repeating» | ||
masak | but that's a little bit of uncharted territory, still. | ||
maybe we can find a good example from some other macro-blessed language. | |||
grondilu | m: printf '%s(%s)', |(355/113).base-repeating | ||
camelia | rakudo-moar 0132b6: OUTPUT«3.(1415929203539823008849557522123893805309734513274336283185840707964601769911504424778761061946902654867256637168)» | ||
timotimo | can we do better than to create a Scalar container to hold the capture when we have a method foobar(|args) ? | 20:35 | |
masak | Common LISP rather than Scheme, I guess... | ||
20:35
tokuhiro_ joined
|
|||
grondilu | m: printf '%s(%s)', |(1/30).base-repeating | 20:35 | |
camelia | rakudo-moar 0132b6: OUTPUT«0.0(3)» | ||
20:36
vendethiel joined
|
|||
psch | masak: the last two paragraphs make me want to grasp for "use" and "no" for visitor macros | 20:36 | |
masak: i'm pretty sure that's a not-so-great idea, but that's what the writing seems to lead to | |||
20:37
mr_ron left
20:39
tokuhiro_ left
20:40
_mg_ left
|
|||
psch | i like the hint of s-expr that comes through in the whole gist | 20:40 | |
especially the "Visitor macros" section | |||
as in, with those we'd have predeclarable ways of complete code transformation | 20:41 | ||
which starts at linting/coding-standards and doesn't really stop | |||
that's to say, we'd gain a mechanism that allows code transformation on a level pretty close to what LISPs allow | 20:46 | ||
although i suppose in the end that hangs on the exact Qtree implementation | 20:47 | ||
(i realize that was pretty much the idea behind it, but i've not really paid close attention before, shelving it as something that's probably beyond me...) | |||
masak | yes, Qtrees are the "hidden player" which would make much of this work. | 20:48 | |
also absent from that gist (but which I know a fair bit more about nowadays) is the distinction between "analytic Qtrees" and "synthetic Qtrees". | 20:49 | ||
that is, the parser can create a Qtree, or you can create a Qtree, and they won't end up being exactly the same. | 20:50 | ||
mainly because the parser has the benefit of parsing thing in a context, and "annotation" its Qtree with that context. (surrounding declarations, etc) | |||
but the Qtrees built node-by-node by the user are "free-floating" until they're actually attached/splied into the program. only then can they get such a context. | 20:51 | ||
specifically, a Qtree that you built with something like `$x = 5;` is never illegal, but it might cause a compilation error when you add it to a part of the program which doesn't have `$x` declared. | 20:52 | ||
vendethiel | psch: I disagree it's a bad idea | 20:54 | |
masak | vendethiel: did you mean "I disagree, it's a bad idea" or "I disagree that it's a bad idea"? :) | 20:55 | |
also, what idea? | |||
vendethiel | masak: second. the idea being "enable or disable visitor macros using 'use' and 'no'" | ||
masak | actually, that's how I envisioned they'd be pulled in normally. | 20:56 | |
20:56
diana_olhovik left
|
|||
psch | i dislike the conflation, mostly | 20:56 | |
masak | but I'm thinking there might also be a lower-level API for that, something where you register visitors on a given parser. | ||
psch | "use/no" for pragmas, modules, vmacros | ||
seems a bit much to me | 20:57 | ||
masak | they all share a certain goal -- pulling something in from the outside. | ||
I'd much rather have "use/no" than "use-module"/"no-module", "use-pragma"/"no-pragma", "use-vmacro"/"no-vmacro" | |||
psch | i suppose arguing from the alternatives i can't disagree | 20:58 | |
as in, having distinct keywords for each would be horrible, yes | 20:59 | ||
masak .oO( strawman accomplished! ) :P | |||
psch | :P | ||
21:00
mr_ron joined
|
|||
psch | i mean, there's no reason why vmacros are the one thing that "do something similar but are imported differently" | 21:00 | |
compared to pragms and moduels (and slangs) | |||
masak | I see vmacros as pretty similar to routines, actually. they don't get called by the user code, but they *do* get called by the parser that reads the user code. | 21:01 | |
lizmat | .tell ugexe I hopefull answered your questions in gist.github.com/lizmat/f3807956c354c14902a3 | ||
yoleaux | lizmat: I'll pass your message to ugexe. | ||
masak | for this reason, they don't really need a name and a place in a lexpad or symbol table. but maybe having a name there helps sometimes. | ||
psch | (fwiw, vmacros and slangs are becoming pretty much TWTDI in my head by now) | ||
lizmat | afk again& | 21:02 | |
psch | that's not *the* but *two* :) | ||
masak | TWTDI? "The Worst Thursday Double Integral"? | ||
psch | two ways to do it :P | 21:03 | |
masak | to me it's more like the difference between BUILD and new | ||
you can use BUILD as long as you're fine with just sending positionals to the default .new method -- that is, you're not changing the default interface of the object | |||
similarly, you can keep using macros (in all their flavors) if you're staying reasonably within limits of what the language already does | 21:04 | ||
ramping up, you might reach for `is parsed` or syntax macros or both | |||
but at some point that grows unwieldy, kinda like a bunch of scattered regexes that want to be a grammar | 21:05 | ||
and then you'd consolidate things into a slang (API pending) | |||
psch | the regex :: grammar analogy makes sense to me... :) | 21:07 | |
masak | sorry for the wonky analogy :) but both `method new` and slangs are for when the things already provided by default are not enough and you need to change things *more* | ||
psch | yeah, that's how i'd order it too | ||
masak | `method new` helps override the default signature of the constructor. (and I meant "nameds" above, not "positionals") | 21:08 | |
psch | macros can fix a few hickups here and there, while slangs can turn everything into COBOL | ||
just like &new can let you BUILD your god object from a single hash | |||
masak | slangs help put you in a new (sub-)language, either a completely different one or one that's "mostly Perl 6 main" or (like regexes) one where Perl 6 main isn't all that far away. | ||
psch: right, exactly. | 21:09 | ||
it's different steps up the power ladder. | |||
in 9 out of 10 classes, I'm content with defining BUILD. | |||
awwaiid | which will let me make it so I can put whitespace around method invocation and move the --> ReturnType outside of the parens? | 21:10 | |
(which I think are my top-two warts) | |||
(I should make a personal wart list) | 21:11 | ||
masak | yes, please make a personal wart list. | ||
21:11
rurban left
|
|||
mst | I'm assuming the perl5 rule of 'if you defined your own new() method you've already gone too far' tends to apply | 21:11 | |
masak | awwaiid: both of those sound more slang-y to me. since they change syntax. | ||
awwaiid | masak++ # encouraging things | ||
I am also ok if they are fixed in the core language :) | 21:12 | ||
masak | mst: that's a personal rule of mine, yes, which I hadn't really verbalized. but yes. | ||
mst | awwaiid: $foo.bar\n .baz is my big objection | ||
awwaiid | yes, exactly that | ||
masak | mst: as time goes by, I'm less and less tempted to override .new | ||
mst | awwaiid: I like lining up method calls vertically | ||
masak | good news, awwaiid and mst: there's already a slang for this! :D | ||
it's called Slang::Tuxic | |||
awwaiid | I had a really nic elooking chain going on and it was so beautiful but didn't work | ||
mst | masak: no, it isn't | ||
awwaiid | orly | ||
mst | awwaiid: if you stick a \ on the end of each line ala Tcl it works for the moment | ||
masak | github.com/FROGGS/p6-Slang-Tuxic/ | 21:13 | |
mst | Slang::Tuxic does a bunch of whitespace related stuff, most of which is weird | ||
21:13
rurban joined,
rurban left
|
|||
masak | heh, no arguments there :) | 21:13 | |
awwaiid | ah yeah. really it is specifically the one mst mentioned that has hit me a few times | ||
I ended up using several .= because it was prettier | |||
mst | masak: yeah, so please don't say "there's a slang for this" | ||
masak | mst: not really sure I understand your objection, but OK. | 21:14 | |
mst: Slang::Tuxic does more than you want? | |||
mst | it introduces a bunch of things I actively don't want | ||
like, say, every single other change it makes | |||
awwaiid | yeah. I am totally fine with no-space-allowed between method and param paren | ||
mst | "there is a slang from which what you want could totally be extracted", OTOH, I will absolutely stipulate to | 21:15 | |
21:15
rindolf left
|
|||
mst | it's just a question of which of the bajillion people annoyed by this gets to it first | 21:15 | |
awwaiid reads source | |||
This is definitely one of those which I would place money on will be Really Annoying for Every New Beginner Ever | |||
masak | I see three things Slang::Tuxic does (though I may have missed things) | ||
(a) allow whitespace in "$obj .meth" | 21:16 | ||
(b) allow whitespace in "$thing {'lookup'}" | |||
(c) allow lack of whitespace in "sub(){}", specifically the lack after "sub" | |||
mst | pretty sure it allows 'thing (<args>);' | 21:17 | |
masak | yeah -- all those things can go under (b), I guess. | 21:18 | |
awwaiid forks. starts chopping things | |||
masak | basically, postcircumfixes can be preceded by whitespace. | ||
mst | right, but that I actively don't won't | ||
awwaiid++ | |||
masak | awwaiid++ | ||
awwaiid: looking at an earlier version/commit might help, too. | |||
awwaiid | oh good idea | ||
21:24
BenGoldberg joined
21:51
pmurias joined
|
|||
vendethiel | awwaiid: nice, I'd love to be able to go and nelwine 'em as well :D | 21:57 | |
22:10
cognominal left
22:14
RabidGravy left,
apotheon left
|
|||
timotimo | oh | 22:14 | |
should we set arguments like |args "is raw" by default (or just generate the same code either way?) | 22:15 | ||
because i don't really see a reason why |args should be stored inside a scalar container | |||
vendethiel | m: sub foo { $[1, 2, 3] }; sub bar { [1, 2, 3] }; say foo.perl, bar.perl # tell me they're different :o | 22:16 | |
camelia | rakudo-moar 0132b6: OUTPUT«[1, 2, 3][1, 2, 3]» | ||
timotimo | m: sub foo { return $[1, 2, 3] }; say foo.perl | 22:17 | |
camelia | rakudo-moar 0132b6: OUTPUT«[1, 2, 3]» | ||
timotimo | m: sub foo { return [1, 2, 3] }; say foo.perl | ||
camelia | rakudo-moar 0132b6: OUTPUT«[1, 2, 3]» | ||
timotimo | m: sub foo { return 1, 2, 3 }; say foo.perl | ||
camelia | rakudo-moar 0132b6: OUTPUT«(1, 2, 3)» | ||
timotimo | hum. | ||
22:18
apotheon joined
|
|||
masak | 'night, #perl6 | 22:21 | |
pink_mist | good night masak | ||
22:22
pmurias left
22:23
TEttinger joined
22:24
apotheon left
22:28
apotheon joined
22:33
yqt left
22:36
tokuhiro_ joined
22:41
tokuhiro_ left
22:45
cognominal joined
22:47
spider-mario left
22:51
araujo_ joined
22:53
mr_ron left
22:54
araujo left
22:56
mr_ron joined
22:57
leont left
|
|||
lizmat | ugexe: another comment on gist.github.com/lizmat/f3807956c354c14902a3 | 23:02 | |
23:04
vendethiel left
|
|||
lizmat | enough CURLI ideas for now: gist.github.com/lizmat/f3807956c35.../revisions | 23:20 | |
good night, #perl6! | |||
23:44
cognominal left
23:50
BenGoldberg left
|