»ö« 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. |
|||
00:02
pmurias left
|
|||
RabidGravy | release the goats | 00:02 | |
00:03
Skarsnik left
|
|||
RabidGravy | toodles people! | 00:07 | |
00:11
RabidGravy left
00:14
espadrine_ is now known as espadrine
00:19
ely-se left
00:20
kid51 joined
00:25
average joined
|
|||
average | I was looking at New Zealand's TZ | 00:26 | |
it's GMT+12:45 | |||
00:26
zwu joined
|
|||
average | that kinda throws off some of my calculations | 00:26 | |
does it make sense if I consider .nz to be on GMT-11:15 ? | 00:27 | ||
or is it unsound ? | 00:28 | ||
btw, TZs never cease to amaze me en.wikipedia.org/wiki/List_of_UTC_time_offsets | |||
leont | That would be a day off | ||
average | turns out, they span from GMT-12 to GMT+14 | ||
that means they cover 26 hours, that's very weird | 00:29 | ||
leont | Kiribati has +14 because a country being split by the day separator is suboptimal | ||
average | I would expect the distance between the earliest and the latest timezone to be at most 24h | ||
00:29
zwu left
|
|||
average | that's how much time it takes for Earth to revolve around its axis | 00:30 | |
leont: is it suboptimal ? | |||
leont: or are they just pampered and wanted to be different ? | |||
leont | Euphemisms, I like using them ;-) | ||
average | if someone asked me I would just tell them Kiribati is full of hipsters | ||
"Oh we're on this timezone called GMT+14, you've never heard of it" | 00:31 | ||
leont | Try -2:00, that's the one no one ever heard of | ||
average | leont: because it's in the ocean ? | 00:32 | |
leont | Population estimate of Fernando de Noronha and South Georgia and the South Sandwich Islands combined: 51 | 00:33 | |
00:33
rurban left,
rurban1 joined
|
|||
average | leont: but they made sure they got their own timezone | 00:34 | |
those 51 people must be super-important | |||
00:35
rurban joined
00:36
spider-mario left
|
|||
AlexDaniel | m: say DateTime.new(‘2015-12-24T12:23:00+69:42’) | 00:37 | |
camelia | rakudo-moar 3259ba: OUTPUT«2015-12-24T12:23:00+69:42» | ||
00:37
rurban1 left
|
|||
AlexDaniel | m: say DateTime.new(‘2015-12-24T12:23:00+69:42’).timezone | 00:37 | |
camelia | rakudo-moar 3259ba: OUTPUT«250920» | ||
AlexDaniel | what's that | 00:38 | |
m: say DateTime.new(‘2015-12-24T12:23:00+02:00’).timezone | |||
camelia | rakudo-moar 3259ba: OUTPUT«7200» | ||
AlexDaniel | ah right | ||
00:38
linuxuser9000 left
|
|||
leont | timezone is the wrong word for that, really :-/ | 00:39 | |
AlexDaniel | average: what kind of calculations are you doing? :) | ||
leont: yeah, it is clock offset | |||
leont: why do we even have this crap | |||
00:40
joydo joined
00:42
kjs_ joined
|
|||
AlexDaniel | the whole assumption that the sun should be shining with some specific brightness at some specific hours is just not relevant anymore. We don't use sundials, right? | 00:43 | |
00:45
pierre-vigier joined
|
|||
AlexDaniel | though these are separate issues | 00:45 | |
leont | Humans and habits… | 00:46 | |
AlexDaniel | what completely escapes me is how humans strive to improve all aspects of life except calendars and clocks | 00:49 | |
every time I look at monthly stats I wonder “was it adjusted according to the number of days in the month or not?” | 00:50 | ||
come on people, we can do better | |||
joydo | Can somebody help me explain the dynamic variable "$*REPO" ? or some documents I can refer to!!! | 00:53 | |
AlexDaniel | m: say $*REPO | 00:54 | |
camelia | rakudo-moar 3259ba: OUTPUT«inst#/home/camelia/.perl6/2015.12-212-g3259ba3» | ||
00:55
BenGoldberg joined
00:57
kjs_ left
|
|||
AlexDaniel | m: say ‘🖕’.uniname | 01:01 | |
camelia | rakudo-moar 3259ba: OUTPUT«REVERSED HAND WITH MIDDLE FINGER EXTENDED» | ||
average | does Perl6 have a monotonic clock ? | 01:05 | |
you need a monotonic clock guys.. | |||
01:09
alpha123 left
01:10
pierre-vigier left,
pierre-vigier joined
01:17
molaf left,
molaf joined
|
|||
leont | Not sure that has to be part of the language, but they're sure darn useful | 01:18 | |
autarch | and a pentatonic scale - need that too | 01:20 | |
TimToady wonders what "monotonic" means there | 01:22 | ||
skids | Well, the definition is solid in non-parallel applications, at least. | ||
leont | Steadily increasing | 01:23 | |
As opposed to wallclock which follows human time, and can move around at will | |||
TimToady | our instants are certainly monotonic in that sense | ||
leont | monotonic is what you'd use for a benchmark, wallclock is for end-users | ||
That doesn't mean the clock that generates them is | |||
skids | Oh, well that wasn't the definition I thought then. | 01:24 | |
TimToady | that's a problem with the computer, not the language | ||
leont | Time is difficult :-/ | ||
It's neither, or both, but probably neither. It's time. | |||
TimToady | Instants are supposed to be sync'd to TAI to the extent possible to determine on the computer | ||
leont | You're missing the point | 01:25 | |
Unless your computer is/has an atomic clock, it doesn't have a monotonic timesource that's relatable to human time (and even one could argue TAI is an average) | |||
A typical monotonic clock is based on seconds since boottime, since that won't skip when the user decides their clock is wrong. | 01:26 | ||
01:28
espadrine left
|
|||
TimToady | a user is not supposed to be able to change Instants at their whim | 01:29 | |
but I see that backtranslating from the system clock can be a problem | 01:30 | ||
we could peg Instants to a monotonic clock at the beginning of a process, but then we could have concurrent processes that disagree on the current Instant by a significant degree | 01:33 | ||
there's no easy answer that solves every problem | |||
average | linux.die.net/man/3/clock_gettime | 01:35 | |
see the part about CLOCK_MONOTONIC | |||
skids | Well, that resets on reboot. | 01:37 | |
average | "continuity is more important than having actual time" (I think he means monotonicity is more important than actual time) www.youtube.com/watch?v=-5wpm-gesOY#t=9m13s | 01:39 | |
01:39
yqt left
|
|||
average | he mentions Google has a clock that smears leap seconds all throughout the day | 01:39 | |
I suppose they are doing that in the attempt of having an actual monotonic clock that is not affected by leap seconds | 01:40 | ||
"A leap second is a one-second adjustment that is occasionally applied to Coordinated Universal Time (UTC) in order to keep its time of day close to the mean solar time, or UT1." | |||
01:40
jshy left
|
|||
average | ^^ and that's a leap second | 01:40 | |
01:40
z8 left
|
|||
TimToady | we'd rather have another second in our monotonic time than to have seconds vary in length | 01:41 | |
mspo | that assumes monotonic means monotonic in your OS | ||
yoleaux | 15 Jan 2016 22:11Z <sortiz> mspo: I'm working in a p6-LMBD | ||
mspo | sortiz: nice | ||
TEttinger | they do though, if you're working at a different speed | ||
approaching the speed of light, seconds do vary in length | 01:42 | ||
01:42
bzipitidoo left
|
|||
TimToady | we aren't worried about that for Perl 6 | 01:42 | |
TEttinger | haha | ||
100 years not 100,000 | |||
TimToady | TAI is good enough for earthbound earthlings :) | ||
and if it's not, you're gonna have your own clock already :) | 01:43 | ||
TEttinger | ha yes | ||
skids | Eh, if reality is only partially ordered in the first place a Lamport timestamp should do just fine. | 01:46 | |
average | skids: lamport is that distributed systems guy ? | 01:49 | |
skids: he made that clock for distributed systems right ? | |||
skids | Yeah. One of the distributed partially ordered causality schemes. | 01:50 | |
01:51
ssotka left
01:54
Dee22 joined
|
|||
leont | If you want monotonic time, you probably don't need to map it to human time. Instants don't need to have a meaningful value, you'd only use them to create Durations | 01:56 | |
TimToady | that's pretty much how they're defined; epoch-less atomic seconds | 01:57 | |
people keep wanting to confuse them, however :) | 01:58 | ||
01:58
AndyDee left
|
|||
leont | They do! | 01:58 | |
01:59
SCHAAP137 left,
Dee22 is now known as AndyDee
02:11
pierre-vigier left
02:16
leont left
02:17
pierre-vigier joined
02:21
xpen joined
02:27
zcm left
02:28
pierre-vigier left,
xpen left
02:29
xpen joined
02:32
pierre-vigier joined
02:34
jme` left
02:41
xpen_ joined
02:45
xpen left
02:58
molaf_ joined
03:01
molaf_ left,
Herby_ joined
|
|||
Herby_ | Good evening, everyone! | 03:01 | |
03:02
Actualeyes joined
|
|||
Herby_ | m: comb(<[a..z]>, "h.e.l.l.o.").say | 03:02 | |
camelia | rakudo-moar 3259ba: OUTPUT«()» | ||
Herby_ | m: comb(/./, "h.e.l.l.o.").say | ||
camelia | rakudo-moar 3259ba: OUTPUT«(h . e . l . l . o .)» | ||
Herby_ | how would I go about stripping punctuation out of a string? | ||
03:03
molaf left
|
|||
Herby_ | m: comb(/<[a..z]>/, "h.e.l.l.o.").say | 03:03 | |
camelia | rakudo-moar 3259ba: OUTPUT«(h e l l o)» | ||
Herby_ | :) | ||
autarch | I could use some help debugging a confusing warning in github.com/autarch/perl6-Test-Stream | ||
Herby_ | m: comb(/<[a..z]>/, "h.e.l.l.o.").join.say | 03:04 | |
camelia | rakudo-moar 3259ba: OUTPUT«hello» | ||
Herby_ | m: comb(/<[a..z]>/, "hello. this is a test string. \n and another line!").join.say | ||
camelia | rakudo-moar 3259ba: OUTPUT«hellothisisateststringandanotherline» | ||
Herby_ | wish I could help, autarch, but I'm still fumbling my way through the basics | 03:05 | |
autarch | hmm, now maybe the warning went away ... | ||
alright, that's odd | 03:06 | ||
Herby_ | m: $string = "Was it a car or a cat I saw?"; if $string.lc.comb(/<[a..z]>/) eq $string.lc.comb(/<[a..z]>/).reverse { say "Its a palindrome" }; | 03:07 | |
camelia | rakudo-moar 3259ba: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Ce35O6S5QMVariable '$string' is not declared. Did you mean 'Stringy'?at /tmp/Ce35O6S5QM:1------> 3<BOL>7⏏5$string = "Was it a car or a cat I saw?"» | ||
Herby_ | m: my $string = "Was it a car or a cat I saw?"; if $string.lc.comb(/<[a..z]>/) eq $string.lc.comb(/<[a..z]>/).reverse { say "Its a palindrome" }; | 03:08 | |
camelia | rakudo-moar 3259ba: OUTPUT«Its a palindrome» | ||
03:08
kid51_ joined
03:09
kid51 left
03:10
kid51_ is now known as kid51
|
|||
autarch | ok, here's the warning - check out the repo, then run ... perl6 -Ilib -e 'use Test::Predicates' | 03:10 | |
and the warning I get is - "Use of uninitialized value of type Mu in string context | |||
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in code at /home/autarch/projects/perl6/Test-Stream/lib/Test/Predicator.pm6 line 66" | |||
but what's so confusing is that this happens at compilation time and this code is not being run | |||
the warning used to be repeatable, but now it seems to only happen sometimes, if I run that command repeatedly it doesn't always show up | 03:11 | ||
03:13
pierre-vigier left,
nadim joined
03:15
_nadim left
|
|||
autarch | I've got to stop waiting to ask questions til after the europeans have all gone to sleep | 03:20 | |
skids | try --ll-exception | 03:21 | |
autarch | skids: it's just a warning - will that still help? | 03:23 | |
skids | maybe not. | ||
autarch | on another topic, how do I fork? | ||
skids | autarch: as it so happens, I braindumped what I do to send PRs last night at github.com/perl6/user-experience (the two "Rakudo" links in the README.md) | 03:27 | |
autarch | skids: I really think travis should be doing this - the point is to make it easier for core devs to accept/reject PRs | 03:28 | |
I mean, it's good to get people to run the tests themselves too, but the CI system if the protection against lazy people like me who always forget | |||
skids | Yeah, I havent had the time to stat to learn travis yet, not being a actual "developer" really. | 03:29 | |
03:29
lnrdo joined
|
|||
skids | But It's good to tell people what travis would be testing anyway so they can dig into what is failing. | 03:30 | |
I can't seem to get that warning to happen here. | 03:32 | ||
autarch | skids: I just pushed a commit that may have made it go away | 03:35 | |
the last commit that I know produced the warning is e0083d5c31a3b28d070fbdb506eee5a30a5542ad | |||
skids | Yeah that made the difference. | 03:36 | |
03:36
pierre-vigier joined
|
|||
autarch | but what did I change? that's what's so confusing - I basically copied that code from Test.pm6 and that one never warns | 03:38 | |
I wonder if it's some very odd compiler bug | |||
skids | It seems to happen when some other file under lib/ has been recently touched and needs to be recompiled, other than Predicates.pm | 03:39 | |
03:40
linuxuser9000 joined
|
|||
skids | Predicator.pm6 actually | 03:40 | |
03:44
kid51 left
|
|||
autarch | I just don't understand the warning | 03:45 | |
skids | m: Mu.Str | 03:48 | |
camelia | rakudo-moar 3259ba: OUTPUT«Use of uninitialized value of type Mu in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/WbOEF2_20y line 1» | ||
03:49
lnrdo left
03:51
noganex_ joined,
Zero_Dogg left
03:52
Zero_Dogg joined,
Zero_Dogg left,
Zero_Dogg joined
|
|||
dalek | kudo-star-daily: e4d2e7d | coke++ | log/ (6 files): today (automated commit) |
03:53 | |
03:54
noganex left
03:56
cpage__ joined,
cpage_ left,
cpage__ is now known as cpage_
03:59
rurban1 joined
|
|||
skids | m: sub f ($op) { qq{&infix:«$op»}; } | 04:00 | |
camelia | rakudo-moar 3259ba: OUTPUT«Use of uninitialized value of type Mu in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in code at /tmp/WdRUE5CITk line 1» | ||
skids | golfed so far. | ||
only happens on precomp. | |||
erm, when precomping | |||
autarch | yeah, that's just really odd, unless & is interpolated somehow? | 04:01 | |
ah, maybe that's the issue? | |||
04:01
rurban left
|
|||
autarch | yeah, I think it is | 04:01 | |
m: say qq{&infix<==>} | |||
camelia | rakudo-moar 3259ba: OUTPUT«5===SORRY!5=== Error while compiling /tmp/OMUWEf_M2pUndeclared routine: infix used at line 1. Did you mean 'indir', 'index'?» | ||
autarch | m: say qq{\&infix<==>} | ||
camelia | rakudo-moar 3259ba: OUTPUT«&infix<==>» | ||
skids | missing colon | 04:02 | |
autarch | m: say qq{&infix:<==>} | ||
camelia | rakudo-moar 3259ba: OUTPUT«&infix:<==>» | ||
autarch | hmm, no clue then | ||
m: say qq{\&infix:<==>} | |||
camelia | rakudo-moar 3259ba: OUTPUT«&infix:<==>» | ||
autarch | m: sub foo { 42 }; say "&foo" | 04:03 | |
camelia | rakudo-moar 3259ba: OUTPUT«&foo» | ||
autarch | m: sub foo { 42 }; say "&foo()" | ||
camelia | rakudo-moar 3259ba: OUTPUT«42» | ||
autarch | yeah, definitely interpolated | ||
skids | m: sub f ($op) { qq{&infix:($op)}; }; f(">").perl.say | ||
camelia | rakudo-moar 3259ba: OUTPUT«"\&infix:(>)"» | ||
skids | m: sub f ($op) { qq{&infix:«$op»}; }; f(">").perl.say | ||
camelia | rakudo-moar 3259ba: OUTPUT«Use of uninitialized value of type Mu in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in code at /tmp/TzD4Y9bjWs line 1"\&infix:«>»"» | ||
skids | m: sub f ($op) { qq{&infix:<$op>}; }; f(">").perl.say | 04:04 | |
camelia | rakudo-moar 3259ba: OUTPUT«"\&infix:<>>"» | ||
autarch | m: say &infix:<>>.perl | 04:08 | |
camelia | rakudo-moar 3259ba: OUTPUT«Use of Nil in string context in any canonicalize_pair at src/Perl6/World.nqp line 4039Use of Nil in string context in any canonicalize_pair at src/Perl6/World.nqp line 40455===SORRY!5===Undeclared routine: infix:<> used at line 1. Did …» | ||
autarch | you need to use «>» | ||
04:08
rurban joined
04:10
rurban1 left
04:12
rurban left
04:13
rurban joined
|
|||
TimToady | infix references evaluate the name as a constant at compile time, so you can't parameterize it like that | 04:21 | |
skids | Right but why is it interpolated? | 04:22 | |
(the actual code this was golfed from used EVAL on it after makin the string) | |||
04:23
AndyDee left
|
|||
average | hey kids, did you eat your vegetables today ? | 04:23 | |
04:24
pierre-vigier left
|
|||
Herby_ | o/ | 04:26 | |
average | \o | 04:28 | |
04:28
skids left
|
|||
Herby_ | \o/ | 04:28 | |
04:29
pierre-vigier joined,
skids joined
|
|||
skids | m: "&abs(1)".perl.say; # it's hitting the "looks like a &-qualified function call" | 04:30 | |
camelia | rakudo-moar 3259ba: OUTPUT«"1"» | ||
skids | ...but it isn't | ||
04:30
lnrdo joined
04:33
lnrdo left,
pierre-vigier left
|
|||
autarch | skids: I think it's interpolated because you can do this ... | 04:36 | |
m: sub foo { 42 }; say "&foo()" | |||
camelia | rakudo-moar 3259ba: OUTPUT«42» | ||
skids | Right that's what I eant with the "&abs(1)" line. | 04:37 | |
I think (?) its a bug | |||
autarch | no idea | ||
m: sub foo { 42 }; say "foo()" | |||
camelia | rakudo-moar 3259ba: OUTPUT«foo()» | ||
autarch | it seems like it might be intentional, since it's not that likely to be typed by accident | ||
04:37
cpage_ left
|
|||
skids | It's intentional that "&foo()" works but probably not that "&infix:«" without a following () tries to do the same thing | 04:38 | |
m: "&infix:<+>(1,2)".say | 04:39 | ||
camelia | rakudo-moar 3259ba: OUTPUT«3» | ||
skids | m: "&infix:«+»(1,2)".say | ||
camelia | rakudo-moar 3259ba: OUTPUT«3» | ||
skids | m: "&infix:«+»".say | ||
camelia | rakudo-moar 3259ba: OUTPUT«&infix:«+»» | ||
autarch | skids: design.perl6.org/S02.html#Sub_calls | 04:40 | |
yeah, that lack of parens means it shouldn't interpolate according to that synopsis | |||
skids files a rakudobug | |||
04:42
nadim left
04:52
rurban1 joined
|
|||
skids | RT#127284 | 04:53 | |
04:53
rurban left
|
|||
average | m: say "Eat your veggies kids, very important" | 04:54 | |
camelia | rakudo-moar 3259ba: OUTPUT«Eat your veggies kids, very important» | ||
04:56
rurban joined,
rurban1 left
|
|||
autarch | skids++ | 04:58 | |
04:59
revhippie left
05:03
rurban1 joined
05:04
xpen_ left
05:05
rurban left
05:06
jme` joined
05:07
rurban joined
05:08
rurban1 left
05:11
cpage_ joined
05:13
skids left
05:30
raiph joined
05:31
khw left
05:45
aenaxi left
05:48
zmisc joined
05:50
Cabanossi left
05:54
Cabanossi joined,
zmisc left
05:55
sno left,
sno joined,
BenGoldberg left
05:57
aenaxi joined,
jme` left
05:59
xpen joined,
jme` joined
06:01
pat_js joined
06:04
nadim joined
|
|||
AlexDaniel | I have to admit that this one is pretty clever: tinyurl.com/juynybx | 06:22 | |
though I'm not sure if it is still a butterfly | 06:23 | ||
06:24
linuxuser9000 left
06:28
Psyche^ joined
06:30
pierre-vigier joined,
nadim left
06:32
Psyche^_ left
06:33
nadim joined
06:34
pierre-vigier left
06:39
nadim left
06:40
_nadim joined
06:45
raiph left
06:47
joydo left
06:52
AlexDaniel left
|
|||
dalek | osystem: eaedef1 | azawawi++ | META.list: Add OpenCV to ecosystem |
06:53 | |
06:55
pierre-vigier joined
06:59
pierre-vigier left
07:08
rurban left,
rurban joined
07:10
CIAvash joined
07:13
pierre-vigier joined
07:16
_nadim left
07:21
linuxuser9000 joined
07:22
st_iron joined
|
|||
st_iron | good morning | 07:22 | |
07:39
st_iron left
07:55
_nadim joined
08:01
jme` left
08:14
xpen left
08:16
_nadim left
08:23
azawawi joined,
pat_js left
08:24
linuxuser9000 left,
pierre-vigier left,
pierre-vigier joined
08:26
darutoko joined
|
|||
azawawi | hi | 08:26 | |
how does one force panda install XYZ ? --force does not seem to do it | |||
nevermind, 'zef install XYZ' works perfectly and skips installed modules :) | 08:34 | ||
08:41
CIAvash left,
CIAvash joined
08:46
rurban1 joined
08:48
firstdayonthejob joined,
rurban left,
yurivish_ left
08:53
troydm left,
rurban joined
08:55
rurban1 left,
Actualeyes left
08:57
RabidGravy joined,
rurban left
08:58
rurban joined
09:06
pierre-vigier left,
pierre-vigier joined
09:09
Actualeyes joined
|
|||
Zero_Dogg | Is there any way to have run wait until the command exits, like system() did in perl5? | 09:10 | |
09:13
rindolf joined
|
|||
nine | Zero_Dogg: which command? | 09:14 | |
Zero_Dogg | nine: whatever is being executed with run() | 09:15 | |
azawawi | Zero_Dogg: design.perl6.org/S29.html#shell ? | ||
nine | Unless you use any options run() does wait for the command to exit | 09:16 | |
Zero_Dogg | ah, ok, the docs (doc.perl6.org/type/IO#sub_run) was not clear on that, and Proc was described as «running process», so I assumed it referred to the process still running | 09:17 | |
09:17
_Gustaf_ joined
09:20
domidumont joined
|
|||
azawawi | Zero_Dogg: Proc::Async is the one that does not run if i remember correctly | 09:22 | |
RabidGravy | Proc::Async runs things and returns before they complete, straight Proc (i.e run() ) doesn't | ||
azawawi | Zero_Dogg: i.e. async | ||
Zero_Dogg | thanks | ||
RabidGravy | :) | ||
azawawi | RabidGravy: :) | ||
09:25
domidumont left
09:26
domidumont joined
09:41
pierre-vigier left,
SCHAAP137 joined
09:49
pierre-vigier joined
09:52
pmurias joined
|
|||
azawawi | retupmoca: ping | 09:52 | |
09:53
firstdayonthejob left
09:59
_Gustaf_ left
|
|||
[Tux] | csv-ip5xs 50000 17.653 12.150 | 10:01 | |
test 50000 22.528 21.830 | |||
test-t 50000 12.284 11.400 | |||
csv-parser 50000 50.566 -0.131 | |||
10:05
rurban1 joined
10:07
salv0 left,
rurban left
10:09
rurban joined
10:10
pierre-vigier left
10:12
rurban1 left
10:13
pierre-vigier joined
|
|||
timotimo | o/ | 10:18 | |
azawawi | timotimo: hi there | 10:23 | |
modules.perl6.org/#q=Opencv # is finally working :) | 10:24 | ||
github.com/azawawi/perl6-opencv/bl...o-world.p6 # hello world | |||
timotimo | neat :) | 10:25 | |
azawawi | now it is time to do OO wrappers :) | 10:27 | |
and more API wrapped | |||
timotimo | bubble wrap! | ||
azawawi | github.com/abidrahmank/OpenCV2-Pyt...ic_ops.rst | ||
timotimo: any progress on your ipython p6 kernel? | 10:28 | ||
RabidGravy | cool, azawawi++ | ||
timotimo | no :( | 10:29 | |
i haven't even started looking at arnsholts work in that repo much :( | |||
10:30
kjs_ joined
10:32
Herby_ left
|
|||
azawawi | timotimo: metacpan.org/release/Devel-IPerl # Perl 5 ipython kernel | 10:33 | |
lucs | In Synopsis 26 mentions 「=head86 A "Missed it by I<that> much!" heading | 10:37 | |
」 | |||
And it makes me smile :) | |||
DrForr | s/head/agent/ | 10:38 | |
lucs | Yeah, I grew up with that :) | 10:39 | |
timotimo | i don't know what that means :< | ||
lucs | Old running gag in an old TV show: youtu.be/oPwrodxghrw | 10:40 | |
DrForr | /Get Smart!/ ref. | ||
timotimo | ah | 10:41 | |
i saw the movie they put out recently-ish | |||
lucs | He was Agent 86. | ||
timotimo | it was amazing | 10:42 | |
masak | good antenoon, #perl6 | 10:43 | |
azawawi | do we have something like python's "import something as st" ? | ||
masak: hi | |||
RabidGravy | marning masak | 10:44 | |
azawawi, you could do it with an EXPORT sub | 10:45 | ||
azawawi | RabidGravy: do you have an example? | ||
10:46
FROGGS joined
|
|||
RabidGravy | not in my code, but basically the EXPORT sub returns a Map with symbol => thing pairs | 10:47 | |
timotimo | um, i don't think that's what he's asking for? | 10:48 | |
isn't what he wants to have something used and installed under a different name than it itself wants? | |||
RabidGravy | well, it can do that | ||
it doesn't have to be just subroutine, it can be types too | 10:49 | ||
10:49
protium left
|
|||
timotimo | we're not going to go around telling people "you have to write an EXPORT subroutine so that others can use your module nicely" | 10:49 | |
nine | S11 speculates about more possibilities, but I don't think we're even close to that. | 10:51 | |
10:53
pierre-vigier left
|
|||
RabidGravy | well no, but it was a short-cut for "no there is no built in mechanism as yet, but you could emulate it with an EXPORT" :) I'm sure azawawi's clever enough to read between the lines ;-) | 10:53 | |
anyway, off to the seasidde before the impending snowpocalypse | 10:55 | ||
timotimo | i didn't realize we don't do that at all yet :| | ||
10:59
RabidGravy left
|
|||
azawawi | im clever enough? :) | 11:09 | |
azawawi eats tea + cake :) | |||
i was asking for a nice way to namespace (prefix) a module exports | 11:10 | ||
DrForr | BUT THE CAKE... never mind. | ||
11:12
abaugher left
11:13
abaugher joined
11:15
spider-mario joined
11:16
pierre-vigier joined
11:22
mcmillhj left
11:25
rurban1 joined
11:26
rurban left
11:28
rurban joined,
_Vi left
11:29
dpk left,
rurban1 left
11:31
yoleaux joined,
dpk joined,
ChanServ sets mode: +v yoleaux
11:32
rurban1 joined,
rurban left
11:36
kjs_ left
11:38
psy joined
|
|||
azawawi | github.com/azawawi/perl6-opencv/bl...o-world.p6 # a bit of OpenCV::Mat Perl 6 OO | 11:38 | |
11:39
leont joined
11:40
kjs_ joined
11:42
pierre-vigier left
|
|||
zhmylove | masak: Hi! my $c = 1; for @*ARGS {qqx"curl -o $c++.fmt('%02d').htm $_.subst("'","\\'",:g)"} # tested on the recently built rakudo 2015.12, so actually I _can_ do c++ without { } | 11:42 | |
11:43
pierre-vigier joined
|
|||
zhmylove | azawawi: great! What is $img.clone ? | 11:46 | |
azawawi | zhmylove: get a new copy of the image matrix so you can manipulate it | ||
zhmylove: e.g. you want to make it grayscale and then put them side by side | 11:47 | ||
11:47
pierre-vigier left
|
|||
zhmylove | azawawi: actually I can't get the difference with `my OpenCV::Mat $denoised_img = $img;`... Could you please describe or just give a link where I can read about it? | 11:48 | |
azawawi | zhmylove: they point to the same C++ object reference. It is an OpenCV library thing. | 11:50 | |
let me simplify the example | |||
11:51
leont left
|
|||
azawawi | zhmylove: docs.opencv.org/2.4.11/modules/core...=clone#Mat Mat::clone() const | 11:51 | |
zhmylove | azawawi: got it! Thank you a lot! Actually `method clone() returns OpenCV::Mat ` helped too. | 11:53 | |
12:02
Guest76102 joined
|
|||
azawawi | zhmylove: np, added an example of how to load in grayscale if you're interested | 12:04 | |
azawawi starts working on wrapping drawing api | |||
12:04
Guest76102 left
12:08
FROGGS_ joined
12:10
_Vi joined
12:12
FROGGS left,
perl6newbee joined
12:18
rurban1 left
12:19
rurban joined
12:22
rindolf left
12:23
rurban1 joined,
rurban left
12:25
firstdayonthejob joined
12:26
pecastro left
12:27
Skarsnik joined
12:30
rurban joined
12:31
rurban1 left,
vendethiel- joined,
vendethiel left
12:34
rurban left
12:35
rurban joined
12:40
M_ joined
12:42
rurban1 joined,
rurban1 left
12:43
rurban left
|
|||
lucs | How do I do the equivalent of 「$k ~~ %h」 to check for a value instead of a key? | 12:52 | |
12:52
pmurias left
12:54
telex left,
firstdayonthejob left
12:56
telex joined
13:01
TEttinger left,
gfldex left
13:05
gfldex joined,
rindolf joined
13:12
sortiz left
13:13
kid51 joined
|
|||
geekosaur | match against %h.values? | 13:16 | |
13:16
firstdayonthejob joined
|
|||
lucs | Fails, %h.values is a Seq, not sure how to handle that. | 13:17 | |
13:18
kjs_ left
13:21
rindolf left
13:27
brrt joined
13:30
rindolf joined
13:34
M_ left
|
|||
timotimo | it'll have to be something like "defined %h.values.index($needle)" or so | 13:35 | |
alternatively, $needle ~~ any(%h.values) | |||
kid51 | At rakudo.org/how-to-get-rakudo/, I read: "NOTE: the Rakudo Star with 6.c Christmas Perl 6 release is not yet available. Check back soon or try one of the older versions." | ||
When will "soon" happen? | |||
lucs | timotimo: Thanks. | 13:36 | |
kid51 | I ask because I'm about to start a Perl6 study group in NYC and, for the people likely to participate in this group, I've been advised that Rakudo Star will be a better bet. | ||
DrForr | A study group? Nice. | ||
brrt | .seen konobi | 13:37 | |
yoleaux | I saw konobi 4 Jan 2016 17:55Z in #perl6: <konobi> pmurias: just how things on the JS backend are going... has beena while since i had a chance to look | ||
brrt | darn, that's some time ago | ||
timotimo | kid51: sorry about that. FROGGS_ has been putting in time to bring the latest rakudo star release to fruition | ||
13:39
FROGGS__ joined
|
|||
brrt | we could say we're a bit understaffed in the polishing-and-releasing department | 13:39 | |
13:39
SCHAAP137 left
|
|||
timotimo | mhm | 13:40 | |
13:40
FROGGS_ left
13:42
kid51_ joined
13:43
SCHAAP137 joined
13:44
kid51 left,
kid51_ is now known as kid51,
FROGGS_ joined,
FROGGS__ left
13:47
pierre-vigier joined
13:49
lucasb joined
|
|||
lucasb | sorry, I'm one week without reading the logs. just wanted to know if a release will happen today, or if you decided to delay it? | 13:52 | |
13:53
FROGGS_ left
13:54
sena_kun joined
|
|||
timotimo | hm. looks like [Coke] signed up for this month's release | 13:54 | |
sena_kun | Hi, #perl6. | 13:58 | |
timotimo | hello sena_kun | 13:59 | |
14:03
espadrine joined
|
|||
sena_kun | I was thinking this morning about bindings to C libs. In some way we just need to read bunch of signatures(and structures/variables) and convert it into perl6 expressions. Maybe it can be done my perl6 program? Something like c2hs library in haskell, which can generate bindings automatically. I searched a bit and found nothing like this. Is this a bad idea or just nobody has enough time to try to do it? | 14:05 | |
Skarsnik | huggable not here :( | 14:06 | |
Did you have a look at github.com/Skarsnik/gptrixie ? | |||
DrForr | sena_kun: You need a full C parser and c preprocessor to do it that way. | ||
Not saying it's a bad idea, I've thought about it myself. | 14:07 | ||
timotimo | DrForr: did you have a look at gptrixie? | 14:08 | |
DrForr | Didn't know of its existence. | ||
brrt | senia_kun; if you have a compiler ready, you can do something like gcc -E to do macro evaluation | ||
14:08
kjs_ joined
14:13
brrt left
14:15
_Vi left,
sena_kun left
14:24
Peter__R left
14:29
rurban joined
14:30
ely-se joined
14:34
sena_kun joined
14:38
RabidGravy joined,
_Vi joined
|
|||
sena_kun | DrForr, also, to just do bindings we don't need a full C parser. We need to parse only .h files, which is not so complex as .c, aren't we? | 14:39 | |
mspo | hat if you used nm and objdump instead? | 14:41 | |
DrForr | Try 'cpp -E /usr/include/stdio.h' and have a look at the output. | ||
sena_kun | DrForr, ah, sorry, you're right. | 14:42 | |
DrForr | Not trying to dissuade, it's just quite a bit of work. | ||
RabidGravy | well for the most part, but there are libraries that are entirely composed of .h files (hey i2c_dev I'm looking at you) so it is entirely possibly that you need to parse C completely | ||
Skarsnik's gptrixie makes a decent fist of making the binding code from a .h fie though | 14:43 | ||
14:44
kjs_ left
|
|||
RabidGravy | you have seen the github.com/Skarsnik/gptrixie ? | 14:44 | |
sena_kun | RabidGravy, oh, I was sure it exist. Thank you. Skarsnik posted it already, but I missed the message. | 14:45 | |
14:46
lokien_ joined
|
|||
RabidGravy | I stuck it at the PortMidi.h and it made a reasonable go at it for a weird interface, would need some tweeking but a good start | 14:47 | |
14:49
brrt joined,
_nadim joined
14:54
_nadim left
14:55
pierre-vigier left
14:56
pierre-vigier joined
|
|||
Skarsnik | Feel free to fill issue on what is wrong x) | 14:59 | |
sena_kun | gist.github.com/Altai-man/ea83a55ffa51ec88089a - here is a gist, which can produce "Unhandled kind 1" error. If you use native perl6 Bool code will be correct. It will be good to replace this message with something more readable. | 15:00 | |
15:01
FROGGS joined
|
|||
dalek | c: f614b01 | (David Brunton)++ | doc/Language/operators.pod: Cross meta operator Some of the meta operator documentation is repeated in the infix operator sections. This makes the cross section match the other meta operators, though. |
15:09 | |
c: ef9708a | sylvarant++ | doc/Language/operators.pod: Merge pull request #356 from dbrunton/patch-3 Cross meta operator |
|||
Skarsnik | sena_kun, well you are not supposed to use bool outside a native x) | 15:14 | |
but I think it's like an Int for perl 6 | 15:15 | ||
m: use NativeCall; say bool.WHAT; say bool.var.WHAT | |||
camelia | rakudo-moar 3259ba: OUTPUT«(bool)Method 'var' not found for invocant of class 'NativeCall::Types::bool' in block <unit> at /tmp/oJ74kfCAEf line 1» | ||
Skarsnik | m: use NativeCall; say bool.WHAT; say bool.VAR.WHAT | ||
camelia | rakudo-moar 3259ba: OUTPUT«(bool)(bool)» | ||
Skarsnik | m: use NativeCall; say bool.repr | ||
camelia | rakudo-moar 3259ba: OUTPUT«Method 'repr' not found for invocant of class 'NativeCall::Types::bool' in block <unit> at /tmp/adYqFESKhp line 1» | ||
Skarsnik | m: use NativeCall; say bool.REPR | ||
camelia | rakudo-moar 3259ba: OUTPUT«P6int» | ||
15:18
khw joined
|
|||
sena_kun | Skarsnik, I know, but 1)emacs perl6-mode didn't highlight Bool properly(fixed); 2)someone can just do a typo and we need pretty error messages anyway. If it's NativeCall "error", I can try to fix it and send a PR. But greping zavolaj with "unhandled" or "kind" gives me nothing. | 15:19 | |
Skarsnik | zavolaj is "dead" | 15:20 | |
everything is in rakudo | |||
masak | is that clearly signaled in the zavolaj github repo? | ||
Skarsnik | and it's probably not possible to catch the missuse of those type :( | ||
I know I should not have called it bool xD | 15:21 | ||
but like c_bool or something | |||
15:22
DarthGandalf left
15:23
jme` joined
|
|||
ely-se | If I want to export a multi sub, do I have to add is export to each definition or only to the proto? | 15:23 | |
15:24
DarthGandalf joined
|
|||
ely-se | apparently only on the proto | 15:24 | |
RabidGravy | I would expect that the proto would be anough | ||
15:24
_Vi left
15:33
xpen joined,
average left
15:36
balazs left
|
|||
ely-se | m: [+] (1,) | 15:36 | |
camelia | ( no output ) | ||
ely-se | m: say [+] ("1",) | ||
camelia | rakudo-moar 3259ba: OUTPUT«1» | ||
ely-se | m: ([+] ("1",)).perl.say | 15:37 | |
camelia | rakudo-moar 3259ba: OUTPUT«1» | ||
ely-se | nice, it converts | ||
15:43
sammers left,
zakharyas joined
15:44
_Vi joined
15:51
sena_kun left
|
|||
b2gills | m: say 0.6931471805599453 == log 2; say log 2; say log(2) == ~log 2 | 15:54 | |
camelia | rakudo-moar 3259ba: OUTPUT«True0.693147180559945False» | ||
lucasb | one digit of difference? | 15:55 | |
b2gills | The same bug showed up in Perl 5: rt.perl.org/Public/Bug/Display.html?id=127182 | 15:56 | |
masak | interesting. | ||
I mean, not surprises me with floating-point rounding errors, but I don't think I'd've been able to predict that one. | 15:57 | ||
not much* | |||
b2gills | I was reading the P5P mailing list summary blogs.perl.org/users/sawyer_x/2016/...-10th.html | 15:58 | |
masak | nice. | ||
sawyer_x++ b2gills++ | |||
ely-se | Is there a function to get the full path to a program given its name, looking up in the PATH environment variable? | ||
lucasb | ely-se: I'm not aware of any builtin that does this. so you'll probably have to traverse the dirs in PATH yourself | 16:00 | |
16:00
domm__ joined
|
|||
ely-se | ok! | 16:00 | |
RabidGravy | I think File::Which does that | 16:01 | |
b2gills | It was already tested with Rakudo if you read the summary. (I don't know if a bug was reported yet) The fix doesn't seem to work though | ||
m: printf "%.18g\n", log 2 | |||
camelia | rakudo-moar 3259ba: OUTPUT«0.693147180559945» | ||
ely-se | brb | ||
16:01
ely-se left,
domm__ left,
domm__ joined,
domm__ left
16:02
_Vi left
16:03
domm_plix joined,
domm_plix left
16:09
pierre-vigier left,
pierre-vigier joined
|
|||
azawawi | RabidGravy: im back :) | 16:10 | |
RabidGravy | RARR! | ||
Skarsnik | azawawi, go finish pg array in dbiish support! | 16:11 | |
azawawi | RabidGravy: tested the ethernet shield one one of the 2 Arduino unos i got yesterday :) | ||
RabidGravy: the pins were twisted so i had to fix them lol | |||
RabidGravy | oopsie | ||
16:13
lsm left
|
|||
Skarsnik | I use my arduino to capture my snes controller input x) | 16:13 | |
azawawi | RabidGravy: they didnt have the camera shield/addon though... i wanted to use it to transmit images via a cheap 433 MHz transmitter/receiver back to my PC for Serial to OpenCV/Perl6 program :) | ||
16:14
pierre-vigier left
16:15
lsm joined,
zakharyas left
|
|||
azawawi | RabidGravy: the local electronics store did not have also an RPi2 box too... | 16:15 | |
RabidGravy: my luck :( | |||
RabidGravy | :-\ you can get an ov7670 based camera thing from nearly anywhere for a few quid | 16:16 | |
16:17
ely-se joined
|
|||
azawawi | anywhere but here... lol | 16:17 | |
b2gills | m: say $_ = log(2).base(10,17); say $_ == log 2 | 16:19 | |
camelia | rakudo-moar 3259ba: OUTPUT«0.69314718055994531True» | ||
azawawi | github.com/azawawi/perl6-opencv/bl...o-world.p6 # Loading image, grayscale, denoise and writing image and moving image preview windows :) | 16:25 | |
16:27
_Vi joined
|
|||
ely-se | Why does dir pass Strs to test and not IO::Paths? | 16:33 | |
16:34
balazs joined
|
|||
Skarsnik | I think it's because you can Str.IO | 16:35 | |
16:36
TimToady left
16:37
TimToady joined
16:40
pmurias joined
|
|||
dalek | p: 481d81a | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (3 files): [js] Use the same exception class for both types of exceptions thrown. |
16:41 | |
p: e71a1bd | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (2 files): [js] nqp::{push,pop,unshift,shift,splice} throw apropriate exceptions on fixed arrays. |
|||
ely-se | lucasb: I think this will do: gist.github.com/rightfold/0869cee15c3735b43417 | 16:51 | |
16:52
skids joined
|
|||
lucasb | ely-se: pretty cool :) just repeating that RabidGravy also mentioned File::Which. | 16:54 | |
ely-se | oh hmm didn't notice that | ||
16:56
xpen left
16:59
scz joined
17:04
DarthGandalf left
17:05
perl6newbee left
17:06
DarthGandalf joined
17:08
_Vi left
17:09
orbus left
17:10
_nadim joined
|
|||
gfldex | m: class C {}; class W {}; sub outer(::T $c){ sub (T){ &?ROUTINE.signature.say } }; my $inner = outer(C); $inner(C.new); $inner(W.new); | 17:12 | |
camelia | rakudo-moar 3259ba: OUTPUT«(T)Type check failed in binding <anon>; expected C but got W in sub at /tmp/RkOzlgeovb line 1 in block <unit> at /tmp/RkOzlgeovb line 1» | ||
gfldex | the type check is correct but stringy on the type capture in the inner function does not resolve the type | ||
17:13
sjoshi joined
|
|||
gfldex | m: class C {}; class W {}; sub outer(::T $c){ sub (T){ &?ROUTINE.signature.params[0].say } }; my $inner = outer(C); $inner(C.new); | 17:14 | |
camelia | rakudo-moar 3259ba: OUTPUT«T $» | ||
gfldex | m: class C {}; class W {}; sub outer(::T $c){ sub (T){ dd &?ROUTINE.signature.params[0], T === C } }; my $inner = outer(C); $inner(C.new); | 17:15 | |
camelia | rakudo-moar 3259ba: OUTPUT«T $Bool::True» | ||
gfldex | m: class C {}; class W {}; sub outer(::T $c){ sub (T){ dd &?ROUTINE.signature.params[0], T === C, T.new } }; my $inner = outer(C); $inner(C.new); | 17:16 | |
camelia | rakudo-moar 3259ba: OUTPUT«T $Bool::TrueC.new» | ||
gfldex grabs his rakudobug form | |||
dalek | p: d2f4787 | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (2 files): [js] Type checking on fixed arrays. |
17:18 | |
cognominal | perl6 verbose for one liner. Can I do better ? | 17:21 | |
$ a h | |||
alias h='history' | |||
$ a 6e | |||
alias 6e='perl6 -MMONKEY-SEE-NO-EVAL -e' | |||
$ h | 6e 'my $rx = EVAL "rx/@*ARGS[0]/"; $*IN.lines.grep($rx).tail(5).eager.join("\n").say' git | |||
nine | cognominal: just lines.grep is enough. The lines() sub uses $*IN by default | 17:27 | |
Also the .eager seems superfluous as the join needs to read all lines anyway | 17:28 | ||
17:30
brrt left
|
|||
cognominal | nope, lines uses $*IN if no arguments | 17:32 | |
thx anyway | |||
I mean if @*ARGS == 0 | 17:34 | ||
gfldex | do i have access to named arguments inside EXPORT ? | 17:36 | |
17:40
sjoshi left
|
|||
azawawi | m: sub c( &a (Int) ) {}; sub b($) {}; c( &b ) | 17:48 | |
camelia | rakudo-moar 3259ba: OUTPUT«Too few positionals passed; expected 1 argument but got 0 in sub-signature of parameter &a in sub c at /tmp/1w2aE5v0OB line 1 in block <unit> at /tmp/1w2aE5v0OB line 1» | ||
azawawi | what's wrong with the above code? | 17:49 | |
17:50
xinming_ joined
|
|||
timotimo | i think it has to be &a:(Int) | 17:50 | |
otherwise it tries to unpack &a into one positional argument that has to be an Int | |||
azawawi | so what's the correct syntax for doing it? | 17:52 | |
im trying to use callbacks via nativecall for value sliders | |||
gfldex | m: sub c( &a:(Int) ) {}; sub b($) {}; c( &b ) | ||
camelia | rakudo-moar 3259ba: OUTPUT«Constraint type check failed for parameter '&a' in sub c at /tmp/RN1HIQHyKL line 1 in block <unit> at /tmp/RN1HIQHyKL line 1» | ||
17:52
xinming left
|
|||
gfldex | m: sub c( &a:(Int) ) {}; sub b(Int $) {}; c( &b ) | 17:53 | |
camelia | ( no output ) | ||
17:55
_Vi joined
|
|||
azawawi | gfldex: thanks | 17:55 | |
so basically the documentation here is wrong, right? | 17:57 | ||
doc.perl6.org/language/nativecall#F..._arguments | |||
cognominal | If I don't want to go pure Perl6 I can do : | ||
$ a t5 | |||
alias t5='tail -5' | |||
$ h | 6ne '.say if /git/' | t5 | |||
with | 17:58 | ||
$ a 6ne | |||
alias 6ne='perl6 -MMONKEY-SEE-NO-EVAL -ne' | |||
18:04
olinkl joined
18:15
yurivish joined
|
|||
azawawi | github.com/azawawi/perl6-opencv/bl...o-world.p6 # slider callbacks are now working. Enjoy :) | 18:16 | |
18:16
abaugher left
|
|||
timotimo | azawawi: i wrote the correct syntax right before i told you what's wrong :S | 18:17 | |
then i went AFK | |||
18:17
abaugher joined
|
|||
azawawi | timotimo: fixed :) | 18:18 | |
ely-se | can a promise return a promise? | ||
timotimo | sure | ||
ely-se | nice | 18:19 | |
After the ECMAScript 6 Promise fiasco you can never be sure | 18:22 | ||
azawawi | pasteboard.co/QggG9WB.png # OpenCV fun with Perl 6 :) | ||
timotimo | i don't know anything about that, ely-se | ||
ely-se | timotimo: in ECMAScript 6, the then method automatically flattens. Thus you can't write any generic code that uses promises | 18:23 | |
basically then checks if the callback returns a Promise, and if it does, recurs | |||
timotimo | oh | 18:24 | |
RabidGravy | m: (await Promise.in(1).then({ Promise.in(1))).then({say "baa"}); | 18:30 | |
camelia | rakudo-moar 3259ba: OUTPUT«5===SORRY!5=== Error while compiling /tmp/5Z2kpkRBdFMissing blockat /tmp/5Z2kpkRBdF:1------> 3await Promise.in(1).then({ Promise.in(1)7⏏5)).then({say "baa"}); expecting any of: statement end statement modifier…» | ||
RabidGravy | m: (await Promise.in(1).then({ Promise.in(1)})).then({say "baa"}); | ||
camelia | ( no output ) | ||
pnu | should panda read the extra_statefiles from _all_ Installable repos in the repo-chain? -> github.com/tadzik/panda/pull/289 | ||
RabidGravy | m: await (await Promise.in(1).then({ Promise.in(1)})).then({say "baa"}); | ||
camelia | rakudo-moar 3259ba: OUTPUT«baa» | ||
18:33
abaugher left
18:34
ely-se left
18:41
abaugher joined
|
|||
MadcapJake | Translated a presentation on first-class commands into Perl 6 yesterday: github.com/MadcapJake/Command6 | 18:47 | |
18:48
lucasb left,
lostinfog joined
|
|||
grondilu | ~/perl6/rakudo $ git pull | 18:51 | |
Already up-to-date. | |||
^what's going on?? | |||
18:53
Peter__R joined
|
|||
MadcapJake | grondilu: git status; git branch | 18:54 | |
TimToady | or just don't pull so often :) | 18:55 | |
grondilu | :P | ||
TimToady | nobody's pushed to nom in the last 24 hours | 18:57 | |
must be some kind of a record :) | |||
RabidGravy | must be finished then | 19:00 | |
19:00
_nadim left,
_nadim joined
19:01
vendethiel- left
19:11
kjs_ joined
19:12
kjs_ left
19:13
kjs_ joined
19:15
kjs_ left,
kjs_ joined
|
|||
MadcapJake | is there a module for parsing Perl 6 | 19:16 | |
Skarsnik | Perl 6 ? | ||
MadcapJake | lol | ||
DrForr | It's written in Perl 6 grammars. | 19:17 | |
MadcapJake | So no module then? I need something that I could plug into a program. | ||
DrForr | Look at the Rakudo:: modules on modules.perl.org. | 19:18 | |
MadcapJake | sweet | ||
19:20
vendethiel joined
|
|||
MadcapJake | I'm gonna try and write a command line tool for generating autocompletes (also will have a linter but I think I'll write my own parser for that) | 19:20 | |
19:21
yurivish_ joined
|
|||
MadcapJake | I realized that writing a linter directly in JavaScript (for my linter-perl6 package) was not very modular, so I'm gonna write it in perl6 and then create easily parsed output for various linters/editors | 19:22 | |
RabidGravy | MadcapJake, the perl6 parser that it uses to parse the programs is available at runtime | 19:23 | |
this may however be overkill | |||
MadcapJake | well the problem is, that parser is setup to run the program. I think I'll need to create a custom parser for both features of this tool because I need to make sure it doesn't stop when there are errors, it just skips over whatever it doesn't understand | 19:24 | |
RabidGravy | well the actions are setup to run the program, you can just supply your own actions | 19:26 | |
MadcapJake | i could try that for sure but really i don't need to know everything. The autocomplete parser could just look for my/has/our/class/sub/[sub]method declarations and add the name to an array. | 19:28 | |
The linter parser I think I would actually have a pluggable grammar that you select which rules you want to check for in the META.info file. Something along the lines of eslint eslint.org/docs/user-guide/configuring.html but perhaps with some saner defaults | |||
pmurias | MadcapJake: why skip errors in a linter? | 19:34 | |
MadcapJake | pmurias: what do you mean? | ||
pmurias | MadcapJake: "I'll need to create a custom parser..." | 19:35 | |
MadcapJake | because `perl6 -c` stops at the first error, I want a linter to capture everything it can find in a file, not just the first error in the first stage that it hits. | ||
19:36
_nadim left
|
|||
gfldex | can i overload EXPORTALL? | 19:36 | |
19:36
kjs_ left
|
|||
pmurias | MadcapJake: keep in mind that it's literally imposible to parse Perl 6 with anything that's not Perl 6 | 19:37 | |
MadcapJake | pmurias: well I'm not trying to parse an executable program, I'm just looking for errors. So each rule will be setup to find a given kind of error. | 19:38 | |
but yes this program will be written in perl6 :) | |||
pmurias | MadcapJake: what sort of error do you want to find? | 19:39 | |
* errors | |||
cognominal | pmurias, MadcapJake is the great author of atom p6fe syntax hiliter and knows very well the limit of adhoc perl6 parsing | ||
MadcapJake, what is needed is an alternative dumper for --target=parse | 19:40 | ||
also the current dumper does not descend into EXPRs | 19:41 | ||
MadcapJake | that'd be one way to do it, but i still feel like you're limited by the fact that the parser is designed for creating an executable program. whereas an error parser could just have each rule be specifically designed for a given error. | ||
cognominal | apparently need a rewrite of the EXPR parser to do that | ||
MadcapJake++ for P6FE | 19:42 | ||
MadcapJake | pmurias: Good question! Anything that could be discovered via parsing the text of a file. | ||
19:42
vendethiel left
|
|||
MadcapJake | cognominal: thanks! Glad you like it! | 19:42 | |
19:44
_nadim joined
|
|||
cognominal | MadcapJake, also a good higlighter should be dynamic so that when cliking a operator it shows the relative precedences by higlighting the operator (say in backgournd red) and its operands (in background blue). I don't know any that does that. | 19:45 | |
19:45
vendethiel joined
19:46
ChoHag left
|
|||
MadcapJake | cognominal: yeah that would be really awesome! Actually I think that could be done in atom. A plugin could get the text of the file, the cursor location, and then just create some rules for what the surrounding text is, then apply some CSS! | 19:46 | |
cognominal | Really need a really iterate editing environment. The state of the art stopped at smalltalk which did not evolve :( | ||
Anyway, in the meantime P6FE is good stopgap | 19:47 | ||
jnthn | P6FE++ | ||
pmurias | for a lot of perlers the state of the art stopped at vim :/ | ||
19:48
AndyDee joined
|
|||
MadcapJake | I hope to add other cool packages to Atom, but I want to do the brunt of the computation in perl6 and then just have the atom packages be wrappers around shell commands | 19:48 | |
cognominal | MadcapJake, when learning a new language, very often someone is stalled because he can't visually parse the code. Dynamic highliting would fix that. | ||
P6FE++ indeed | |||
19:49
ChoHag joined
|
|||
cognominal | I am happy to see that jhntn is moving to atom | 19:49 | |
19:50
xnrand is now known as xrnand,
xrnand is now known as xnrand
|
|||
jnthn | Yeah, I need to get working (or patch) a multi-line editing module though... | 19:50 | |
19:51
Actualeyes left
|
|||
jnthn | The one I tried didn't seem to work, and I kinda can't live without it. | 19:51 | |
MadcapJake | multi-line editing module? | ||
19:51
ely-se joined
|
|||
MadcapJake | I use ctrl-click all the time to create multiple cursors. it even works with ctrl-double-click | 19:52 | |
cognominal | MadcapJake, is there any way in atom to compile nqp/rakudo and click on the error message to open the relevant file?. Especially difficult in nqp because the compilation units are concatenated files. | 19:53 | |
jnthn | MadcapJake: ooh | 19:54 | |
ely-se | > ‘rule’ causes whitespace in the regex to match literal whitespace in the matched text | ||
Is this still true? | |||
jnthn | MadcapJake: So is there a keyboard shortcut for that? | ||
ely-se | I am so confused. | ||
19:55
_nadim left
|
|||
jnthn | ely-se: Yes, inserts calls to <.ws> where there is whitespace between atoms | 19:55 | |
ely-se | oh ok | ||
does the default <.ws> match optional whitespace or required whitespace? | |||
jnthn | rule foo { bar baz } = token foo { bar <.ws> baz <.ws> } iirc | ||
ely-se: required between alphanumeric, optional otherwise | 19:56 | ||
ely-se | ok, that explains | ||
jnthn | But you can override ws to do whatever you want | ||
MadcapJake | you could compile via atombuild.github.io - it supports GNU Make. I've never used it with make so I don't know if it matches error paths to files or not, but I know that atom-build *does* support that | ||
cognominal: ^ | |||
jnthn | MadcapJake: The one that's wired into my fingers is Alt + Shift + Up/Down arrow keys, which is what I'd really love to have work | 19:57 | |
MadcapJake | jnthn: those should work in atom | ||
jnthn: it works on my end | 19:58 | ||
cognominal | MadCapJake, multiple cursors are great in atom. I have yet to understand all the subtleties, though | ||
Skarsnik | multi cursors? x) | ||
jnthn | MadcapJake: Odd...it doesn't here... | ||
MadcapJake: Version 1.2.3 fwiw | |||
cognominal | also, I use an emacs compatibility module so I can use my finger memory in atom. | 19:59 | |
thx MadcapJake, i will check it | |||
MadcapJake | jnthn: try `ctrl-shift-p` and type `add selection` and you should see two options for add above below, and there key shortcut next to it | ||
jnthn | MadcapJake: Aha, Ctrl + Alt + Up/Down | 20:00 | |
Thanks a lot! :) | |||
MadcapJake | jnthn: no prob! curious why your shortcut is different. | 20:01 | |
ely-se | are there any tools for grammar debugging? | ||
jnthn | ely-se: Grammar::Tracer is one of the most useful...has a bug I should really patch, but tends to help quite a bit anyways | ||
MadcapJake: Dunno. I'm on Windows...though Notepad++ has Alt + Shift + Up/Down... | 20:02 | ||
MadcapJake | jnthn: ahh, yeah i'm on linux, mine is alt-shift-up/down | ||
jnthn guesses he can find where to tweak this... :) | |||
ely-se | jnthn: thanks | 20:03 | |
azawawi | github.com/azawawi/perl6-opencv/bl...drawing.p6 # random rectangle fun with OpenCV/Perl6 :) | ||
MadcapJake | jnthn: i think i know why it's different for me: ctrl-alt-up/down is for linux desktop switching | 20:05 | |
cognominal | jnthn++ for the not guts serie. jnthn got the guts to not gut. | ||
jnthn | MadcapJake: Ah, OK. :) | 20:06 | |
MadcapJake: Just found out how to make it what I want it to be in my custom keymap :) | |||
azawawi | pasteboard.co/Qn7mN5C.png # Camelia randomness :) | 20:07 | |
jnthn | So, don't even have to re-muscle \o/ | ||
20:07
yurivis__ joined
|
|||
MadcapJake | jnthn: nice! | 20:08 | |
20:09
kjs_ joined,
domidumont left,
yurivish_ left
20:10
domidumont joined
20:11
pierre-vigier joined
20:13
domidumont left
20:15
pierre-vigier left,
leont joined
|
|||
ely-se | jnthn: can you print the remaining text with the debugger? | 20:16 | |
20:19
protium joined
|
|||
jnthn | ely-se: um...I can't remember...if you type help or so it'll tell you all the things it knows how to do. | 20:21 | |
ely-se | printing text isn't in there, hence :p | 20:22 | |
20:23
pmqs_ joined
|
|||
ely-se | something like {say $/.postmatch} in the regex maybe | 20:24 | |
ah, adding <ws> to the begin of TOP already helps | 20:25 | ||
jnthn | ely-se: Feel free to make a github issue requesting what you missed | 20:26 | |
20:26
darutoko left
|
|||
jnthn | I'd like to fix the LTM bug that folks sometimes hit in the next couple of weeks, so can probably put it what you're after also. :) | 20:26 | |
20:26
Zero_Dogg left
20:27
pmqs left,
Zero_Dogg joined,
Zero_Dogg left,
Zero_Dogg joined
|
|||
ely-se | yay my parser finally works \o/ | 20:28 | |
20:28
marmay_ joined
|
|||
jnthn | \o/ | 20:30 | |
ely-se | I forgot to implement some actions so it croaked. | 20:31 | |
20:31
kjs_ left
20:33
cooper left,
bowtie left
20:34
kjs_ joined,
shmibs left,
bowtie joined
20:37
rurban1 joined
20:38
rurban left
20:41
shmibs joined
20:45
BenGoldberg joined
|
|||
azawawi | Good night #perl6 | 20:47 | |
20:50
kjs_ left
|
|||
rindolf | azawawi: night. | 20:50 | |
20:54
CIAvash left
20:56
revhippie joined
|
|||
autarch | is there any way to make "CALLER::MY::<$foo> = ..." work if $foo hasn't been declared at all yet? | 21:02 | |
m: sub foo { CALLER::MY::<$foo> = 42 }; foo(); dd MY::' | 21:03 | ||
camelia | rakudo-moar 3259ba: OUTPUT«5===SORRY!5=== Error while compiling /tmp/uF1K5NyCrqTwo terms in a rowat /tmp/uF1K5NyCrq:1------> 3ALLER::MY::<$foo> = 42 }; foo(); dd MY::7⏏5' expecting any of: infix infix stopper postfix s…» | ||
autarch | m: sub foo { CALLER::MY::<$foo> = 42 }; foo(); dd MY:: | ||
camelia | rakudo-moar 3259ba: OUTPUT«Cannot modify an immutable Nil in sub foo at /tmp/Z2gC93ZO2M line 1 in block <unit> at /tmp/Z2gC93ZO2M line 1» | ||
autarch | m: sub foo { CALLER::MY::<$foo> = 42 }; my $foo is dynamic; foo(); dd MY:: | ||
camelia | rakudo-moar 3259ba: OUTPUT«PseudoStash.new(("!UNIT_MARKER" => !UNIT_MARKER,"\$!" => Nil,"\$/" => Nil,"\$=finish" => Mu,"\$=pod" => [],"\$?PACKAGE" => GLOBAL,"\$_" => Any,"\$foo" => 42,"\$¢" => Nil,"\&foo" => sub foo () { #`(Sub|54728688) ... },"::?PACKAGE" => GLOBAL,:EXPORT(EXPORT)…» | ||
21:05
azawawi left
|
|||
masak | m: sub foo { CALLER::MY::<$foo> = 42 }; my $foo; foo(); say "alive" | 21:05 | |
camelia | rakudo-moar 3259ba: OUTPUT«alive» | ||
masak | autarch: not sure what more beyond that you want. | ||
autarch | masak: I want to not have to declare $foo at all | ||
jnthn | Lexpads are immutable at runtime. | 21:06 | |
autarch | basically, I want a way of putting some sort of marker in the caller's scope so I can later find it by looking at the packages in a trace | ||
jnthn | (A large amount of Perl 6's optimizability and error checking derives from that.) | ||
So it'd need to be something that happens at compile time, like an import or use statement. | |||
Ulti | Skarsnik have you seen github.com/andydude/p6-c-parser | 21:07 | |
masak | or a macro. | ||
autarch | jnthn: that makes sense | ||
jnthn | masak: I was going with things that work today | 21:08 | |
autarch: Do you need to make the thing statically or dynamically? | |||
autarch | jnthn: dynamically | ||
21:08
marmay_ left
|
|||
autarch | I'm trying to track the caller of a sub, but from elsewhere in the code | 21:08 | |
but I'm probably making this harder than it needs to be and I can just capture the caller immediately and save it somewhere | 21:09 | ||
jnthn | Wait, maybe that wasn't clear. Do you need to mark the block, or do you need to mark a particular invocation record? | ||
callframe(1).code does role { method marker() { True } } # may work if you can cope with marking the block itself | |||
autarch | yeah, that wouldn't work, the markers needs to go away once the called sub exitrs | 21:11 | |
ely-se | is it bad to override clone? | ||
jnthn | ely-se: No, it's fine | ||
ely-se | ok :) | ||
jnthn | autarch: Yeah, then we meant the same thing by dynamic... | 21:12 | |
autarch | yep | ||
Skarsnik | Ulti, yes, but it's quite useless in its actual form x) And it's probably unreasonnable to use something else that a gcc/clang output x) | 21:13 | |
anyway, good night here | 21:14 | ||
21:16
Skarsnik left
|
|||
Ulti | g'night | 21:18 | |
dalek | p: 7c7ea34 | (Pawel Murias)++ | src/vm/js/nqp-runtime/reprs.js: [js] Serialize MultiDimArray. |
21:22 | |
ely-se | can you assign a private property of another object of the same class? | ||
pmurias | autarch: what are you trying to accomplish? | 21:25 | |
autarch | pmurias: I want to be able to find the caller of a particular sub (or subs) several layers further down the callstack | ||
and I don't know what sub is being called in advance, so the subs themselves need a way to say "my caller is the one you're looking for" | |||
pmurias | why do you need to that? | 21:26 | |
cognominal | jnthn, "lexpads are immutable at run time", assuming no EVAL in inner lexical scopes? | ||
masak | cognominal: that's not an exception to the rule. | ||
ely-se | hmm, it seems temp borks when used with a hash with non-string keys | ||
masak | cognominal: the variable declarations stay within the inner scopes. EVAL has its own compile time. | ||
autarch | pmurias: in order to provide useful error messages, basically | ||
cognominal | anyway it needs MONKEY-SEE-NO-EVAL | 21:27 | |
autarch | in other words, if I call foo() which then calls 5 other things and one of those things generates an error, ideally that error says "called at line X" which is the line where foo() was called | ||
ely-se | m: my %h{Pair}; %h{a => 1} = 42; temp %h = %h.clone; | ||
camelia | rakudo-moar 3259ba: OUTPUT«Type check failed in binding key; expected Pair but got Str in block <unit> at /tmp/7YVkdzDeCu line 1» | ||
ely-se | m: my %h{Pair}; %h{a => 1} = 42; temp %h{Pair} = %h.clone; | 21:28 | |
camelia | ( no output ) | ||
ely-se | interesting | ||
cognominal | ok, EVAL means a new lexical scope so it can't mess with outer scopes | ||
jnthn | ely-se: Feel free to file that one | ||
ely-se | oh right, that assigns the Pair property | ||
jnthn: ok | |||
jnthn | cognominal: Correct. | 21:29 | |
ely-se | where should I report it? Rakudo? | ||
pmurias | autarch: something like Carp? | ||
cognominal | so the REPL implies more nesting at each line? | ||
timotimo | yo | ||
yeah, that's how it's implemented right now :( | |||
autarch | pmurias: yes, but to an arbitrary depth that isn't known in advance ;) | ||
cognominal | so the REPL implies one more lexical nesting at each newline line? # reformulated | 21:30 | |
timotimo | cognominal: yes | ||
jnthn | ely-se: Mail [email@hidden.address] | ||
21:31
robfin joined
|
|||
ely-se | jnthn: done | 21:33 | |
robfin | how to call method with method-name contained in scaler string, like calling $obj.{$ChosenMethod} | ||
jnthn | $obj."$ChosenMethod"() | ||
robfin | perfect thanks! | 21:34 | |
21:35
cpage_ left,
_nadim joined
|
|||
masak | robfin: note you need the parens at the end -- otherwise Perl 6 will assume you're confused and maybe trying to do Perl 5 style string concatenation | 21:35 | |
m: my $obj; my $ChosenMethod; $obj."$ChosenMethod" | |||
camelia | rakudo-moar 3259ba: OUTPUT«5===SORRY!5=== Error while compiling /tmp/eTPxYKs946Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.at /tmp/eTPxYKs946:1------> 3; my $ChosenMethod; $obj."$ChosenMethod"7⏏5<EOL>» | ||
ely-se | I'll use LEAVE for now then | 21:36 | |
robfin | got it. thanks to you all | 21:38 | |
21:41
uruwi joined
|
|||
uruwi | Hi | 21:42 | |
21:43
ChoHag left
|
|||
jnthn | sleep & | 21:43 | |
uruwi | m: multi sub trait_mod:<is> (Attribute:D $attr, :$transient!) { }; class A { has $!a; has $!b is transient }; say trait_mod:<is>(A.^attributes[1], :transient) | 21:44 | |
camelia | rakudo-moar 3259ba: OUTPUT«Nil» | ||
uruwi | m: multi sub trait_mod:<is> (Attribute:D $attr, :$transient!) { True }; class A { has $!a; has $!b is transient }; say trait_mod:<is>(A.^attributes[1], :transient) | ||
camelia | rakudo-moar 3259ba: OUTPUT«True» | ||
uruwi | m: multi sub trait_mod:<is> (Attribute:D $attr, :$transient!) { True }; class A { has $!a; has $!b is transient }; say trait_mod:<is>(A.^attributes[1], :transient); my $a = A.new(a => 1, b => 2) | 21:45 | |
camelia | rakudo-moar 3259ba: OUTPUT«True» | ||
uruwi | m: multi sub trait_mod:<is> (Attribute:D $attr, :$transient!) { True }; class A { has $!a; has $!b is transient }; say trait_mod:<is>(A.^attributes[1], :transient); my $a = A.new(a => 1, b => 2); say $a; | ||
camelia | rakudo-moar 3259ba: OUTPUT«TrueA.new» | ||
uruwi | m: multi sub trait_mod:<is> (Attribute:D $attr, :$transient!) { True }; class A { has $.a; has $.b is transient }; say trait_mod:<is>(A.^attributes[1], :transient); my $a = A.new(a => 1, b => 2); say $a; | ||
camelia | rakudo-moar 3259ba: OUTPUT«TrueA.new(a => 1, b => 2)» | ||
21:45
ChoHag joined
|
|||
uruwi | m: multi sub trait_mod:<is> (Attribute:D $attr, :$transient!) { True }; class A { has $.a; has $.b is transient }; say trait_mod:<is>(A.^attributes[$_], :transient) for ^2; my $a = A.new(a => 1, b => 2); say $a; | 21:46 | |
camelia | rakudo-moar 3259ba: OUTPUT«TrueTrueA.new(a => 1, b => 2)» | ||
uruwi | m: multi sub trait_mod:<is> (Attribute:D $attr, :$transient!) { False }; class A { has $.a; has $.b is transient }; say trait_mod:<is>(A.^attributes[$_], :transient) for ^2; my $a = A.new(a => 1, b => 2); say $a; | ||
camelia | rakudo-moar 3259ba: OUTPUT«FalseFalseA.new(a => 1, b => 2)» | ||
uruwi | m: multi sub trait_mod:<is> (Attribute:D $attr, :$transient!) { True }; class A { has $.a; has $.b is transient }; say trait_mod:<is>(A.^attributes[$_], :transient) for ^2; my $a = A.new(a => 1, b => 2); say $a; | ||
camelia | rakudo-moar 3259ba: OUTPUT«TrueTrueA.new(a => 1, b => 2)» | ||
masak | uruwi: there's also /msg camelia ... | ||
uruwi | I was going to ask for help. | ||
masak | uruwi: if you feel like you're spamming #perl6 or something | ||
uruwi: I'm not sure what you want to do above. mostly I'm just hypnotized by a dozen similar-looking one-liners | 21:47 | ||
uruwi | Trying to add an `is transient` trait so I can introspect objects for serialization. | 21:48 | |
masak | why are you trying to add it both with an explicit `is transient` and then also with a run-time call? | ||
why don't you actually do something useful in the `trait_mod:<is>` sub? | 21:49 | ||
have you considered that `True` isn't enough? :) | |||
uruwi | I'm adding the `is transient` in the class definition, then trying to see which fields have it during runtime. | ||
masak | I think you're overestimating the magic that goes on with trait mods | ||
you need to actually do something in the sub | 21:50 | ||
typically, use `does` and mix in a role of some kind | |||
which you can then introspect on the attribute using ~~ | |||
uruwi | Ah, thanks! | 21:51 | |
ely-se | I have a real hard time understanding the behaviour of clone | 21:52 | |
masak | ely-se: .clone is similar to .new | 21:53 | |
ely-se: except it inherits attributes from the old object, which can then be overridden | |||
ely-se: so `my $obj = C.new(:foo(1), :bar("mwhahaha")); my $obj2 = $obj.clone(:bar(2));` would create a C object with :foo(1) and :bar(2) | 21:54 | ||
ely-se: but I bet you know this, and are confused by something else ;) | |||
ely-se | masak: gist.github.com/rightfold/bd6447b6f03f6b539a80 | 21:55 | |
the last line I expected to print only "(a => 1) => 2" | 21:56 | ||
but it seems that $c.clone.n affects %!h of the original C | |||
geekosaur | isn't clone shallow? | 21:59 | |
masak | ely-se: I'm confused by line 19. which seems to override the %!h in the *original* object. | ||
ely-se: recall that .clone is called on the original object, not on the clone | |||
ely-se | masak: it swaps them, effectively | ||
masak | ok, I suspected that's what you were doing | 22:00 | |
22:00
robfin left
|
|||
ely-se | I'd use temp but temp is broken for hashes with non-string keys | 22:00 | |
masak | maybe that doesn't work, for whatever reason? | ||
ely-se: you can use .WHICH to see if you actually have two distinct hashes in the two objects | |||
ely-se | callsame uses the original %!h, then the original %!h is overwritten with a clone | ||
masak: let's see | |||
22:00
kjs_ joined
|
|||
masak | ely-se: it's a cute pattern, cloning the original object's hash. don't believe I've seen that before. ely-se++ | 22:01 | |
ely-se | they are the same hash | ||
22:01
kjs_ left
|
|||
ely-se | WHICH returns the same value for both | 22:01 | |
Hash' clone method works though. It returns a new hash | 22:03 | ||
m: my %h{Pair}; my %i{Pair} = %h.clone; %h.WHICH.say; %i.WHICH.say; | 22:04 | ||
camelia | rakudo-moar 3259ba: OUTPUT«Hash[Any,Pair]|78748640Hash[Any,Pair]|78748752» | ||
masak | m: class C { has %.h; method clone { C.new(:h( %!h.clone )) } }; my $c = C.new; say $c.h.WHICH; say $c.clone.h.WHICH | 22:07 | |
camelia | rakudo-moar 3259ba: OUTPUT«Hash|66908304Hash|66908352» | ||
masak | that works too | ||
ely-se | I don't want it public though | ||
masak | I just wanted to be able to test it easily here | ||
ely-se | I have mutators. | 22:08 | |
maybe I'll just call new and then loop over the original hash and call the mutators | |||
though I do want to know why this doesn't work | |||
masak | m: class C { has %.h; method clone { my $result = callsame(); %!h .= clone; $result } }; my $c = C.new; say $c.h.WHICH; say $c.clone.h.WHICH | ||
camelia | rakudo-moar 3259ba: OUTPUT«Hash|52028064Hash|52028064» | ||
masak | that... doesn't work. | ||
ely-se | very strange | ||
it should shouldn't it | 22:09 | ||
masak | and we can see that the way it doesn't work is that it doesn't replace the %!h in the original object | ||
m: class C { has %.h; method clone { my $result = callsame(); $result } }; my $c = C.new; say $c.h.WHICH; say $c.clone.h.WHICH | 22:10 | ||
camelia | rakudo-moar 3259ba: OUTPUT«Hash|48279952Hash|48279952» | ||
masak | i.e. the `%!h .= clone;` statement has no measurable effect | ||
ely-se | maybe clone can't mutate the original | ||
masak | well, it's not throwing any error | 22:11 | |
ely-se | what about non-hash attributes? | ||
masak | and I don't see why it shouldn't be able to. it's just a normal method | ||
22:12
rindolf left,
pierre-vigier joined
|
|||
ely-se | m: class C { has $.x; method clone { my $result = callsame; $!x = 1 => 2; $result } }; my $c = C.new; say $c.x.WHICH; $c.x = 5 => 6; say $c.clone.x.WHICH | 22:12 | |
camelia | rakudo-moar 3259ba: OUTPUT«AnyCannot modify an immutable Any in block <unit> at /tmp/fe3D2wrhse line 1» | ||
ely-se | m: class C { has $.x is rw; method clone { my $result = callsame; $!x = 1 => 2; $result } }; my $c = C.new; $c.x = 5 => 6; say $c.x.WHICH; say $c.clone.x.WHICH | 22:13 | |
camelia | rakudo-moar 3259ba: OUTPUT«Pair|Int|5|Int|6Pair|Int|5|Int|6» | ||
ely-se | oh lol | ||
pairs are immutable | |||
22:13
kaare_ left
|
|||
ely-se | Ahh wait, don't hashes assign in list context? | 22:13 | |
it stays the original hash | |||
it slurps instead of reassigning reference | |||
masak | ely-se: aaaaaah | 22:15 | |
ely-se | that's nasty | ||
masak | ely-se: maybe binding would work, then | ||
ely-se | nope, lol | ||
Type check failed in binding; expected Associative[Any,Pair] but got Hash[Any,Pair] | |||
masak | m: class C { has %.h; method clone { my $result = callsame(); %!h := %!h.clone; $result } }; my $c = C.new; say $c.h.WHICH; say $c.clone.h.WHICH | ||
camelia | rakudo-moar 3259ba: OUTPUT«Hash|73343744Hash|73343744» | ||
masak | um, uh? | ||
ely-se | which is stupid considering doc.perl6.org/images/type-graph-Hash.png | ||
masak | agreed | 22:16 | |
ely-se has no idea what is going on | |||
22:16
pierre-vigier left
|
|||
masak | ely-se: I think you have enough to submit a rakudobug, if you haven't already ;) | 22:17 | |
ely-se | yummy, shrimps | ||
m: my %h; %h := %h.clone; | 22:18 | ||
Ulti | ~/win 5 | ||
camelia | ( no output ) | ||
ely-se | m: class C { my %!h; method m { %!h := %!h.clone } }; C.new.m | 22:19 | |
camelia | rakudo-moar 3259ba: OUTPUT«Use of uninitialized value of type Any in string contextAny of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in any throw at src/Perl6/World.nqp line 37405===SORRY!5=== Error while compiling /tmp/15XJNu7GCsCannot us…» | ||
ely-se | wtf | ||
masak | seems you got an error during the throwing of an error :/ | 22:20 | |
ely-se | we can conclude that hashes are broken :P | ||
time to submit my second bug today | 22:21 | ||
masak | aye | ||
ely-se | HUH | 22:22 | |
now it works | |||
ah, it works only if the key type isn't set | 22:23 | ||
22:35
AlexDaniel joined
22:38
bpmedley left
|
|||
ely-se | hmm, it seems IO::Pipe.new isn't useful | 22:47 | |
oh, need to call IO::Pipe.pair | |||
22:47
yqt joined
|
|||
ely-se | which is not implemented xD | 22:48 | |
22:51
zacts left
22:56
zacts joined
22:58
espadrine left
22:59
pmurias left
|
|||
ely-se | can I create an IO::Handle from an Int file descriptor? | 23:06 | |
geekosaur | @index fdToHandle | ||
hm, did i break it? | 23:07 | ||
hackage.haskell.org/package/unix/do...fdToHandle | |||
also System.Posix.IO | 23:08 | ||
ely-se | geekosaur: Perl 6, not Haskell | ||
geekosaur | whoops, I am doing poorly today | ||
xenu | :D | ||
geekosaur | I onlu realized thechannel error when I tried to figure out the bot | ||
ely-se | :P | ||
geekosaur | I think... fd to handle has issues? because libuv wants to hide it | 23:09 | |
geekosaur got less sleep than intended last night and is still having coughing fits so naps are out :/ | |||
ely-se | guess I'll open from /proc/seld/fd/* | 23:14 | |
if that works | |||
geekosaur | there's some internal thing iirc that can get the fd, for some things. (sockets were a problem iirc) | 23:16 | |
ely-se | I don't want to get the fd. I have the fd and want to get an IO::Handle object | ||
geekosaur | yeh, but if you can't go one way easily you usually can't go theother way easily either | 23:17 | |
like, if you have an fd for a socket, you are already nonportable and libuv really wants to be portable. (windows sockets aren't fds) | 23:18 | ||
ely-se | eww gist.github.com/rightfold/eab266b8...m6-L12-L13 | 23:21 | |
but at least it works :p | |||
23:30
kjs_ joined,
lichtkind joined
|
|||
zostay | m: for cross(0..2, 0..2) -> ($x, $y) { say ++$ } | 23:35 | |
camelia | rakudo-moar 3259ba: OUTPUT«123456789» | ||
yoleaux | 7 Jan 2016 13:53Z <hoelzro> zostay: could you ping me when you have a chance? I have ideas about your abort() woes | ||
zostay | m: my $a = 0..2; my $b = 0..2; for cross($a, $b) -> ($x, $y) { say ++$ } | ||
camelia | rakudo-moar 3259ba: OUTPUT«1» | ||
zostay | why are those two lines different? | ||
or better question: how do i make the second behave like the first? | 23:36 | ||
abaugher | I've used rakudobrew to build moar 2015.12 and panda. Now when I try to install modules with panda it says "Please remove leading 'v' from perl version in Text::CSV's meta info. Text::CSV requires Perl version 6.0.0. Cannot continue." | 23:37 | |
Is there a way I can get panda to ignore that, or otherwise make it work? --force and --notests don't get past it. | |||
skids | I had to remove 6.0.0 and just put 6 in all my modules. | 23:39 | |
zostay | m: my $a = 0..2; my $b = 0..2; for cross($a.list, $b.list) -> ($x, $y) { say ++$ } # the best i can come up with | 23:42 | |
camelia | rakudo-moar 3259ba: OUTPUT«123456789» | ||
skids | m: my @a = 0..2; my @b = 0..2; for cross(@a, @b) -> ($x, $y) { say ++$ } | ||
camelia | rakudo-moar 3259ba: OUTPUT«123456789» | ||
AlexDaniel | zostay: why do you expect $a to work like array? | 23:43 | |
m: my $a = 0..2; my $b = 0..2; for cross(@$a, @$b) -> ($x, $y) { say ++$ } | 23:44 | ||
camelia | rakudo-moar 3259ba: OUTPUT«123456789» | ||
23:50
yurivis__ left
23:55
jvcakg joined
|
|||
jvcakg | Greetings | 23:57 | |
23:59
scz left
|
|||
zostay | AlexDaniel: because i've been messing with perl 6 for months and what i expect from things is still catching up from all the changes in the last few months | 23:59 |