»ö« 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. |
|||
lelf | smth more end-user-friendly? the problem is that ‘sub foo is native’ is too lazy with regard to dyn library bindings | 00:01 | |
timotimo | if it's okay to be unix-specific, you can try binding dlopen and friends with nativecall | 00:02 | |
00:04
markong joined,
margeas left
00:17
margeas joined
00:19
markong left
00:23
ckraniak joined
00:26
margeas left
00:29
lookatme joined
00:33
wamba left
00:34
Grauwolf_ joined
00:36
Grauwolf left,
Geth joined,
ChanServ sets mode: +v Geth
00:37
epony left
|
|||
lookatme | o| | 00:40 | |
TimToady | .oO(a grim cyclops?) |
00:41 | |
00:41
S007 joined
|
|||
lookatme | o_O | 00:42 | |
TimToady | .oO(the top of a movie projector?) |
00:44 | |
00:47
troys_ is now known as troys
|
|||
lookatme | (°ー°〃) | 00:48 | |
00:50
S007 left
|
|||
TimToady | .oO(an upside-down skateboard flying out of a dustcloud?) |
00:51 | |
gfldex | .oO(What is the hippie smoking…again?) |
00:52 | |
.oO(And can I have some too?) |
00:53 | ||
lookatme | (@_@;) | ||
00:55
epony joined
|
|||
TimToady | .oO(a winking snail towing another snail out of a tunnel?) |
00:56 | |
00:56
S007 joined,
epony left
00:57
epony joined
|
|||
lookatme | (⊙﹏⊙) | 00:57 | |
TimToady | .oO(hard to shoot at the target when I drank too much...) |
00:58 | |
01:00
brrt left
|
|||
lookatme back to work | 01:00 | ||
TimToady | o| | ||
01:03
Cabanossi left
01:05
Cabanossi joined
|
|||
Geth | ecosystem: a02d987859 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list Add CoreHacker::Q to ecosystem "Perl 6 QAST Visualizer": github.com/zoffixznet/q |
01:13 | |
01:13
Zoffix joined
|
|||
Zoffix | .tell lizmat you had some interest in the module. The first baby version got released as CoreHackers::Q: github.com/zoffixznet/q | 01:14 | |
yoleaux | Zoffix: I'll pass your message to lizmat. | ||
01:15
Zoffix left
01:16
nativecallable6 left,
nativecallable6 joined,
ChanServ sets mode: +v nativecallable6
01:17
unicodable6 left,
quotable6 left,
unicodable6 joined,
quotable6 joined
01:19
cdg_ left
01:40
cdg joined
01:45
cdg left
02:06
troys is now known as troys_
02:09
stmuk joined
02:16
cdg joined
02:21
cdg left
02:35
troys_ is now known as troys
02:40
squashable6 left,
bloatable6 left
02:41
greppable6 left
02:42
perlbot joined
02:43
Actualeyes joined
02:44
ilbot3 left
02:50
cdg joined
02:52
cdg left,
cdg joined
03:01
ilbot3 joined,
ChanServ sets mode: +v ilbot3
03:06
khisanth_ left,
troys is now known as troys_
03:19
pilne left
03:20
khisanth_ joined
03:28
Todd_ joined
|
|||
Todd_ | Ji All. I am stumped. I just installed rakudo-pkg on a Fedora 27 server (removed all the zef's and rakudo's first) and I can't get anything to zef properly. All packages have the same issue. " --force-test" is required on all of them to complete. When I go to "use xxx", you get an error messages as to it can;t find one of the long letter directories in the /opt path (it really isn't theWould someone mind looking at my vpaste and tel | 03:34 | |
" --force-test" is required on all of them to complete. If I force, when I go to "use xxx", you get an error messages as to it can't find one of the long letter directories in the /opt path (it really isn't there). Would someone mind looking at my vpaste and telling me what I am doing wrong? | |||
vpaste.net/MnJEg | |||
sorry for the weird copy and paste. | 03:35 | ||
03:37
Zoffix joined
|
|||
Zoffix | Todd_: do you have ~/.zef or ~/.perl6 directory by any chance? | 03:38 | |
I may be mistaken, but it's possible zef is installing the modules user-local, but the path when you `use` them doesn't include the path where it's installing them or something. | |||
Todd_ | yes and yes | ||
Zoffix | Todd_: and when you `use` the module? Does the error message list ~/.perl6 in the list? | 03:39 | |
Todd_ | # eraseme.pl6 ===SORRY!=== Could not find Terminal::ANSIColor at line 9 in: /home/linuxutil /root/.perl6 /opt/rakudo-pkg/share/perl6/site /opt/rakudo-pkg/share/perl6/vendor /opt/rakudo-pkg/share/perl6 CompUnit::Repository::AbsolutePath<54193536> CompUnit::Repository::NQP<30451248> CompUnit::Repository::Perl5<30451288> | 03:40 | |
Zoffix | Todd_: are you root? | 03:41 | |
Todd_ | yes and I just realized that and renamed /root/.zef and /root/.perl6 | 03:42 | |
lookatme | Is it lake some test tool ? or something else | ||
like prove | |||
Todd_ | rerunning "zef install Terminal::ANSIColor" gives the same error | ||
lookatme | I faced same problem in fresh installation of Fedora 27 | 03:43 | |
Zoffix | Todd_: renamed to what?... | 03:44 | |
Todd_ | mv ~/.zef ~/.zef.000 mv ~/.perl6 ~/.perl6.000 | ||
both the root and users | 03:45 | ||
Zoffix | No idea | ||
03:45
Zoffix left
|
|||
Todd_ | I am doing a "dnf --enablerepo=* upgrade" to see if that helps | 03:46 | |
lookatme | Todd_, you can try it with --debug | 03:49 | |
Todd_ | the zef command? | ||
lookatme | yeah, it print the debug message | ||
Todd_ | in progress | 03:50 | |
vpaste.net/21U9f | 03:51 | ||
Is this a hint: | 03:53 | ||
ListUtil.c: loadable library and perl binaries are mismatched | |||
where are these loadable libraries? | |||
I think I am on to something. Don't anybody help me until I get back | 03:54 | ||
rats. renaming .precomp did not help | 03:55 | ||
lookatme | idk | ||
no idea :) | |||
geekosaur | that message is a *perl 5* mismatch | 03:56 | |
03:57
bloatable6 joined,
ChanServ sets mode: +v bloatable6
|
|||
geekosaur | you have a perl 5 XS module that doesn't match the perl 5 executable (or shared library, depending on how perl was configured0 | 03:57 | |
something tells me your F27 is much more hosed than just rakudo. or you have a perl 5 you copied over that needed to not be copied. | 03:58 | ||
lookatme | so some perl5 script will failed ? | ||
Todd_ | ahhhh. now it is starting to make sense. I will try wiping p5 and reinstalling it. I presume zef is using p5 | ||
lookatme | And I think the zef maybe use prove(a perl5 script for test) to test something | ||
geekosaur | I think it uses Inline::Perl5 for some things | ||
probably have to ask nine | |||
Todd_ | I have had the WORST luck with Inline::Perl5. Probpably a good thing as it forced me to dive into p6 harder | 03:59 | |
lookatme | And I am wonder why you copy the Perl5 or Rakudo and other things ? | ||
The correct way is reinstall them, not copy | 04:00 | ||
geekosaur | and/or ugexe | 04:01 | |
Todd_ | I am using `# dnf remove perl` and the corresponding install. ther is a reinstall, but I wanted to hunt down any leftovers first | 04:02 | |
removed and reinstalled p5. Still get: loadable library and perl binaries are mismatched | 04:04 | ||
04:06
eliasr left
04:12
telex joined
04:19
troys_ is now known as troys
|
|||
Todd_ | update: the perl 5 chat guys are helping me fix battling cpan and installed binaries, which is causing the issue | 04:35 | |
wish list: please update zef to use perl6 instead of perl5 to do its magic | 04:38 | ||
okay: # perl -v bash: /usr/bin/perl: No such file or directory | 04:43 | ||
04:44
Cabanossi left
04:45
Cabanossi joined
|
|||
Todd_ | I useed find to hunt down any leftovers and now I will reinstall | 04:46 | |
# dnf install perl perl-interpreter this will be a while! | 04:47 | ||
04:49
lelf left
|
|||
Todd_ | Yippee!!!! This command show the offender! # perl -le 'for (@INC) { print $_ if -f "$_/DBI.pm" }' | 05:09 | |
`mv /home/todd/perl5 /home/todd/perl5.000` fix the issue | |||
05:10
troys is now known as troys_
05:11
troys_ is now known as troys
05:18
Actualeyes left
05:20
kerframil left
|
|||
Todd_ | "if" Fedora had our moduels loaded up, would this be the right way to translate their names into the repo names (word in Perl 5): | 05:20 | |
# dnf repoquery --whatprovides 'rakudo(DateTime::Format)' | |||
05:21
MasterDuke joined
05:25
kerframil joined
05:31
kerframil left
05:46
eythian joined
05:52
Kaiepi left,
Kaiepi joined
06:03
Sgeo joined
06:18
troys is now known as troys_
06:21
troys_ is now known as troys
|
|||
Todd_ | I am having trouble installing modules on Fedora 26. Would someone please look at my vpaste and see what I am doing wrong? vpaste.net/x04uk | 06:29 | |
All moduesl give the same error | 06:30 | ||
06:30
sena_kun joined
06:31
khw left
06:33
sena_kun left
06:41
lowbro joined,
lowbro left,
lowbro joined
|
|||
El_Che | Todd_: it looks like you're using system zef instead the one of the package | 07:07 | |
/opt/rakudo-pkg/bin/zef (as root) or /opt/rakudo-pkg/bin/install_zef_as_user if you want them in your $HOME | |||
(the latter is the beter option for dev stuff) | 07:08 | ||
Todd_: rakudo-pkg does not touch system path to no interfere with system rakudo (if present). You need to look at the PATH section in the doc to prevent this type of error | 07:10 | ||
in short "export PATH=/opt/rakudo-pkg/bin:$PATH" will do (and adding ~/.perl6/bin if you install locally) | 07:11 | ||
Todd_ | I uninstalled the rakudo package and reinstalled Fedroa's and all is well. Go figure .... | 07:14 | |
El_Che | it's not related | 07:16 | |
you are using /usr/bin/zef | |||
while the package provides /opt/rakudo-pkg/bin/zef | |||
I decided not to change the user $PATH when I created the packages, maybe I need to review that, but not interfearing with system rakudo is a good thing, imho | 07:18 | ||
even when not adapting the path can lead to weird (but safe) results | 07:19 | ||
Todd_ | I uninstalled rakudo and rakudo-ref. Then did a global find and aced ANYTHING that had the letters "zef" in it. I then installed the rakudo-pkg rpm. That is when I got into trouble. I did this same thing an fe hours earlier on a Fedora 27 server and it went perfectly, excewpt for the Perl 5 module mismatches that blew zef's mind. | 07:21 | |
I have this Fedora 26 machien scheduels for upgrade to 27 tomorrow evening, so I may have to go through this again. | 07:22 | ||
El_Che | well, having to manually delete binaries is a bad thing is they were installed from packages | 07:23 | |
for the record, rakudo-okg is self contained in /opt/rakudo-pkg and modules installed locally are in ~/.perl6 | |||
nothing is written elsewhere | 07:24 | ||
07:25
espadrine left
07:35
troys left
07:46
lichtkind joined
07:47
ChoHag joined
|
|||
Todd_ | It is going to be a fun night. Thank you all for the wonderful help! | 07:48 | |
07:56
abraxxa joined
08:05
zakharyas joined
08:09
zakharyas1 joined
08:11
zakharyas left
08:14
sjn joined
08:26
ChoHag left
08:35
wamba joined
08:41
darutoko joined
|
|||
Geth | doc: 7a0bb28bdc | (Luca Ferrari)++ | doc/Type/Any.pod6 Improve &exit documentation. Specify that exit status code has to be interpreted by calling process, and that LEAVE is prevented when using exit. Remark that &exit should be used to terminate abnormally only the main process, while exceptions should be used for other cases (e.g., methods). This does not remove the TODO item attached, but I believe there's not a better place to document exit since it is already documented with the usage of MAIN and the phasers. |
08:45 | |
synopsebot | Link: doc.perl6.org/type/Any | ||
doc: fed435e1b2 | (Luca Ferrari)++ | doc/Language/functions.pod6 Explain that 'return' in MAIN will produce always an exit code of zero. |
|||
synopsebot | Link: doc.perl6.org/language/functions | ||
08:47
scimon joined
08:58
melezhik joined
09:03
ckraniak left
09:04
zakharyas1 left
09:06
zakharyas joined
09:07
Todd_ left
09:13
lookatme left
|
|||
torbjorn | the token/rule names found in key names in the resulting Match object - is there magic involved in determining whta class they get? | 09:13 | |
ie token foo { [foo]* } # would that result in $/<foo> being an Array because of the * ? | 09:14 | ||
09:14
dakkar joined
|
|||
moritz | [foo] doesn't capture | 09:18 | |
(foo)* does, and yes, $<foo> would be an array | |||
the only exception is the ? quantifier, which produces either a Match or a Nil capture | |||
09:31
lowbro left
09:32
lelf joined
|
|||
torbjorn | ah yes, () of course | 09:33 | |
so token foo { foo } # woueld not be an array? | 09:34 | ||
moritz | that doesn't even capture | ||
well, $<foo> in the caller caputres | 09:35 | ||
lelf | How do you do “:(Foo[::T] \a, Foo[T] \b)”? Akin to “:(::T \a, T \b)”. [Foo is defined] | 09:36 | |
moritz | m: my token foo { foo }; 'foo' ~~ /<foo>/ and say $<foo>.^name | ||
camelia | Match | ||
moritz | m: my token foo { foo }; 'foo' ~~ /<foo>+/ and say $<foo>.^name | ||
camelia | Array | ||
09:44
wamba left
|
|||
Geth | doc: e3edec2d40 | (Luca Ferrari)++ | doc/Language/functions.pod6 Small rephrasing about coercion. Also define the example class Bar at the beginning of the example, there is no point here to leave it abstract. |
09:45 | |
synopsebot | Link: doc.perl6.org/language/functions | ||
dakkar | hmm. re: coercion, I feel it mixes "target type" and "method used to get it". I can't say «sub x(IO::Path() $d) { ... }», even though «sub x(IO() $d) { ... }» will actually coerce to IO::Path | 09:54 | |
m: sub x(IO::Path()$d) { $d.^name.say}; x('a') | 09:55 | ||
camelia | No such method 'IO::Path' for invocant of type 'Str' in sub x at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
dakkar | m: sub x(IO()$d) { $d.^name.say}; x('a') | ||
camelia | IO::Path | ||
10:00
travis-ci joined
|
|||
travis-ci | Doc build errored. Luca Ferrari 'Small rephrasing about coercion. | 10:00 | |
travis-ci.org/perl6/doc/builds/327159440 github.com/perl6/doc/compare/fed43...edec2d409b | |||
10:00
travis-ci left
|
|||
buggable | [travis build above] ☠ Did not recognize some failures. Check results manually. | 10:00 | |
10:04
stmuk_ joined
10:05
zakharyas1 joined
10:06
stmuk left
10:07
vichib left,
zakharyas left
10:08
ChoHag joined
10:25
cdg left
10:30
wamba joined
10:43
lichtkind left
10:47
ChoHag left
10:54
ChoHag joined,
dct left
10:56
Zoffix joined
|
|||
Zoffix | dakkar: it's just a convention that a method named "Foo" converts an object to type "Foo". The coersion merely calls a method with .^name of target type. Str does not have "IO::Path" method so that coersion rightly fails. IO::Path does role IO tho and Str type has IO method that returns an IO object (IO::Path in this case). | 10:59 | |
But nothing's stopping you from defining a method with IO::Path as a name and using IO::Path as target type in coercer | 11:00 | ||
m: use MONKEY; augment class Str { method IO::Path { self.IO } }; -> IO::Path(Str) $x { dd $x }("foo") | |||
camelia | IO::Path.new("foo", :SPEC(IO::Spec::Unix), :CWD("/home/camelia")) | ||
11:01
dct joined
|
|||
Zoffix | FWIW, there are also two paths in coersion: the slow path will try to see if there's a method and complain if there isn't: | 11:04 | |
m: try '-> IO::Path(Str) :foo(:bar(:$ber)) {}("x")'.EVAL; say [$!.^name, $!] | |||
camelia | [X::AdHoc Unable to coerce value for '$ber' from Str to IO::Path; no coercion method defined in block <unit> at EVAL_0 line 1 in block <unit> at <tmp> line 1 ] |
||
Zoffix | But the fast path will go right away to try to call it and will just throw method not found error as a result: | 11:05 | |
m: try '-> IO::Path(Str) {}("x")'.EVAL; say [$!.^name, $!] | |||
camelia | [X::Method::NotFound No such method 'IO::Path' for invocant of type 'Str' in block <unit> at EVAL_0 line 1 in block <unit> at <tmp> line 1 ] |
||
11:06
ckraniak joined
|
|||
Zoffix | (that's an implementation detail, but perhaps the docs should be more vague about what gets thrown when coercion fails) | 11:07 | |
11:11
rindolf joined
|
|||
Zoffix | m: -> ::T \a where Array[T.of], \b where Array[T.of] {}(Array[Int], Array[Int]) | 11:13 | |
camelia | ( no output ) | ||
Zoffix | m: -> ::T \a where Array[T.of], \b where Array[T.of] {}(Array[Int], Array[Num]) | ||
camelia | Constraint type check failed in binding to parameter 'b'; expected anonymous constraint to be met but got Array[Num] (Array[Num]) in block <unit> at <tmp> line 1 |
||
11:13
ilmari joined,
ilmari left,
ilmari joined
|
|||
Zoffix | lelf: doesn't look like that's implemented (filed as R#1383). That ^ looks like a slower workaround you could use | 11:15 | |
synopsebot | R#1383 [open]: github.com/rakudo/rakudo/issues/1383 [NYI] Type capture in parametarization NYI | ||
11:18
Zoffix left
|
|||
lelf | ha! alright | 11:22 | |
m: (my Int @ = [1..3]).WHAT # ← is there a shortcut for this? | 11:24 | ||
camelia | ( no output ) | ||
11:24
margeas joined
|
|||
lelf | specifiying the *.of type I mean… this is also too wordy: | 11:30 | |
m: Array[Int]([1..3]).of | |||
camelia | ( no output ) | ||
11:32
ckraniak left
|
|||
jnthn | Could be (my Int @ = 1..3) or Array[Int](1..3) I'd think | 11:36 | |
Saves creating a throw-away Array | |||
moritz | m: dd Array[Int].new(1, 2, 3) | 11:49 | |
camelia | Array[Int].new(1, 2, 3) | ||
dakkar | re: type coercions, I understand everything that Zoffix said, and I know why it's that way. My issue is that the *documentation* says that in «Foo() $x», Foo is the parameter type that things get coerced to. | 11:53 | |
but that's not correct. It's both a type constraint, and the name of the conversion method | |||
if I want a IO::Path, but not a IO::Special, and allow my callers to pass me a string… I can't | 11:54 | ||
(and no, sub x(IO() $x where IO::Path) is a terrible work-around) | 11:55 | ||
could we add a «sub IO::Path» alongside «sub IO», and document more clearly what the coercion actually does? | |||
I may try doing that this weekend… | |||
scimon | Generally if I want a string that should be a valid IO::Path I make a subset but that's me. subset DirPath of Str where *.IO.d | 12:01 | |
That sort of thing. | |||
12:02
andrzejku joined
|
|||
scimon | I dunno. I'm not feeling 100% at the moment so am probably not understanding. | 12:03 | |
andrzejku | hi | ||
can you see my messages? | |||
12:04
dupadupakupa joined
|
|||
DrForr | andrzejku: Yes. | 12:05 | |
andrzejku | thnks :) | ||
12:05
dupadupakupa left
|
|||
andrzejku | I decided to use sublime for irc and it looks it is working | 12:05 | |
DrForr | irssi+tmux=shiny. | 12:06 | |
12:06
zakharyas1 left
|
|||
ilmari | tmux, schmux | 12:15 | |
screen 4lyf | |||
12:17
rindolf left
12:20
cdg joined
|
|||
DrForr | I started out with screen, but split-display sold me. | 12:22 | |
12:25
cdg left,
SCHAPiE joined
|
|||
Altreus | irssi ftl | 12:26 | |
weechat 4 lyf | |||
moritz wtf | 12:28 | ||
DrForr | Shrug. | 12:29 | |
12:43
leah2 left
12:45
leah2 joined
12:50
leah2 left
|
|||
lelf | I'm prob missing something trivial: how do you “X fff Y” getting list of lists (one for each matching sequence)? | 12:55 | |
moritz | lelf: example? | ||
12:56
ckraniak joined
|
|||
lelf | <begin 1 2 end begin 3 end X begin …> ⇒ [[1,2], [3], …] | 12:57 | |
masak | lelf: not sure `fff` is the best tool for that, but it's definitely doable with (say) a recursive function or a loop/given construction | 12:59 | |
lelf: the problem you're bound to run into with `fff` is that its internal state is per *site* in the code -- which doesn't square well with needing one state per [] list | 13:01 | ||
Geth | doc: 0cfb87fb9e | (Luca Ferrari)++ | doc/Language/exceptions.pod6 Explain die uses $*ERR. See issue #1722. |
||
synopsebot | Link: doc.perl6.org/language/exceptions | ||
Geth | doc: 28d8512437 | (Luca Ferrari)++ | doc/Language/exceptions.pod6 Add a $*ERR.say on a simple catch block as example of how to use STDERR. See discussion in issue #1722. |
||
masak | (more exactly, there's one internal state per clone of the surrounding function. but that helps little here. I guess you *could* clone the function once per new list -- say, by re-entering the surrounding function -- but at this point I'd argue that we're far into X/Y land, and should use another tool.) | 13:02 | |
lelf: on a high level, what you appear to be doing is turning SAX into DOM :) | |||
lelf: how do you plan to handle mis-nested data such as <end begin> or <begin end end begin> ? | 13:03 | ||
(another thing `fff` won't do for you) | |||
lelf | no, no nesting | 13:15 | |
13:19
raschipi joined
|
|||
masak | no nesting? um, but `[1, 2]` is nested inside `[[1, 2], [3], ...]` | 13:21 | |
13:22
leah2 joined
|
|||
lelf | there can't be begin-end inside begin-end. so… say, one-level nesting | 13:23 | |
masak | ok, now I see what you're saying | 13:24 | |
13:26
travis-ci joined
|
|||
travis-ci | Doc build passed. Luca Ferrari 'Add a $*ERR.say on a simple catch block as example of how to use STDERR. | 13:26 | |
travis-ci.org/perl6/doc/builds/327219218 github.com/perl6/doc/compare/e3ede...d8512437a1 | |||
13:26
travis-ci left
|
|||
masak | m: my @result; my @part; for <begin 1 2 end begin 3 end> { when "begin" { @part = () }; when "end" { @result.push(@part) }; default { @part.push($_) } }; say @result.perl | 13:26 | |
camelia | [[IntStr.new(3, "3")], [IntStr.new(3, "3")]] | ||
masak | hm :) | ||
m: my @result; my @part; for <begin 1 2 end begin 3 end> { when "begin" { @part := [] }; when "end" { @result.push(@part) }; default { @part.push(+$_) } }; say @result.perl | 13:27 | ||
camelia | [[1, 2], [3]] | ||
lelf | I'm itching for a Haskell’s groupBy function (group elements by comparing adjacent ones). So like squish, but groupping, not uniquing. | 13:28 | |
jnthn | lelf: See categorize and classify | 13:30 | |
Oh, but that doesn't require adjacency | |||
masak | yeah, that's where the `fff` angle isn't all bad | 13:40 | |
it just fails in other ways | |||
nothing stopping you from writing your own grouping function, though | 13:41 | ||
13:41
itaipu joined
|
|||
[Coke] waves good morning over his bacon & coffee. | 13:44 | ||
13:48
perlpilot joined
13:54
cdg joined
13:55
vichib joined,
vichib left,
vichib joined
13:56
cdg left,
cdg joined
14:02
zakharyas joined
|
|||
moritz | m: my @i = <begin 1 2 end begin 3 end>; say @i.grep(:k, 'begin') Z @i.grep(:k, 'end') | 14:09 | |
camelia | ((0 3) (4 6)) | ||
moritz | m: my @i = <begin 1 2 end begin 3 end>; say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1) | 14:10 | |
camelia | ((1 2) (5 5)) | ||
moritz | m: my @i = <begin 1 2 end begin 3 end>; say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1).map({@i[&infix<..>(|$_)}) | 14:11 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in subscript; couldn't find final ']' (corresponding starter was at line 1) at <tmp>:1 ------> 3 'end').map(*-1).map({@i[&infix<..>(|$_)7⏏5}) expecting any of:… |
||
moritz | m: my @i = <begin 1 2 end begin 3 end>; say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1).map({@i[&infix<..>(|$_)]}) | 14:12 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: infix used at line 1. Did you mean 'indir', 'index'? |
||
moritz | m: my @i = <begin 1 2 end begin 3 end>; say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1).map({@i[&infix:<..>(|$_)]}) | ||
camelia | Too few positionals passed; expected 2 arguments but got 1 in block <unit> at <tmp> line 1 |
||
moritz | m: my @i = <begin 1 2 end begin 3 end>; say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1).map({@i[&infix:<..>(|$_.list)]}) | ||
camelia | Too few positionals passed; expected 2 arguments but got 1 in block <unit> at <tmp> line 1 |
||
moritz | m: my @i = <begin 1 2 end begin 3 end>; say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1).map({ say $_.perl }) | ||
camelia | 2 5 ((1 True) (5 True)) |
||
moritz | m: my @i = <begin 1 2 end begin 3 end>; say @i.grep(:k, 'begin').map(*+1) Z=> @i.grep(:k, 'end').map(*-1).map({ say $_.perl }) | ||
camelia | 2 5 (1 => True 5 => True) |
||
14:13
jkramer joined
|
|||
jkramer | p6: '11325992321982432123259' ~~ m:ex/[ (\d ** 2..*) \d* ] ** 2..*/ | 14:13 | |
camelia | MoarVM panic: Memory allocation failed; could not allocate 100208 bytes | ||
moritz | m: my @i = <begin 1 2 end begin 3 end>; (say @i.grep(:k, 'begin').map(*+1) Z=> @i.grep(:k, 'end').map(*-1)).map({@i[&infix:<..>(|$_.list)]}) | ||
camelia | (1 => 2 5 => 5) Too few positionals passed; expected 2 arguments but got 1 in block <unit> at <tmp> line 1 |
||
jkramer | Does this work for anyone? It uses 100% CPU for me and hangs forever | ||
14:13
atta joined
|
|||
moritz | m: my @i = <begin 1 2 end begin 3 end>; (say @i.grep(:k, 'begin').map(*+1) Z=> @i.grep(:k, 'end').map(*-1)).map({say .perl }) | 14:13 | |
camelia | (1 => 2 5 => 5) Bool::True |
||
jkramer | Ah I guess it doesn't :) | 14:14 | |
moritz | jkramer: try it with fewer characters first? | ||
m: my @i = <begin 1 2 end begin 3 end>; (say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1)).map({say .perl }) | |||
camelia | ((1 2) (5 5)) Bool::True |
||
jkramer | p6: '112112' ~~ m:ex/[ (\d ** 2..*) \d* ] ** 2..*/ | ||
camelia | ( no output ) | ||
moritz | m: my @i = <begin 1 2 end begin 3 end>; (say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1)).map({@i[&infix:<..>(|$_.list)]}) | ||
camelia | ((1 2) (5 5)) Too few positionals passed; expected 2 arguments but got 1 in block <unit> at <tmp> line 1 |
||
jkramer | Oh wait that regex is broken anyway :D | 14:15 | |
timotimo | "memory allocation failed" is often the result of infinite recursion of some kind | ||
moritz | m: my @i = <begin 1 2 end begin 3 end>; (say @i.grep(:k, 'begin').map(*+1) Z @i.grep(:k, 'end').map(*-1)).map({@i[.[0] .. .[1]]}) | ||
camelia | ((1 2) (5 5)) Index out of range. Is: 1, should be in 0..0 in block <unit> at <tmp> line 1 |
||
moritz | :( | ||
timotimo | moritz: why not Z.. actually? and then index into @i directly with the result? | 14:17 | |
m: my @i = <begin 1 2 end begin 3 end>; (say @i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({@i[@$_]}) | |||
camelia | (1..2 5..5) | ||
timotimo | m: my @i = <begin 1 2 end begin 3 end>; say (say @i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({@i[@$_]}) | 14:18 | |
camelia | (1..2 5..5) ((1)) |
||
timotimo | m: my @i = <begin 1 2 end begin 3 end>; say (say @i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({say $_; @i[@$_]}) | ||
camelia | (1..2 5..5) True ((1)) |
||
timotimo | oh, haha | ||
m: my @i = <begin 1 2 end begin 3 end>; say (@i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({say $_; @i[@$_]}) | |||
camelia | 1..2 5..5 ((1 2) (3)) |
||
buggable | New CPAN upload: List-Util-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz | ||
timotimo | m: my @i = <begin 1 2 end begin 3 end>; say (@i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({@i[@$_]}) | ||
camelia | ((1 2) (3)) | ||
14:19
committable6 left,
committable6 joined,
ChanServ sets mode: +v committable6
|
|||
jkramer | p6: '112112' ~~ m:ex/(\d ** 2..*) [\d* ($0)]+/ | 14:20 | |
camelia | ( no output ) | ||
timotimo | m: my @i = <begin 1 2 end begin 3 end>; @i.grep('begin'|'end') Zeq |('begin', 'end') xx * ?? (@i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({@i[@$_]}) !! fail "malformed begin/end pairins" | 14:21 | |
camelia | Potential difficulties: Useless use of Zeq in sink context at <tmp>:1 ------> 3nd begin 3 end>; @i.grep('begin'|'end') 7⏏5Zeq |('begin', 'end') xx * ?? (@i.grep(: |
||
timotimo | m: my @i = <begin 1 2 end begin 3 end>; ([&&] @i.grep('begin'|'end') Zeq |('begin', 'end') xx *) ?? (@i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({@i[@$_]}) !! fail "malformed begin/end pairins" | ||
camelia | ( no output ) | ||
timotimo | m: my @i = <begin 1 2 end begin 3 end>; say ([&&] @i.grep('begin'|'end') Zeq |('begin', 'end') xx *) ?? (@i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({@i[@$_]}) !! fail "malformed begin/end pairins" | ||
camelia | ((1 2) (3)) | ||
timotimo | m: my @i = <begin 1 2 begin 3 end end>; say ([&&] @i.grep('begin'|'end') Zeq |('begin', 'end') xx *) ?? (@i.grep(:k, 'begin').map(*+1) Z.. @i.grep(:k, 'end').map(*-1)).map({@i[@$_]}) !! fail "malformed begin/end pairins" | ||
camelia | malformed begin/end pairins in block <unit> at <tmp> line 1 |
||
jkramer | Any ideas why this doesn't match? | ||
Shouldn't it return both 11 and 112 twice each? | 14:22 | ||
14:22
ggoebel left
|
|||
timotimo | you want :ex and :ov maybe? | 14:23 | |
p6: '112112' ~~ m:ex:ov/(\d ** 2..*) [\d* ($0)]+/ | |||
camelia | ( no output ) | ||
timotimo | p6: say '112112' ~~ m:ex:ov/(\d ** 2..*) [\d* ($0)]+/ | ||
camelia | () | ||
timotimo | p6: say '112112' ~~ m:ex/(\d ** 2..*) [\d* ($0)]+/ | ||
camelia | () | ||
jkramer | Doesn't ex imply ov? | 14:24 | |
> To find all possible matches of a regex – including overlapping ones – and several ones that start at the same position, use the :exhaustive (short :ex) adverb. | |||
timotimo | ah | 14:25 | |
p6: say '112112' ~~ rx/(\d ** 2..*) [\d* ($0)]+/ | |||
camelia | Nil | ||
timotimo | p6: say '112112' ~~ rx/(\d ** 2..*)/ | 14:26 | |
camelia | 「112112」 0 => 「112112」 |
||
timotimo | p6: say '11112' ~~ rx/(\d ** 2..*) [($0)]+/ | ||
camelia | Nil | ||
timotimo | p6: say '11112' ~~ rx/(\d ** 2..*) [($0)]/ | ||
camelia | Nil | ||
timotimo | hm? | ||
p6: say '11112' ~~ rx/(\d **? 2..*) [\d*? ($0)]/ | 14:27 | ||
camelia | Nil | ||
jkramer | p6: '112112' ~~ m:ex/(\d ** 2..*) \d* $0/ | ||
camelia | ( no output ) | ||
jkramer | Hmm weird the versionwith $0 without parens works for me locally, just not with ($0) | ||
timotimo | you're not outputting anything | ||
p6: say '112112' ~~ m:ex/(\d ** 2..*) \d* $0/ | |||
camelia | (「112112」 0 => 「112」 「11211」 0 => 「11」 「12112」 0 => 「12」) |
||
jkramer | Oh | 14:28 | |
p6: say '112112' ~~ m:ex/(\d ** 2..*) \d* ($0)/ | |||
camelia | () | ||
timotimo | oh | ||
jkramer | Why doesn't $0 work with parens? | ||
timotimo | because nested parens, i bet | ||
m: say 'aabbcde' ~~ m/(\w) $0 ((\w) $0)/ | |||
camelia | 「aabb」 0 => 「a」 1 => 「bb」 0 => 「b」 |
||
timotimo | i should get waked up or something | 14:29 | |
m: say 'aabbaaba' ~~ m/(\w) $0 [(\w) $0]/ | |||
camelia | 「aaba」 0 => 「a」 1 => 「b」 |
||
timotimo | there you can see the difference more clearly; but most clearly if it's printed with proper newlines | ||
p6: say '112112' ~~ m:P5:ex/(\d{2,}) \d* ($1)/ | 14:33 | ||
camelia | () | ||
timotimo | p6: say '112112' ~~ m:P5:ex/(\d{2,}) \d* ($0)/ | ||
camelia | () | ||
timotimo | i wonder how we compile that | ||
p6: say '112112' ~~ m:P5:ex/(\d{2,}) \d* $0/ | |||
camelia | () | ||
timotimo | jkramer: does that help? | 14:36 | |
not the last three lines, of course | |||
those are just noise | |||
14:36
vichib left
14:37
rindolf joined
14:38
ggoebel joined
|
|||
jkramer | timotimo: Yeah thanks, I found some kind of workaround using another parens around the whole thing: '112112' ~~ m:ex/((\d ** 2..*) \d* $0)+/ | 14:38 | |
14:38
cdg left
|
|||
moritz | if you're already using :ex, why use the + inside the regex at all? | 14:40 | |
timotimo | p6: say '112112' ~~ m:P5:ex/(\d{2,}) \d* \1/ | 14:41 | |
camelia | () | ||
timotimo | how does p5 regex do backreferences to numbered captured groups again ... | ||
jkramer | \1 :) | ||
I think | 14:42 | ||
14:42
aquila-chrysaeto joined
|
|||
timotimo | right. $0 turned into an INTERPOLATE call in the :P5 regex i had up there | 14:42 | |
14:43
ckraniak left
|
|||
jkramer | moritz: 'cause I want to count the repetitions of the number, but I haven't quite figured out how to do this with the Match object I'm getting | 14:43 | |
moritz | jkramer: what problem are you trying to solve? | 14:45 | |
14:46
aquila-chrysaeto left,
scimon left
|
|||
jkramer | moritz: I want to find all numbers of 2+ digits in a string made of digits and the number of their occurances :) | 14:47 | |
It's not a real problem, just a random programming practice I found somewhere to get used to Perl 6 :) | |||
moritz | m: say '11211' ~~ m:ex/\d ** 2..* / | 14:48 | |
camelia | (「11211」 「1121」 「112」 「11」 「1211」 「121」 「12」 「211」 「21」 「11」) | ||
moritz | m: say ('11211' ~~ m:ex/\d ** 2..* /).map(*.Str).Bag | 14:49 | |
camelia | Bag(11(2), 112, 1121, 11211, 12, 121, 1211, 21, 211) | ||
timotimo | m: say '11211'.comb.rotor(2=>-1).>>join("").Bag | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing dot on method call at <tmp>:1 ------> 3say '11211'.comb.rotor(2=>-1).>>7⏏5join("").Bag expecting any of: postfix |
||
timotimo | m: say '11211'.comb.rotor(2=>-1)>>.join("").Bag | ||
camelia | Bag(11(2), 12, 21) | ||
timotimo | jkramer: how's that? | ||
moritz | timotimo: that's only 2 digit numbers, not 2+ digit numbers | 14:50 | |
timotimo | oh, of course! | ||
14:50
ckraniak joined
|
|||
timotimo | m: say ('11211' ~~ rx:ex/\d ** 2..*/).Bag | 14:50 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Adverb ex not allowed on rx at <tmp>:1 ------> 3say ('11211' ~~ rx:ex/\d ** 2..*/7⏏5).Bag |
||
timotimo | m: say ('11211' ~~ m:ex/\d ** 2..*/).Bag | ||
camelia | Bag(「11211」, 「1121」, 「112」, 「11」, 「11」, 「1211」, 「121」, 「12」, 「211」, 「21」) | ||
timotimo | m: say ('11211' ~~ m:ex/\d ** 2..*/)>>.Str.Bag | 14:51 | |
camelia | Bag(11(2), 112, 1121, 11211, 12, 121, 1211, 21, 211) | ||
timotimo | with the original regex implementaiton you had you also have the problem that the second time some two-digit thing appears, it'll be the start of another attempt again | ||
so you'll count everything multiple times | |||
moritz | m: say bag '11211' ~~ m:ex/\d\d+/ # golfing! | 14:52 | |
camelia | Bag(「11211」, 「1121」, 「112」, 「11」, 「11」, 「1211」, 「121」, 「12」, 「211」, 「21」) | ||
moritz | m: say bag ~<< '11211' ~~ m:ex/\d\d+/ # golfing! | ||
camelia | Bag(False) | ||
moritz | m: say bag ~<<('11211' ~~ m:ex/\d\d+/) | ||
camelia | Bag(11(2), 112, 1121, 11211, 12, 121, 1211, 21, 211) | ||
timotimo | that looks nicer | 14:53 | |
14:54
jdoege joined
|
|||
jdoege | Good (whatever time of day it is wherever you may be). I have a question and i am hoping someone here may have an answer. I have a large grammar that is finally working really well. The last task I have for it is to ignore comments. My plan is to redefine the ws token to include a comment regex. However, to get started, I began by simply redefining the ws token to what I believe it already is: token ws { \s+ | <|w> } | 14:58 | |
When I test my parser with this redefined ws token, it quickly fails on test cases it previously passed on when I would expect (nearly) identical behavior. | 15:00 | ||
Did I redefine ws incorrectly? | |||
raschipi | Did you use the non-capturing form? <.ws> | 15:01 | |
jdoege | Also, I notice that the parser now explicitly parses ws (as seen in Grammar::Trace output) whereas previously it was implicit and invisible. Is that expected? | ||
I never reference ws directly. This is just implicit rule usage. | 15:02 | ||
perlpilot | that last bit is interesting | ||
raschipi | So, after declaring it you lost the magic, is that it? | 15:03 | |
jdoege | Yup. | ||
15:06
Phlogistique left
15:08
Actualeyes joined
15:09
Grauwolf_ left
15:10
Grauwolf joined
15:16
lancew joined
|
|||
jdoege | Interesting. Despite the documentation saying that ws matches \s+ or <|w>, there is an example of redefining ws to not match vertical whitespace that looks like this: token ws { <!ww> \h* } When I change my definition to token ws { <!ww> \s* } my parser resumes working. A bit of documentation clarification/correction may be in order. I am not sure I understand the distinction between these two definitions. | 15:18 | |
15:19
FROGGS joined
15:22
El_Che joined
15:29
Actualey` joined,
lancew left
15:31
Actualeyes left
15:45
aquila-chrysaeto joined
15:46
ckraniak left
15:49
eliasr joined
15:50
aquila-chrysaeto left
|
|||
jkramer | timotimo: Nice, I didn't think of that, I focused too much on doing it all with a regex. :) I ended up with this one-liner (some formatting of the result included): | 15:51 | |
.match(/(..+)/, :ex)>>.Str.Bag.pairs.grep(*.value > 1).map(*.kv.join(':')).join(' ').say for $*IN.lines; | |||
lizmat | jkramer: I think you can leave out the .pairs there | 15:52 | |
jkramer | lizmat: True, thanks :) | 15:53 | |
Saved a few more bytes by replacing .join(' ') with .Str :) | 15:55 | ||
timotimo | m: my $b = bag <hi hi hi bye bye lo>; say $b >>->> 1 | ||
camelia | Cannot modify an immutable Bag (Bag()) in block <unit> at <tmp> line 1 |
||
timotimo | m: my $b = bag <hi hi hi bye bye lo> | ||
camelia | ( no output ) | ||
timotimo | m: my $b = <hi hi hi bye bye lo>.BagHash; say $b; say $b >>->> 1; say $b | 15:56 | |
camelia | BagHash(bye(2), hi(3), lo) BagHash(bye, hi(2)) BagHash(bye(2), hi(3), lo) |
||
timotimo | m: my $b = <hi hi hi bye bye lo>.BagHash; say $b; say ($b >>->> 1) >>+>> 1; say $b | ||
camelia | BagHash(bye(2), hi(3), lo) BagHash(bye(2), hi(3)) BagHash(bye(2), hi(3), lo) |
||
timotimo | a nice, round-about way to filter out things that only have one entry in the bag | ||
lizmat | sometimes I think a dedicated method for Bags would help | 15:57 | |
16:00
cdg joined
|
|||
timotimo | dedicated what method? | 16:01 | |
16:02
cdg left,
cdg joined
16:03
cdg_ joined
|
|||
lizmat | for grepping out items by frequency | 16:04 | |
the .grep is general, so it goes out and creates Pairs, and take the value, etc. etc. | |||
while a dedicated method wouldn't need to do all of that | |||
Bag.frequency(1) would give all elements with a frequence of 1 | 16:05 | ||
Bag.frequency(* > 1) would give all elements with a frequence > 1 | |||
*frequency | |||
Ulti | by elements do you mean just the keys or the pairs? | 16:06 | |
this is a nice idea for if you're using bag models for stats | 16:07 | ||
16:07
cdg left
|
|||
lizmat | just the keys | 16:07 | |
16:12
squashable6 joined
16:17
john51 left
16:18
vichib joined,
vichib left,
vichib joined
16:20
esh joined
16:21
esh left
16:23
wamba left,
john51 joined
16:25
vichib left
16:26
lelf` joined
16:27
esh joined,
vichib joined
16:28
vichib left
|
|||
[Coke] had to rediscover Test::More in p5 today, whoops. | 16:28 | ||
16:28
lelf left
16:29
vichib joined
|
|||
[Coke] | "why aren't I getting test descriptions!?" /me's brain full | 16:29 | |
16:34
domidumont joined
|
|||
moritz | prove -v ? | 16:34 | |
16:35
zakharyas left
|
|||
[Coke] | moritz: no, because I was using Perl 5's "Test", not "Test::More" | 16:35 | |
16:38
ckraniak joined
|
|||
moritz | aaaarg | 16:38 | |
[Coke] | Wonder if it'd be worth trying to convert this to Inline::Perl5 (need WWW::Mechanize). | 16:40 | |
16:44
esh left
16:46
esh joined
|
|||
lizmat notes WWW::Mechanize is really needed | 16:50 | ||
16:55
cdg joined,
abraxxa left
16:57
cdg__ joined,
domidumont left
16:58
cdg left,
cdg_ left,
hoelzro joined
17:02
troys joined
17:03
vichib left
|
|||
El_Che | lizmat: or something minimalistic in the style of github.com/headzoo/surf | 17:05 | |
17:09
khw joined
17:22
coverable6 left,
benchable6 left
17:23
coverable6 joined,
ChanServ sets mode: +v coverable6,
benchable6 joined,
ChanServ sets mode: +v benchable6
17:26
domidumont joined
17:30
dakkar left
17:37
cdg joined
17:38
cdg__ left
17:39
bisectable6 left,
bisectable6 joined,
ChanServ sets mode: +v bisectable6
17:44
wamba joined,
zakharyas joined
17:52
raschipi_ joined
17:53
itaipu left,
raschipi left
17:54
ckraniak left
18:06
leah2 left
18:07
darutoko left
18:13
leah2 joined
18:32
st_elmo joined
18:46
|oLa| joined
18:49
bdmatatu joined,
Kaiepi left
|
|||
bdmatatu | Hi folks, is there a p6 equivalent to Perl 5's 'do FILE'? | 18:51 | |
18:52
Kaiepi joined
|
|||
raschipi_ | run? | 18:53 | |
DrForr | You probably want EVALFILE, according to the 5to6 docs. | 18:54 | |
bdmatatu | I think that runs it in another process...I'm thinking like 'use' but for something that's not *.pm or *.pm6 | ||
oh, thanks DrForr | |||
18:55
Kaiepi left,
Kaiepi joined
|
|||
lizmat | bdmatatu: EVAL slurp $file | 18:59 | |
bdmatatu | Great, that works too | 19:01 | |
19:02
ggoebel left
|
|||
lizmat | FWIW, EVALFILE is better, and doesn't run in another process | 19:02 | |
19:02
itaipu joined
|
|||
lizmat | in fact, it is basically implemented as EVAL slurp $fule | 19:02 | |
$file | |||
bdmatatu | I was kind of hoping it might also be possible to do that in the current lexical scope (e.g. any lexical vars in FILE would still be visible) | 19:04 | |
19:05
|oLa| left
|
|||
lizmat | they are, if you use EVALFILE | 19:07 | |
bdmatatu | oh! | ||
El_Che | EVALFILE will be the title of the first security trolling talk about Perl 6 ;) | ||
lizmat | bdmatatu: if you put a "say $a" in a file "foo", and then do "my $a = 42; EVALFILE 'foo', it *will* say "42" | 19:08 | |
bdmatatu | Okay, I was thinking about declaring 'my $a' in file foo and then trying to use it after doing an EVALFILE | 19:09 | |
I could see how that would be bad securitywise | |||
lizmat | you cannot change a pad once it is executing | 19:10 | |
El_Che | bdmatatu: isn't a yaml or json file an alternative for declaring variables? | 19:11 | |
[Coke] | lizmat: I had someone actually give me a hard time about using perl 5 on this (even though I am the only one who writes one offs in perl here. He was suprised to see me use 5 instead of 6) | 19:12 | |
lizmat | well, yes | ||
[Coke] | (he was just teasing, but I still felt like I cheated. :) | ||
lizmat looks sternly at [Coke] | |||
DrForr | bdmatatu: Look at one of the config modules, or even (like others say) a .json or .yaml file - Letting configuration files run arbitrary code can get ugly. | 19:13 | |
bdmatatu | Yeah I know it's ugly, but can be really handy for debugging and experimenting | ||
timotimo | or use a programming language that's made for config files: Lua | ||
El_Che | bdmatatu: It's not much effort to put the contents of a yaml or json file in an hash | 19:14 | |
lizmat | m: my $a = 42 but role { method foo { "foo" } }; say $a; say $a.foo # perhaps another way to add debugging info to values ? | ||
camelia | 42 foo |
||
19:15
troys is now known as troys_
|
|||
bdmatatu | The idea is that I want to load a script from a repl session and look at all the variables that were declared | 19:15 | |
lizmat | m: role foo { has $.foo }; my $a = 42 but foo("bar"); say $a; say $a.foo # another way | ||
camelia | 42 bar |
||
19:17
esh left
|
|||
El_Che | lizmat, AlexDaniel` , jnthn: 2017.12 rakudo linux packages are being built. Thx for fixing the bug | 19:17 | |
19:17
esh joined
|
|||
lizmat | El_Che++ # perseverance! | 19:17 | |
19:17
zakharyas left
|
|||
El_Che | lizmat: people call other names referring to that :) | 19:18 | |
TEttinger | El_Che: tenacity? | ||
El_Che | pain in the ass | ||
:) | |||
TEttinger | force of will? Nietzche's usage of a similar term in German? | 19:19 | |
El_Che | don't go there :) | 19:20 | |
19:20
ggoebel joined
|
|||
TEttinger | persistence | 19:22 | |
:) | |||
19:26
ckraniak joined
19:29
esh left
19:30
esh joined
19:31
esh left
19:33
raschipi_ left,
esh joined
19:35
esh left
|
|||
tobs | I'd like to react whenever $*IO.lines but that code seems to want to slurp .lines. Iterating with 'for' works but I like Supply as a conceptual wrapper and also need multiple taps. | 19:36 | |
19:36
esh joined
|
|||
tobs | Can someone help? A Supply of a lazy Seq seems like something natural | 19:36 | |
jnthn | Try react whenever Supply.from-list($*IO.lines) { } | 19:38 | |
19:39
greppable6 joined,
ChanServ sets mode: +v greppable6
|
|||
tobs | That isn't interactive either. It waits until I Ctrl+D (Rakudo 2017-07 still, if that makes a difference) | 19:39 | |
19:40
japhb joined
|
|||
tobs | s/$*IO/$*IN/ specifically | 19:41 | |
19:42
esh left
19:43
esh joined
|
|||
jnthn | Hm, curious, if I do perl6 -e 'react whenever Supply.from-list($*IN.lines) { .say }' then type foo and press enter, it immediately outputs foo | 19:46 | |
tobs | Not here, with the same line. Updating Rakudo can't hurt (I hope) | 19:47 | |
lizmat | STDIN isn't buffered, is it ? | ||
jnthn | It's either fixed in a more recent version or it's platform sensitive; handy I have 2017.12 on Linux (works) and 2017.07 on Windows (doesn't) | ||
tobs | 2017.07 on Linux here | 19:48 | |
jnthn | OK, then it's most probably a fix since then | ||
El_Che | 2017.12 rpms/devs/apk should be out in some minutes | ||
jnthn | oh, also maybe try: react whenever Supply.from-list($*IN.lines, :scheduler($*SCHEDULER)) { .say } | ||
tobs | jnthn: that works | 19:50 | |
jnthn | OK, then I can guess what change(s) fixed it :) | 19:51 | |
19:53
domidumont left
20:00
dct left
|
|||
tobs | (yes, 2017.12 works here too) | 20:09 | |
20:10
st_elmo left
20:24
dct joined
|
|||
El_Che | github.com/nxadm/rakudo-pkg/releas...g/v2017.12 | 20:27 | |
2017.12 packages released | 20:28 | ||
20:29
itaipu left
|
|||
moritz | El_Che++ | 20:30 | |
20:30
Zoffix joined
|
|||
Zoffix | m: &postcircumfix:<[ ]>() | 20:30 | |
camelia | WARNINGS for <tmp>: Useless use of constant value [ ] in sink context (lines 1, 1) Cannot resolve caller postcircumfix:<[ ]>(...); none of these signatures match: (\SELF, Any:U $type, |c is raw) (\SELF, int $pos) (\SELF, int $pos… |
||
Zoffix | m: &postcircumfix:<[ ]>(1, 0) | ||
camelia | WARNINGS for <tmp>: Useless use of constant value [ ] in sink context (lines 1, 1) |
||
Zoffix | I'm debugging that warning.... Does this bit of QAST look like it should be there? gist.github.com/zoffixznet/549227c...xt-L53-L57 | 20:31 | |
Nothing is there for `infix:<+>` and I tried removing that bit, but now the code doesn't find the right routine name. Wondering if that bit is supposed to be there of if I'm removing it too soon | |||
20:33
comborico1611 joined
|
|||
moritz | m: &circumfix:<[ ]>(1, 0) | 20:33 | |
camelia | WARNINGS for <tmp>: Useless use of constant value [ ] in sink context (lines 1, 1) Cannot resolve caller circumfix:<[ ]>(Int, Int); none of these signatures match: () (Iterable:D \iterable) (Mu \x) in block <unit> at <tmp> li… |
||
moritz | Zoffix: ^^ do you mean that code? | ||
'cause I only found a circumfix, not a postcircumfix, in that QAST tree | 20:34 | ||
or is that the point? | |||
comborico1611 | Looking for an emacs tip. CHARACTER-HERE CURSOR-HERE. How do I drop character-here to a new line and preserve its indentation? | ||
Zoffix | moritz: yeah, that code, with &circumfix | ||
comborico1611 | and preserve its* | ||
Zoffix | moritz: no, the point is what appears two be two Stmts; one empty and one is just a `call &infix:<,>`, which I believe is causing the warning. They don't seem to be used for anything, are they? | 20:35 | |
20:36
cdg left
|
|||
moritz | Zoffix: I wonder if the two elements of the infix:<,> call correspond to the [ and the ] from the routine name | 20:36 | |
Zoffix | moritz: yeah. And it's made here: github.com/rakudo/rakudo/blob/mast....nqp#L2532 | ||
Well, s/yeah/I think so/; | 20:37 | ||
Zoffix recompiles and dumps the values | 20:38 | ||
damn, forgot .ast call; /me does recompiles again | 20:43 | ||
20:45
awwaiid joined
|
|||
Zoffix | moritz: yeah, it's the circumfix: gist.github.com/zoffixznet/c4b9070...bdfeb5336a | 20:47 | |
the [ and ] chars for it | |||
20:48
mempko left
|
|||
Zoffix | My next best guess is something rips out ASTs for the colonpair with WVal(Str) for `infix:<+>`, but it forgets to handle the more complex colonpair for circimfix. Just need to find that rip-out bity | 20:48 | |
s/y$// | |||
Zoffix relocates but will read replies, if any | 20:49 | ||
20:53
pilne joined
|
|||
timotimo | DrForr: you may want to delete that comment on your blog, the one that advertises a lot of liposuction service related addresses? | 20:54 | |
actually, every one of those links points at the same url | |||
20:57
itaipu joined
20:58
dct left
20:59
evalable6 left,
troys_ is now known as troys,
evalable6 joined
21:01
rindolf left
|
|||
masak .oO( those ads suck ) | 21:03 | ||
21:03
Hotkeys joined
21:05
dct joined
21:11
bdmatatu left
21:12
kerframil joined
21:15
rindolf joined
21:22
bwisti joined,
itaipu left
21:24
perlpilot left,
itaipu joined
21:32
comborico1611 left
21:34
itaipu left
21:43
dct left,
rindolf left
21:45
dct joined
21:48
japanoise left
21:54
troys is now known as troys_
21:55
itaipu joined
21:58
cdg joined
|
|||
timotimo | oooooh | 22:00 | |
22:10
japanoise joined
22:12
brrt joined,
syntaxman joined,
syntaxman is now known as Guest14653
22:19
espadrine_ joined
22:29
margeas is now known as markong
22:32
statisfiable6 left,
releasable6 left,
releasable6 joined
|
|||
timotimo | hmm. turning a for @plan { } with "when" statements inside into a while @plan with a $_ = @plan.shift in front makes when target the block outside of that | 22:32 | |
22:32
statisfiable6 joined,
reportable6 left
|
|||
timotimo | not surprising, but annoying in this case | 22:32 | |
22:32
reportable6 joined
22:37
dct left
|
|||
buggable | New CPAN upload: List-Util-0.0.2.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.2.tar.gz | 22:48 | |
Zoffix is disappointed Perl 5's Util vs Utils confusion made it into Perl 6 | 22:49 | ||
huh... | 22:50 | ||
We have both List::Util and List::Utils? :S | |||
Zoffix assumes the singular is the fruit of Project Camelia | 22:52 | ||
22:53
Zoffix left
|
|||
lizmat | Zoffix: List::Util is a more or less straight port of Perl 5's List::Util | 22:55 | |
colomon's List::Utils is a nice collection, but has no bearing on the Perl 5 version | |||
lizmat goes to bed: enough porting for today | 22:56 | ||
buggable | New CPAN upload: Sub-Name-0.0.4.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.4.tar.gz | 22:58 | |
23:14
cdg left
23:15
cdg joined
23:19
cdg left
23:22
daxim joined
23:25
troys_ is now known as troys
23:27
cdg joined
23:32
cdg left
23:46
brrt left
|
|||
timotimo | m: my $foo; my $p1 = a => $foo; my $p2 = a => $foo => 1; $foo = 99; say $p1; say $p2; | 23:53 | |
something wrong with camelia? | |||
c: HEAD my $foo; my $p1 = a => $foo; my $p2 = a => $foo => 1; $foo = 99; say $p1; say $p2; | |||
evalable6: say "hi" | |||
what's happening | |||
camelia | a => 99 a => (Any) => 1 |
||
committable6 | timotimo, ¦HEAD(0be9d55): «a => 99a => (Any) => 1» | ||
evalable6 | hi | ||
timotimo | OK | ||
so, is this by design? |