»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
dataangel | p6: class zz { has @.yy is readonly; }; my $xx = zz.new(yy => [1, 2]); say $xx.yy; $xx.yy = [3, 4]; say $xx.yy; # why am I able to reassign it if it is read only? | 00:03 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«[1 2][3 4]» | ||
gfldex | should .f on a dangling symlink throw an exception? | 00:04 | |
00:05
n1lp7r left
|
|||
gfldex | the consequence is that any program that is working with files has to special case dangling symlinks | 00:05 | |
00:06
pierre_ joined
00:07
trnh left
00:08
canopus left
|
|||
dataangel | Why bother having classes and roles instead of just roles? They seem strictly better, you get errors instead of confusing behavior | 00:11 | |
00:12
mcmillhj joined,
pi____ joined
00:13
pi__ left
00:14
canopus joined
|
|||
jdv79 | roles can't do a bunch of things. they are fundamentally different. | 00:15 | |
00:16
mcmillhj left
|
|||
timotimo | is there some context to that role vs class thing you just said? | 00:18 | |
we might want to emit errors or warnings for "is readonly" on @ or % sigiled attributes | |||
dataangel | timotimo: roles give you errors when you have conflicting method names, and apparently classes don't | 00:19 | |
timotimo | readonly will only cause a getter (not a getter-setter) to be generated | ||
but that's only about changing the value of "outer" scalar containers | |||
you can only have conflicting method names when you do multiple inheritance | |||
otherwise inheritance has the explicit feature to replace a method with the same name by another | |||
though we may want at some point to have something like java's @Override that forces you to say which class you override a method from | 00:20 | ||
dataangel | timotimo: oh you can't do virtual's with roles | ||
timotimo | on the other hand, you can still always $theThing.Class::method(...) | ||
you totally can | |||
but a role that gets "does"ed into a class acts just like if you had just written the contents of the role { ... } into the class {...} itself | |||
dataangel | timotimo: what is the purpose of only generating a getter if you can reassign the array anyway? | ||
00:21
canopus left
|
|||
timotimo | it's not really re-assigning | 00:21 | |
it's "storing into" | |||
we don't have "deep read-only-ness" or "deep immutability" anyway, because that's *really* hard | 00:23 | ||
00:26
canopus joined
00:28
BenGoldberg joined
00:29
rkazak joined
00:31
sena_kun left
|
|||
pi____ | m: class Account-Holder { has $!name; my class Account { has $!account-number; } } | 00:35 | |
camelia | ( no output ) | ||
pi____ | how do i access the account number in the above code? | 00:36 | |
timotimo | there are multiple ways. one of them is to make it "our class Account" and go Account-Holder::Account | ||
another is to build a little accessor that does nothing but return Account | |||
pi____ | would that accessor be a method inside the Account class? | 00:37 | |
timotimo | i'd imagine so | 00:38 | |
methods don't have to be called on an instance, if they don't access attributes of self | |||
pi____ | hmm, could i bother you for an example? | ||
timotimo | m: class Account-Holder { has $!name; my class Account { has $!account-number; }; method get-acc-class { Account } }; my $foo = Account-Holder.get-acc-class.new(:account-number(9999999)); say $foo | 00:39 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«Account-Holder::Account.new» | ||
timotimo | ah, private attributes don't get set by the default constructor, nor are they output by the default .perl | ||
i'm about to go home so i can sleep :) | 00:41 | ||
pi____ | all right haha thanks | ||
00:41
mvorg left
|
|||
timotimo | have fun with perl6 :) | 00:41 | |
pi____ | you bet! | ||
00:46
cdg joined
00:51
lambd0x joined
|
|||
lambd0x | m: my @a = <1 2 3 4>; sub no ([$pivot, $pivot2, *@a]) { say $pivot ~ " " ~ $pivot2;} ; say no(@a); | 00:54 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«1 2True» | ||
00:54
mcmillhj joined
|
|||
lambd0x | that's so nice | 00:55 | |
Guys does the * here turns @a into a pointer from which I take the first, second... element for the sub? | 00:56 | ||
00:59
mcmillhj left
01:00
pi____ left
|
|||
gfldex | it's the rest | 01:03 | |
grondilu is reading perl6.party/post/The-Awesome-Errors-of-Perl-6 | 01:04 | ||
m: say "foo" . "bar"; | |||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unsupported use of . to concatenate strings; in Perl 6 please use ~at <tmp>:1------> 3say "foo" .7⏏5 "bar";» | ||
grondilu | ^seems a bit excessive to assume that strongly that a concatenation was intended. | 01:05 | |
timotimo | m: sub infix:<.>($a, $b) { $a ~ $b }; say "hello" . "world" | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unsupported use of . to concatenate strings; in Perl 6 please use ~at <tmp>:1------> 3x:<.>($a, $b) { $a ~ $b }; say "hello" .7⏏5 "world"» | ||
timotimo | m: sub infix:<.>($a, $b) { $a ~ $b }; say "hello"."world" | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.at <tmp>:1------> 3$a, $b) { $a ~ $b }; say "hello"."world"7⏏5<EOL>» | ||
timotimo | hm. i guess. | 01:06 | |
grondilu | I would have said something like "undefined use of '.' as a binop between string. In Perl 6, string concatenation is done with ~." | ||
timotimo | i think it should be possible to override . | ||
grondilu | or seomthing like that. | ||
timotimo | "between strings" isn't all, though | 01:07 | |
as you can use string concat to stringify, too | |||
grondilu | yeah. | ||
01:07
lambd0x left
|
|||
grondilu | maybe just add a "presumably" adverb. | 01:09 | |
01:09
cpage_ left
|
|||
grondilu | like: "Unsupported use of ., presumably to concatenate strings." | 01:10 | |
I would agree that it's no big deal at all though. The current message is not too bad. Just bugged me slightly. | 01:11 | ||
01:13
cpage_ joined
01:14
mcmillhj joined
01:15
cdg left
01:16
cdg joined
01:19
mcmillhj left
01:20
cdg left
01:28
mcmillhj joined
|
|||
SmokeMachine____ | how can I add elements on a SetHash inside of a hash? | 01:28 | |
m: my SetHash %a; %a<new_sethash><str_element_of_sethash> = True; %a.perl.say | 01:29 | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«Type check failed in assignment to %a; expected SetHash but got Hash (${}) in block <unit> at <tmp> line 1» | ||
timotimo | it can't automatically create the SetHash for you, i'm afraid | ||
maybe that's buggable | |||
m: my SetHash %a; %a<new_sethash> .= new; say %a.perl | 01:30 | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«(my SetHash % = :new_sethash(SetHash.new()))» | ||
timotimo | m: my SetHash %a; %a<new_sethash><a> = 1; say %a.perl | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«Type check failed in assignment to %a; expected SetHash but got Hash (${}) in block <unit> at <tmp> line 1» | ||
timotimo | m: my SetHash %a is default(SetHash); %a<new_sethash><a> = 1; say %a.perl | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«Type check failed in assignment to %a; expected SetHash but got Hash (${}) in block <unit> at <tmp> line 1» | ||
timotimo | so autovivification apparently doesn't work with typed hashes | ||
01:31
kalkin-_ joined,
kalkin- left
|
|||
timotimo | so you'll have to //= .new before accessing a sethash-inside-the-hash to make sure it exists | 01:31 | |
well, //= bleh.new | |||
SmokeMachine____ | m: my Hash of SetHash $a .= new; $a<bla><ble>++; dd $a | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«Hash[SetHash] $a = (my SetHash % = :bla(${:ble(1)}))» | ||
SmokeMachine____ | but as a scalar it works... why? | 01:32 | |
m: my Hash of SetHash $a .= new; $a<bla><ble> = "not a possible set value"; dd $a | |||
camelia | rakudo-moar 6cd6ef: OUTPUT«Hash[SetHash] $a = (my SetHash % = :bla(${:ble("not a possible set value")}))» | ||
01:32
mcmillhj left
|
|||
SmokeMachine____ | now that doesn't make sense... | 01:32 | |
timotimo | that's pretty weird | 01:33 | |
looks to my tired eyes like a rakudobug | |||
SmokeMachine____ | timotimo: the scalar and the hash versions should do the same, right? | 01:35 | |
timotimo | not sure | 01:37 | |
you can see if the generated code is the same with --target=ast :) | 01:38 | ||
i can see if my pillow is still on my bed with --target=sleep | |||
o/ | |||
SmokeMachine____ | :) have a good night! | 01:39 | |
timotimo | have a good * :) | 01:40 | |
gfldex | m: my (Bool :$foo, Bool :$bar) = True; dd ?$foo, ?$bar | 01:49 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«Bool::TrueBool::False» | ||
01:53
rkazak left
|
|||
sammers | ola perl6 | 01:53 | |
01:54
labster left
01:57
mcmillhj joined
|
|||
sammers | are there any examples of capturing keystrokes as a Supply? | 01:58 | |
gfldex | sammers: you need to set the terminal to raw mode what may clash with concurrency | 02:00 | |
see github.com/krunen/term-termios | |||
02:02
mcmillhj left
|
|||
sammers | gfldex, thanks I will take a look. I have been messing around with this example, trizen.gitbooks.io/perl6-rosettaco...acros.html | 02:02 | |
02:04
ptolemarch left
02:12
mcmillhj joined
|
|||
AlexDaniel | .seen raiph | 02:15 | |
yoleaux | I saw raiph 13 Aug 2016 18:25Z in #perl6: <raiph> dataangel: Most Perl 6 string and numeric types implicitly coerce between string and numeric interpretations by default; you have to be explicit if you don't want that | ||
02:16
noganex_ joined
02:17
grondilu left,
mcmillhj left
|
|||
AlexDaniel | .tell raiph Using readable names for placeholder values (like $^key and $^value) is a footgun, please consider not recommending it publicly | 02:17 | |
yoleaux | AlexDaniel: I'll pass your message to raiph. | ||
02:19
noganex left
|
|||
SmokeMachine____ | m: Str(Numeric) ~~ Int | 02:20 | |
camelia | ( no output ) | ||
SmokeMachine____ | m: say Str(Numeric) ~~ Int | 02:21 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«False» | ||
SmokeMachine____ | Shouldn't be true? Why? | ||
m: say Int ~~ Str(Numeric) | 02:22 | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«False» | ||
SmokeMachine____ | m: say Str(Int) ~~ Int | 02:23 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«False» | ||
SmokeMachine____ | m: say Str(Int) ~~ Str | 02:24 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«False» | ||
02:25
mcmillhj joined
02:27
stux|RC-only left
|
|||
gfldex | sammers did you manage to get the terminal into raw mode? Seams not to work for me. | 02:27 | |
sammers: got it :) | 02:28 | ||
02:28
dan joined
02:29
mcmillhj left
02:32
harmil joined
02:34
AlexDaniel left,
dan left
02:35
wamba joined
02:36
zacts joined
02:39
mcmillhj joined
02:43
canopus left
02:44
mcmillhj left
02:46
kid51 left
|
|||
gfldex | sammers: that's how far I got gist.github.com/60ec413cc652bbbc6e...b413338237 | 02:51 | |
02:51
canopus joined
|
|||
timotimo | does start { ... }.Supply really work like that? i don't think so. | 02:52 | |
02:53
mcmillhj joined
|
|||
timotimo | i think you're just turning the promise into a supply that'll emit exactly once when the promise is kept | 02:53 | |
i.e. when you've entered 10 keystrokes, you'll get a result from the started block | |||
i'd expect the emit in that case to fall through to the outermost react { ... } that your stuff is in | |||
and thus be completely ineffective for the whenever loop you've meant to use it for | |||
but i think it should error out instead | 02:54 | ||
it doesn't have a supplier in its dynamic environment, i don't think | |||
back to trying to get to sleep ... | |||
02:58
mcmillhj left
03:00
kyclark left
|
|||
BenGoldberg | m: say Str(Int).WHAT; | 03:05 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«(Str(Int))» | ||
03:21
kyclark joined
03:22
salparadise joined
|
|||
gfldex | sammers: this works: gist.github.com/60ec413cc652bbbc6e...b413338237 | 03:25 | |
03:27
mcmillhj joined
03:28
labster joined
03:31
kyclark left
03:33
mcmillhj left
03:36
thor_ joined
03:37
thor_ left
03:39
holyghost left
03:45
mcmillhj joined
03:48
wamba left
03:49
mcmillhj left,
holyghost joined
03:52
Lamjarred joined
|
|||
Lamjarred | Gabor Szabo? | 03:54 | |
hello all | |||
03:56
Lamjarred left
04:00
mcmillhj joined
04:04
broquaint left
04:05
mcmillhj left
04:06
broquaint joined
04:11
skids left
|
|||
dalek | pan style="color: #395be5">perl6-examples: 22ed552 | (David Warring)++ | t/categories/parser (2 files): rename t/categories/parser-SimpleString.t -> t/categories/parsers/SimpleStrings.t |
04:18 | |
pan style="color: #395be5">perl6-examples: 2300b77 | (David Warring)++ | / (2 files): add some basic CSSGrammar tests. Fix `@page` rule |
|||
04:20
harovali joined
04:23
Cabanossi left
04:24
Cabanossi joined
04:28
harovali left
04:29
harovali joined
04:32
mcmillhj joined,
khw left
04:35
andrzejku joined
04:36
mcmillhj left
04:40
andrzejku left
04:45
pierre_ left,
wbill left
04:49
pierre_ joined
04:50
pierre_ left
04:57
andrzejku joined
04:59
pierre_ joined
05:04
pierre_ left
05:05
harovali left
05:17
pierre_ joined
05:21
pierre_ left
05:27
harmil left
05:28
brrt joined,
rkazak joined
05:35
pierre_ joined
05:40
pierre_ left
05:42
BenGoldberg left
05:43
Matthew[m] left,
tadzik left,
M-Illandan left
05:49
mcmillhj joined
05:53
pierre_ joined
05:54
mcmillhj left,
brrt left
05:57
pierre_ left
06:01
CIAvash joined
06:02
darutoko joined
06:11
pierre_ joined
06:13
andrzejku left,
mcmillhj joined
06:17
labster left
06:18
mcmillhj left,
pierre_ left
06:24
rkazak left,
tadzik joined
06:26
firstdayonthejob joined
06:30
nadim joined,
pierre_ joined
06:34
pierre_ left
06:35
pierre_ joined
06:37
movl left
06:41
mcmillhj joined
06:45
movl joined
06:46
mcmillhj left
06:48
firstdayonthejob left,
Lemy_ joined
06:51
movl left
06:52
Lemy left
06:53
M-Illandan joined,
Matthew[m] joined
06:54
mcmillhj joined
06:57
movl joined
06:59
mcmillhj left
07:01
movl left
07:08
zakharyas joined
07:09
mcmillhj joined
07:11
cschwenz joined
07:13
pecastro joined
07:14
mcmillhj left
07:19
sno left
07:22
mcmillhj joined
07:26
movl joined
07:27
labster joined
07:28
mcmillhj left
07:33
bjz joined
07:40
mcmillhj joined
07:44
mcmillhj left
07:46
labster left
07:48
bjz left
07:57
domidumont joined
08:00
g4 joined
08:01
domidumont left,
domidumont joined
08:03
Wiertek joined
08:05
araujo joined
08:06
araujo left,
RabidGravy joined
08:11
dakkar joined
08:13
mcmillhj joined
08:17
sno joined,
mcmillhj left
08:22
domidumont left,
movl left
08:23
movl joined
08:31
bjz joined
08:32
mcmillhj joined
08:34
pdcawley_ joined
08:37
pdcawley left,
mcmillhj left
08:39
bjz left,
Upasaka joined
08:46
mcmillhj joined
08:47
movl left
08:50
movl joined
08:52
kjs_ joined,
mcmillhj left
08:58
TheLemonMan joined,
bjz joined
09:00
labster joined
09:02
mcmillhj joined
09:04
test joined,
test is now known as Guest95863
09:05
Guest95863 left
09:06
mcmillhj left
09:10
kjs_ left
09:11
jonas2 joined
09:14
cschwenz1 joined,
cschwenz left
09:18
mcmillhj joined
09:21
movl left
09:22
cschwenz1 left,
mcmillhj left
09:29
rindolf joined
09:30
mcmillhj joined,
inokenty left
09:31
pdcawley_ left
09:32
dLeCamarae joined
09:35
mcmillhj left
09:44
pdcawley joined
09:45
melezhik joined
|
|||
melezhik | Hi all! | 09:45 | |
DrForr | Howdy! | ||
melezhik | A hopefully simple question on perl6 subroutines | ||
given a perl6 module Foo::Bar | |||
09:45
movl joined
|
|||
melezhik | and I want to call a subroutine foo which is defined at this module | 09:46 | |
by "full" name | |||
09:46
dakkar left
|
|||
melezhik | like in perl5 I will have something like Foo::Bar::foo() | 09:46 | |
how can I do this in perl6? | |||
also, my module gets used in runtime | 09:47 | ||
DrForr | m: class Foo::Bar { sub bar { say "hi" } } Foo::Bar::bar(); | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Strange text after block (missing semicolon or comma?)at <tmp>:1------> 3class Foo::Bar { sub bar { say "hi" } }7⏏5 Foo::Bar::bar(); expecting any of: infix infix stoppe…» | ||
DrForr | m: class Foo::Bar { sub bar { say "hi" } }; Foo::Bar::bar(); | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«Could not find symbol '&bar' in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
melezhik | sub module_run($name, %args = %()) is export { my $mod_name = 'Sparrowdo::' ~ $name; require ::($mod_name); } | ||
so I can't hardcode a name of module as it resolved in runtime | 09:48 | ||
so having "require ::($mod_name); " i want to call some $mod_name's subroutines | 09:49 | ||
and last thing it should be module, not class | |||
gfldex | melezhik: if you load a module at runtime you have to do a runtime lookup for the symbol | ||
melezhik | yes, sure | 09:50 | |
I know how to do this in perl5 | |||
I just need a hint on perl6 syntax | |||
09:50
kjs_ joined
|
|||
gfldex | ::("YourClassHere") | 09:50 | |
tadzik | require 'Foo'; ::('Foo').symbol | ||
09:50
domidumont joined
|
|||
melezhik | tadzik. I can't hardcode a Foo; as Foo is in $mod_name | 09:51 | |
gfldex | ::("$YourClassHere") | 09:52 | |
TimToady | DrForr: you need an 'our' for that to work | ||
yoleaux | 15 Aug 2016 01:21Z <gfldex> TimToady: you may want to spend some attention on m: sub f { 42 }; my ($i where * == 2) = f; (backlog: irclog.perlgeek.de/perl6/2016-08-15#i_13023085) | ||
DrForr | 'our sub... ' yeah, forgot. As usual, doing more things in the background. | ||
09:52
mcmillhj joined
|
|||
DrForr | Also, (Terry Riley)++ | 09:53 | |
tadzik | melezhik: yes, that's why I used a string in there in both cases :) | ||
so in your case, require $mod_name; ::($mod_name).blabla | |||
melezhik | tadzik : can I have this? - :($mod_name).$funcname ? | 09:54 | |
not sure ... really | |||
tadzik | in that case you may need ::("$funcname::$mod_name") .....I think | 09:55 | |
melezhik | ahhh . funcname is defined and could be a constant ... so you example will be fine | ||
tadzik | I always used that for methods | ||
melezhik | tadzik. will try and let you know, thanks | ||
09:57
mcmillhj left
09:59
dakkar joined
10:00
labster left
10:03
AlexDaniel joined,
Hor|zon_ joined,
rburkholder joined
10:05
mvorg joined
10:06
Hor|zon left
10:10
TEttinger left
|
|||
melezhik | tadzik, looks like your way relates to class, not module; my case: use v6; unit module Sparrowdo::Nginx; use Sparrowdo; sub tasks { .... }; | 10:10 | |
I have an error - Method 'tasks' not found for invocant of class 'Sparrowdo::Nginx' | |||
when try this code - $name = 'Nginx'; my $mod_name = 'Sparrowdo::' ~ $name; require ::($mod_name); ::($mod_name).tasks | 10:11 | ||
tadzik | right, how about the one I suggested later? | ||
10:11
rburkholder left
|
|||
melezhik | what exactly? | 10:11 | |
sorry, if missed something ... | |||
arnsholt | The $thing.method is purely for invoking methods | 10:13 | |
What tadzik is referring to is `::$("$mod_name::$func_name")` I think | 10:14 | ||
Which probably also requires you to make it `our sub tasks { ... }` | |||
If you want to make the methodcall syntax work, you could make it `unit class` and `method tasks` | 10:15 | ||
melezhik | hm . I don't want a methods, I want plain subroutines | ||
what about this? | |||
gregf_ | m: class Foo::Bar { method bar() { say "Bar!" } }; say Foo::Bar.bar # should this work melezhik ? | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«Bar!True» | ||
melezhik | I don't want call this as class methods, while it's doable, but I need I simple subroutines | ||
it probably will work, but what about calling some module's function, using Foo::Bar::name style , like I would have in perl5? | 10:16 | ||
nine | melezhik: just do it? | 10:17 | |
melezhik: it's exactly the same syntax in Perl 6 | |||
melezhik | just do what? | ||
ahh, ok | |||
gregf_ | well, it doesnt have to be just like in Perl5 *literally* - *smiles*... Perl6 is a new language ;) | ||
nine | m: module Foo::Bar { our sub foo { say "hello"; } }; Foo::Bar::foo; | 10:18 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«hello» | ||
melezhik | yeah, this is why I told style, not way ... ))) | ||
gregf_ | melezhik: Foo::Bar->bar() # is how youll do this in moose as well, | ||
nine has the solution! next question :) | 10:19 | ||
10:19
tokomer joined
|
|||
melezhik | ahhh, guys, again I don't want to call it like class method .... ok, I will try a Foo::Bar::func ... and will let you know ... | 10:19 | |
nine | melezhik: also why exactly is the module loaded at runtime? | ||
10:19
domidumont left
|
|||
melezhik | ok, I see nine's example will try it too ... | 10:19 | |
tadzik | yep, I meant what arnsholt++ said :) | 10:21 | |
melezhik | nine, it's about upper API style, I don't want users will "use Some::Module" and just have some other syntax, but probably I will need to go a "standard" way, getting use modules explicitely ... | ||
10:22
pdcawley_ joined
|
|||
nine | melezhik: Sorry, I don't think I understood what you're trying to say? | 10:22 | |
melezhik | nine I mean I use a runtime module loading for the sake of simplicity of upper code relying in the modules, but nevermind now ))) | 10:24 | |
10:24
pdcawley left
|
|||
arnsholt | I suspect using classes will give you a cleaner inheritance and composition story, even if the classes aren't instantiable/don't have any instance methods | 10:24 | |
sammers | hi perl6 | 10:25 | |
DrForr | Afternoon, sammers | ||
arnsholt | Since it lets you provide default implementations for trivially implemented methods and the like | ||
DrForr | (at least locally) | ||
arnsholt | G'noon =) | ||
sammers | afternoon, yeah, here it is ~19:30 | ||
so, I am trying to make a single react / whenever respond to multiple supplies, is this possible? | 10:26 | ||
jnthn | whenever Supply.merge($s1, $s2, ...) { } | ||
sammers | ah, great | 10:27 | |
melezhik | arnsholt I got your point, the code is pretty raw , I am at the begining of the desing, will take your words into account ... | ||
arnsholt | jnthn++ to the rescue! | ||
TheLemonMan | hmm, when is it advised to use sigilless parameters for functions? from what I glean from the documentation it is another "lighter" way to pass readonly content | ||
timotimo | sigilless is equivalent to "is raw" | 10:29 | |
jnthn | When you don't want to enforce any context on the argument, generally | 10:30 | |
TheLemonMan | oh, I didn't get you'd completely lose the context. Thanks for the heads-up | 10:31 | |
timotimo | you don't lose it, yo ujust don't force any context on the argument | 10:32 | |
jnthn | m: sub foo($a) { for $a { .say } }; foo([1,2,3]) | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«[1 2 3]» | ||
jnthn | m: sub foo(\a) { for \a { .say } }; foo([1,2,3]) | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«[1 2 3]» | ||
jnthn | Um...well that didn't do what I expected :P | 10:33 | |
oh, duh | |||
m: sub foo(\a) { for a { .say } }; foo([1,2,3]) | |||
camelia | rakudo-moar 6cd6ef: OUTPUT«123» | ||
jnthn | It'll only do what I expect if I type it right :P | 10:34 | |
Anyway, the $a means "this is an item", so when you iterate you're just going to get a single iteration | |||
Whereas \a is non-commital. If the original thing would iterate as many items then that'll happen. | |||
TheLemonMan | hmm, I'm slightly less confused now heh | 10:38 | |
melezhik | finally I decided to go a class way and it works. thansk to all! | 10:41 | |
tadzik | so the ::("$foo::$bar") syntax didn't? | ||
10:48
bob777 joined
|
|||
melezhik | this is what I get when try to this in none class way: | 10:48 | |
::('Sparrowdo::Nginx::tasks')(%args) | |||
unit module Sparrowdo::Nginx; sub tasks () {...} | 10:49 | ||
and error is: | |||
No such symbol 'Sparrowdo::Nginx::tasks' | |||
timotimo | i'd think you'd have to manually split on :: and use the :: operator each time? | ||
10:49
movl left
|
|||
timotimo | ::('Sparrowdo')::('Nginx')::tasks | 10:49 | |
melezhik | well, let me try | ||
10:50
tokomer left
|
|||
melezhik | the same error - No such symbol 'Sparrowdo::Nginx::tasks' | 10:51 | |
when try to invoke via - ::('Sparrowdo')::('Nginx')::tasks(%args); | |||
timotimo | OK | 10:52 | |
melezhik | head lib/Sparrowdo/Nginx.pm6 - use v6; unit module Sparrowdo::Nginx; use Sparrowdo; sub tasks (%args) { | ||
timotimo | well, for one, you could also type that Sparrowdo::Nginx::tasks :) | ||
and only make the parts that are dynamic use the ( ) | 10:53 | ||
arnsholt | I experimented with camelia and couldn't get it to work | ||
timotimo | OK | ||
arnsholt | m: module Foo { our sub foo { say "foo" } }; Foo::foo() # works | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«foo» | ||
timotimo | i don't know much about this part of things | ||
arnsholt | m: module Foo { our sub foo { say "foo" } }; ::("Foo")::foo() # nope? | 10:54 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«No such symbol 'Foo::foo' in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
arnsholt | Rakudobug perhaps? | ||
melezhik | arnsholt: let me try ... | ||
timotimo | m: our module Foo { our sub foo { say "foo" } }; ::("Foo")::foo() | 10:55 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«No such symbol 'Foo::foo' in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
timotimo | m: our module Foo { our sub foo { say "foo" } }; ::("Foo") | ||
camelia | ( no output ) | ||
timotimo | m: our module Foo { our sub foo { say "foo" } }; ::("Foo")::.keys.say | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«()» | ||
timotimo | m: our module Foo { our sub foo { say "foo" } }; ::("Foo")::('&foo') | ||
camelia | ( no output ) | ||
timotimo | that's the magic ingredient | ||
you need the sigil in there, as it's part of the name | |||
not sure why it doesn't show up in the .keys, though | |||
10:55
movl joined
|
|||
melezhik | yeah, arnsholt: you had it right, I need an our sub ... | 10:55 | |
"our" is vital part ... | 10:56 | ||
timotimo | without "our" it won't be accessible via the package at all | ||
for subs, the default is "my", which means "only available in the lexical scope" | |||
melezhik | yeah, now I see ... | ||
CIAvash | Am I the only one who thinks our errors don't look good when you compare it to Rust and Elm's? | 10:57 | |
timotimo | isn't elm one of the haskell-to-javascript languages? | ||
10:57
movl left
|
|||
CIAvash | yes | 10:57 | |
well, not exactly haskell, it has similarities | 10:59 | ||
11:00
movl joined
11:01
ufobat joined
|
|||
ufobat | ola p6 :-) | 11:01 | |
melezhik | unfortunately this code still does not work: my $func_name = 'Sparrowdo::' ~ $name ~ '::tasks'; ::($func_name)(%args); | ||
No such symbol 'Sparrowdo::Nginx::tasks' | 11:02 | ||
not sure what I had wrong ... | |||
my module code is - use v6; unit module Sparrowdo::Nginx; use Sparrowdo; our sub tasks (%args) { ... } | |||
timotimo | you forgot to put the & before tasks | ||
bjz | timotimo: it's like haskell, but with all the astronautical type system stuff ripped out and a simpler syntax (ie. less syntactic sugar) | 11:03 | |
11:03
grondilu joined
|
|||
melezhik | timotimo - works! thanks a lot! | 11:03 | |
))) | |||
timotimo | yay | ||
melezhik | so I did a subroutine/modules way too! | 11:04 | |
at least I have to ways by hand now ))) | |||
CIAvash | look at this comment for example, "The second error needs multiple paragraphs to explain. Why isn't it instead something like:" www.reddit.com/r/programming/comme..._6/d6j42wh | 11:05 | |
melezhik | arnsholt: - thank you too! | 11:06 | |
timotimo | CIAvash: yeah, we should really put the eject sign at the beginning of the block, not at the end | 11:07 | |
11:07
pierre_ left
|
|||
CIAvash | timotimo: it's not just the eject sign. the amount of code to show in the error, the explanations and where they appear | 11:08 | |
melezhik | a final working version is - sub module_run($name, %args = %()) is export { require ::('Sparrowdo::' ~ $name); ::('Sparrowdo::' ~ $name ~ '::&tasks')(%args); } | ||
TheLemonMan | I don't quite like the eject sign tbh | 11:09 | |
probably the fact that I never configured urxvt font fallbacks correctly concurs to that | 11:10 | ||
CIAvash | I also like the way Elm and Rust show the line numbers | 11:11 | |
JIC someone has not seen it yet: blog.rust-lang.org/2016/08/10/Shap...-come.html elm-lang.org/blog/compiler-errors-for-humans | 11:15 | ||
also, is there a reason run-time errors don't show the code in the error? | 11:18 | ||
timotimo | you have to set an env var if you want that | 11:19 | |
RAKUDO_VERBOSE_STACKTRACE or something along those lines | |||
CIAvash | oh | ||
lizmat clickbaits p6weekly.wordpress.com/2016/08/15/...-go-wrong/ | 11:22 | ||
CIAvash: the value of RAKUDO_VERBOSE_STACKFRAME is the number of lines before/after you want to see | 11:25 | ||
CIAvash | thanks | 11:28 | |
DrForr | lizmat: Feeling better? | ||
lizmat | DrForr: yeah, it's mostly nagging bruises now | 11:29 | |
11:29
tokomer joined
|
|||
lizmat | I never thought I would have green fingers, but now I have | 11:29 | |
DrForr | Good to hear. (see, actually) | ||
That sounds serious. Ow. | 11:30 | ||
lizmat | oddly enough, no trouble with typing... | ||
DrForr | I was wondering about that... | ||
lizmat | but picking up heavier things with my left hand is still too painful | ||
AlexDaniel | lizmat: sounds great! According to my linear predictions, csv tests should be under one second now… so please catch up! | 11:31 | |
on a slightly more serious note, I'm glad that you feel better :) | |||
lizmat | AlexDaniel DrForr thank you for your kind words :-) | 11:32 | |
timotimo | lizmat: i'm hoping for speedy, complication-free, and effortless recovery :) | ||
AlexDaniel | .oO( compilation-free? ) |
11:33 | |
lizmat | timotimo: thank you | ||
timotimo | hah | ||
11:36
bob777 left
11:37
bob777 joined
|
|||
unmatched} | CIAvash: TBH, I feel like people are putting these examples on a pedestal and showing them off without proper context. The problem with all those "^^^^ this bit blah blah" IMO is the errors are always different. I have to scan for the "^^^" bits amid my code. Whereas if the error always looks the same, I can just look at the spot where the line number is or where the short code sample is. If I see ".^name" | 11:42 | |
(the carret makes it easy to spot), I already know it's the unitialized Str warning and I can just skim to the end of the line to see the line number. It wouldn't be so easy with giant code samples in the way. Also, I wonder how all of that ASCII-art-in-code style looks with real-world code rather than crafted code samples. Some of the lines in Rakudo source are over 80 chars, much over. If I have an error at | |||
the end of such a line and the error displayer shoves a long error at the end of it, we're looking at a line that won't even fit into my terminal. | |||
El_Che | I am trying to add perl6 support to vim syntastic (a linter) and a must say the free form of errors has been trying for my limited vimscript skills | 11:44 | |
unmatched} regrets writing that article now | 11:45 | ||
jnthn | El_Che: But most errors are structured objects | ||
unmatched} | We have bigger problems to focus on right now than what trolls on Reddit think about our error messages. | ||
jnthn | El_Che: Which you could dump out in some easy-to-handle form (JSON or so) | ||
arnsholt | jnthn: Which are then passed as unstructured text into the next stage of the pipeline >.< | ||
jnthn | Wat? | 11:46 | |
Which pipeline? :) | |||
timotimo | the user's terminal | ||
in this case, at least | |||
arnsholt | Like in El_Che's vimscript example, the raw string of the error message is passed as-is into the linting stuff | ||
Which is, as you rightly point out, not a very good idea | 11:47 | ||
I guess making Rakudo capable of dumping exceptions as JSON shouldn't be too onerous? | |||
El_Che | oh, maybe I hijacked the wrong conversation | ||
11:47
smls joined
|
|||
El_Che | let me explain | 11:48 | |
11:48
melezhik left
|
|||
arnsholt | An env-var/command-line parameter to toggle it, and some code in the top-level exception handler? | 11:48 | |
jnthn | Yes, my point was that you would probably be better off writing a small wrapper script that compiles the code to lint, CATCHes the compilation exception, and dumps it in some standard form :) | ||
El_Che | I loved Perl6 errors. They are clear for the user | ||
11:48
andreoss joined
|
|||
jnthn | Then you can deal in type names and pull out structured info | 11:48 | |
andreoss | can i forbid .new to be called on class? | ||
El_Che | (terrible wifi here, let me read the backlog) | ||
jnthn | method new(|) { die "Can't new this" } | 11:49 | |
timotimo | can't newt his what? | ||
ilmari | is it really a class if you can't .new it? | ||
arnsholt | jnthn: Yeah, exactly. My background in NLP just makes me particularly allergic to the traditional Unix way of flinging unstructured text around and expecting robust software to somehow magically occur =) | ||
El_Che | I kind of got most of the syntastic perl6 support working, but it's fragile as it indeed parses the "perl6 -c" output | 11:50 | |
arnsholt | andreoss: `method new { die "Nope!" }` should do the trick, shouldn't it? | ||
El_Che | and some errors have the same pieces of information in an other place | ||
andreoss | jnthn: `subtype Null is Foo; # singleton ` | ||
arnsholt | Alternatively, is repr('Uninstantiable') | ||
andreoss | this would not be correct? | ||
El_Che | so a json error switch would be a wow | ||
CIAvash | unmatched}: I just referred to one part of the reddit comment. Blog posts and discussions sometimes can lead to good things, don't regret it :) | 11:51 | |
jnthn | I don't think you can .new on a subset type either, so that's another way | ||
andreoss | m: class Nil3 is repr('Uninstantiable') { }; Nil3.new.say | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«You cannot create an instance of this type (Nil3) in block <unit> at <tmp> line 1» | ||
11:51
Wiertek left
|
|||
andreoss | *subset | 11:51 | |
El_Che | also similar on the perl5 linter (perl -c), the perl 6 one will be disabled out of the box because of security concerns regarding -c | 11:53 | |
11:53
tokomer left,
tokomer joined
11:54
tokomer left,
tokomer joined
|
|||
nine | ilmari: it can still have other constructors beside .new. Also it could be a static class. | 11:54 | |
gfldex | unmatched}: if you would have written the same blog post about rust, you would have seen the same amount of hate. There are always folk who feel threaten by change but wont express the reason for their irrational behaviour. | 11:55 | |
11:56
pierre_ joined
|
|||
gfldex | unmatched}: assholes have a function in human society, they teach use humility. | 11:57 | |
andreoss | m: class Foo { has $.a } ; subset Bar is Foo where *.a ~~ Int; | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Method 'add_parent' not found for invocant of class 'Perl6::Metamodel::SubsetHOW'at <tmp>:1» | ||
andreoss | is this supposed to work? | ||
timotimo | no | 11:58 | |
it has to be "subset Bar of Foo" | |||
gfldex | LTA tho | ||
timotimo | if you just write "subset Bar", you get a subset of Any. then you say "it's derived from Foo" | ||
yeah, the error could be made clearer by a bit of special-case knowledge | |||
thing is, class derivement is just one case of "is" | 11:59 | ||
and it stands to reason you want to add some traits to your subsets | |||
if add_parent doesn't exist, the "is" trait for derivation could say "you cannot derive a SubsetHOW from a class" | 12:00 | ||
thought that sounds like "you can't make subsets out of types" which is kind of bogus | |||
12:00
pierre_ left
|
|||
timotimo | and we'd have to run to the end of the statement to figure out if there's an "of Bar" that comes after the "is Bar" | 12:00 | |
to figure out if the user left out the "of" part by accidentaly writing "is" instead | 12:01 | ||
*shrug* | |||
i'm sure someone will find a cleverer way than what i'm thinking of :) | |||
andreoss | is it not possible to write somehthing like `subset Foo(Int $a, $b) of Bar;`? | 12:03 | |
gfldex | unmatched}: thinking about it, you did make one mistake. You forced the opinion that those errors are awesome on the reader - in the very first line. You may want to leave it to them to make that judgement. | ||
andreoss: what would you want the signature do in that case? | 12:04 | ||
andreoss | gfldex: attribute list | 12:07 | |
lizmat | andreoss: we even have an exception for it: X::Cannot::New | 12:08 | |
12:10
domidumont joined
|
|||
andreoss | i thought it would be posible to use subsets as ADTs. | 12:10 | |
`role List {}; subset Nil of List; subset Cons($a, List $b) of List;` | |||
m: subset Foo($a); | 12:11 | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$a' is not declaredat <tmp>:1------> 3subset Foo(7⏏5$a);» | ||
gfldex | Sir, please lay down that Nil! | 12:12 | |
andreoss | so it's legal to have singature in subset definition? what can i put there? | ||
gfldex | m: my $a; subset Foo($a); | 12:13 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«Cannot invoke this object (REPR: Uninstantiable; Foo) in block <unit> at <tmp> line 1» | ||
jnthn | andreoss: No, subset types are refinement types | 12:14 | |
They take an existing type and add a condition (the "where") | |||
gfldex | being not-illegal doesn't mean it works. | ||
jnthn | All that's doing is invoking the subset | 12:15 | |
Which doesn't do anything useful :) | |||
gfldex | m: subset Foo of Str; sub f(Foo){}; &f.signature.params[0].say | 12:16 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«Str $ where { ... }» | ||
gfldex | there is no introspection for subsets directly, but you can get there via a signature | ||
unmatched} | gfldex: nah, the title was deliberately provocative :) My regret is not the reddit comments themselves but I have two Perl 6 channels open and both of them are discussing Perl 6's errors based on commentary of those reddit trolls, and some people even proposing we start opening RT tickets for a whole category of error "LTA-ness". | 12:17 | |
I feel that's a distraction. | |||
12:18
flaviusb left
|
|||
jnthn | gfldex: You can introspect the refinement and the refinee using the MOP | 12:18 | |
m: subst Foo of Str where *.chars > 10; say Foo.^refinee | |||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3subst Foo of Str7⏏5 where *.chars > 10; say Foo.^refinee expecting any of: infix infix stopper postfix statement…» | ||
jnthn | m: subset Foo of Str where *.chars > 10; say Foo.^refinee | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«(Str)» | ||
jnthn | m: subset Foo of Str where *.chars > 10; say Foo.^refinement | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«{ ... }» | ||
El_Che | jnthn: this is a very naive implementation of wrapper like you said using EVALFILE: paste.ubuntu.com/23061364/ . My question: is there something like EVALFILE that would implement the perl6 -c behaviour? Some magic with the $lang option? | ||
jnthn | m: subset Foo of Str where *.chars > 10; say Foo.^refinement('abc') | 12:19 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«Too many positionals passed; expected 2 arguments but got 3 in any refinement at gen/moar/m-Metamodel.nqp line 3441 in block <unit> at <tmp> line 1» | ||
jnthn | m: subset Foo of Str where *.chars > 10; say Foo.^refinement().('abc') | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«False» | ||
gfldex | ENOSUCHDOC | ||
gfldex takes notes | |||
jnthn | El_Che: Not yet, but if use "use nqp;" then you can nqp::getcomp('perl6') and it's got methods on to let you do that... | 12:20 | |
(Bit tied up with $dayjob at the moment to find an example, sorry) | |||
El_Che | jnthn: thx. No haste | ||
12:21
g4 left
|
|||
El_Che | jnthn: the question is if I continue trying to parse the error string and learn more vimscript of try to get into nqp :) | 12:21 | |
I can't win | |||
lizmat | jnthn: isn't the code in sub EVAL (except the last line) really what we want ? | 12:22 | |
El_Che | (I thought that adding perl6 support to syntastic was't nothing more than copying the existing perl5 one with a few adaptations. Famous last words. At least it kind of work already, but as I say, too fragile) | ||
CIAvash | unmatched}: The reddit comments didn't make me discuss the errors, if that's what you're implying. I was thinking about it before even the Rust article. | 12:23 | |
12:30
n1lp7r joined
|
|||
andreoss | can i subset anonymous role/class? | 12:32 | |
gfldex | m: subset Foo of role :: {}; | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Invalid typename 'role'at <tmp>:1------> 3subset Foo of role7⏏5 :: {};» | ||
gfldex | m: subset Foo of class :: {}; | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Invalid typename 'class'at <tmp>:1------> 3subset Foo of class7⏏5 :: {};» | ||
unmatched} | CIAvash: I guess it's not just the fallout from the article that bugs me, but a ton of LTA error tickets in RT queue. They all feel disjointed, with no master plan for them. Last week I changed a content of a warning, to close a ticket, only to realize it was changed earlier not so long ago, also due to "LTA error" ticket. And today's discussion technically means that warning is LTA again and needs to be | 12:33 | |
gfldex | nope | ||
unmatched} | changed again. So we just keep changing stuff about any time someone has an alternate view on what the text should read. | ||
nine | El_Che: what lizmat said :) | ||
El_Che: have a look at src/core/control.pm | |||
lizmat | nine: wonder whether we should expose this as COMPILE() | 12:34 | |
unmatched} | CIAvash: and maybe there should be (or maybe there already is) a mechanism for a module-space module to take all these exceptions these errors actually are and output them and format them any way the module pleases. We can have Exceptions::Rust Exceptions::Elm Exceptions::Trans::Russian, whatever | ||
*shrug* | |||
El_Che | nine, lizmat: having a look | 12:35 | |
nine, lizmat: although alternative structured (like yaml or json) error would also be cool: perl6 -c --errors-as-json :) | 12:36 | ||
nine: suprisingly, the crappy github functionality gave me the correct file as the second match. It never does that | 12:37 | ||
most of the time I end up cloning and using ack :) | |||
dalek | osystem: c924372 | (Alexey Melezhik)++ | META.list: Sparrowdo module to install Nginx web server. |
12:38 | |
osystem: 43c634f | (Zoffix Znet)++ | META.list: Merge pull request #233 from melezhik/master Sparrowdo module to install Nginx web server. |
|||
12:40
n1lp7r left
|
|||
CIAvash | unmatched}: I understand what you mean, but I don't think just dicussing it would hurt anybody. I'm not saying we have to do something right now, or do it based on someone's comments on reddit. And you can just share your opinion like you did, discussions shouldn't necessarily lead to some action. | 12:41 | |
12:41
kid51 joined
|
|||
arnsholt | El_Che: The Perl 6 IPython kernel has an example of getcomp and friends, just gimme a sec to find it | 12:42 | |
andreoss | gfldex: is it bug/NYI? | ||
12:43
melezhik joined,
kyclark joined
|
|||
unmatched} | andreoss: what's the usecase for this? If you're "throwing" the role away anyway, why not make it be right from the start, without a subset? | 12:44 | |
arnsholt | El_Che: github.com/timo/iperl6kernel/blob/...6.pm6#L177 is the code that evaluates incoming code | ||
gfldex | andreoss: i don't think it makes sense in the first place. But then, I do think a lot of odd things. | ||
arnsholt | It's a bit complex due to having to thread the context of the previously evaluated code around the new code | ||
andreoss | unmatched}: to add attributes to subtype. `subset Foo of role :: { does Bar; has $.zzz }; ` | 12:45 | |
jnthn | A subtype doesn't have state | ||
arnsholt | There are two places you want to look at for examples of how Rakudo does it today: src/Perl6/Compiler.nqp in the rakudo repo, and src/HLL/Compiler.nqp in nqp | ||
jnthn | *subset type | ||
unmatched} | andreoss: so just do role Foo does Bar { has $.zzz } | ||
jnthn | So no, it doesn't make sense. | ||
12:46
movl left,
movl joined,
prammer joined
|
|||
andreoss | paste.debian.net/789857/ | 12:47 | |
unmatched}: i was trying to use subsets as ADTs | |||
which now i see is mis-use | 12:48 | ||
12:48
kid51 left
12:52
nilptr joined,
nilptr is now known as n1lp7r
12:53
perlpilot left
|
|||
gfldex | m: subset Nil of Str; | 12:53 | |
camelia | ( no output ) | ||
gfldex | o.0 | ||
El_Che | arnsholt: thx. But I think you code really executes the code (that would imply getting -I right), while I think for I linter I just need to compile it. So back to the last line of EVAL like liz said. | ||
12:54
pmurias joined
|
|||
unmatched} | m: class Nil {}; role Str {}; | 12:54 | |
camelia | ( no output ) | ||
gfldex | that takes obfuscation to a completely now level :) | 12:55 | |
arnsholt | El_Che: Yeah, for that there are different methods on the compiler object you can call. I *think* the one you want is simply called compile | 12:57 | |
Which returns a callable object which can be invoked to do the execution | |||
unmatched} | m: sub say { put "You shall not say! $^a" }; sub infix:<+> { $^a - $^b }; say 2 + 2 | 12:59 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«You shall not say! 0» | ||
arnsholt | I should probably write up some kind of description of how to get at and interact with the compiler object; it's less horrifyingly guts hackery than you might expect | 13:02 | |
In my ample spare time, in between thesis, new job and baby >.< | 13:03 | ||
El_Che | arnsholt: yeah, join the club | ||
arnsholt: that should go right in to the doc (next to the blog). To useful to get lost in a random post | 13:04 | ||
13:04
wamba joined
|
|||
andreoss | m: class Str {}; say "hi"; | 13:05 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«===SORRY!===This type cannot box a native string: P6opaque, Str» | ||
andreoss | why no "Redeclaration of symbol Str"? | 13:06 | |
unmatched} | You can shadow all of the builtins by default. | ||
*by design | |||
jnthn | Because the existing one is a lexical symbol | ||
And so the new package-scoped decl doesn't conflict | |||
arnsholt | The setting is an outer lexical scope, so you get shadowing instead | 13:07 | |
jnthn | Right | ||
13:07
mcmillhj joined
|
|||
arnsholt | It's like "my $a = 1; { my $a = 2; }" | 13:07 | |
andreoss | m: our class Bar {} ; { local class Bar {} }; | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Redeclaration of symbol Barat <tmp>:1------> 3our class Bar {} ; { local class Bar7⏏5 {} }; expecting any of: generic role» | ||
andreoss | m: my class Bar {} ; { my class Bar {} }; | 13:08 | |
camelia | ( no output ) | ||
jnthn | Closer to "my $a = 1; { our $a = 2; }" I guess, but yeah. | 13:09 | |
unmatched} | m: my class Bar {} ; { class Bar {} }; | ||
camelia | ( no output ) | ||
13:10
pierre_ joined
|
|||
pmurias | unmatched}: re comments on reddit, most of them seemed people nit picking for arguments sake | 13:13 | |
SmokeMachine____ | m: say Str(Int) ~~ Int | 13:15 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«False» | ||
13:15
cdg joined
|
|||
SmokeMachine____ | Shouldn't it be true? | 13:16 | |
If it shouldn't, how can I get the Str and the Int from the Str(Int)? | 13:17 | ||
13:17
Sgeo_ left
|
|||
SmokeMachine____ | Something like: Str(Int).final-type == Str && Str(Int).from-type == Int | 13:19 | |
Is there something like that? | |||
13:22
vincentbosch joined
13:24
skids joined
13:25
rba__ joined
13:27
inokenty joined
|
|||
RabidGravy | er | 13:28 | |
13:28
vincentbosch left
|
|||
unmatched} | m: my $v = Str(Int); say $v.^methods | 13:30 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«Method 'methods' not found for invocant of class 'Perl6::Metamodel::CoercionHOW' in block <unit> at <tmp> line 1» | ||
RabidGravy | It's not a type as such, though it looks weird - it's a type coercion of a type object, I'd expect a different result | 13:31 | |
unmatched} | m: my $v = Str(Int); say $v.^target_type | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«(Str)» | ||
unmatched} | m: my $v = Str(Int); say $v.^constraint_type | ||
camelia | rakudo-moar 6cd6ef: OUTPUT«(Int)» | ||
RabidGravy | yeah | ||
my brane wants Str(Int) to be an undefined string | 13:32 | ||
gfldex | Perl6::* are missing in the docs, are they in roast? | 13:35 | |
13:35
Hor|zon joined
|
|||
gfldex | seams not so | 13:35 | |
RabidGravy | gfldex, they are documented as MetaModel::* e.g. docs.perl6.org/type/Metamodel$COLO...eContainer | 13:36 | |
13:36
ptolemarch joined
|
|||
gfldex | a few are | 13:36 | |
RabidGravy | so CoercionHOW isn't | 13:37 | |
well it's add the ones that are tested and not documented | |||
13:38
Hor|zon_ left
|
|||
gregf_ | m: my $v = Str(Int); say $v.^name | 13:43 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«Str(Int)» | ||
gregf_ | m: my $v = Str(Int); say $v.^name; $v = 10.29; | 13:44 | |
camelia | rakudo-moar 6cd6ef: OUTPUT«Str(Int)» | ||
13:44
sufrostico joined
|
|||
TheLemonMan | hmm, the exception backtrace from a broken promise points to the block where await is called, quite counterintuitive when you have to debug some code gone wild | 13:44 | |
gfldex | known bug | 13:45 | |
unmatched} | Is it really a bug, rather than merely a limitation? | ||
gfldex | you can add a CATCH inside the thread and .say the exception | ||
unmatched} | TheLemonMan: it's cause it's on another thread. Stick a CATCH { default { warn $_; warn .backtrace} } | ||
somewhere inside that thread | 13:46 | ||
13:46
MilkmanDan left
|
|||
TheLemonMan | that's much better | 13:46 | |
unmatched} | \o/ | ||
Definitely an area of improvement to be made in. Gets pretty annoying when you got lots of starts and supplies and things | 13:47 | ||
TheLemonMan | you'd have to somehow raise the exception (or pass some more informations about the call-site) rather than just passing the Exception object as a result | 13:48 | |
gfldex | IIRC it's in a Failure already but await is messing it up | 13:49 | |
TheLemonMan | afaics await is just calling .result on the promise, which in turn just calls .throw | 13:51 | |
13:51
khw joined
|
|||
RabidGravy | I think if you catch the exception from the await and get the inner exception or something it's right | 13:51 | |
ugexe | you have to catch the 3rd exception, but only during a blood moon | 13:52 | |
unmatched} | :D | ||
13:52
movl left
|
|||
TheLemonMan | hmm, will a full moon suffice ? | 13:56 | |
ugexe | are you willing to part with your first born? | ||
RabidGravy | speaking of blood sacrifice I'd better be testing the Net::AMQP with this new rabbitmq version | 13:58 | |
14:03
prammer left
14:04
jack_rabbit left
14:10
Woodi left
14:11
kyclark left
|
|||
dalek | osystem: 51b7ca0 | (Alexey Melezhik)++ | META.list: Sparrowdo module to install/update Sparrow Toolchain on target host. |
14:14 | |
osystem: 4376a98 | (Zoffix Znet)++ | META.list: Merge pull request #234 from melezhik/master Sparrowdo module to install/update Sparrow Toolchain on target host: github.com/melezhik/sparrowdo-sparrow-update/ |
|||
14:14
kyclark joined
|
|||
SmokeMachine____ | unmatched}: thanks! | 14:16 | |
14:18
kyclark left,
movl joined
|
|||
pmurias | new nqp-js blog post: blogs.perl.org/users/pawel_murias/2...pdate.html | 14:24 | |
14:27
movl left
|
|||
unmatched} | pmurias++ | 14:27 | |
14:28
kyclark joined
|
|||
CIAvash | pmurias++ | 14:29 | |
14:30
kyclark left
14:37
tokomer left
|
|||
mst | awesome! | 14:38 | |
defend perl6's naming on twitter, get yelled at by stmuk | 14:39 | ||
14:39
kjs_ left
|
|||
unmatched} | ooo drama :D | 14:39 | |
mst: link? :) | |||
mst | twitter.com/shadowcat_mst/status/7...3764837377 | 14:40 | |
RabidGravy | moar popcorn needed, between that and people roasting UKIP :) | 14:42 | |
14:42
_4d47 joined
|
|||
unmatched} | Ah, great, ribasushi calling my words schizzophrenic. | 14:43 | |
unmatched} sighs | |||
RabidGravy | there are some particularly uncivilised people around | ||
gfldex | twitter could be so nice without all those humans | ||
mst | unmatched}: I thought my defence was really quite nice | 14:44 | |
until for some reason the star release manager turned up and started yelling at me and the perl6 person in the thread :( | |||
gregf_ | heh.. cool down guys.. its Perl *runs* | ||
14:44
jonas2 left
|
|||
El_Che | ah, I am famous. I am in the twitter thread (nxadm) | 14:45 | |
unmatched} | mst: I don't see those comments though for some reason | ||
mst | twitter.com/nxadm/status/765545028026527745 | 14:46 | |
El_Che | unmatched}: it starts here twitter.com/ribasushi/status/765500776034758656 | ||
14:47
canopus left
|
|||
unmatched} | heh | 14:47 | |
14:47
kyclark joined
|
|||
RabidGravy | everyone will be famous for some multiple of 160 characters | 14:47 | |
El_Che | anyway, there seems to be some bad blood there. Not much of a discussion after a few tweets | 14:48 | |
14:48
Wiertek joined
|
|||
mst | I was trying to constructively point out that the will to rename wasn't even -really- there on the perl5 side | 14:49 | |
given my plan got basically ignored | |||
14:49
mcmillhj left
|
|||
mst | also, 'larry gets to name things perl' <- uh, yeah, that's why I was hoping we'd end up with 'pumpkin perl' and 'camelia perl' as being what people said | 14:49 | |
El_Che | same same but different, not cool - let's be friends - I tried to fix it but nobody moved - shut up - shut up you first | ||
there you go :) | |||
mst | right | 14:50 | |
still confused why smtuk decided to jump in and start attacking people | |||
but, whatever | |||
jdv79 | i wonder if that squabble will ever die | 14:52 | |
mst | I like my answer of "I tried, people didn't, let's file it under 'actually people don't care that much'" | 14:53 | |
unmatched} | No, of course not. People don't really give a shit about the name, they just want their 5 minutes of fame yelling about things. | ||
They could call it Rakudo, but no one cares enough. | |||
pmurias | I hope the better Perl 6 becomes the better the relations with the Perl 5 community will be | ||
14:53
canopus joined
14:54
mcmillhj joined
|
|||
El_Che | while the battle are the Field of Despair rages for days, people outside the echochamber thought: WUT, people still use PERL? :) | 14:55 | |
mst | indeed | ||
this is why my current project is building something non-perl people will want to use that's incidentally implemented in perl | |||
it will probably eventually be implemented in a mixture of perl5 and perl6 | |||
but I figure the best way to advocate a language is to have people want to learn it because they're already using it for something | 14:56 | ||
14:56
cdg left
|
|||
mst | there's plenty of people who only know PHP because they needed to beat wordpress or mediawiki with a stick etc. | 14:56 | |
El_Che | mst: that why I learn Ruby (Puppet) | ||
t | |||
unmatched} | pmurias: if it weren't for mst, my relations would consist of (1) "Mojolicious developers shitlisting me for an exasperated tweet about their work and having a discussion about me for several hours" (2) Ribasushi parading my comments about wanting to live in peace as "schizzo". I can totally see this ending up in a breaking point and me stopping to care what Perl 5 folks think or do, since my only point of | 14:57 | |
contact is through these sort of interactions. | |||
mst | what I'm upset about is that I went to the trouble of stepping in to defend from the perl5 side | ||
and then got yelled at by a perl6 person | |||
it makes me not want to bother | |||
El_Che | mst in an ambassador role. Who would have thought :) | ||
14:57
nowan_ left
|
|||
unmatched} | :) | 14:58 | |
lizmat | El_Che: you might be surprised :-) | ||
El_Che | I ... am | ||
:) | |||
mst | El_Che: ironically, the only reason Chef was written in ruby was that their early customers were all rails shops | ||
the prototype was a Catalyst app | |||
15:00
nowan joined
|
|||
El_Che | mst: I was told that the first prototypes/versions of puppet were in perl, but the author moved to ruby for better dsl support | 15:00 | |
I can't find a verification of it though | 15:01 | ||
mst | El_Che: yes, that's *puppet*. I said *chef*. | ||
I was around for the birth of both. | |||
El_Che | that sounds creepy :) | 15:02 | |
mst the ghost of christmas past | |||
15:12
mcmillhj left
15:13
obfusk left
15:14
obfusk joined
|
|||
timotimo | i don't see stmuk be a part of that discussion at all, strangely | 15:18 | |
mst | starts from twitter.com/nxadm/status/765545028026527745 with him attacking El_Che for no apparent reason | ||
timotimo | oh, man. twitter is hard to navigate. | 15:19 | |
*shrug* :\ | 15:20 | ||
gregf_ | imho "radically different languages" doesn't sound quite right :| | 15:22 | |
gfldex | m: use variables :D; my @a; @a[0] = Any; | 15:23 | |
camelia | rakudo-moar c159f0: OUTPUT«Type check failed in assignment to @a; expected Any:D but got Any (Any) in block <unit> at <tmp> line 1» | ||
15:24
mcmillhj joined
15:28
perlpilot joined
15:33
rindolf left,
zakharyas left
15:36
grondilu left
15:39
rindolf joined
|
|||
stmuk | El_Che: there is a FLOSS Weekly interview with the Puppet authors where they say they were Perl people who used Ruby for pragmatic reasons | 15:41 | |
mspo | I recall it | 15:42 | |
back in the great ruby DSL trend days | |||
timotimo | the great DSL wars | ||
mspo | and puppet is dog slow to prove how ruby-esque it is | 15:43 | |
my puppet runs are 30s - 3m now-a-days | |||
it's painful | |||
unmatched} | What's an R operator? Trying to search for it on docs site is proving impossible :/ | 15:44 | |
timotimo | it's a metaoperator | ||
it reverses the arguments to an operator | |||
TheLemonMan | m: my @y is default(42); say @y; | ||
camelia | rakudo-moar c159f0: OUTPUT«[]» | ||
timotimo | m: say 5 - 10; say 5 R- 10 | ||
camelia | rakudo-moar c159f0: OUTPUT«-55» | ||
timotimo | m: say 5 / 10; say 5 R/ 10 | ||
camelia | rakudo-moar c159f0: OUTPUT«0.52» | ||
unmatched} | Oh | ||
m: say 5 R, 1 | |||
camelia | rakudo-moar c159f0: OUTPUT«(1 5)» | ||
unmatched} | Thanks | ||
timotimo | m: 10 R= my $foo; say $foo | 15:45 | |
camelia | rakudo-moar c159f0: OUTPUT«10» | ||
unmatched} | 0.o | ||
Ulti | SmokeMachine____ your example with the scalar and hash version of SetHash the % named variables are all Hashes so if you say SetHash %variable you end up declaring a Hash[SetHash] where the keys are typed iirc | ||
El_Che | mspo: I restricted my puppet use to a run in a tmp space on a remote server to create the persistent configuration of docker containers (using among other hiera-eyaml for gpg encryption of secrets) | ||
unmatched} | m: my @y is default(42); say @y[^3]; # TheLemonMan, the default applies to elements that don't have values | ||
camelia | rakudo-moar c159f0: OUTPUT«(42 42 42)» | ||
timotimo | Ulti: nope, for typed keys you need to Hash{SetHash} | ||
Ulti | timotimo its more it ends up being that | 15:46 | |
not saying the square bracket thing is syntax | |||
timotimo | Ulti: the role arguments for Associative and Hash are "reversed" for that reason | ||
Ulti | just a description | ||
El_Che | mspo: so the puppet/ruby lib code is nowadays pretty simple and small (it used to be huged and complicated) | ||
TheLemonMan | unmatched}, ugh, that's confusing | ||
Ulti | %thing is a hash I noticed this when someone else was asking about the exact same thing with BagHash | ||
timotimo | but they want a hash that has BagHash-es stored in it | 15:47 | |
Ulti | no they want the %thing to be the BagHash at least in the person previously | ||
unmatched} | TheLemonMan: what did you think it would end up as? | ||
gfldex | m: my %h is SetHash.=new; dd %h.push(a => 1) | ||
camelia | rakudo-moar c159f0: OUTPUT«Cannot modify an immutable SetHash in block <unit> at <tmp> line 1» | ||
Ulti | my BagHash %thing = BagHash.new; | ||
unmatched} | m: my $y is default(42); say $y; | 15:48 | |
camelia | rakudo-moar c159f0: OUTPUT«42» | ||
Ulti | gfldex: hmm interesting | ||
unmatched} | m: my $y is default(42); $y = (1, 2, 3, 4,); say $y; | ||
camelia | rakudo-moar c159f0: OUTPUT«(1 2 3 4)» | ||
TheLemonMan | unmatched}, a compile-time error tbh heh, I originally mistyped the sigil in my code and was wondering what was going on | ||
Ulti | so the `is` is needed | ||
timotimo | Ulti: that's just a bug; i think it was already filed. | ||
Ulti | k k | ||
SmokeMachine____ | Util: no iPhone wanted a hash of SetHashes... | 15:49 | |
[Coke] would give lizmat a hug, but is afraid that would hurt. | 15:51 | ||
SmokeMachine____ | My problem was I couldn't set values on a sethash inside of a hash... | 15:52 | |
lizmat | [Coke]: there are still spots unbruised :-) | ||
15:52
pmurias left
|
|||
El_Che | lizmat: what happened? | 15:52 | |
15:52
kjs_ joined
|
|||
lizmat | last Sunday hit the concrete of the bikepath at 25km/hour | 15:53 | |
SmokeMachine____ | m: my SetHash %a; %a<bla><ble>++ | ||
camelia | rakudo-moar c159f0: OUTPUT«Type check failed in assignment to %a; expected SetHash but got Hash (${}) in block <unit> at <tmp> line 1» | ||
El_Che | lizmat: let me guess, you wanted to speed up stuff with at least 30% | ||
:) | |||
lizmat: something broken? | |||
lizmat | nothing broken, just a lot of scratches and bruises | ||
I now have green fingers on my left hand :-) | 15:54 | ||
quite amazing :-) | |||
AlexDaniel | lizmat: what about the bike? Is it alright? | ||
15:54
kjs_ left
|
|||
lizmat | yeah, mostly, one of the brakes needed adjusting | 15:54 | |
[Coke] ROTFLS at el_che's comment. :) | |||
SmokeMachine____ | Shouldn't that work? | 15:57 | |
AlexDaniel | lizmat: well, consider rethinking your priorities :D that being said, some people argue that while healhcare is free in some countries, bike parts are not… | ||
15:58
mcmillhj left
|
|||
unmatched} | lol | 15:58 | |
lizmat | AlexDaniel: and don't forget the labour :-) | ||
gfldex | SmokeMachine____: no, it should not work | 15:59 | |
SmokeMachine____ | Why not? | ||
gfldex | because you never told the compiler the shape of %a. Therefor it must assume that you want a "autovivified" shape. | 16:00 | |
and shaped Hashes are NYI | |||
(i think) | |||
m: my SetHash %a{1}; | 16:01 | ||
camelia | ( no output ) | ||
gfldex | m: my SetHash %a{1}; dd %a | ||
camelia | rakudo-moar c159f0: OUTPUT«Hash[SetHash,Int] %a = (my SetHash %{Int} = )» | ||
16:01
mcmillhj joined
|
|||
dalek | c: 8105200 | coke++ | util/list-missing-methods.p6: whitespace cleanup |
16:02 | |
c: 6b162d4 | coke++ | doc/Type/Callable.pod6: whitespace |
|||
16:02
kjs_ joined
16:03
MilkmanDan joined
|
|||
SmokeMachine____ | I said that I wanted a hash of sethashes... Didn't I? | 16:03 | |
16:03
Ledmitz joined
|
|||
gfldex | m: my %a; %a<bla> = SetHash.new; %a<bla><blub>++; dd %a; | 16:03 | |
camelia | rakudo-moar c159f0: OUTPUT«Hash %a = {:bla(SetHash.new("blub"))}» | ||
SmokeMachine____ | But why it's not autovivified? | 16:04 | |
unmatched} | m: my SetHash %a; %a<bla> = SetHash.new; %a<bla><ble>++ | ||
camelia | ( no output ) | ||
unmatched} | m: my SetHash %a; %a<bla> = SetHash.new; %a<bla><ble>++; dd %a | ||
camelia | rakudo-moar c159f0: OUTPUT«Hash[SetHash] %a = (my SetHash % = :bla(SetHash.new("ble")))» | ||
unmatched} | SmokeMachine____: it is; it's just the autovivification uses a Hash, so you get the type mismatch error | 16:05 | |
gfldex | m: my %a is default(SetHash.new); # it should do that but with a proper closure | ||
camelia | ( no output ) | ||
Ledmitz | hello. this should be a simple one sine I don't know perl at all. having a problem with quoted text. I think the "s/" seems to be the problem. How can I treat as normal quote? | ||
"/media/Silo/Projects/Audio/ManaSound/Done" | |||
unmatched} | Ledmitz: there's no problem in that string. We'll need more context. | 16:06 | |
Ledmitz: also, what Perl is that? Perl 5 or Perl 6? | |||
SmokeMachine____ | m: my SetHash %a; %a<bla> .= new; %a<bla>++; dd %a | ||
camelia | rakudo-moar c159f0: OUTPUT«Method 'succ' not found for invocant of class 'SetHash' in block <unit> at <tmp> line 1» | ||
16:06
mcmillhj left
|
|||
Ledmitz | ok .. its the bfserve.pl script. I want to host sfx that I have made | 16:06 | |
unmatched} | Ledmitz: are there error messages? | 16:07 | |
16:07
kjs_ left
|
|||
SmokeMachine____ | But if I said that it's a sethash, shy it autovivifies as a hash? | 16:07 | |
Ledmitz | OOOhhhh unmatched} ... I am Perl 5 here, I guess | ||
16:07
zacts left
|
|||
gfldex | SmokeMachine____: you may have stepped on a bug | 16:08 | |
Ledmitz | unmatched}> shall I send a code snippet to you pm? | ||
unmatched} | Ledmitz: OK. | ||
Ledmitz: and error messages you're getting | |||
16:08
zacts joined
|
|||
SmokeMachine____ | gfldex: already known bug? | 16:09 | |
gfldex | _may_ | ||
16:09
zacts is now known as Guest42865,
zakharyas joined
|
|||
Ledmitz | unmatched}> no errors and I checked syntax online. all good, but terminal shows different color | 16:09 | |
16:09
Guest42865 left
|
|||
gfldex | the problem is that the type you provide, may require arguments to new to make sense. How should the compiler know? | 16:10 | |
autovivication with %h<foo>++ makes sense because ++ defaults to Int and Int.new defaults to 0 so you end with a foo => 1 | 16:11 | ||
unmatched} | Ledmitz: erm, you're just using a dumb syntax highlighter that thinks it's the s/// operator, even though it's just a string. | ||
Ignore it. | |||
16:12
melezhik left
|
|||
SmokeMachine____ | Shouldn't it looks at the type of the variable to get a hint? | 16:12 | |
16:12
mcmillhj joined
|
|||
gfldex | it doesn't get there for %a<bla><ble>++ | 16:13 | |
Ledmitz | unmatched}> ok.. just trying to track down why the server not functioning. | ||
16:13
brrt joined
|
|||
unmatched} | Ledmitz: you might get better luck in one of... I'm assuming Battle Field... forms, since the problem is likely not with the script, but with your setup. | 16:14 | |
*forums | |||
gfldex | m: my SetHash %a; %a.VAR.default.say | ||
camelia | rakudo-moar 05cdc1: OUTPUT«(SetHash)» | ||
gfldex | so the default value is a type object | ||
m: my SetHash %a is default(Any); %a.VAR.default.say | 16:15 | ||
camelia | rakudo-moar 05cdc1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Default value '(Any)' will never bind to a parameter of type Hash[SetHash]at <tmp>:1------> 3my SetHash %a is default(Any)7⏏5; %a.VAR.default.say expecting any of: constraint» | ||
Ledmitz | unmatched}> hm.... I'm guessing the script is really old and the pearl newest on Debian Unstable | ||
SmokeMachine____ | m: my SetHash %a; %a<bla>.^name.say | ||
camelia | rakudo-moar 05cdc1: OUTPUT«SetHash» | ||
Ledmitz | *new | ||
16:15
MilkmanDan left
|
|||
unmatched} | Ledmitz: it should still work fine. Maybe your config is wrong, dunno. | 16:16 | |
Ledmitz | unmatched}> ok well ty. where do I go for forums? | ||
SmokeMachine____ | Shouldn't it give a hint? | ||
unmatched} | Ledmitz: no idea. This is a Perl 6 programming channel and your script is a Perl 5 server for a game :} Not exactly overlapping fields :) | ||
16:17
brrt left,
mcmillhj left
|
|||
Ledmitz | unmatched}> well sorry bout that. I'm gonna try #hexchat. they might know. could be client settings | 16:17 | |
SmokeMachine____ | m: my SetHash %a is default(SetHash.new); %a<bla><ble>++; dd %a | ||
camelia | rakudo-moar 05cdc1: OUTPUT«Hash[SetHash] %a = (my SetHash %)» | ||
Ledmitz | unmatched}> channel modes seem fine | ||
16:17
harovali joined
|
|||
Ledmitz | thanks | 16:18 | |
unmatched} | No problem. | ||
16:18
Ledmitz left,
brrt joined
|
|||
gfldex | is default(SetHash.new) will call .new at compile time | 16:19 | |
SmokeMachine____ | Makes sense... | ||
gfldex | so you end up with the same Sethash in any slot of %a | ||
16:21
MilkmanDan joined,
lostinfog joined
|
|||
gfldex | m: my SetHash %h; %h but WHENCE({SetHash.new}) | 16:22 | |
camelia | rakudo-moar 05cdc1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared name: WHENCE used at line 1» | ||
16:23
mcmillhj joined
16:24
cdg joined
|
|||
gfldex | is WHENCE implemented at all? | 16:25 | |
nvm, it's not in roast | 16:26 | ||
lizmat | gfldex: WHENCE *is* implemented at nqp level and is responsible for: | ||
my %h; my $b := %h<a>; dd %h; $b = 42; dd %h | 16:27 | ||
m: my %h; my $b := %h<a>; dd %h; $b = 42; dd %h | |||
camelia | rakudo-moar 05cdc1: OUTPUT«Hash %h = {}Hash %h = {:a(42)}» | ||
lizmat | afk& | ||
16:29
mcmillhj left
16:30
edehont joined,
pduh joined
|
|||
timotimo | oh wow, this is comedy gold | 16:31 | |
16:31
brrt left
|
|||
timotimo | "it is literally the same meaning as its dictionary definition" - "no it's not, *links to oatmeal comic about 'literally'*" - "yeah, it is." | 16:31 | |
unmatched} is confused | 16:32 | ||
timotimo | the "literally" was properly used in the original comment | ||
and someone went "LITERALLY ISNT USED LIKE THAT" | |||
SmokeMachine____ | m: my %a is Hash of SetHash; %a<bla><ble>++; dd %a | 16:33 | |
camelia | rakudo-moar 05cdc1: OUTPUT«(my SetHash % = :bla(${:ble(1)}))» | ||
timotimo | though of course you can debate whether a function "taking" a code block is an acceptable use of a word that literally means "taking" | ||
unmatched} feels like the context is missing... | |||
timotimo | just the comment thread about your blog post | 16:34 | |
SmokeMachine____ | gdldex: looks that it worked... | ||
unmatched} | Ah | ||
timotimo | i wonder if clang had levenshtein based suggestions before rakudo did | ||
unmatched} | I like gobbling. It's cute and fun. An error in your code is a traumatic event, so humour is a good thing. | ||
SmokeMachine____ | Or not... | 16:35 | |
m: my %a is Hash of SetHash; %a<bla><ble> = "qwer"; dd %a | |||
camelia | rakudo-moar 05cdc1: OUTPUT«(my SetHash % = :bla(${:ble("qwer")}))» | ||
timotimo | i think that's a bug there | 16:36 | |
probably already filed | |||
*shrug* | |||
apparently clang already had typo correction in 2011 at the latest | 16:38 | ||
unmatched} | Lool, 44 comments on that reddit thread. "Did you actually read the error?" "Did you actually read my comment?".. Yeah, I don't think I going to be reading them :} | 16:39 | |
16:40
mcmillhj joined
|
|||
unmatched} contemplates publishing "Perl 6 The Most Awesome Language You Ever Dreamed Of!" | 16:41 | ||
And then watch the world burn, as people argue themselves in the comments to death :D | |||
I might do it just to troll... | |||
timotimo | not sure how i'd like that | 16:44 | |
stmuk | social media would be fine if it wasn't for the people that used it! | ||
16:44
mcmillhj left
|
|||
unmatched} | timotimo: but it would be purely for my own entertainment :D | 16:47 | |
16:48
edehont left
|
|||
timotimo | OK | 16:48 | |
16:48
edehont joined
16:49
dakkar left
16:50
kyclark left
|
|||
unmatched} | m: say (1 R, 2 R, 3 R, 4) | 16:51 | |
camelia | rakudo-moar 05cdc1: OUTPUT«(2 1)» | ||
mspo | El_Che: so you just use it as a Dockerfile template machine? | 16:52 | |
16:53
pierre_ left,
mcmillhj joined
|
|||
[Coke] | unmatched}: precedence | 16:54 | |
unmatched} | [Coke]: of what? I can't figure out how to put parens in | 16:55 | |
m: say (1 R, (2 R, (3 R, 4))) | |||
camelia | rakudo-moar 05cdc1: OUTPUT«(((4 3) 2) 1)» | ||
unmatched} | Ah | ||
hm | 16:56 | ||
m: say (((1 R, 2) R, 3) R, 4) | |||
camelia | rakudo-moar 05cdc1: OUTPUT«(4 (3 (2 1)))» | ||
unmatched} | m: @a = (1 R, 2 R, 3 R, 4); dd @a | ||
camelia | rakudo-moar 05cdc1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '@a' is not declaredat <tmp>:1------> 3<BOL>7⏏5@a = (1 R, 2 R, 3 R, 4); dd @a» | ||
unmatched} | m: my @a = (1 R, 2 R, 3 R, 4); dd @a | ||
camelia | rakudo-moar 05cdc1: OUTPUT«Array @a = [2, 1]» | ||
unmatched} | Come come (1, 2, 3, 4) doesn't have this issue? | 16:57 | |
[Coke] | m: say |(1 R, 2 ) R, |(3 R, 4) | ||
camelia | rakudo-moar 05cdc1: OUTPUT«(4 3 2 1)» | ||
timotimo | so the R metaop doesn't do well with list prefix ops? | 16:58 | |
unmatched} | It's from this ticket: rt.perl.org/Ticket/Display.html?id...et-history | 16:59 | |
17:00
Wiertek left,
cdg left
|
|||
[Coke] | unmatched}: my plan on that ticket was to hope jnthn answered it. :| | 17:00 | |
17:00
zacts_pi joined
|
|||
unmatched} | :D | 17:01 | |
jnthn | I suspect that it just ain't handling list associativity right | 17:09 | |
jnthn@lviv:~/dev/rakudo$ ./perl6-m --target=ast | |||
===SORRY!=== | |||
Cannot find method 'repl-loop' on object of type QAST::CompUnit | |||
Well, bother. | 17:10 | ||
Curiously though the AST looks kinda right | 17:11 | ||
so does METAOP_REVERSE | 17:12 | ||
Oh | |||
The optimizer screws it | |||
With --optimzie=off it works out fine | |||
timotimo | uh oh. i wonder if i tried to "optimize" the metaop reverse? | 17:13 | |
jnthn | Probably :P | 17:14 | |
Compiling a patch | |||
timotimo | needs moar tests | 17:15 | |
17:15
prammer joined,
MilkmanDan left
|
|||
jnthn | yup, got a fix | 17:16 | |
17:16
stux|RC-only joined
|
|||
unmatched} | \o/ | 17:16 | |
17:16
bob777 left,
firstdayonthejob joined
|
|||
jnthn | Of course, my NQP and Rakudo builds are way behind HEAD... :) | 17:19 | |
m: use Test; is (1 R, 2 R, 3 R, 4), (4, 3, 2, 1) | 17:21 | ||
camelia | rakudo-moar 05cdc1: OUTPUT«not ok 1 - # Failed test at <tmp> line 1# expected: '4 3 2 1'# got: '2 1'» | ||
unmatched} | m: use Test; is-deeply (1 R, 2 R, 3 R, 4), (4, 3, 2, 1) | 17:22 | |
camelia | rakudo-moar 05cdc1: OUTPUT«not ok 1 - # Failed test at <tmp> line 1# expected: $(4, 3, 2, 1)# got: $(2, 1)» | ||
El_Che | mspo: I am not a linux admin jobwise, so that part is on their team (jenkins, git setup etc). For our team I picked the pieces togethere and wrote what was needed to allow us to do our deployments on a safe way. We ended with a server that retrieve the configuration from git, build it, puts the secrets in (in git encrypted with gpg hiera-eyaml) and pushed the config to the docker host and restarts the | 17:25 | |
container (or retrieve the coorrect image from the registry) | |||
17:28
brrt joined
|
|||
mspo | El_Che: oh okay | 17:31 | |
17:31
kyclark joined
|
|||
El_Che | mspo: it works pretty nice, a git-jenkins flow | 17:32 | |
mspo: but becasue of security concerns we needed a more specific flow (we are responsable for the AAI setup (infra & code), including everything related to ldap, ad, iam, radius, etc) | 17:34 | ||
kyclark | If I “run” with :merge, I never get anything back. Minimal failing case: | ||
pastie.org/10936630 | |||
17:35
harovali left
|
|||
jnthn | unmatched}: Fix pushed, ticket closed :) | 17:35 | |
unmatched} | kyclark: it's likely buggy. I get a coredump with my $p = run "echo", "hello", :merge; say $p.out.slurp-rest | 17:36 | |
jnthn: that was fast :D \o/ | |||
17:36
harovali joined
|
|||
jnthn | Yeah, well, my alternative for the last 30 mins of work time today was continuing dealing with integrating with an oAuth2 impl whose authors can't read RFCs...so it wasn't really a hard choice. :P | 17:37 | |
unmatched} | heh | ||
17:38
zacts_pi left
17:39
domidumont left
17:40
domidumont joined,
domidumont left
17:46
edehont left
17:50
Woodi joined
17:52
zacts joined
17:53
canopus left
17:56
djbkd joined
17:58
mvorg left
|
|||
stmuk remembers the YAPC::EU 14 oauth dance | 17:59 | ||
17:59
canopus joined
18:00
Sgeo_ joined
18:05
cdg joined
|
|||
brrt | o... auth... :-( | 18:07 | |
although, i was actually having problems with xauth today | |||
so | |||
always trouble | |||
18:10
n1lp7r left
|
|||
El_Che | jnthn: come to saml2 if you want an overdose of RFCs and xml :) | 18:13 | |
18:14
brrt left
18:19
kurahaupo joined
18:21
_28_ria left,
zacts left
18:22
_28_ria joined
18:23
zakharyas left
18:25
kurahaupo_ joined
18:26
prammer left,
kurahaupo left,
prammer joined
18:32
leego joined
18:33
sno left
18:36
cdg left
18:41
awwaiid left
18:42
awwaiid joined
18:43
zacts joined
18:48
_28_ria left
|
|||
kyclark | Is there a way to do more than one file test at a time. $file.IO.fe won’t give me “file” and “exists” | 18:51 | |
18:51
prammer left
|
|||
sjn | kyclark: doesn't "file" imply "exists"? | 18:53 | |
18:53
trnh joined,
trnh left,
trnh joined
|
|||
kyclark | Yes, bad example, what about “file” and “executable”? | 18:53 | |
I guess just $file.IO.e && $file.IO.f? | |||
unmatched} | kyclark: $file.IO ~~ :e & :f | ||
kyclark | Oooo, pretty~ | ||
! | |||
unmatched} | .e and .f given $file.IO | 18:54 | |
18:54
sufrostico left
|
|||
ugexe | you used to be able to do .all<f e> | 18:54 | |
unmatched} | kyclark: sorry, executable woulbe :x not :e | 18:55 | |
lizmat | . | 18:56 | |
sjn | btw, is there a reason for panda seemingly throwing an error when trying to install a module that's already installed? | 18:57 | |
ugexe | thats actually rakudo that throws | ||
kyclark | Is it possible to set an INPUT_RECORD_SEPARATOR-somethingorother when reading files? | 18:58 | |
e.g., $/ | 18:59 | ||
ugexe | nl-in and nl-out | ||
smls | kyclark: Pass the :nl ("newline") option to open() | ||
dLeCamarae | Has anyone built Rakudo for the Intel Galileo, or will I be the first? | ||
sjn | ugexe: stack trace refers to Panda::Installer line 61 <github.com/tadzik/panda/blob/maste...pm#L61> | 19:00 | |
ugexe | $to.install is calling a method on a rakudo class | ||
sjn | CompUnit::Repository | ||
ugexe | ::Installation | 19:01 | |
19:01
smls left
19:03
prammer joined
19:07
rindolf left,
lichtkind joined,
andreoss left
19:09
cyphase left,
kurahaupo joined,
pdcawley joined
19:12
kurahaupo_ left
19:13
pdcawley_ left,
cyphase joined
19:15
darutoko left
19:16
rindolf joined
19:18
kjs_ joined,
sno joined
19:20
rindolf left,
rindolf joined
19:25
awwaiid left,
awwaiid joined
19:26
kjs_ left
19:29
kjs_ joined
19:30
awwaiid left,
nadim left,
grondilu joined,
awwaiid joined
19:31
cyphase left
|
|||
TheLemonMan | I dug a bit into the ticket #128803 because apparently it's how I now like wasting my time, found that what goes wrong is is-runtime doesn't return True when called in print-exception, I instrumented with some say the code and this is the output I got from running the first test-case outlined in the ticket ptpb.pw/jpWv I hope that's somehow useful :) | 19:31 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128803 | ||
19:35
cyphase joined
19:36
wamba left
|
|||
unmatched} | TheLemonMan: great! Can't wait for your fix :) | 19:38 | |
19:39
kjs_ left,
dLeCamarae left
19:43
zacts left
19:45
rindolf left
|
|||
unmatched} | m: X::OutOfRange.new(what => ".rotor position is", got => -1, range => "0..Inf", comment => "(ensure the negative gap is not larger than the length of the sublist)").new.throw | 19:46 | |
camelia | rakudo-moar ba20d3: OUTPUT«Argument out of range. Is: <unknown>, should be in <unknown> in block <unit> at <tmp> line 1» | ||
unmatched} | Weird that the got/range/comment don't get displayed :\ | ||
19:46
rindolf joined
|
|||
unmatched} | s: <a b c d b>, "rotor", \(1 => -2) | 19:47 | |
SourceBaby | unmatched}, Sauce is at github.com/rakudo/rakudo/blob/1728...t.pm#L1152 | ||
unmatched} | Ah, two .news | ||
m: X::OutOfRange.new(what => ".rotor position is", got => -1, range => "0..Inf", comment => "(ensure the negative gap is not larger than the length of the sublist)").throw | |||
camelia | rakudo-moar ba20d3: OUTPUT«.rotor position is out of range. Is: -1, should be in 0..Inf; (ensure the negative gap is not larger than the length of the sublist) in block <unit> at <tmp> line 1» | ||
19:48
zacts joined
|
|||
TheLemonMan | unmatched}, heh I'm still trying to figure out how all the moving pieces work together | 19:50 | |
unmatched} | TheLemonMan: if it's of help, there's an Internals course: edumentab.github.io/rakudo-and-nqp-...ls-course/ | 19:51 | |
TheLemonMan | oh, that's very nice, thanks unmatched} | ||
unmatched} | There's also this article; unsure of how useful it will be to you tho: perl6.party/post/Hacking-on-Rakudo-...x-Your-Fix | 19:52 | |
TheLemonMan | that's the article that made me try out Perl6 :) | 19:53 | |
19:53
canopus left
|
|||
[Coke] | unmatched}++ | 19:53 | |
19:54
TEttinger joined
|
|||
lizmat | unmatched} : seems like my fix borked the test for #127695 in t/spec/S19-command-line/repl.t ? | 19:57 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127695 | ||
20:00
canopus joined,
trnh left
20:01
zacts left,
mcmillhj left
20:03
vendethiel joined
20:05
cyphase left
20:08
mcmillhj joined
20:10
cyphase joined
|
|||
unmatched} | TheLemonMan: that's music to my ears :) | 20:12 | |
vcv | unmatched}++ | ||
unmatched} | lizmat, I'll take a look closer when I get home, but it seems to be just another test that assumed the REPL starts up even if the requested module was not found | 20:14 | |
lizmat | unmatched}: that makes sense, safe travels! | ||
20:26
cdg joined
20:27
cdg left,
cdg joined
|
|||
TheLemonMan | from what I can tell it seems the backtrace is too shallow to reach the point where eval/print_control/compile is | 20:29 | |
20:34
pmurias joined,
ggoebel joined,
brrt joined
20:35
zacts joined
20:36
itaipu joined
20:37
zacts left,
zacts joined
20:38
awwaiid left
20:39
domidumont joined
|
|||
lizmat | TheLemonMan: have you tried running with --ll-exception ? | 20:39 | |
TheLemonMan | lizmat, yep, I've just learned about that switch heh | 20:40 | |
20:40
awwaiid joined
|
|||
kyclark | Given two arrays like @names and @values, how could I combine them into a single hash? | 20:45 | |
@names Z @values doesn’t quite do what I want | |||
hoelzro | @names Z=> @values | 20:46 | |
that should do the trick, I think | |||
m: my @names = <foo bar baz>; my @values = 1..3; my %h = @names Z=> @values; say %h.perl | |||
camelia | rakudo-moar dd9b76: OUTPUT«{:bar(2), :baz(3), :foo(1)}» | ||
kyclark | Flippin’ sweet. | 20:47 | |
Heckin’ awesome. | |||
perlpilot | Perl 6 is just awesome that way :) | ||
20:48
domidumont left,
mohae joined
|
|||
AlexDaniel | interestingly, I'm no longer impressed by stuff like this | 20:48 | |
after seeing enough Perl 6 code it just feels normal | 20:49 | ||
perlpilot | This morning I was debugging some P5 and wanted to dump the value of a hashref on the 5th iteration of a loop. I immediately typed say Dumper($thingy) is $++ == 4; and then got annoyed that I had to use an actual variable and had to declare it somewhere. | ||
s/is/if/ | 20:50 | ||
20:50
mohae_ left
|
|||
perlpilot | Perl 6 is full of little "convenience" things like that that just make it more fun to use | 20:50 | |
AlexDaniel | it also annoys me that you have to import Dumper… | 20:51 | |
perlpilot | indeed | ||
20:52
kjs_ joined
20:55
mvorg joined
20:56
brrt left
20:59
mcmillhj left,
skids left,
mcmillhj joined
|
|||
El_Che | m: class foo { foo() } | 21:03 | |
camelia | rakudo-moar dd9b76: OUTPUT«WARNINGS for <tmp>:Useless use of constant value foo() in sink context (line 1)» | ||
21:03
Ven joined
|
|||
El_Che | m: class foo { my $a = 'a'; foo } | 21:04 | |
camelia | rakudo-moar dd9b76: OUTPUT«WARNINGS for <tmp>:Useless use of constant value foo in sink context (line 1)» | ||
unmatched} | that looks like a coercer | ||
21:04
mcmillhj left
|
|||
El_Che | about the errors message. Regular errors (typo's, wrong infixes, forgotten ';', etc) return the filename in the first line of the error output. "Undeclared" errors (e.g. Undeclared routine) does not return a filename what so ever | 21:06 | |
zengargoyle | it's been a while, but i think i've seen horrid SHA hashes in some sorts of error messages or other outputs where one would expect a 'filename' of some sort. | 21:08 | |
El_Che | zengargoyle: it doen't matter that much as long as the errors are consistent. The filename (and line nr) is needed by the vim linter (syntastic) in order to highlight the error line | 21:10 | |
zengargoyle | sure, i'm just thinking more of the general useage case. | 21:11 | |
geekosaur | zengargoyle, that was fixed some time ago so it gets translated to the user visible name | ||
perlpilot | zengargoyle: sounds like you're thinking of how files used to be shown from comp unit repos | 21:12 | |
geekosaur | (actually it outputs both, because if you have two different modules that use the same user visible names but are distinct by, say, auth or ver, you need the hash to distinguish) | ||
zengargoyle | cool, thought i saw one a week or two ago. but i haven't been doing much p6 for a while so ... | ||
like i could have swore i saw it in like 'panda --help' or something where '/path/to/panda' was '/path/to/some-long-hash' or something. | 21:14 | ||
perlpilot | if you saw it a week or so ago, it must have been from an old perl6 :) | 21:15 | |
or an old panda maybe | |||
unmatched} | Don't you still get the hash in the filename, it's just you're also told what module it is in parentheses? | ||
zengargoyle | nah, fresh rakudobrew. install. | ||
maybe i missed the parenthesized part. | 21:16 | ||
perlpilot | must be | ||
(it's parenthetical ... how important could it be? ;) | |||
unmatched} | m: class foo { foo().HOW.^name.say } | ||
camelia | rakudo-moar dd9b76: OUTPUT«Perl6::Metamodel::CoercionHOW» | ||
unmatched} | \o/ | 21:17 | |
zengargoyle | :) | ||
geekosaur | mm, this sounds like something different? like the script is printing its $*PROGRAM and that contains the hash because that's the actual name of the script within the filesystem? | ||
(or is it $?PROGRAM? sigh) | |||
unmatched} | $*PROGRAM | 21:19 | |
21:21
xfix left
21:24
prammer left
21:26
labster joined,
itaipu left
|
|||
zengargoyle | ah, yeah. maybe it was some other older thing from pre precomp days that was printing out itself. | 21:28 | |
21:29
CIAvash left,
edehont joined
|
|||
kyclark | I have a MAIN that accepts a :$sep=‘,’ for parsing files that works fine with commas, but now I want to specify —sep=“\t” on the command line and it’s not working correctly to “split” the text. Any ideas? | 21:30 | |
ugexe | are you sending an actual tab or a literal slash literal t? | 21:31 | |
kyclark | I’m not sure how to specify it from the command line. I’ve tried —sep=\t —sep=“\t” —sep=\\t | 21:33 | |
None work | |||
ugexe | you have to do that yourself | 21:34 | |
kyclark | Wow, an actual tab makes it funky | ||
geekosaur suspects it only understands literal characters, not backslash escapes | |||
you might want to try --sep=$'\t' | |||
(bash-ism) | |||
avuserow_ | try `--sep="<Ctrl+v><Ctrl+i>"` (e.g. pushing ctrl+v then ctrl+i while within the double quotes)? | ||
ugexe | or s/\\t/\t/ in your program | 21:35 | |
unmatched} | There's a site someone linked to here that makes you solve all sorts of decoding challenges in HTTP headers. Anyone recall the URL? | ||
It was some different language, not English | |||
kyclark | geekosaur nailed it, but I guess I will have to detect literal ‘\t’ and set it to “\t” ??? | 21:36 | |
geekosaur | what ugexe said, basically | ||
21:36
rindolf left
|
|||
geekosaur | except you probably want general character escape processing (hm. is that perhaps exposed somewhere convenient?) | 21:37 | |
ugexe | just use .trans, there isnt that many instances | ||
21:37
zacts left
|
|||
kyclark | Oh, right. ugexe got it, too | 21:37 | |
ugexe | github.com/rakudo/rakudo/blob/nom/...ON.pm#L107 along those lines | 21:38 | |
geekosaur | until you try to use \x or \c... | ||
21:41
prammer joined
|
|||
unmatched} | Ah, found that site: www.vg.no/ | 21:43 | |
21:44
TheLemonMan left
21:45
prammer left
|
|||
avuserow_ prepares for a flight by cloning `perl6-all-modules`... never know when you need some light reading | 21:47 | ||
21:50
Ven left
21:56
Ven joined
|
|||
masak | hm, perl6-all-modules hasn't been updated since May... | 22:00 | |
'night, #perl6 | 22:01 | ||
22:02
Ven left
|
|||
timotimo | gnite masak | 22:05 | |
22:08
rkazak joined
|
|||
kyclark | Can the arguments to MAIN be made mutable? | 22:08 | |
22:09
edehont left
|
|||
kyclark | Here’s what I have right now: | 22:09 | |
sub MAIN (Str $file!, Str :$sep=',', Int :$limit=0) { | |||
I need to alter $sep if it’s “\t” | 22:10 | ||
geekosaur | m: sub aMAIN (Str $file!, Str :$sep is rw =',', Int :$limit=0) { } | 22:11 | |
camelia | rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Cannot use 'is rw' on an optional parameterat <tmp>:1» | ||
geekosaur | bleh | ||
kyclark | Yeah, that’s what I was seeing. I wondered if I just had things in the wrong order. | ||
22:11
heatsink joined
|
|||
geekosaur | so, you can but you can;t use the =',' shorthand, you need to check for it being defined and set it to ',' yourself in code | 22:12 | |
kyclark | It’s not a big deal to copy to another variable. Gives me an opportunity to discuss immutability. | ||
geekosaur | hm. no, tjat makes it mandatory. sigh | ||
kyclark | FWIW, I’m working up an intro to programming in Perl (6) for biologists (www.gitbook.com/book/kyclark/metag...s/details) | 22:13 | |
22:15
kurahaupo left
22:20
pduh left
|
|||
kyclark | I don’t seem to be able to “run” a command with pipes e.g. “cut -f 1 | sort | uniq" | 22:21 | |
I can “shell” it, but it just goes to $*OUT | |||
ugexe | shell has the same options as run | ||
22:22
stux|RC-only left
|
|||
El_Che | are there perl 6 users using vim? I just pushed a fork of syntastic with perl6 support: github.com/nxadm/syntastic. It works for me (TM), but it still work in process (does the linter catch all the errors?) and need some work before sending a PR upstream. Perl6 info: github.com/nxadm/syntastic/blob/ma...E-perl6.md | 22:23 | |
beware: ugly vimscript code | |||
22:24
MilkmanDan joined
|
|||
geekosaur | you can also make run spawn a shell to run the pipeline, although using shell is better. | 22:24 | |
22:25
kjs_ left
22:26
xfix joined
|
|||
ugexe | you can pipe with run by doing like `run ..., :in($other-proc.out.lines)` | 22:26 | |
AlexDaniel | geekosaur: what do you mean by “better” ? ;) | ||
geekosaur | I'm imagining that run splits its string into words. I doubt it does so with shell quoting, so you'd have to do various ugly things to keep it from producing ["/bin/sh", "-c", "'cut", "-f", "1", "|", ...] | 22:27 | |
El_Che | This is wat it the perl6 support on vim-syntastic looks like: snag.gy/7LYGPV.jpg | 22:28 | |
geekosaur | in fact you might not be able to prevent that at all... I haven't looked at how it does its thing | ||
whereas shell doesn't need any string splitting hackery | |||
22:30
sufrostico joined
|
|||
kyclark | OK, so I can run my pipeline with “shell” with a final redirect in to “> tmp” and then read that, but that’s fairly hackish, no? | 22:32 | |
22:32
stux|RC-only joined
|
|||
AlexDaniel | kyclark: .out.slurp-rest | 22:35 | |
run() does not split anything, you give it the arguments and they're passed as is | 22:36 | ||
22:37
bjz left
|
|||
AlexDaniel | shell() might not need string splitting hackery, but I don't know of any reliable way to pass any variables to it yet… you can pass your stuff into its STDIN, I guess… | 22:38 | |
so if you're choosing between splitting your arguments properly OR trying to prevent things to be evaled, I'd much rather choose the former | 22:39 | ||
22:40
lostinfog left
22:41
heatsink left
22:46
firstdayonthejob left,
cpage_ left
22:55
bjz joined
23:02
n1lp7r joined
23:03
bjz left
23:06
stux|RC-only left
23:09
prammer joined
23:13
prammer left
23:15
pmurias left
23:16
rkazak left
23:17
kurahaupo joined
23:23
skids joined
|
|||
dalek | ateverable: 26c5749 | (Daniel Green)++ | Bisectable.p6: Show short commit hashes for 'good' commit also |
23:32 | |
Ulti | kyclark: in your book you might want to show given when with junctions rather than the if else for counting nucleotides | 23:33 | |
kyclark: also feel free to pinch anything from here perl6advent.wordpress.com/2014/12/...-of-perl6/ | 23:35 | ||
timotimo | m: constant FOOBAR == 4j # LTA error | ||
camelia | rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Preceding context expects a term, but found infix = insteadat <tmp>:1------> 3constant FOOBAR ==7⏏5 4j # LTA error» | ||
timotimo | the j was meant to be a ;, but oh well | ||
j really looks a lot like a semicolon anyway | |||
nxadm found that | 23:38 | ||
El_Che | timotimo: you type weird thing when testing the vim syntaxchecker :) | 23:44 | |
timotimo | no, nxadm typed a weird thing when testing the vim syntaxchecker | 23:46 | |
El_Che | I am nxadm | 23:47 | |
:) | |||
and nxadm goed to bed, bye! | 23:49 | ||
kyclark | Ulti, thanks for all that! | 23:53 | |
Ulti, can you expand on your comment about junctions for counting nucleotides? | |||
timotimo | YOU ARE THAT! | 23:54 | |
23:58
prammer joined
|
|||
MasterDuke | kyclark: i think he means that: if $letter eq 'a' || $letter eq 'A' could instead be: if $letter eq 'a' | 'A' | 23:58 | |
23:58
RabidGravy left
|
|||
timotimo | yes, except the optimization for that is - if i'm not mistaken - tsill b0rked at the moment | 23:58 |