»ö« 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. |
|||
00:12
llfourn joined
00:16
llfourn left
00:18
daxim joined
00:21
laouji joined
00:27
perturbation left
00:31
raiph left
00:39
laouji left,
laouji joined
00:44
laouji left
00:46
laouji joined
|
|||
Sgeo | As someone who has limited experience with Perl but much more experience with Python and Haskell, what's interesting about Perl6? | 00:47 | |
augment: benign parasitic. supersede: deadly parasitic | 00:50 | ||
ShimmerFairy | Not that I can speak much to comparing P6 to P5 (since I only know 6), but the design of Perl 6 is a bit more "modern" than P5; for example, when I initially tried using P5, I got tripped up on an introductory Qt tutorial because of -> for methods, among other things. | ||
ugexe | you can sum that up as MONKEY-TYPING in general, and thats hardly new to perl6 | 00:51 | |
Sgeo | I have no idea what parasitic means nor why PErl6 has something called deadly parasitic | 00:52 | |
ugexe | i thought those were your words | 00:53 | |
ShimmerFairy | Sgeo: "augment" means "let me give this class some new features", "supersede" means "I can do a better job than you, move over!" :) | ||
Sgeo | ugexe, raw.githubusercontent.com/perl6/mu...tsheet.txt | 00:54 | |
timotimo | yo Sgeo | 00:55 | |
Sgeo | hi | ||
timotimo | for a moment i was surprised you didn't know anything about perl6, since i've seen you in here for so long ... then i noticed i know you from a differen tchannel %) | ||
ugexe | yea i dont know what those mean either Sgeo | 00:59 | |
Sgeo | timotimo, heh. I don't really talk much on that channel though | ||
ShimmerFairy | "parasitic" I assume refers to the fact that, like any good parasite, "augment" and "supersede" attach to and affect classes that didn't really ask for it :) | 01:02 | |
ugexe | sounds like a role | 01:03 | |
ShimmerFairy | It's not like a role or mixin though, because it affects the class in question for the entire scope (and maaaaybe outer scopes too, but I can't recall) | 01:04 | |
ugexe | the benign/deadly parasitic are referring to scopes though. so i guess maybe its scope is dependent on the parasites host, but doesnt do much to explain benign/deadly | 01:07 | |
ShimmerFairy | No, benign/deadly is surely a description of what the keywords do ("augment" changes, "supersede" replaces) | 01:08 | |
ugexe | its grouped directly under my, our, has, anon, and state under a header titled scope. if thats what it means then its organization is confusing to me | 01:09 | |
ShimmerFairy | It's because 'augment' and 'supersede' occupy the same position as those other keywords in code, though admittedly they're the odder ones in the collection :) | 01:11 | |
01:15
BenGoldberg joined
|
|||
ShimmerFairy | To be fair, 'state' doesn't have much to do with scoping either (it's more about having the variable persist in its current scope) | 01:16 | |
Sgeo | m: my $chapter = 3; undefine $chapter; say defined $a; | 01:17 | |
camelia | rakudo-moar d8fa56: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vzsvMQQ_g7Variable '$a' is not declaredat /tmp/vzsvMQQ_g7:1------> 3ter = 3; undefine $chapter; say defined 7⏏5$a;» | ||
Sgeo | tablets.perl6.org/tablet-3-variables.html | ||
:/ | |||
Starting to think that this tablet is garbage | |||
timotimo | the tablets aren't the most up to date resource, sadly | 01:18 | |
ShimmerFairy | That should probably say 'chapter' instead of 'a' | 01:19 | |
timotimo | you may want doc.perl6.org instead | ||
and i believe the difference between augment and supercede is that augment will just augment a class whereas supercede will supercede it | |||
ShimmerFairy | And yes, the tablets are a pretty old resource, I wouldn't recommend them really. | 01:20 | |
Sgeo | ty | ||
Maybe they shouldn't be mentioned, or noted as an old resource, on perl6.org | |||
Oh there is a disclaimer but it applies to all resources on the page | 01:21 | ||
perl6.org/documentation/ | |||
ugexe | we were discussing the descriptions "benign parasitic" and "deadly parasitic" as related to what augment and supercede do | 01:22 | |
timotimo | oh | 01:23 | |
ShimmerFairy | which, as I understand it, is in relation to what augment and supersede do, specifically :) | ||
timotimo | well, in "benign parasitic", the host survives, in "deadly parasitic", it doesn't | ||
dalek | kudo-star-daily: be23065 | coke++ | log/ (8 files): today (automated commit) |
01:24 | |
Sgeo | What does ~~ :e mean, what kind of thing is :e, a pair? How does smartmatch work against a pair? | ||
ugexe | existence adverb on a file | 01:25 | |
Sgeo | How does smartmatch work on that? | ||
timotimo | :e is short for e => True, smart matchign against that calls the method .e and checks if the result is True | 01:26 | |
m: say "yay" if "hi" ~~ uc => "HI" | |||
camelia | rakudo-moar d8fa56: OUTPUT«yay» | ||
01:26
rmgk left
|
|||
timotimo | m: say "yay" if "hi" ~~ :say | 01:26 | |
camelia | rakudo-moar d8fa56: OUTPUT«hiyay» | ||
timotimo | simple as that | ||
Sgeo | timotimo, doc.perl6.org/type/Pair | ||
I don't see an ACCEPTS listed, it would be helpful if it was | 01:27 | ||
timotimo | ah | ||
yes, very true | |||
01:27
rmgk joined
|
|||
Sgeo | Also that : isn't required? | 01:27 | |
m: say "yay" if "hi" ~~ say | |||
camelia | rakudo-moar d8fa56: OUTPUT«5===SORRY!5===Argument to "say" seems to be malformedat /tmp/8IZkeuxgR_:1------> 3say "yay" if "hi" ~~ say7⏏5<EOL>Other potential difficulties: Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an …» | ||
timotimo | it is | ||
Sgeo | Oh I missaw the uc one | ||
I can imagine someone trying .e but that won't work except in a when because it's against the $_ not against the argument | 01:28 | ||
timotimo | "the argument"? | 01:29 | |
oh | 01:30 | ||
you mean "foo.txt" ~~ .e | |||
Sgeo | yes | ||
timotimo | you'll get a warning, but you'll not likely immediately get what it tries to tell you | ||
m: given "foo.txt" { when .e { say "hi" } } | |||
camelia | rakudo-moar d8fa56: OUTPUT«Method 'e' not found for invocant of class 'Str' in block <unit> at /tmp/LtKKhM3dv9:1» | ||
timotimo | m: given "foo.txt" { when :e { say "hi" } } | 01:31 | |
camelia | rakudo-moar d8fa56: OUTPUT«Method 'e' not found for invocant of class 'Str' in block <unit> at /tmp/JPWu7VcWCv:1» | ||
Sgeo | THat when would work though because of the given | ||
timotimo | oh, also, the .e and stuff don't work on strings directly, you'll need to .IO that | ||
Sgeo | It's ~~ directly that could be an issue | ||
timotimo | m: given "foo.txt".IO { when :e { say "hi" } } | ||
camelia | ( no output ) | ||
timotimo | m: given "foo.txt".IO { when .e { say "hi" } } | ||
camelia | ( no output ) | ||
timotimo | er, huh | ||
m: say "foo" ~~ True | |||
camelia | rakudo-moar d8fa56: OUTPUT«Potential difficulties: Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead at /tmp/5ZNEMnKVB9:1 ------> 3say "foo" ~~7⏏5 TruefooTrue» | ||
timotimo | m: say "foo" ~~ say "hi" | ||
camelia | rakudo-moar d8fa56: OUTPUT«hiTrue» | ||
timotimo | m: say "foo" ~~ (say "hi") | ||
camelia | rakudo-moar d8fa56: OUTPUT«hiTrue» | ||
timotimo | it only warns if the True or False is syntactic, i see. | ||
Sgeo | m: "foo.txt".IO ~~ .e | 01:32 | |
camelia | ( no output ) | ||
01:32
HoppingMadMan left
|
|||
Sgeo | m: say "foo.txt".IO ~~ .e | 01:32 | |
camelia | rakudo-moar d8fa56: OUTPUT«False» | ||
Sgeo | m: say "foo.txt".IO ~~ :e | ||
camelia | rakudo-moar d8fa56: OUTPUT«False» | ||
timotimo | oh, hold on | ||
m: say "hello there" ~~ .say | |||
camelia | rakudo-moar d8fa56: OUTPUT«hello thereTrue» | ||
timotimo | m: "hello there" ~~ .say | ||
camelia | rakudo-moar d8fa56: OUTPUT«hello there» | ||
timotimo | $_ is set on the RHS of ~~ | ||
Sgeo | Ah | ||
01:46
[particle]1 joined
01:48
gfldex left
01:50
Hor|zon joined
01:54
Hor|zon left
01:59
llfourn joined
02:04
llfourn left
02:13
yqt left
|
|||
Sgeo | "In the case of my $x, the lexpad entry for the variable $x is a pointer to an object of type Scalar, usually just called the container." | 02:16 | |
Is this still true? I don't see Scalar on the list of types | |||
ShimmerFairy | m: my $a = 42; say $a.WHAT; say $a.VAR.WHAT | 02:17 | |
camelia | rakudo-moar d8fa56: OUTPUT«(Int)(Scalar)» | ||
ShimmerFairy | As far as I can tell, yes, and Scalar should probably be on a list of Perl 6 types :) | 02:18 | |
02:19
Zoffix left
|
|||
Sgeo | m: my $a; my $b := ($a, 0); $b[0] = 5; say $b; | 02:22 | |
camelia | rakudo-moar d8fa56: OUTPUT«5 0» | ||
Sgeo | Can I imagine $ and @ to be namespaces where default assignment to a non-rebinded thing in that namespace behaves different? | 02:23 | |
Or what can illustrate the difference between $ and @? | 02:24 | ||
ShimmerFairy | m: my $a = [1,2]; my @b = [1,2]; my @c = 1,2; say $a.perl; say @b.perl; say @c.perl; # here's a difference | 02:26 | |
camelia | rakudo-moar d8fa56: OUTPUT«[1, 2][[1, 2]]<>[1, 2]<>» | ||
Sgeo | m: my $a = 0; $a[0]=5; say $a; | 02:32 | |
camelia | rakudo-moar d8fa56: OUTPUT«Cannot modify an immutable Int in block <unit> at /tmp/hKWAZrBNeh:1» | ||
Sgeo | Works with @ | ||
02:33
Guest44551 is now known as ponbiki
02:46
noganex joined
02:48
noganex_ left
|
|||
zostay | what's the difference between [] and []<>? | 02:49 | |
02:49
cognominal left
|
|||
zostay | ah... []<> flattens and [] does not? | 02:50 | |
02:51
kaare_ joined
03:00
davido__ left
03:01
davido__ joined
|
|||
skids | zostay: []<> is going away. | 03:02 | |
It was a pre-GLR experiment/workaround. | 03:03 | ||
(As far as I know, at least) | |||
Sgeo | If I have a capture like \($a, $b), am I capturing the containers or values? Can I pass that to things expecting is rw? | 03:05 | |
Did I get Capture syntax right? | |||
zostay | syntax is correct | ||
Sgeo | ty | 03:06 | |
zostay | i don't know the answer to your first question, though | ||
PerlJam | Sgeo: you can find out what Rakudo thinks with a little experimentation :) | 03:09 | |
Sgeo | m: sub foo($a is rw, $b) { $a = 5; say $a; }; my $f = 10; my $x = \($f, 12); foo(|$x); | ||
camelia | rakudo-moar d8fa56: OUTPUT«5» | ||
PerlJam | A "say $f;" at the end could have told you the value/container answer. | 03:11 | |
Sgeo | Huh, where? $f wouldn't be transformed. Maybe a say $x? | 03:15 | |
03:15
dayangkun joined
|
|||
Sgeo | m: sub foo($a is rw, $b) { $a = 5; say $a; }; my $f = 10; my $x = \($f, 12); foo(|$x); say $x; | 03:15 | |
camelia | rakudo-moar d8fa56: OUTPUT«5\(5, 12)» | ||
Sgeo | m: sub foo($a is rw, $b) { $a = 5; say $a; }; my $f = 10; my $x = \($f, 12); foo(|$x); say $x.perl; | ||
camelia | rakudo-moar d8fa56: OUTPUT«5\(5, 12)» | ||
Sgeo | ?? | ||
skids | m: sub foo($a is rw, $b) { $a = 5; say $a; }; my $f = 10; my $x = \($f, 12); foo(|$x); say $f; | 03:20 | |
camelia | rakudo-moar d8fa56: OUTPUT«55» | ||
Sgeo | say @bar.perl; # [7, 9]<> | 03:23 | |
If a doc says that, is it old? | |||
Because if it is, I'll be sad because it's the clearest $ vs @ I've seen | |||
doc.perl6.org/language/variables | |||
skids | It's current/recent but people did not like it. | 03:24 | |
Sgeo | So something's changing? | 03:25 | |
:/ | |||
skids | Yes we still have the GLR to go before release. | ||
03:27
yeahnoob joined
|
|||
Sgeo | m: my $foo\ bar = 5; say $f\ oobar | 03:29 | |
camelia | rakudo-moar d8fa56: OUTPUT«5===SORRY!5=== Error while compiling /tmp/p9fCJi8QWzBogus postfixat /tmp/p9fCJi8QWz:1------> 3my $foo7⏏5\ bar = 5; say $f\ oobar expecting any of: infix infix stopper statement end statement …» | ||
Sgeo | I was expecting that to work, I thought those are unspaces | 03:30 | |
Ah "Although we say that the unspace hides the whitespace from the parser, it does not hide whitespace from the lexer. As a result, unspace is not allowed within a token." | 03:31 | ||
03:42
ChoHag joined
|
|||
ChoHag | In particular, a role may say | 03:43 | |
trusts ::?Class; | |||
to allow self!attr() access to the role's $!attr variables with the class or from other roles composed into the class. | |||
Surely self!foo() allows access to the *methods*, which may or may not be accessors. How are trustworthy attributes accessed? | 03:44 | ||
(Also: 'from the class') | |||
(Also also: Amongst pet examples, it discusses using proto to disambiguate conflicting methods and uses the example 'proto method shake {...}' - shaking pets is bad) | 03:47 | ||
03:47
davido__ left
03:48
davido__ joined
|
|||
ChoHag | (From the top of S14) | 03:49 | |
Sgeo | Is subset basically like contracts except with nicer syntax than in Racket? | 03:50 | |
How careful are they to maintain correct blame in higher-order function situations? | |||
*{$x} -> %h { %h[$x] } | 03:51 | ||
03:51
Hor|zon joined
|
|||
Sgeo | Is that correct or should it be | 03:51 | |
*{$x} -> %h { %h{$x} } | |||
design.perl6.org/S02.html | |||
03:56
Hor|zon left
|
|||
skids | That's a typo I'm pretty sure. | 03:56 | |
ShimmerFairy | Yeah, using [] on a hash just does the normal "non-list is treated as one-item list" thing, which is certainly not what you want in that situation. | 03:57 | |
Sgeo | m: (-> $x { say "foo"; })(1|2); (sub ($x) { say "bar"; })(1|2) | 04:00 | |
camelia | rakudo-moar d8fa56: OUTPUT«foobarbar» | ||
Sgeo | Also that mandatory space after sub for that second statement threw me for a loop, Javascript doesn't need that | ||
04:00
llfourn joined
|
|||
Sgeo | So why is Mu default for the first and Any default for the second? | 04:00 | |
skids | Sgeo: general and consistent rule (I think) is all "ident()" are calls. | 04:04 | |
Sgeo | If you want to be able to match normal values and Junctures it's preferred to use Any|Juncture, in case there are future things added to Mu-but-not-Any? | ||
04:05
llfourn left
|
|||
Sgeo | m: my $failure = fail "I fail."; say "No fail."; | 04:07 | |
camelia | ( no output ) | ||
04:07
virtualsue joined
|
|||
Sgeo | Shouldn't it have either failed or succeeded? | 04:07 | |
dalek | ecs: e2ee789 | skids++ | S02-bits.pod: Fix a copy-paste that had left hash example with wrong brackets |
||
skids | Sgeo++ | 04:08 | |
ShimmerFairy | m: say Nil ~~ Any; say Failure ~~ Any; | 04:09 | |
camelia | rakudo-moar d8fa56: OUTPUT«TrueTrue» | ||
skids | Sgeo: No because you never sunk the failure. | ||
ShimmerFairy | Huh, S02 says this shouldn't be the case: | ||
skids | m: my $failure = fail "I fail."; $failure; say "No fail."; | 04:10 | |
camelia | rakudo-moar d8fa56: OUTPUT«WARNINGS:Useless use of variable $failure in sink context (line 1)» | ||
skids | Oh I guess that gets caught these days. | ||
Sgeo | skids, if I never sunk the failure, why didn't the say go through? | ||
ShimmerFairy | > Any Perl 6 object (default routine parameter type, excludes Junction, Nil, Failure) | ||
skids | Hrm good question, it does with -e. | 04:11 | |
ShimmerFairy | Oh, I think I got the smartmatches reversed, nvm | 04:13 | |
Sgeo | Tieable role should be documented imo | 04:14 | |
skids | Oh right. fail() actually tries to return unlike Failure.new. And right now there's a bug when it tries to do it at the top level. | ||
Sgeo | Also tying reminds me of Tcl | 04:15 | |
core.tcl.tk/tcllib/doc/trunk/embed...e/tie.html | |||
A more complicated API around something Tcl itself provides in a simple manner, lemme see | |||
skids | m: sub a { my $failure = fail "I fail."; say "No fail."; }; a(); #...but... | 04:16 | |
camelia | rakudo-moar d8fa56: OUTPUT«I fail. in sub a at /tmp/p4nGRo7QVH:1 in block <unit> at /tmp/p4nGRo7QVH:1Actually thrown at: in block <unit> at /tmp/p4nGRo7QVH:1» | ||
skids | m: sub a { my $failure = Failure.new("I fail."); say "No fail."; }; a(); #...but... | ||
camelia | rakudo-moar d8fa56: OUTPUT«No fail.» | ||
Sgeo | tcl.tk/man/tcl8.6/TclCmd/trace.htm#M14 | ||
skids | m: sub a { my $failure = Failure.new("I fail."); $failure; say "No fail."; }; a();. | 04:17 | |
camelia | rakudo-moar d8fa56: OUTPUT«5===SORRY!5=== Error while compiling /tmp/92XB3tXRkDBogus statementat /tmp/92XB3tXRkD:1------> 3l."); $failure; say "No fail."; }; a();.7⏏5<EOL> expecting any of: dotty method or postfix» | ||
Sgeo | "trace add variable name ops commandPrefix | ||
: Arrange for commandPrefix to be executed whenever variable name is accessed in one of the ways given by the list ops. | |||
skids | m: sub a { my $failure = Failure.new("I fail."); $failure; say "No fail."; }; a(); | ||
camelia | rakudo-moar d8fa56: OUTPUT«No fail.» | ||
skids | hrm. | ||
Sgeo | Tcl has a few too many ways to pass code to be executed to something | 04:18 | |
As in, a subroutine might expect a script, or a command prefix, or (I forget what else) | |||
Command prefix is the modern way, but Tk is old and expects scripts | |||
ChoHag | Haha! Expects scripts. Because expect is written in ... never mind | 04:19 | |
skids | Something strange with camelia's context WRT failures I guess. | ||
Sgeo | ChoHag, heh, forgot about that, pun not intended | ||
ChoHag | Forgetting about expect is a net positive. | 04:20 | |
I would like to do the same. | |||
Sgeo | I never actually used it. 100% of my interest in Tcl is because I like learning about languages, although it did come in handy on the job because needed to add a thing to a load balancer that uses Tcl | 04:21 | |
s/it/expect/ | 04:22 | ||
skids | Yeah every once in a while I'm like "crap Im going to have to lear TCL" because it is popular on network gear, but a better solution than device-side scripts seems to always appear. | 04:23 | |
Thank goodness most of the next-gen stuff is moving to python, not that I know that either but... | 04:24 | ||
ChoHag | Python's easy. | ||
Sgeo | Tcl is actually... interesting IMO, in its model of metaprogramming | ||
But I very strongly recommend learning Tcl via tutorial instead of example | |||
skids | Yeah but metaprogramming is the last thing you want happenning on routers :-) | 04:25 | |
ChoHag | But (and probably because) it's not very expressive. | ||
Sgeo | Tcl is beautiful if learned properly, horrific trying to guess $ vs no $ and expr and all these other things if not learned properly | ||
Although due to lack of garbage collection of mutable things, I tend to... be really really bad at not leaking gigs of memory | 04:26 | ||
"That is, if $a interpolates, so do $^a, $*a, $=a, $?a, $.a, etc. It only depends on the $." | 04:29 | ||
IIUC, $a does not interpolate? Not that the text is wrong if I'm understanding correctly, but maybe a better example could be used? | |||
ShimmerFairy | $a does interpolate in places that allow it. | 04:30 | |
Sgeo | "It will not automatically dereference to its contents unless placed explicitly in some kind of dereferencing context." | 04:32 | |
What are dereferencing contexts | 04:33 | ||
skids | I think prety much everything but a binding context? | 04:35 | |
Sgeo | lol context | 04:36 | |
04:36
BenGoldberg left
|
|||
ShimmerFairy | Sgeo: in the part you're reading (AFAICT), it's saying that $x will never expose itself as anything aside from a singular item _unless_ you put it in @($x) or such. | 04:36 | |
Sgeo | m: my $a = (1,2,3); my @b = $a, 4, 5; say @b; | ||
camelia | rakudo-moar d8fa56: OUTPUT«1 2 3 4 5» | ||
04:37
vendethiel joined
|
|||
skids | m: my $a = (1,2,3); my @b = $a, 4, 5; say @b.perl; | 04:37 | |
camelia | rakudo-moar d8fa56: OUTPUT«[1, 2, 3; 4; 5]<>» | ||
Sgeo | Ah | 04:40 | |
ShimmerFairy | The .gist method for lists tends to be lacking, in my opinion. | 04:42 | |
skids | up too late again. Gotta stop dieseling and go to bed. | 04:44 | |
04:44
skids left
04:45
cognominal joined
04:46
nys left
04:47
[Sno] left
|
|||
Sgeo | Can a parcel be interpreted as a capture at runtime? THat is, a thing with a dynamically created Pair being used to mean named argument? | 04:48 | |
ChoHag | Is this a bug or expected behaviour: | 04:51 | |
m: class A { multi submethod BUILD { say "...A" } }; class B is A { submethod BUILD { say "...B" } }; class C is A { }; say "B:"; B.new; say "C:"; C.new | |||
camelia | rakudo-moar d8fa56: OUTPUT«B:...A...BC:...A...A» | ||
ChoHag | vs. | ||
m: class A { submethod BUILD { say "...A" } }; class B is A { submethod BUILD { say "...B" } }; class C is A { }; say "B:"; B.new; say "C:"; C.new | |||
camelia | rakudo-moar d8fa56: OUTPUT«B:...A...BC:...A» | ||
ChoHag | Seems like A's submethod is leaking into C when it's a multi. | 04:53 | |
04:53
llfourn joined
05:00
vendethiel left
|
|||
Sgeo | doc.perl6.org/type/Pair | 05:10 | |
Should probably have the :x($foo) syntax | |||
ShimmerFairy | it does, though. (see :key<value> near the top) | 05:12 | |
Sgeo | That's for strings though, iiuc | 05:13 | |
05:13
virtualsue left
|
|||
ShimmerFairy | yeah, but it's just sugar for :key('value') | 05:16 | |
Sgeo | Might not be obvious to a newbie reading the docs? | 05:17 | |
ShimmerFairy | Fair enough, though there might be some sort of "general overview" page describing it already. (Certainly wouldn't hurt, I don't think.) | ||
tony-o | ChoHag: that looks like a bug | 05:19 | |
05:22
khw left
|
|||
Sgeo | m: grep Failure.new("FAIL"), 0, 1 | 05:23 | |
camelia | ( no output ) | ||
jdv79 | tony-o: why did you create 2 HTTP::Server dists? | ||
tony-o | jdv79: what do you mean? | 05:24 | |
one is a role.. | |||
jdv79 | Async and Threaded seem odd name choices as rakudo's async uses threads. | ||
tony-o | one uses an ::Async socket, the other uses blocking sockets in threads | ||
jdv79 | they both look like classess to me | 05:25 | |
ah | |||
tony-o | i thought you meant HTTP::Server - not those two things | ||
jdv79 | do you see both being used long term or just for experimentting? | 05:26 | |
tony-o | the ::Threaded one will go away, it was temporary while the IO::Socket::Async problems were hammered out | 05:27 | |
they're interchangable, though, both abide by 'HTTP::Server' | 05:28 | ||
Sgeo | Does it make sense to have both async and sync? If some library uses sync it becomes harder to do async stuff with that library. That's, like, a good thing (of few) that Node.JS does, force the entire ecosystem async with cultural and technical pressure | 05:30 | |
ChoHag | Then don't use that library if you want async code. | 05:31 | |
jdv79 | easier said than done | 05:32 | |
sometimes there is no alternative | |||
ChoHag | Do you not have a text editor? | ||
(Yes yes. I know. I'm joking ... mostly) | 05:34 | ||
tony-o | they both use threads, they just use them differently | 05:35 | |
ChoHag | If I have a class B is class A, and class C is class A, can I (at run time) create an instance of class B is class C? | 05:40 | |
05:45
rurban joined
|
|||
ChoHag | NB. Not "should I", "can I". | 05:45 | |
05:46
laouji left,
laouji joined
05:48
diana_olhovik_ joined
|
|||
tony-o | do you care if A is a role ? | 05:51 | |
05:52
Hor|zon joined
|
|||
tony-o | m: class A { has $.x = 5; }; class B is A { }; role C is A { }; my B $r .=new; $r does C; $r.x.say; | 05:53 | |
camelia | rakudo-moar d8fa56: OUTPUT«5» | ||
tony-o | m: class A { has $.x = 5; }; class B is A { }; role C is A { has $.y = 50; }; my B $r .=new; $r does C; $r.y.say; | ||
camelia | rakudo-moar d8fa56: OUTPUT«50» | ||
tony-o | i'm too tired for this | ||
ChoHag | Yes because this is a thought experiment and I already know I can get a similar effect with roles. | ||
This is just sticking fingers in the plug socket to see what happens, not anything practical. | 05:54 | ||
If you want something practical and easy before you finally succumb to sleep, tell me how to distinguish at runtime between an instance and a type. | |||
ugexe | .DEFINITE? | 05:55 | |
05:56
Hor|zon left
|
|||
ChoHag | Ah! "There is one more macro:", just below the visible page. | 05:57 | |
05:58
FROGGS_ left
05:59
domidumont joined
06:00
rurban left
|
|||
moritz | \o | 06:03 | |
blogs.perl.org/users/sterling_hanen...rface.html | |||
06:08
[Sno] joined
06:10
domidumont left
06:11
domidumont joined
|
|||
jdv79 | zostay++ | 06:14 | |
06:14
domidumont left
06:15
domidumont joined
06:17
telex left
06:18
telex joined
06:22
domidumont left
06:35
zacts joined
06:45
krunen joined
06:48
FROGGS joined
06:53
Hor|zon joined
06:58
Hor|zon left
|
|||
Sgeo | m: my @a = 1,2,3; say map *+1, @a | 06:58 | |
camelia | rakudo-moar d8fa56: OUTPUT«2 3 4» | ||
Sgeo | But map seems to use vararg, so how does it take @a like that? | 06:59 | |
Does @a become multiple arguments in that context or something? | |||
s/vararg/slurpy/ # Use Perl6 terminology | |||
ChoHag | Can anything other than the first argument be the routine to apply? | 07:00 | |
In which case all subsequent arguments are values to map over, and @a flattens. | 07:01 | ||
m: my @a = [1,2,3]; say map *+1, @a; | 07:02 | ||
camelia | rakudo-moar d8fa56: OUTPUT«4» | ||
moritz | note that [] does not flatten in slurpies | ||
ChoHag | m: my @a = [1,1,1]; say map *+1, @a; | 07:03 | |
camelia | rakudo-moar d8fa56: OUTPUT«4» | ||
ChoHag | I know. | ||
Hooray! I had (whether given or not) an answer rather than a question! | |||
<-- Progressing. | |||
07:10
darutoko joined
07:12
azawawi joined
|
|||
azawawi | hi | 07:12 | |
moritz | \o azawawi | ||
07:18
RabidGravy joined
|
|||
Sgeo | m: say [1,2,3].WHAT | 07:21 | |
camelia | rakudo-moar d8fa56: OUTPUT«(Array)» | ||
Sgeo | Do I need to know Perl 5 to make sense of all this context stuff? | ||
ChoHag | It might help if you didn't. | 07:23 | |
07:23
brrt joined
|
|||
dalek | c: ef6ea00 | moritz++ | / (2 files): Document X::Channel::SendOnClosed |
07:24 | |
c: 3446cd5 | moritz++ | lib/Type/ (2 files): Document X::Channel::ReceiveOnClosed |
|||
07:33
pdcawley joined
|
|||
RabidGravy | morning! | 07:38 | |
jdv79 | is it possible to make an obj look like a scalar and a list? | 07:40 | |
brrt | yes, why not? | ||
jdv79 | how? | 07:41 | |
brrt | m: my $a = [1,2,3]; say $a; | ||
camelia | rakudo-moar d8fa56: OUTPUT«1 2 3» | ||
jdv79 | cause i can't seem to do it. | ||
07:41
virtualsue joined
|
|||
brrt | then you'll have to specify your question a bit more :-) | 07:41 | |
jdv79 | no, i mean $foo = "asdf" would set $foo's scalar member and $foo.[1] would set into $foo's list member | 07:42 | |
brrt | hmmm | 07:50 | |
i think you can fake that | |||
but why would you | |||
jdv79 | i'm trying an overly clever interface for a path, either operate on the whole in str form or operate on the seperate parts | 07:51 | |
surely p6 is up to the task;) | |||
llfourn | do you have a MyPath obj? If so I think you can just define a postcircumfix for MyPath... | 07:52 | |
jdv79 | that gets me list ops, sure | ||
llfourn | though im not sure how assignment like MyPath $path = '/foo/bar' would work | ||
jdv79 | but how about $foo = '/bar/baz'? | ||
yeah | |||
RabidGravy | overr-ride assignment ;-) | 07:53 | |
llfourn | I think in future you can do MyPath() $path to coerce it | ||
jdv79 | i think that is not allowed | ||
07:54
Hor|zon joined
|
|||
RabidGravy | it's just make it a string sub-class with some list-like features | 07:54 | |
then the assignment would Just Work™ | 07:55 | ||
jdv79 | that's what i'm asking about | ||
i don't know how to do it if its possible even | |||
RabidGravy | right, yiour question about assignment confused me | ||
llfourn | m: class Path is Str { }; my Path $p = '/foo/bar'; | 07:56 | |
camelia | rakudo-moar d8fa56: OUTPUT«Type check failed in assignment to '$p'; expected 'Path' but got 'Str' in block <unit> at /tmp/E1SZkXxAvL:1» | ||
llfourn | How do you make subclass str assignment work to string? | 07:57 | |
dalek | p: 3fec6e0 | hoelzro++ | src/vm/jvm/ (2 files): Create mapping and implementation for force_gc on JVM |
||
p: a317d34 | hoelzro++ | src/vm/jvm/stage0/ (10 files): Re-bootstrap JVM files for force_gc |
|||
p: 426ca43 | hoelzro++ | src/vm/jvm/HLL/Backend.nqp: Add force_gc implementation for JVM backend |
|||
RabidGravy | I lied | ||
p: e99940c | FROGGS++ | src/vm/jvm/ (13 files): Merge pull request #240 from perl6/jvm-force-gc JVM force_gc |
|||
07:59
Hor|zon left
|
|||
Sgeo | How do you do a named argument slurpy that collects names that are used multiple times? | 08:00 | |
:@x collects multiple xs, but *% is used for named slurpy | 08:01 | ||
RabidGravy | jdv79, would applying a role to the attribute work for you? | ||
jdv79 | example =? | ||
RabidGravy | Speo | 08:02 | |
jdv79 | maybe in a lame way i can "is Proxy" to get hold of assignment ^H | ||
Sgeo | If I call | ||
foo :x(5) :x(6) | |||
RabidGravy | Speo, er you'd have to create the hash from a bunch of pairs | ||
Sgeo | ANd foo wants all named arguments | ||
llfourn | Sgeo: I think named args have to be unique, you want a list of pairs | ||
Sgeo | m: sub multix(:@x) {say @x; }; multix :x<hi> :x<bye>; | 08:03 | |
camelia | rakudo-moar d8fa56: OUTPUT«Type check failed in binding @x; expected 'Positional' but got 'Str' in sub multix at /tmp/cqCf3Nm6b8:1 in block <unit> at /tmp/cqCf3Nm6b8:1» | ||
llfourn | m: sub multix(:@x) { say @x }; multix [ :x<hi>, :x<bye> ]; | 08:04 | |
camelia | rakudo-moar d8fa56: OUTPUT«Too many positionals passed; expected 0 arguments but got 1 in sub multix at /tmp/niUx8P02Pp:1 in block <unit> at /tmp/niUx8P02Pp:1» | ||
llfourn | m: sub multix(:@x) { say @x }; multix :x([ :x<hi>, :x<bye> ]); | ||
camelia | rakudo-moar d8fa56: OUTPUT«x => hi x => bye» | ||
Sgeo | Look for this: sub fun (Int :@x) { ... } | 08:05 | |
design.perl6.org/S06.html | |||
llfourn | Sgeo: You're right, looks like not yet implemented then.. | 08:06 | |
Sgeo | So... how to slurpy? | ||
And also I assume this will be fixed by December? | |||
llfourn | We can only hope :) | ||
m: sub foo(*@pairs) { say @pairs }; foo x => 1, x => 2; | 08:07 | ||
camelia | rakudo-moar d8fa56: OUTPUT«Unexpected named parameter 'x' passed in sub foo at /tmp/fdsfnW1ZuW:1 in block <unit> at /tmp/fdsfnW1ZuW:1» | ||
llfourn | m: sub foo(@pairs) { say @pairs }; foo [x => 1, x => 2]; | 08:08 | |
camelia | rakudo-moar d8fa56: OUTPUT«x => 1 x => 2» | ||
Sgeo | m: sub foo(*%pairs) { say %pairs }; foo x => 1, x => 2; | ||
camelia | rakudo-moar d8fa56: OUTPUT«x => 2» | ||
llfourn | that's only way I can think of | ||
yeah % will always uniqueify | |||
Sgeo | Maybe by requesting the capture? | 08:11 | |
08:11
vytas joined
|
|||
Sgeo | m: sub foo(|cap) { say cap }; foo x => 1, x => 2; | 08:11 | |
camelia | rakudo-moar d8fa56: OUTPUT«\(:x(2))» | ||
Sgeo | m: sub foo(|$cap) { say $cap }; foo x => 1, x => 2; | 08:12 | |
camelia | rakudo-moar d8fa56: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EO8X5hd6T3Obsolete use of | or \ with sigil on param $capat /tmp/EO8X5hd6T3:1------> 3sub foo(|$cap7⏏5) { say $cap }; foo x => 1, x => 2; expecting any of: shape declaration» | ||
RabidGravy | Speo, | 08:13 | |
m: sub f( *@x) {say @x}; f((x => 1), (x => 2)) | |||
camelia | rakudo-moar d8fa56: OUTPUT«x => 1 x => 2» | ||
RabidGravy | you can also de-nameify them by making the keys variavle | ||
08:14
vytas left
|
|||
Sgeo | Please stop calling me Speo, it's Sgeo and Speo does not ping me | 08:14 | |
RabidGravy | please type in a bigger font then ;-p | 08:15 | |
llfourn | sub f(*@x) {say @x}; f (x => 1, x => 2) | 08:16 | |
RabidGravy | m: sub f( *@x) {say @x};my $x ="x"; f($x => 1, $x => 2) | ||
llfourn | m: sub f(*@x) {say @x}; f (x => 1, x => 2) | ||
camelia | rakudo-moar d8fa56: OUTPUT«x => 1 x => 2» | ||
llfourn | seems like they are the same :) | ||
the space before the openning ( actually matters in p6 | 08:17 | ||
08:19
virtualsue left
08:21
sqirrel joined
|
|||
jnthn | morning, #moarvm | 08:21 | |
yoleaux | 2 Aug 2015 12:09Z <nine> jnthn: your commit 56ae33ea0a5ac3d54a5fef2aa15eab34f9e9594b broke &?CALLER::ROUTINE: role Marker { }; sub foo { say &?CALLER::ROUTINE ~~ Marker; }; my $test = sub { foo(); }; $test(); $test does Marker; $test(); | ||
2 Aug 2015 14:32Z <nine> jnthn: I can workaround missing &?CALLER::ROUTINE with nqp::getcodeobj(nqp::ctxcode(nqp::ctxcaller(nqp::ctx))) | |||
nine | Good morning, jnthn! | ||
nwc10 | jnthn: but this is #perl6! | 08:22 | |
jnthn | oops! | ||
good morning, #perl6 :) | |||
nine: &?ROUTINE access through CALLER only worked before by accident; note that none of &?BLOCK/$?FILE/$?LINE are available that way either. | |||
nine: I don't intend to put it back; ratehr, that functionality should be exposed through callframe. | 08:23 | ||
*rather | |||
nine | jnthn: ok. Unfortunately callframe doesn't give any access to the CALLER ROUTINE either. But at least nqp does. | 08:24 | |
jnthn | nine: Yes, I know callframe doesn't at the momnet; I was saying that it should get a method that calls nqp::getcodeobj(nqp::ctxcode, ...) to let you get hold of it. | 08:25 | |
nine | Shall we call it .routine? | 08:26 | |
jnthn | No, 'cus not everything is a routine | ||
Hm, I see that CallFrame lacks .caller and .outer methods to navigate around too | 08:28 | ||
.code would perhaps be general enough | |||
nine | S06 says: "(For instance, caller.hints('&?ROUTINE') will give you the caller's routine object." | ||
azawawi | hmmm what's wrong with this code: $method = $method.subst(/ (<[A..Z]>) /, {$0.lc}, :g); | ||
nine | jnthn: I'd be fine with .code. I can have a shot at implementing the mentioned methods over the next couple of days. | 08:29 | |
08:32
Hor|zon joined
|
|||
jnthn | nine: Wow, that's...ugly :) Please lets just make it .code, to match .line and .file. ;) | 08:38 | |
nine: Also, please do feel free to take that one; I need to use what brane I have for GLR. | 08:39 | ||
DrForr | .file, .line, .column ? - Though I imagine there *are* some people out there that read their code in proportional fonts... | 08:40 | |
jnthn | DrForr: We can only present information we actually have. :) | ||
(We don't store column in the bytecode annotations) | 08:41 | ||
08:41
azawawi left
|
|||
DrForr | Ah. | 08:41 | |
nine | jnthn: will do :) | ||
08:42
rindolf joined
|
|||
jnthn | From backlog: you can't collect all arguments with the same name, later ones override earlier ones. I know S06 speculates on something with the @ sigil in the receiving method, but it's actually pretty much impossible to implement (to see why, think about how it interacts with multi-dispatch, or Capture literals) | 08:47 | |
08:50
ChoHag left
|
|||
dalek | c: 21fdb8b | moritz++ | lib/Type/Channel.pod: Channel: document what happens when calling .close while a .receive is blocking |
08:55 | |
08:57
spider-mario joined
09:05
vendethiel joined
09:08
sqirrel left
09:10
vytas joined,
virtualsue joined
09:11
Hor|zon left
09:20
vytas left
09:24
vytas joined
|
|||
moritz | zostay: ping | 09:31 | |
zostay: regarding P6SGI: on the one hand I love the ability to return a Promise or a Channel; OTOH it makes writing middlewares much more complicated, because a middleware must implement all the calling conventions, no? | 09:32 | ||
I wonder if there's a simpler solution | 09:33 | ||
jnthn | I read the doc and need to ponder it more, but I suspect a Supply might allow better throughput for the streaming stuff | ||
moritz | that was another thing I considered | 09:34 | |
09:34
azawawi joined
|
|||
moritz | but supplies are tricky in this situation, no? | 09:35 | |
jnthn | How so? | ||
moritz | because the caller must be able to tap before any events are emitted | ||
or is that only a problem for on-demand supplies? | |||
jnthn | Oh, I was more thinking the API would return a Supply that is tapped in order to process the request. | 09:36 | |
Which will be much neater with the new "supply" keyword | |||
Looking at the examples: | 09:37 | ||
sub app(%env) { | |||
start { | |||
... | |||
Is how you write something to process a request off in the thread pool | |||
09:37
espadrine joined
|
|||
jnthn | So you can use await, presumably | 09:37 | |
Though I guess maybe to spread computation | |||
But with what I'm suggesting the streaming case becomes more like: | 09:38 | ||
sub app(%env) { | |||
supply { | |||
... | |||
Which middleware - if it's not already on a thread pool thread - can just ".tap-on(ThreadPoolScheduler).tap(&send-output-to-client) | 09:39 | ||
" | |||
This gives much better thread affinity for the data in question | 09:40 | ||
And so CPU cache locality | |||
leont | Yeah, supplies would make more sense to me too, but that's only after having worked with them for some time. To some extend it's an ackquired taste I guess. | ||
09:41
yeahnoob left
|
|||
jnthn | Yeah, it's a producer/consumer threading model vs. a reactive one. | 09:42 | |
Generally, though, good performance depends on keeping inter-thread communication down. | |||
And so far as I can see, that's only going to become more and more the case. | 09:43 | ||
So any place that lacks natural temporal decoupling to render the cache effects of the inter-thread communication unimportant will suffer when you make unneeded movement of a flow between threads. | 09:44 | ||
And that's the case here really: you just produced a bunch of data and you want to toss it into a socket (maybe after some further processing). | |||
09:45
RabidGravy left
|
|||
jnthn | The Channel approach means you shove inter-thread communication there, and if the next layer down wants to actually process the data then the thread doing so will have to grab all of the data into its cache, while with the Supply one you're still on the same thread. | 09:46 | |
If anyone with a blogs.perl.org account wants to post a link to this, feel free | 09:47 | ||
jnthn gets back to GLRing :) | |||
brrt | S32-io/IO-Socket-Async.rakudo.moar hangs, but you're probably aware of that | 09:48 | |
jnthn | brrt: I wasn't; haven't seen it do that in a long, long time... :( | 09:49 | |
brrt | oh :-( | ||
well, you probably know i'm on linux | 09:50 | ||
and maybe it helps if i say that i use unoptimized builds? | |||
jnthn | Maybe | ||
Does it happen repeatably? | |||
brrt | quite :-) | 09:54 | |
09:58
g4 joined,
g4 left,
g4 joined
|
|||
azawawi | tony-o: ping | 10:03 | |
10:03
darutoko- joined
|
|||
dalek | c: 0441841 | smls++ | lib/Language/subscript (2 files): rename page 'subscripting' -> 'subscripts' |
10:04 | |
10:06
aindilis` joined
10:07
TimToady_ joined
10:08
araujo left,
darutoko left,
silug_ left,
TimToady left,
ponbiki left,
rindolf left,
ponbiki_ joined,
aindilis left,
rindolf joined,
smls joined
10:11
araujo joined
10:16
silug_ joined
10:17
brrt left
10:22
RabidGravy joined
10:26
pierrot left
10:30
pecastro joined
10:31
leont left
10:35
renormalist joined
10:36
sqirrel joined
|
|||
dalek | c: fb90586 | moritz++ | lib/Language/subscripts.pod: Fix typo, LLFourn++ |
10:42 | |
smls | oops :P | 10:45 | |
nine | Posted an irc.perl6.org link to the P6SGI blog post | 10:51 | |
10:54
pierrot joined
|
|||
dalek | c: 32aa3fd | smls++ | lib/Language/subscripts.pod: subscripts: fix :delete section example; ronaldxs++ |
10:57 | |
tony-o | azawawi: whats up? im getting ready to leave for the airport? | 11:05 | |
s/\?$// | |||
azawawi | tony-o: any plans to integrate Bailador with HTTP::Server::* ? | ||
11:07
sqirrel left
|
|||
tony-o | what do you mean? | 11:07 | |
azawawi | tony-o: Bailador to use HTTP::Server::Threaded as a backend instead of HTTP::Easy::PSGI | 11:08 | |
tony-o | if youd like to and you build it around the http::server role - http::server::async is almost ready | 11:09 | |
azawawi | Bailador::Async ? | ||
or Bailador::Threaded... | 11:10 | ||
tony-o | i didnt have anything i intended to write right away or anything | ||
azawawi | ok on it :) | ||
thanks for the reply | |||
tony-o | after async, i have like 10 other modules that are probably broken :/) | 11:11 | |
azawawi | like? | 11:12 | |
11:21
pierrot left
|
|||
nine | The modern way would be a PSGI (or P6SGI) backend for Bailador and HTTP::Server::* based PSGI implementations. | 11:22 | |
tadzik | well, internally that's how it works :) | ||
nine shuts up then | |||
tadzik | bailador is only using http-easy because it was the only thing that worked anyway | ||
or so I remember :) | 11:23 | ||
yeah, Bailador::dispatch_psgi seems to be the psgi app | |||
github.com/tadzik/Bailador/blob/ma...or.pm#L108 | 11:24 | ||
azawawi | tadzik: i see | 11:26 | |
nine: thanks :) | |||
tony-o | psgi seems dated | 11:27 | |
RabidGravy | well it's six or so years old | 11:33 | |
11:37
TEttinger left
11:39
Zoffix joined
11:42
gfldex joined
11:43
brrt joined
12:10
zakharyas joined
|
|||
itz | much of the perl5 world probably still uses CGI TBH | 12:11 | |
Zoffix | Probably. Legacy stuff and what not. | 12:13 | |
virtualsue | a lot of the world is legacy | ||
jnthn | Legacy = the code made it into production and is doing useful stuff. Becoming legacy is success. :) | 12:15 | |
Zoffix | Legacy = the code that is too expensive to upgrade. :) | 12:16 | |
jnthn | We might often wish folks had left us a better legacy, alas... :) | ||
brrt | huh, i recently read 'technical depth' for 'technical debt' | 12:18 | |
and i thought, that's not even wrong | 12:19 | ||
12:21
colomon joined
|
|||
itz | the code you wrote might be "legacy" but mine is "heritage" ;) | 12:22 | |
12:22
brrt left
|
|||
Zoffix | lol | 12:23 | |
12:24
kkielak joined
12:25
oxide94 joined
12:26
oxide94 left
12:31
leont joined
|
|||
jdv79 | self.bless returns an instance? | 12:31 | |
nine | yes | 12:32 | |
m: class Foo { method new() { return self.bless } }; Foo.new.perl.say | 12:33 | ||
camelia | rakudo-moar d8fa56: OUTPUT«Foo.new» | ||
RabidGravy | m: enum G (Boo); # somewhat less that fabulous error message | 12:35 | |
camelia | rakudo-moar d8fa56: OUTPUT«===SORRY!===Cannot invoke this object (REPR: Null, cs = 0)» | ||
jdv79 | i was getting : Cannot look up attributes in a type object | ||
nine | jdv79: with what code exactly? | 12:36 | |
12:36
TimToady_ left
12:37
lucasb joined
12:38
TimToady joined,
kkielak left
12:39
dayangkun left
|
|||
jdv79 | now i'm getting a different error | 12:41 | |
gist.github.com/anonymous/4d6c3cff038c4b3131bd | |||
trying to access a private array attr in new | |||
RabidGravy | you probably want to pass the a => 1,2,3 to bless | 12:43 | |
jdv79 | the docs are lacking on this sort of thing ^H | ||
nine | The whole process is somewhat less magical than one would expect. bless returns an instance, but it doesn't magically replace self in your class method. self still is your type object | ||
jdv79 | ok, but i used $obj not self | ||
nine | If you need to access the new object's privates, you have to do so in an object method like BUILD | ||
jdv79 | why not in new? | 12:45 | |
RabidGravy | when you create the object using bless, you are getting a new object, you are not in *its* new so the attribute is private to you | 12:46 | |
12:46
cognominal left
|
|||
jdv79 | seems unusual | 12:47 | |
and i didn't notice that in the docs | |||
nine | jdv79: it's really just a consequence of the construction process being as little magical as possible. The advantage is, that it's very customizable. | ||
12:48
cognominal joined
|
|||
RabidGravy | just added something to that gist | 12:49 | |
jdv79 | so to set a priv attr at construction one needs to pass to bless and defined a BUILD to catch it? | 12:50 | |
RabidGravy | dunno why it shagged up the formatting thoug | ||
well that's one way of doing it yes | 12:51 | ||
jdv79 | ok | 12:52 | |
jdv79 can't wait for comprehensive docs | |||
i thought i had more patient to dig but its like every little thing | |||
gets to be too much ^H:( | 12:53 | ||
*patience | |||
thanks | |||
RabidGravy | this is explained in the docs.perl6.org/language/classtut#Constructors | ||
jdv79 | ok. i see it now. | 12:56 | |
i was reading the spec and then hit that doc and missed taht bit | 12:57 | ||
RabidGravy | :) | 12:59 | |
13:02
spider-mario left
13:03
zakharyas left
|
|||
dalek | c: c470d2c | smls++ | lib/Language/subscripts.pod: subscripts: Fill in the "Basics" section |
13:04 | |
smls | jnthn, lizmat: Since you seem to be the experts on that topic, it would be nice if one of you could take a look at doc.perl6.org/language/subscripts#Custom_types (everything from that heading to the end of the page) to check if what I wrote is correct and if the example code looks sane. | 13:09 | |
13:14
azawawi left
|
|||
PerlJam | smls++ nice example | 13:15 | |
timotimo | oi | 13:16 | |
er | |||
o/ | |||
do we really want the heading as well as the first line of tables rendered in yellow? | |||
rather than having headings in a different color, so that the colors stay somewhat alternating? | 13:17 | ||
or perhaps switch up even and odd in tables? | |||
it's probably important to make the style work for tables with and without headers ... | |||
PerlJam | timotimo: I'm fine with the even/odd colors, but the headings need a different color IMHO | 13:18 | |
smls | PerlJam: My intention for that example was to demonstrate all 3 different "levels" of providing AT-KEY: 1) simple delegation 2) explicit method that simply forwards another object's AT-KEY 3) method that returns a custom container | ||
timotimo: I'm not really happy with the table style either. It's somewhere on my todo list. | |||
timotimo | good to know, thanks! | 13:19 | |
PerlJam | smls: one random thing that occurs to be because of your doc is that .elems seems out of place. Or it makes me think that there should be an .ELEMS that .elems is automatically aliased to. | 13:22 | |
13:23
khw joined
|
|||
smls | Well, in general you'd also implement .list .keys .values .iterator etc | 13:23 | |
.elems just happens to be used by subscripts in addition to users calling it directly | 13:24 | ||
13:24
awwaiid joined
|
|||
smls | but that's not so different from .list/.iterator being called by `for` or `map`. | 13:24 | |
PerlJam | true | 13:25 | |
I guess my nice, neat mental box that says "uppercase may be called for you by Perl" doesn't want it to be any other way :) | 13:26 | ||
smls | everything is better than Python's ghastly __foo__ naming scheme for special/interpreter-called methods ;) | 13:27 | |
PerlJam | I dunno ... those are certainly unambiguous :) | 13:30 | |
dalek | ast: 86cfb03 | (Stefan Seifert)++ | S06-advanced/callframe.t: CallFrame.code should now return the code object As per jnthn++'s suggestion: irclog.perlgeek.de/perl6/2015-08-03#i_10994354 |
||
kudo/nom: a38b59c | (Stefan Seifert)++ | src/core/CallFrame.pm: Support CallFrame.code to return the code object As per jnthn++'s suggestion: irclog.perlgeek.de/perl6/2015-08-03#i_10994354 |
|||
13:37
skids joined
13:47
brisby joined
13:50
synbot6 joined
13:51
synbot6 left
13:52
synbot6 joined,
synbot6 left
13:53
laouji left
|
|||
lucasb | evalbot control version | 14:00 | |
camelia | This is evalbot revision eb33872 | ||
lucasb | idk if "evalbot control pull" is enough to update the evalbot | ||
it seems there is a newer revision that makes github gist api work again | 14:01 | ||
sorry! I issued 'evalbot control restart'. I thought it would come back automatically | 14:06 | ||
I thought it was running inside a 'while true; do ...; done' loop | 14:07 | ||
jnthn | lucasb: It...usually does come back, from memory. | 14:08 | |
14:08
synbot6 joined,
brisby left
|
|||
RabidGravy | boom | 14:09 | |
timotimo | it ought to, yeah, i think so | 14:15 | |
nine: can you have a quick look-see? | |||
lucasb | I'm very very sorry! My intent was just update it. Someone with a hack account will have to take a look, I guess. | ||
FROGGS | it is not not running on hack AFAIK | 14:16 | |
timotimo | correct | ||
lucasb | oh | ||
timotimo | it runs on nine's box | ||
it's no problem, lucasb, we'll be back to working order in no time | 14:17 | ||
RabidGravy | and in the interim we can talk among ourselves ;-) | 14:26 | |
nine | Can't locate JSON.pm in @INC (you may need to install the JSON module) BEGIN failed--compilation aborted at lib/EvalbotExecuter.pm line 79.. | 14:31 | |
timotimo | huh, that's interesting | 14:33 | |
lucasb | oh, right, Mouq++ added the JSON dependency when he fixed the github gist api | ||
timotimo | would it have to be JSON::PP or JSON::XS? | ||
14:33
brrt joined
|
|||
RabidGravy | don't they have the same interface? | 14:35 | |
FROGGS | I think so | ||
nine | JSON will use JSON::XS if installed | ||
Is this something camelia should be able to do or should I try to install JSON into camelia's perlbrew perl? | 14:36 | ||
FROGGS | I don't think camelia can install Perl 5 modules | ||
14:37
camelia joined,
FROGGS left
|
|||
nine | m: say "I'm back :)" | 14:37 | |
RabidGravy | got the arse now | 14:38 | |
14:38
ChanServ sets mode: +v camelia
|
|||
camelia | rakudo-moar a38b59: OUTPUT«I'm back :)» | 14:38 | |
lucasb | thank you, nine++; and sorry for the trouble :) | 14:39 | |
evalbot control version | |||
camelia | This is evalbot revision 2267d41 | ||
lucasb | m: gist.github.com/anonymous/d2efba968f2a8be140a2 | ||
camelia | rakudo-moar a38b59: OUTPUT«hi» | ||
lucasb | works fine now :) | 14:40 | |
timotimo | very good | ||
RabidGravy | fix it real good | 14:42 | |
hoelzro | good morning, #perl6! | 14:49 | |
nine | And a very good morning to you, hoelzro! | ||
hoelzro | o/ nine! | 14:50 | |
14:51
nys joined
|
|||
b2gills | Chrome crashed so I think it's time for $ apt-get upgrade && reboot | 14:52 | |
14:52
b2gills left
|
|||
RabidGravy | chrome has been really, really bad since the last update | 14:53 | |
geekosaur has not had problems with chrome since disabling gpu support | 14:54 | ||
brrt has actually been using firefox for a while now | |||
geekosaur | somehow that makes it suck both cpu and memory without limit | ||
brrt | oh, and i can't for the life of me get nouveau to do something interesting | ||
geekosaur | every so often I fire up an updated firefox, promptly get reminded why I detest it, and go back to chrome | 14:55 | |
jnthn | Funny, chrome crashed here today too...after running for a month solid. | ||
Remembered my tabs across two windows <3 | |||
14:57
b2gills joined
|
|||
brrt | hmm, i actually hard shutdown my laptop usually | 14:57 | |
geekosaur | that said, I update chrome as often as updates are released, so it's unusual (at least of late, "thanks" Hacking Team) for Chrome to reach a week of uptime ;) | 14:58 | |
b2gills | My computer has been trying to get me to update Chrome, and the kernel for more than a week | 15:00 | |
15:02
[ptc] left
|
|||
zostay | jnthn, moritz: i'm not opposed to using a Supply instead | 15:06 | |
as for whether or not using a Promise/Channel/Supply will cause trouble for the middleware, that will happen anyway | |||
if you want to write complete middleware in PSGI, you have to handle all the callback cases, generally done by using a Plack helper | 15:07 | ||
completely functional middleware must implement everything for both the server and app sides of the spec | 15:08 | ||
b2gills | I think there is a better interface "hiding" in Perl 6 that no-one has "found" yet. | ||
15:09
[ptc] joined,
burnersk joined
|
|||
moritz | b2gills: maybe one could come up with a middleware design where dispatching to the application is just a callsame() came | 15:09 | |
*call | 15:10 | ||
zostay | i hadn't suggested it in the spec, but i don't see why middleware can't be applied by just calling .wrap() on the app routine | 15:14 | |
moritz | one could also imagine an API built around returning promises (even in the synchronous cases) | 15:15 | |
zostay: well, the problem isn't calling; it's dealing with the return value | |||
15:15
brrt left
|
|||
moritz | zostay: imagine a middleware that always wants to add a header ("Cache-Control", for example) | 15:15 | |
ugexe | i use the promise method for synchronous stuff quite a bit | ||
moritz | zostay: so it has to do check the type of the return value, and do one thing if it's Positional, and another if it's a Promise, and a third if it's a Channel | 15:16 | |
zostay | right... the only way around that is to require every app implement a promise that returns an iterable that returns a channel/supply for content | 15:17 | |
afaict | |||
15:17
telex left
|
|||
zostay | the point is to make app writing easy for the app authors, and make server and middleware writing possible | 15:17 | |
if you use the channel or the promise interface you are making a statement that something about your performance is different than a typical app | 15:18 | ||
15:18
telex joined
|
|||
zostay | that's the case if you return a callback in PSGI | 15:18 | |
moritz | well, there's an alternative | 15:19 | |
one could pass around proper objects insteads of hashes / arrays | |||
and those have event callbacks | 15:20 | ||
so a middleware could register a on-header-available callback that adds a header, for example | |||
zostay | is there a generic type in P6 that does that? | 15:21 | |
moritz | (I know this is quite a departure from the current API) | ||
zostay: no; would need be a custom type | |||
another option would be to supply such a type as a utilty/wrapper around the data structure | |||
zostay | then i demur and say you've described a high level framework, not P6SGI which is lowest-common-denominator | 15:22 | |
the reference implementation can provide helpers, but the standard itself must be low level | |||
PSGI/Plack have demonstrated success in this | |||
moritz | agreed, but it's a small low-level API | 15:23 | |
the larger it becomes, the more painful its low-levelness becomes | |||
15:26
diana_olhovik_ left
|
|||
zostay | i need to finish the reference implementation and then we can try things out better | 15:34 | |
nine | In any case I'm happy to see things moving on this front :) | 15:37 | |
15:47
cognominal left
16:00
Begi joined
|
|||
Begi | Hey #perl6 ! How can I get the total number of lines in a file ? | 16:01 | |
Is there like perl 5 a $. var ? | 16:02 | ||
PerlJam | Begi: $*IN.ins (or some other filehandle) | ||
m: END { say $*IN.ins } # curious | 16:04 | ||
camelia | rakudo-moar a38b59: OUTPUT«0» | ||
PerlJam | figured | ||
m: END { say $*ARGFILES.ins } # how about this? | |||
camelia | rakudo-moar a38b59: OUTPUT«(Any)» | ||
PerlJam | that was unexpected | 16:05 | |
(I would have expected 0 alos) | |||
16:20
spider-mario joined
|
|||
timotimo | $*ARGFILES isn't quite perfectly smart yet | 16:23 | |
16:40
rangerprice joined
16:48
yogan joined
|
|||
Begi | Ok thanks. And what's the easiest way to select the last 5 lines of a file ? | 16:53 | |
TimToady | m: my @lines = lines(); say @lines[*-5 .. *] | 16:54 | |
camelia | rakudo-moar a38b59: OUTPUT« Slán! Slán go fóill, a Dhún na nGall, a chontae shéimh gan smál, Is do d’fheara breáth’ in am an ghá nár úmhlaigh riamh roimh Ghall; Tá áit i mo chroí do gach fear is gach mnaoi is gach páiste beag agus mór Atá beo go buan gan bhuairt …» | ||
Begi | Ok thanks. Eh... Is camelia ok ? | 16:57 | |
moritz | m: say 'yes, sir' | 16:59 | |
camelia | rakudo-moar a38b59: OUTPUT«yes, sir» | ||
Begi | :P | 17:00 | |
17:00
DarthGandalf joined
17:01
colomon left
|
|||
TimToady wonders if the Prince of Wales knows Welsh... | 17:05 | ||
llfourn | fairly sure he doesn't | 17:06 | |
itz | he spoke some Welsh at his investiture | 17:10 | |
17:12
domidumont joined,
colomon joined
|
|||
RabidGravy | he did indeed, but we're old enough to remember that | 17:16 | |
17:17
espadrine left
|
|||
RabidGravy | it of course could have been garbage as I for one don't know Cymraeg at all | 17:19 | |
horrifyingly I know more Catalan | 17:20 | ||
vendethiel | my "Programming Perl" books (page 1008, under the "use charnames;" section): `"AMELIA" => "DROMEDARY CAMEL"`. Did camelia change name? :P | ||
dalek | rl6-roast-data: b8b5cbe | coke++ | / (9 files): today (automated commit) |
17:21 | |
17:23
domidumont left
|
|||
lucasb | .u camel | 17:24 | |
yoleaux | U+1F42A DROMEDARY CAMEL [So] (🐪) | ||
U+1F42B BACTRIAN CAMEL [So] (🐫) | |||
[Coke] | .u moose | ||
yoleaux | U+1509 CANADIAN SYLLABICS MOOSE-CREE SK [Lo] (ᔉ) | ||
lucasb | No butterfly in unicode :( | 17:26 | |
17:27
mohij joined
|
|||
[Coke] | .u butt | 17:30 | |
yoleaux | U+1F518 RADIO BUTTON [So] (🔘) | ||
U+1F532 BLACK SQUARE BUTTON [So] (🔲) | |||
U+1F533 WHITE SQUARE BUTTON [So] (🔳) | |||
17:34
dha joined
17:40
khw left
17:45
lizmat joined
17:47
virtualsue left
17:53
Begi left
17:57
llfourn left
|
|||
vendethiel | are the "less" directives actually considered in P5? | 17:57 | |
17:58
aristotle joined
18:00
llfourn joined
|
|||
aristotle | zostay: I think you are being too all-or-nothing when you say if you use the channel or the promise interface you are making a statement that something about your performance is different than a typical app | 18:00 | |
18:01
FROGGS joined
|
|||
aristotle | zostay: I don’t think there’s any point in Perl 6 for distinguishing the deferred/immediate cases. while there may be a case for distinguishing the streaming case | 18:02 | |
lizmat | good *, #perl6! | 18:03 | |
PSA: working on the P6W at the moment... | |||
aristotle | zostay: you don’t want to have to use the PSGI deferred style in Perl 5 if you don’t need to, because it’s so damn inconvenient, because the language doesn’t give you any better option | ||
zostay: but in Perl 6 it’s just putting `start { }` around your code. that’s nothing | |||
lizmat | if anybody thinks of something that should be mentioned, please let me know! | 18:04 | |
18:05
llfourn left
|
|||
aristotle | zostay: the real inconvenience when writing middlewares is the deferred vs immediate case difference. the streaming vs immediate body difference would be simple to handle | 18:06 | |
18:06
zakharyas joined
|
|||
[Coke] | the upcoming swiss perl workshop, maybe? | 18:06 | |
(for liz) | |||
lizmat | [Coke]: already in there, but [Coke]++ for mentioning :-) | ||
aristotle | zostay: many middlewares (maybe most) don’t need to look at the response body at all, so would be unaffected by the body having two possible forms. but many middlewares need to modify the response headers, so they do have to handle the deferred vs immediate distinction | 18:13 | |
18:15
diana_olhovik joined,
ChoHag joined
|
|||
aristotle | zostay: and I don’t see the value of making that distinction in Perl 6, since it doesn’t cost apps anything appreciable to uniformize the response (and that’s the only place where that might incur any costs. every other part of the system becomes simpler for having fewer cases to deal with) | 18:16 | |
moritz, leont: ping ^ | |||
18:19
pierrot joined
18:20
njmurphy left
|
|||
bartolin_ | good evening, #perl6 | 18:20 | |
leont | aristotle: you mean something like always returning a Supply, and middlewares essentially doing .map on those? | 18:34 | |
18:39
zakharyas left
18:42
tphilipp joined,
tphilipp left
|
|||
aristotle | leont: possibly. not firm enough in Perl 6 to say for sure what to use | 18:46 | |
PerlJam | But, laziness + composable async primitives for the win in any case. | 18:50 | |
18:50
estrabd joined
18:51
Mhoram joined
|
|||
zostay | aritstotle, thx... so can i sum up your thoughts as being, "Why not always return a Promise?" | 18:52 | |
aristotle | leont: all I can say is the real pain point of PSGI is deferred vs immediate response, whereas streaming body is a side show, and it would be good to remove the inconvenient distinction. I’d question the need for non-/streaming body distinction too, on principle, but I don’t feel strongly about that one | 18:53 | |
zostay: yeah | |||
zostay | that sounds doable to me | 18:54 | |
jnthn | A Promise is trivially coercable into a Supply | ||
Which probably helps the streaming thing | 18:55 | ||
Uh, or uniformly coding against the streaming thing | |||
But letting folks write start { ... } when that's enough | |||
zostay | well, the streaming thing is primarily for the content... generally while deferred mostly impacts the delivery of headers | 18:56 | |
there are too many adverbs in that last sentence | |||
aristotle | and the headers are of much greater interest to other components than the body | ||
b2gills | Is there a nicer way of writing `my %h := Hash[Any,Any].new;` or `my %h := :{};` where %h will always be of the same type? | 18:57 | |
jnthn | my Any %h{Any}; | ||
Though the first Any is a tad redundant if you just want the keys to be objects | |||
zostay | anyone have a suggestion on what the reference implementation should be called? i have a name, but i don't like it | ||
jnthn | Well, psgi is an anagram of pigs, so something about ham or bacon maybe... :P | 18:59 | |
b2gills | Porki? | 19:00 | |
mst | for some reason I always end up with the Tool satan song in my head except with baaaacon instead of saaaatan | ||
TimToady | what's your kevin psgi number? | 19:01 | |
aristotle | ouch | ||
zostay | lol | ||
TimToady | Inversion of Puntrol... | 19:02 | |
timotimo | mst: UND KEINE SCHINKEN!! | ||
mst | timotimo++ | 19:04 | |
aristotle | zostay: the only thing that comes to mind that’s vaguely in keeping with Rack (Ruby) → Plack (Perl) is maybe Clack (Camelia), which is meh. can’t think of any good way to finnagle “perl 6” or “Six” or something like that into there | 19:06 | |
ChoHag | Clacks | ||
A la Discworld | 19:07 | ||
aristotle | oh wow I totally missed that | ||
lucasb | Clack is the Common Lisp implementation | ||
aristotle | lucasb: oh :( | ||
[Coke] | Plack6? | ||
19:07
diana_olhovik left,
jjido joined
|
|||
ChoHag | Oh now *that's* exciting. | 19:07 | |
jnthn | Slack? | 19:08 | |
(For six...) | |||
zostay | that's where i went with it, i want to avoid confusing it with Plack... i ended up with Spackle | ||
RabidGravy | +1 | ||
TimToady | well, how 'bout Plack -> Gingivitis? | 19:09 | |
aristotle | slack occurred to me but I dunno? tho in a way it’s cool. but it’s going to have a hell of a time competing against the slack.com chat service thing for googlejuice | ||
zostay | could name it after the startup script, slackup | ||
TimToady | Pl6ck would really confuse the dyslexics | ||
aristotle | TimToady: you’re not helping :) | 19:10 | |
RabidGravy | shouldn't the start up script be call slackoff ;-) | ||
jnthn | Heh, "Filling" is what comes after plack...and middleware kinda fills the gap ;P | ||
b2gills | I've been trying to come up with a Perl 6 implementation of en.wikipedia.org/wiki/De_Bruijn_sequence that shows off Perl 6's features, but I've got nothing. | 19:11 | |
zostay | Crack and then the startup script is crackup | 19:12 | |
aristotle | jnthn: yeah re gingivitis, I was going to say it’s unfortunate enough that “Plack” is the colloquial spelling of (dental) plaque in German | ||
TimToady | if you implement with Supply, you could call it Supple | 19:13 | |
moritz | b2gills: if you post a straight Perl 6 version, I can try to make it more idiomatic | ||
zostay | there was an early attempt by someone named Plackdo | 19:14 | |
aristotle . o O ( Sixpack? ) | 19:15 | ||
moritz | aristotle: Sixplack? | ||
ChoHag | Sixplack | ||
aristotle | heh | ||
zostay | Cameliack | 19:16 | |
[Coke] | sixplack++ | ||
lizmat | this weeks Perl 6 Weekly just got published! p6weekly.wordpress.com/2015/08/03/...ing-along/ | ||
19:17
cognominal joined
|
|||
lizmat | publishing a P6W while going at 180 km/hour on the German Autobahn is a special experience | 19:17 | |
aristotle | how does it feel | ||
b2gills | moritz: Part of the problem is I don't really know Python so I'm guessing as it is, I did find one in JS that was easier to figure out en.wikipedia.org/wiki/De_Bruijn_sequence (throw out all code dealing with `memoArr`) | ||
lizmat | aristotle: like living in the fast lane :-) | 19:18 | |
seems it is my turn to drive | |||
& | |||
19:18
lizmat left
|
|||
RabidGravy | sorry I didn't do any new modules but I started four new ones each more distracting than the last | 19:19 | |
ChoHag | Put the yaks away. | 19:20 | |
RabidGravy | but at least I've got a nice pattern for warapping C++ libraries, a lot of ideas for building objects from binary data and some crack induced ideas about ovr-riding enumerations | 19:25 | |
moritz | today's one-liner: finding all the p6 modules that have a 1; at the end | 19:26 | |
19:26
virtualsue joined
|
|||
ChoHag | Wrapping C++ would be nice. People do insist on using it despite it. | 19:26 | |
moritz | moritz@hack:~/p6/perl6-all-modules$ git ls-files|grep -E 'pm6?$' | perl6 -ne '.say if slurp($_) ~~ /1\;\s*$/' | ||
leont | People use C++ because there's not much alternative in its genre. D is largely a cleaned-up C++, but it doesn't have the same momentum or exosystem | 19:27 | |
[Coke] | leont: that sounds… familiar. | 19:28 | |
leont | It does | ||
timotimo | .o( it wouldn't be terribly bad if what we have was called Frack ) | ||
RabidGravy | :) yeah but the hippies might start a camp outside worried we're poisoning the water | 19:29 | |
ChoHag | I killed the debugger. | 19:30 | |
Unhandled exception: ctxlexpad needs an MVMContext | |||
RabidGravy | but you did'nt shoot the sheriff | ||
ChoHag | Nor deputy. | ||
Don't wanna fuck with LEOs these days. | 19:31 | ||
19:31
yqt joined
|
|||
ugexe | in america it is safer to just shoot the LEO | 19:31 | |
19:33
pdcawley left
|
|||
rjbs | on the contrary, SpaceX has been having a lot of trouble shooting things into LEO | 19:35 | |
timotimo | m) | 19:36 | |
what's that other meaning of LEO? | |||
oh | |||
law enforcement officer? | |||
itz | low earth orbit | ||
timotimo | i was asking for "that other meaning" | 19:38 | |
i know about low earth orbit :) | |||
itz | ah | ||
RabidGravy | leprechaun emerency organization | ||
itz | leo sayer? | ||
timotimo | blogs.perl.org/users/aaron_baugher/...erl-6.html ← can somebody send a comment this person's way that .pick isn't mutating on the array you're using, and perhaps suggest using .pick(*) to get a shuffled list of the cards to shift or pop from? | ||
dalek | ast: 1d56978 | usev6++ | S02-types/nested_arrays.t: Change test for RT #98954 and remove duplicate ticket number |
||
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...l?id=98954 | ||
19:39
[Sno] left
|
|||
timotimo | and calling methods "postfix functions" is ... interesting %) | 19:40 | |
19:40
darutoko- left
|
|||
hoelzro | does nqp-j have anything like MoarVM's special_return | 19:41 | |
hoelzro was thinking of trying his hand at implementing DESTROY on the JVM | |||
19:45
ChoHag left
|
|||
[Coke] | 1,031 RTs open | 19:48 | |
b2gills | m: gist.github.com/dwendt/5cc5223d4686d0e33209 | 19:50 | |
camelia | rakudo-moar a38b59: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AyW8s4XgOdPreceding context expects a term, but found infix = insteadat /tmp/AyW8s4XgOd:1------> 3memoArr =7⏏5 {};» | ||
b2gills | damn middle click | 19:51 | |
m: gist.github.com/b2gills/18d9496d0634bb83cf78 | |||
camelia | rakudo-moar a38b59: OUTPUT«0 0 0 1 0 1 1 1a a b a c a d b b c b d c c d da a a bb a a ccc a a dddd a bb bb a bb ccc a bb dddd a ccc bb a ccc ccc a ccc dddd a dddd bb a dddd ccc a dddd dddd bb bb bb ccc bb bb dddd bb ccc ccc bb ccc dddd bb dddd ccc bb dddd dddd ccc ccc ccc dddd…» | ||
jjido | b2gills: nice! | 19:54 | |
b2gills: what does [^$k] do? | 19:55 | ||
b2gills | Array.new( 0 ..^$k ) | ||
Array.new( Range.new( 0, $k, :excludes-max )) | 19:56 | ||
19:56
dha left
|
|||
jjido | b2gills: all right got it | 19:57 | |
b2gills: and "!%%" ? | |||
lucasb | not divisible :) | 19:58 | |
jjido | makes sense | 19:59 | |
b2gills | I really don't like the sub `db` in the middle | 20:00 | |
[Coke] | RT #121145 is closable with tests if someone wants some karma. :) | 20:01 | |
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=121145 | ||
20:01
llfourn joined
|
|||
jjido | b2gills: I see what you mean but that's the algorithm. You could pass @a and @sequence as arguments | 20:02 | |
skids still finds it strange that with all the crazy operators we never got something for ($a - $a % $b) and the ciel version thereof. | |||
jjido | $a -% $b | 20:04 | |
[Coke] | m: say 20 -% 10 | ||
camelia | rakudo-moar a38b59: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1uM5pz_IsPTwo terms in a rowat /tmp/1uM5pz_IsP:1------> 3say 20 -%7⏏5 10 expecting any of: infix infix stopper postfix statement end statem…» | ||
jjido | [Coke]: see, it could be added | 20:05 | |
[Coke]: btw the answer is 20 | |||
20:06
llfourn left
20:07
jjido left
|
|||
skids | "set phasers to stun." "Captain, there appears to be a parrot in my phaser" | 20:14 | |
[Coke] | didn't we just talk about chaining ~~ ? | 20:15 | |
r: say 0 ~~ 0 ~~ 0; | |||
camelia | rakudo-{moar,jvm} a38b59: OUTPUT«False» | ||
[Coke] | masak: if the current state of ~~ and chaining is settled, maybe RT #81336 can be rejected? | 20:16 | |
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...l?id=81336 | ||
ShimmerFairy | [Coke]: it was decided that ~~ is chaining after all (since it was determined that learning that ~~ chains is less disruptive than changing its precedence) | 20:19 | |
RabidGravy | so I can roll back all the changes that occasioned? | 20:20 | |
ShimmerFairy | m: say ("foo" ~~ "foo") && ("foo" ge "bar"); say "foo" ~~ "foo" ge "bar"; # these should be the same, so the bug is still valid | 20:21 | |
camelia | rakudo-moar a38b59: OUTPUT«TrueFalse» | ||
dalek | ast: 235a8c9 | usev6++ | S02-types/set (2 files): Add another two tests for RT #125611 |
20:22 | |
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=125611 | ||
[Coke] | ShimmerFairy: can you clarify on the ticket, then? | 20:23 | |
ShimmerFairy | [Coke]: well, that's how all chaining ops work, so unless you're referring to something else, I'm not sure what there is to clarify. | 20:24 | |
PerlJam | ShimmerFairy: I think he means to add that example. | 20:25 | |
20:25
brisby joined
|
|||
PerlJam | ShimmerFairy: and if he didn't mean that, I'll ask you to please add your "expanded" chaining example to the ticket. :-) | 20:26 | |
20:26
brisby left
20:27
FROGGS left
|
|||
[Coke] | PerlJam++ | 20:28 | |
yes, please add that example as something that shoudl work but doesn't. (even better, write a test, and mention in the ticket which file the test went in) | |||
20:29
mr_ron joined
|
|||
mr_ron | m: gist.github.com/ronaldxs/fe83eac02aa690f787d3 | 20:30 | |
camelia | rakudo-moar a38b59: OUTPUT«04» | ||
mr_ron | Could someone look at the gist - I think it's a bug with Proxy | ||
timotimo | huh? | 20:31 | |
you mean the 0 in there is problematic? | |||
mr_ron | Yes - the zero doesn't make much sense. I don't know that the 4 result makes sense either though ... | 20:32 | |
timotimo | what did you expect it to print instead, mr_ron? | ||
i think the 0 is absolutely correct | 20:33 | ||
what else would it be? | |||
mr_ron | something like Proxy.new | ||
timotimo | oh | ||
well, you'll have to := instead of = | |||
otherwise you'll just fetch the value of that proxy and put it into $p | |||
20:34
rindolf left
|
|||
timotimo | m: my $p := Proxy.new( FETCH => { 1 }, STORE => -> $, $ { say "boing" } ); say $p.perl | 20:35 | |
camelia | rakudo-moar a38b59: OUTPUT«1» | ||
timotimo | m: my $p := Proxy.new( FETCH => { 1 }, STORE => -> $, $ { say "boing" } ); $p = 10 | ||
camelia | rakudo-moar a38b59: OUTPUT«boing» | ||
timotimo | m: my $p = Proxy.new( FETCH => { 1 }, STORE => -> $, $ { say "boing" } ); $p = 10 | ||
camelia | ( no output ) | ||
timotimo | you see? the := vs = makes the big difference | ||
mr_ron | I am playing with it now ... thank you very much for your clarification | 20:37 | |
ShimmerFairy | [Coke]: yeah, I'm thinking of trying to fix it in a couple of minutes, and I'd start by writing tests :) (if I don't start on that soon, I'll just update the ticket) | 20:38 | |
timotimo | sure, no problem :) | 20:40 | |
vendethiel | www.reddit.com/r/perl6 <- can whoever has access to this subreddit modding remove the ad? | 20:41 | |
ShimmerFairy | btw, would it be wise/recommended for me to symlink t/spec to my existing roast repository, so I don't have to deal with going between two copies of the same repo anymore? :) | ||
timotimo | i clicked the "remove" button | 20:42 | |
is it gone? | |||
seems to be | 20:43 | ||
mr_ron | m: state $p := Proxy.new( FETCH => { 1 }, STORE => -> $, $ { say "boing" } ); $p = 10 | 20:45 | |
camelia | rakudo-moar a38b59: OUTPUT«(signal SEGV)» | ||
timotimo | ooooh | ||
20:45
rindolf joined
|
|||
timotimo | yeah, state and := is not compatible | 20:45 | |
m: state $test := 1; say $test | 20:46 | ||
camelia | rakudo-moar a38b59: OUTPUT«(signal SEGV)» | ||
timotimo | no need for a proxy there, no need for an assignment even | ||
20:46
kaare_ left
20:47
kaare_ joined
|
|||
mr_ron | sorry - I am prematurely optimizing and worrying that every access to a mutator needs to allocate a new Proxy object. | 20:48 | |
20:49
brisby joined
|
|||
timotimo | proxies aren't terribly expensive; the more interesting part is probably taking the closures for the fetch and store blocks | 20:50 | |
RabidGravy | mr_ron, really only need to start worrying about that when you want to do something after the value is set :) | 20:51 | |
20:53
llfourn joined
20:54
brisby left
|
|||
bartolin_ | r: my $str; my $i = 0; while $i < 2 { LEAVE { last }; $i++; $str ~= ~$i; }; say $str; $str = ""; $i = 0; while $i < 2 { LEAVE { $str ~= "leaving" }; $i++; $str ~= ~$i; }; say $str | 20:54 | |
camelia | rakudo-moar a38b59: OUTPUT«11leaving2leaving» | ||
..rakudo-jvm a38b59: OUTPUT«1» | |||
mr_ron | m: gist.github.com/ronaldxs/e0a325c9e3bc716cf7f7 | 20:55 | |
camelia | rakudo-moar a38b59: OUTPUT«246» | ||
bartolin_ | [Coke]: ^^ alas, there still seems to be something wrong on JVM with RT #121145 | ||
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=121145 | ||
20:55
dha joined
|
|||
[Coke] | bartolin_: hokay. | 20:56 | |
jnthn | I promised to share whatever progress I'd made on GLR implementation by today. Here it is: gist.github.com/jnthn/aa370f8b32ef98e4e7c9 | ||
timotimo | oh, GLR interacts with Whatever? | 20:57 | |
[Coke] | We can at least add a test and make sure we don't regress on moar - don't have to get JVM 100% before christmas. | ||
jnthn | timotimo: It interacts with most things :P | ||
bartolin_ | [Coke]: I'll add a test for that ... what you said | ||
20:57
kaare_ left
|
|||
mr_ron | the gist is fine. while I have some people looking I was just wondering whether I could get comment on - is the attribute mutator technique a kludge or something likely to work going forward. Technique was displayed yesterday | 20:58 | |
20:58
llfourn left
|
|||
dha | Out of curiosity, do we have a command-line option parsing mechanism at this point? I'm not seeing a relevant module (like the Getopt modules in p5) or anything built-in. | 20:59 | |
[Coke] | dha: sub MAIN | ||
jnthn | dha: Look up sub MAIN | ||
timotimo | yeah, sub MAIN exists and is pretty great | ||
jnthn | mr_ron: There's no plans for Proxy to go away | ||
arnsholt | What they said about sub MAIN. Basically, Getopt and friends are obsolete in Perl 6 | 21:00 | |
timotimo | but it has some design decisions in place that you sometimes want to work against | ||
dha | Ah, ok. Again, the documentation does not make things easy to find... | ||
21:00
skids left
|
|||
timotimo | pretty often, people get annoyed by having to put positionals in the back and all nameds in front | 21:01 | |
jnthn sees we're going from "argh no docs" to "argh I can't find the docs" :) | |||
arnsholt | That's an improvement of sorts, I guess. Good point =) | ||
timotimo | "too many docs, make them go away!" | ||
mr_ron | I didn't mean proxy is going away - the way it is used as an attribute mutator is different from the example in roast which is why I asked - github.com/perl6/roast/blob/master...mutators.t | 21:02 | |
dha | Which raises a troubling question for me. I know everyone's working hard to get Perl 6 out the door, but... without useful docs, is anyone going to be able to use it? | ||
21:02
Ven joined,
Ven left
|
|||
dha | And I want to stress that that question is not intended to start throwing blame around. but it seems like it might be important. | 21:02 | |
jnthn | dha: Looking at the doc repo, it seems a bunch of people are contributing to the docs too. Heck, I thought you'd done a rather sizable contribution... | 21:04 | |
dha | I've done a good deal in my own repo. Mostly for changes from p5 to p6 so far. | 21:05 | |
jnthn | Ah...and planning to migrate that work into doc.perl6.org at some point? | 21:06 | |
dha | But when I see that things like use and while loops (with the new pointy block stuff) isn't in the main docs, that seems troubling. | ||
jnthn- I would like to, yes. Not sure yet how best to do that. suggestions welcome. | |||
[Coke] | dha: yes, it's troubling. Please open tickets on the docs site when you can't find stuff, that'll help. | 21:07 | |
github.com/perl6/doc/issues | |||
dha | [Coke]- how so? put stuff in Wanted? | ||
ah. | |||
ok. | |||
[Coke] | Or in wanted, that's probably fine also. | ||
dha | I've added some stuff to wanted. | 21:08 | |
21:08
rindolf left
|
|||
dha | I don't want to just turn it into a behemoth that's simply mind-numbing, though. :-) | 21:08 | |
jnthn | dha: What're you blocking on exactly? Where it belongs, whether it wants a section of it's own becasue it's in many parts, etc? | 21:09 | |
dalek | ast: 7ce647a | usev6++ | S04-phasers/in-loop.t: Add tests for RT #121145 |
||
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=121145 | ||
21:09
TEttinger joined
|
|||
dha | jnthn- The stuff I've done so far might warrant its own section, if only because it's primarily for perl5 people, documenting the changes from p5 to p6. | 21:10 | |
[Coke] | for sub MAIN, being able to find it via search would be nice - or command line options. I couldn't find it either way. I know there's info in the SYN, though. | ||
jnthn | In general, though, please don't suggest that everyone is working on implementation and nobody on docs. It's clear various people are, and I imagine it's a good bit better to motivate them to keep going by acknowledging that. :) | 21:11 | |
[Coke] | me grabs a copy of doc to see if he can fix the search-didn't-find-anything bug. | ||
dha | Although I'm currently also working on a "new stuff in perl 6 that might make you want to use perl 6" | ||
jnthn | dha: A "Perl 5 to Perl 6" section sounds sensible enough to me, fwiw. | 21:12 | |
dha | jnthn- I apologize for making it sound that way. That really wasn't what I was trying to say. I guess I just don't know who's doing docs, and I'm seeing holes in the docs, so I said what I said. In reality, I'm quite sure people are working on the docs, just not in my immediate vision. | ||
Certainly no insult intended. | 21:13 | ||
[Coke] is seeing lots of Use of Nil in numeric context in block at lib/Panda/Builder.pm:125 | 21:14 | ||
21:15
Ven joined
|
|||
dha | Also, although I don't know how much this holds in general practice, but in my own investigations, I wind up going to the design documents a lot for information, and I don't think (although I could be wrong) that someone trying to learn Perl 6 would go there. Also, true or not, I can't get away from the feeling that the design docs are necessarily what's actually going on in the implementation. | 21:15 | |
Again just my, possibly limited, view. | |||
jnthn | dha: I was already sure you didn't mean it badly; I've just spent plenty of time listening to "argh why isn't Perl 6 getting done" when I was working hard on the darn thing over the years, and know it can be demotivating. :) | ||
dha | And, [Coke] , yes, being able to find MAIN through a search would be helpful. | 21:16 | |
jnthn | Yes, I agree the design docs aren't where we want people to be looking. | ||
They're certainly in places "plans of where we're heading", whereas docs very much want to be "what's there and how to use it" | |||
dha | jnthn- I completely understand that. And if anyone was listening to me and got discouraged, I profusely apologise and open myself to suggestions as to how I can help. | 21:17 | |
jnthn- that's how I see it as well. | |||
jnthn | Given the amount of work you're doing on 5to6 docs, I'd say you already are helping. Please do record what you find missing, though. Like with bugs in the implementation always going into RT, it's better to have them recorded than forgotten. | 21:18 | |
dha | I will do my best. | 21:19 | |
jnthn | dha++ | ||
ShimmerFairy | Not to mention the synopses are to some extent written with the expectation that you know a thing or two about writing compilers :) (as opposed to simply being a regular Perl 6 user) | ||
timotimo | jnthn: liking your gist so far, but i'm not so far into it | ||
dha | And if anyone has the time to review what I've written, just to make sure it's accurate, I would be thrilled to put it into the official doc repo. | ||
mst | the supplies one? if so, looks *really* good to me | ||
[Coke] | mst: new one is the GLR one | ||
mst | very much the sort of thing I'd like to see if we could arrange in perl5 if leonerd ever gets certain of his crazy plans to work | 21:20 | |
ah | |||
not looked at that one | |||
RabidGravy | also doing docs is a strange subset of people in some ways, comfident enough with writing, familiar enough with the subject but not tied up doing stuff to or with the language | ||
[Coke] | jnthn++ # Do ALL THE THINGS | ||
21:20
beastd joined
|
|||
[Coke] wonders if he can make the graphviz stuff go faster when building docs... | 21:20 | ||
jnthn | mst: Glad it looked good to you; I'll be working to get that stuff implemented in the next couple of weeks. :) | ||
timotimo: I think you'll have some fun profiling things. I do have the biases of having written the thing, but the profile output does feel more accessible and easier to work out where the costs are than what's in CORE now... | 21:22 | ||
21:22
jjido joined,
brisby joined
|
|||
dha | And, in case anyone missed the link all the other times I mentioned this... github.com/dha/perl5-to-perl6-docs :-) | 21:22 | |
21:22
brisby left
|
|||
timotimo | :3 | 21:22 | |
dha | Also, currently taking suggestions as to features that might make people want to give Perl 6 a try. | ||
tony-o | Stage parse : 40.659 | 21:23 | |
dha: web scale asynchronous solutions | |||
21:24
Ven left
|
|||
TEttinger | the only problem I have with perl 6 is that it's extremely massive and includes a lot of history that I am not familiar with. | 21:24 | |
jjido | grammars are quite cool. | ||
TEttinger | so stuff like, "oh it's just like in perl 5, but X" | ||
doesn't help me at all | |||
b2gills | jnthn: Would it make sense for List.elems to ask its iterator(s) about how many elems it thinks it has? For example `(1 xx 100).list.elems` would know that it should return 100 without iterating | 21:25 | |
[Coke] | if you want the history, then dha's 5-6 is a good place to start. If not, then where we stole the features from probably doesn't matter to you. | ||
TEttinger | I don't know perl 5, why would I seek that out? | ||
dha | TEttinger - Granted, but I'm guessing a lot of the initial potential audience for p6 are p5 users. | ||
TEttinger | I'm guessing a lot of p5 users are now not p5 users | 21:26 | |
dha | So, yeah, it may not be useful to you, but it may be useful to (many?) others. | ||
tony-o | TEttinger has a good point in that isolates just about everyone but p5 users | ||
jnthn | b2gills: Do you have a use case? | ||
RabidGravy | dha, modern extensible object model, composable concurrency features. consistent design | ||
tony-o | who aren't that likely to port existing production code just because | ||
ShimmerFairy | dha: I have no problem with docs that help with going from P5 to P6. I think the issue of "don't assume people know Perl 5" is more of a general gripe with P6 documentation (the specs have a bad habit of leaving out "just like P5" stuff in some cases) | 21:27 | |
jnthn | b2gills: There's going to be a very limited nuber of situations where we could take that shortcut, is all | ||
TEttinger | I mean, from what I know about perl 6, which is not much, some of the really good features are that it's extremely good at handling language-like things, with grammars, moar's unicode support, and the best regexes anywhere | ||
21:28
mr_ron left
|
|||
lucasb | b2gills: I had a similar idea about .combinations and .permutations knowing how many elements they have without having to iterate everything :) | 21:28 | |
tony-o | a grammar tutorial would have been super helpful, froggs and a couple others in here are the only reason i got through the first one i wrote | ||
jjido | TEttinger: huh Unicode is a bit of an advanced topic | ||
dha | ShimmerFairy- indeed. I am in no way suggesting that the p5->p6 stuff I've done should be the main or, god forbid, only docs. :-) | ||
TEttinger | no one else supports 8.0 | ||
tony-o | a grammar tutorial with actions - | ||
TEttinger | java 9 will support 7.0 | ||
java 9 comes out next year | |||
jnthn | lucasb: OK, now we have an extra use case :) | 21:29 | |
flussence | grammars are cool, but working with data that isn't perfectly formed utf-8 feels like a massive chore atm | ||
jjido | flussence: yeah | ||
ShimmerFairy | dha: My only question is how your work will sit alongside the existing 5to6 doc, if your work will go to doc.perl6.org: doc.perl6.org/language/5to6 | 21:30 | |
leont | Has anyone talked to the unicode people about or NFG? | ||
*our | |||
[Coke] | ShimmerFairy: I think it will replace it if he can get someone to review it. | ||
ShimmerFairy | ah | ||
RabidGravy | to be honest I strongly believe that the majority documentation should just treat it as a completely new language with no antecedents | ||
TEttinger | RabidGravy: agreed | 21:31 | |
tony-o | RabidGravy++ | ||
b2gills | Perhaps someone should go and find things that are in the current 5to6 that aren't in dha++'s version | ||
ShimmerFairy | leont: I forget what they called it, but they do have a thing on handling text in more-or-less the same way we do with NFG. | ||
[Coke] | RabidGravy: yes, that's the plan. | ||
dha | ShimmerFairy - My current off-the-cuff thought is that the Essentials doc I'm currently trying to structure might replace the current 5to6 | ||
jnthn | Agree, but that doesn't mean we can't have a really give 5 -> 6 guide as well (and heck, a [other language] -> 6 guide) | ||
TEttinger | p5->p6 could be in a sidebar even in existing docs, but not assumed knowledge | ||
RabidGravy | and I've been doing perl for more than twenty years | ||
[Coke] | TEttinger: yes. the official docs will not assume knowledge of p5. the only reason the syn do is because they aren't meant for end users. | 21:32 | |
TEttinger | ah | ||
dha | The other docs I've done have been a bit more exhaustive and probably more useful as reference than tutorial | ||
ShimmerFairy | dha: yeah, that makes sense. I was thinking the current one could serve as the introductory doc too, if it's still useful. :) | ||
leont | TPF has some sort of membership to Unicode consortium, it may be useful to have one of the p6 core people involved there too (though I suspect the obvious people may be too busy anyway) | 21:33 | |
jnthn | leont: Not that I'm aware of, but I didn't come up with the idea, just read what Larry'd written in the design docs, asked some questions, read up on Unicode normalization forms, found the most natural algorithmic extension to NFC, and implemented it. :) | ||
b2gills | Perhaps there will be other *to6 docs in the future | ||
ShimmerFairy | [Coke]: I guess that explains it for the synopses, though someone like me who is both A) interested in the compiler-writing portions of P6, to an extent, and B) doesn't know P5, that doesn't make things better :P | ||
TEttinger | 0to6 | ||
dha | ShimmerFairy - Actually, now that I'm thinking it through, it might be best to leave the current 5to6 sort of as is, but maybe add some stuff to it and make *that* the de factor Essentials doc | ||
jnthn | leont: I've got my plate quite full at the moment, as have most of us, but yes, I agree it'd be good if someone from the Perl 6 side was involved there. | 21:34 | |
leont: I may be willing, but not for a few months... :) | |||
dha | And, yes, the 5to6 stuff would be for a specific audience, and *DEFINITELY* not a replacement for actual p6 docs | ||
ShimmerFairy | leont: Well, if I can help out interacting with the Unicode consortium in some way, I did write the initial version of S15, so I guess I might know a thing or two :P | 21:35 | |
dha: incidentally, the 5to6 docs help me learn a bit about how Perl 5 does things, which is interesting even if I'll never use it :) | 21:36 | ||
jnthn | ShimmerFairy: I'm curious, did you look over the NFG impl at all? :) | ||
dha | ShimmerFairy - An unintended, but useful outcome. :-) | ||
ShimmerFairy | jnthn: I don't think I've looked at the code, but I do like what I've tried using so far :) jnthn++ for doing the actual implementation, I'm just the girl who likes to design stuff :P | 21:37 | |
ShimmerFairy needs to fix up the rest of the docs to line up with S15 (mainly S05) sometime, now that she's reminded of it. | 21:38 | ||
timotimo | jnthn: if an iterator pushes all it knows how to push, it'll wait for push-at-least to be called again so that it'll return IterationEnd? | 21:40 | |
ShimmerFairy | dha: > although arrays start with "@", but array I<elements> start with "$", and the like, we've given up. | ||
timotimo | push-all returns IterationEnd, so ... ? | ||
jnthn | timotimo: It returns IterationEnd also if it knows it ran out | ||
ShimmerFairy | dha: I'm not sure I like how defeated that sounds. I think it's for the best we put an end to that :) | 21:41 | |
(also, Essentials.pod is missing an =end pod) | |||
jnthn | timotimo: It says that in the comment even, no? :) | ||
timotimo | ah | ||
jnthn | Returns the number of things # pushed, or IterationEnd if it reached the end of the iteration. | ||
timotimo | i wasn't 100% sure | ||
fair enough | |||
so when the end is reached, it'll never tell you how much was pushed | |||
jnthn | The default impl delegates to push-exactly, which can return IterationEnd | ||
No. Though tbh I don't know of anything that's actually using the number of things pushed yet... | 21:42 | ||
So we may stop doing that. | 21:43 | ||
dha | ShimmerFairy - Valid points. And I've just tossed some stuff in there kind of randomly so far, so I forgot the =end. Thanks. | 21:44 | |
ShimmerFairy | dha: in Functions.pod, "A I<lot> of things are objects.": well, _everything_ in Perl 6 is an object, unless the term 'object' means something different in P5. :) | 21:46 | |
dha | *nod* | 21:47 | |
jnthn | Time for me to get some rest | ||
timotimo | good rest, jnthn | ||
jnthn | More GLoRious hacking tomorrow | ||
'night o/ | |||
timotimo | and thanks for your gist! | ||
dha | How about "in perl 6 everything is an object, even though you may not treat them that way in practice" or something along those lines? | ||
Having just taken Damian's "Perl 6: Transparadigm Programming" class, I don't want to give the impression that, even if everything is an object, you have to do things in an object oriented way. :-) | 21:48 | ||
RabidGravy | "may not need to care or need to treat them that way" | 21:49 | |
lucasb | Differences.pod is so lonely there in the mu repo. Shouldn't it be moved to the doc repo and be merged with 5to6? | 21:50 | |
ShimmerFairy | dha: yes, I believe S01 or S02 describes it as something along the lines of "everything is an object, but Perl 6 lets you ignore that if you're not interested in using OOP" | ||
smls | dha: +1 to expanding the '5to6' doc | ||
if its getting too long, maybe split off separate '5to6-functions' and '5to6-operators' pages | 21:51 | ||
ShimmerFairy | dha: Ah-ha! From S01: "If you want to treat everything as objects in Perl 6, Perl will help you do that. If you don't want to treat everything as objects, Perl will help you with that viewpoint as well." | ||
dha | Well put. | 21:53 | |
RabidGravy | actually a reasonable test of whether that aspiration is met would be to take some complex procedural code and see if it can be ported cleanly | 21:54 | |
with the caveat there is a lot of system interaction P6 doesn't do out the box | 21:55 | ||
21:55
aristotle left
|
|||
dha | Well volunteered, sir! | 21:56 | |
ShimmerFairy | I think at minimum it means you don't suddenly need to declare the types of all your variables, though if Perl 6 forces you to treat everything as an object in parts, that could potentially be remedied. | ||
(Though I should point out that S01 is just the introductory text to the synopses, more or less, and thus isn't likely to receive updates to line up with modern thinking on P6) | |||
RabidGravy | dha, you pick up the samplerate, soundtouch, xbase and soundcloud modules I'm doing and we're good ;-P | 21:57 | |
dha | Heh. | 21:58 | |
ShimmerFairy | dha: when it comes to SIGALRM at least, I suggest trying to find an example of intercepting SIGINT (I recall seeing an example of that wrt concurrency a while back). | 22:00 | |
RabidGravy | being way too distracted the last week | ||
22:02
lucasb left
22:03
dha_ joined
22:04
dha left
22:09
lizmat joined
|
|||
dha_ | ShimmerFairy - Changed the language a bit in Essentials.pod and Functions.pod. thanks for the input. | 22:15 | |
ShimmerFairy | dha_: I'll be sure to go over the rest of it when I've got time. I hope my odd perspective of "I would actually need a 6to5 document" is helpful :) | ||
dha_ | I hope so too. :-) | 22:16 | |
22:16
dha_ is now known as dha
22:17
Begi joined,
Begi left
22:18
lsm-desktop joined
|
|||
RabidGravy | isn't the common alarm case more like "Promise.in($secs).then({#do something});" seeing as there is no alarm()? | 22:26 | |
22:28
skids joined
22:31
smls left,
smls joined
22:36
telex left
22:38
telex joined
|
|||
ShimmerFairy | oof, I discovered why smartmatch won't chain, and it's not pretty. Here's another issue that's brought forth by the problem (I'll check to see if it's already rakudobug'd): | 22:39 | |
m: class Foo { }; multi sub infix:<~~>(Foo $a, Foo $b) { 42.6 }; say Foo.new ~~ Foo; say infix:<~~>(Foo.new, Foo) | |||
camelia | rakudo-moar a38b59: OUTPUT«True42.6» | ||
ShimmerFairy | (basically, the Perl 6 grammar treats ~~ specially, so stuff like this and the chaining bug pop up) | ||
Sgeo | Perl gather/take, unlike Python and ES6 and C# etc. etc., take seems to be abstract-over-able, that is, you can hide the take inside a function call. Those other languages let you abstract usage of yield and equivalent, but to use the abstraction you need to syntactically indicate you're doing so, which makes it obvious control is being given up | 22:42 | |
You can't abstract over the fact of a yield | |||
I wonder if Perl 6's direction on this is deliberate. I guess personally I prefer explicit. Also you can force a higher-order function to give up control unexpectedly by playing tricks with this | 22:43 | ||
vendethiel | Sgeo: yeah, it's deliberate, it's the same with most other features | 22:45 | |
the spec says something along the lines of "if no <keyword> is found in the lexical scope, the dynamic scope will be used" | |||
Sgeo | Wait, gather/take mixes lexical and dynamic scope? | ||
vendethiel | no. | 22:46 | |
Sgeo: quoting the spec "The take function is lexotic if there is a visible outer gather, but falls back to purely dynamic if not. " | |||
It's not mixed, it's one or the other -- can't be both. | 22:47 | ||
22:47
jjido left
|
|||
Sgeo | So what if I use gather, an inner closure uses take, then I give that closure to something else to run later? | 22:47 | |
smls | isn't a dedicated gather { } block *more* explicit than resusing a normal function block like in python? | ||
*reusing | 22:48 | ||
vendethiel | m: sub genval(){ take 3; take 4; }; say do given ^3 { genval; }; say ';;;;'; say do given ^2 { genval; } | ||
m: say 1 | 22:49 | ||
camelia | rakudo-moar a38b59: OUTPUT«take without gather in sub genval at /tmp/MJoo_RMWSL:1 in code at /tmp/MJoo_RMWSL:1 in block <unit> at /tmp/MJoo_RMWSL:1» | ||
rakudo-moar a38b59: OUTPUT«1» | |||
RabidGravy | gather? not given | ||
vendethiel | RabidGravy: whoops; | 22:50 | |
Sgeo | smls, I'm referring to the sense that you can hide a take behind a function definition so any subroutine might secretly hold a take | ||
vendethiel | m: sub genval(){ take 3; take 4; }; say do gather { genval; }; say ';;;;'; say do gather { genval; } # Sgeo | ||
camelia | rakudo-moar a38b59: OUTPUT«3 4;;;;3 4» | ||
RabidGravy | begins with a g and has an e in it, fair enough | ||
Sgeo | vendethiel, now how about if genval was defined in a function that itself had a gather, but was stored somewhere and the later calls called it | 22:51 | |
vendethiel | m: my $closure; gen gengen { $closure = sub { take 3; take 4; }; }; gengen; say do gather { $closure(); }; say ';;;;'; say do gather { $closure(); } | 22:54 | |
camelia | rakudo-moar a38b59: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zfuVwer6VfUndeclared routines: gen used at line 1. Did you mean 'get'? gengen used at line 1» | ||
vendethiel | m: my $closure; sub gengen { $closure = sub { take 3; take 4; }; }; gengen; say do gather { $closure(); }; say ';;;;'; say do gather { $closure(); } # >> | ||
TimToady | I believe rakudo currently only implements the dynamic form, not the lexotic form | ||
camelia | rakudo-moar a38b59: OUTPUT«3 4;;;;3 4» | ||
22:54
llfourn joined,
smls left
|
|||
RabidGravy | don't worry I'll be safely retired in fifteen years time ;-) | 22:55 | |
Sgeo | I think for it to be lexical the literal take would need to be textually inside the literal gather | ||
dalek | ast: 18413a7 | ShimmerFairy++ | S03-operators/relational.t: Add TODO'd tests for RT #81336 |
22:56 | |
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...l?id=81336 | ||
RabidGravy | anyway toodlpip, bed before I turn into a pompkin | 22:58 | |
22:59
llfourn left
23:03
RabidGravy left
23:11
virtualsue left
23:16
gfldex left
|
|||
dha | Question: Apparently (according to the docs) "no warnings" doesn't work currently. does "no strict"? | 23:17 | |
vendethiel | m: no strict; say $a; | 23:18 | |
camelia | rakudo-moar a38b59: OUTPUT«(Any)» | ||
ShimmerFairy | m: no strict; $a = 42; say $a; # dha: does this mean 'yes' ? :) | ||
camelia | rakudo-moar a38b59: OUTPUT«42» | ||
dha | I guess so. Debating whether that should be explicitly stated in 5to6, since it does say that "no warnings" doesn't work. | 23:19 | |
m: $a = 42; say $a; | |||
camelia | rakudo-moar a38b59: OUTPUT«5===SORRY!5=== Error while compiling /tmp/XheqfJL0uNVariable '$a' is not declaredat /tmp/XheqfJL0uN:1------> 3<BOL>7⏏5$a = 42; say $a;» | ||
dha | yep. Looks like that works as I'd expect. | 23:20 | |
ShimmerFairy | 'no warnings' shouldn't be too hard to implement, I don't think (we got 'no worries' a while back, whose intention is to stop P5 gotcha warnings for those who don't know P5) | 23:21 | |
23:22
[Sno] joined
|
|||
dha | I suppose it would be helpful for me to actually learn how things are implemented so I can look and see what is actually going on in the code. But... ow. | 23:24 | |
vendethiel wishes #perl6 good night | |||
(you might want to look at "no worries" in the meantime) | |||
(I mean -- it does MORE than just P5 worries right now, IIRC) | |||
dalek | kudo-star-daily: b7fa490 | coke++ | log/ (9 files): today (automated commit) |
23:25 | |
ShimmerFairy | vendethiel: yeah, because there isn't a special category for P5 worries or anything. That's why I said "intention", and not anything more concrete :P | ||
vendethiel | ShimmerFairy: I actually didn't read your message when I typed mine, and then I was like -- "oops, stale backlog!" | ||
ShimmerFairy | and ♞ vendethiel o/ | ||
23:26
spider-mario left,
vendethiel left
|
|||
ShimmerFairy | dha: it definitely takes a bit of time to get used to reading the Perl 6 grammar as opposed to grammars written in Perl 6 :) | 23:26 | |
dha | I would imagine. What do I need to be able to read to make sense of the rakudo source? C? nqp? Farsi? | 23:27 | |
ShimmerFairy | dha: The underlying stuff is written for NQP, which is a subset of Perl 6 specifically geared towards compiler writing. It's only for the vm-specific stuff that you need to know how to read C or Java or what-have-you | 23:28 | |
dha | Ok. Guess I'll try to find time to learn nqp, then. | 23:29 | |
ShimmerFairy | dha: There was a two-day course a couple years back that explained how to write a compiler in nqp (talking about rakudo, with exercises to implement your own mini-compiler). I can link you to it if you like. | ||
dha | That would be great. Thanks. | 23:30 | |
ShimmerFairy | dha: here you go :) github.com/edumentab/rakudo-and-nq...als-course | ||
dha | Oops. I think I found a mistake in the 5to6 doc. It says that -M and -m have been replaced by --use, but perl6 -h says that -M is how you load a module on the command line. | 23:31 | |
ShimmerFairy | dha: yeah, I recall being confused a bit by that. (--use might work too, but it certainly hasn't replaced anything) | 23:32 | |
flussence | `perl6 --use` agrees with `perl6 -h` there (illegal option) | ||
dha | Ah. So that needs to be changed. Will look into that. | 23:33 | |
ShimmerFairy | I was just about to say, turns out --use does nothing in the first place :) | ||
dha | And, I'm guessing that the ability to "no" a module on the command line via "perl -M -Perl::Module" is gone? | 23:37 | |
23:37
lucasb joined
|
|||
dha | (it is, to my surprise, in Perl 5) | 23:37 | |
ShimmerFairy | perhaps, I've never heard of that before. | ||
Note that -e turns off strict, if that's what you're going after :) | 23:38 | ||
dha | Oh? That's interesting. | ||
ShimmerFairy | I personally don't see why it should, but I chalked it up to another one of those P5 things I'll never understand :P | 23:39 | |
dha | Huh. When I try "perl6 -M -Linenoise" it starts up the REPL, but when I *exit* it spits at me that "-Linenoise" can't be found. That seems... late. | ||
ShimmerFairy | dha: or if you try typing a statement | 23:40 | |
dha | Also, it doesn't let me actually exit. | ||
flussence | would be nice to have a perl6 -E which means "keep strict on", that'd be sorta-consistent with what perl -E does | 23:41 | |
dha | In any case, I'm going to assume that behavior has changed from p5. | ||
23:41
Peter_R left
|
|||
lucasb | m: say 'abc'.index('a') | 23:43 | |
camelia | rakudo-moar a38b59: OUTPUT«0» | ||
lucasb | m: say (<a b c>).combinations('abc'.index('a')).perl | ||
camelia | rakudo-moar a38b59: OUTPUT«()» | ||
lucasb | m: say (<a b c>).combinations(0).perl | 23:44 | |
camelia | rakudo-moar a38b59: OUTPUT«((),)» | ||
lucasb | Maybe someplaces will need to change 'if/unless $n' to explicit test for equal/not-equal zero to accomodate for the existence of the new Index type. | ||
dha | flussence - -E doesn't turn strict on on Perl 5. | 23:45 | |
flussence | I know, that's not what I mean though. It turns on "new stuff after 5.8", and here strict-by-default would also be new stuff | 23:47 | |
dha | Hm... I don't know. In the context of Perl 6, *everything* is "new stuff". :-) | 23:49 | |
Zoffix | But it's not. Warnings by default, it seems. | 23:50 | |
Sgeo | Is gather/take magic, or does it use control exceptions or something? | 23:54 | |
TimToady | yes, control exceptions | 23:55 | |
at least in the current implementation | |||
this may change after the GLR, at least in cases where we know it's in an eager context | 23:56 | ||
Zoffix | GLR? | 23:57 | |
TimToady | Great List Refactor | 23:59 |