»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋 Set by Zoffix on 25 July 2018. |
|||
00:00
reportable6 left
00:03
reportable6 joined
|
|||
timotimo | nice. | 00:04 | |
not quite as effective when + and ~ are different operators though | |||
00:20
Cabanoss- left
00:30
Cabanossi joined
00:34
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
pilne | would a rough/quick/dirty way to get solid gtk3 bindings just to use nativecall on the c libs? | 00:36 | |
or will that induce too many problems with input lag? | |||
Xliff | m: say (! !) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Prefix ! requires an argument, but no valid term found at <tmp>:1 ------> 3say (! !7⏏5) expecting any of: prefix |
00:37 | |
Xliff | m: say !() | ||
camelia | True | ||
timotimo | Xliff: you want to throw some gtk bindings at pilne? | ||
pilne | i mean.... at the moment i'm just a very enthusiastic rookie at doing anything with perl6 :D | 00:38 | |
Xliff | pilne: There's GTK::Simple, which just gets you to the GUI goodness. | ||
Or my project, which attemps to port the whole thing. | |||
github.com/Xliff/p6-GtkPlus | |||
00:38
wildtrees left
|
|||
pilne | tyvm | 00:40 | |
i really do love how just skimming idiomatic perl6 just reads like it works (at least mostly from what i've encountered) | |||
Xliff | pilne: I know. I love it! | 00:42 | |
pilne | that's one thing that i always liked about perl5 being more concered with data structure than type, i know p6 approaches sig/twigles differently, but it it still awesome | 00:44 | |
Xliff | pilne: If you are looking for something specific from GTK in Perl6 and it's not there, please let me know. | ||
Also, p6-GtkPlus does take a bit to build. That's one of the reasons it's only available via git. | |||
I've updated the installation instructions on the bottom of the project page. | 00:45 | ||
00:47
aborazmeh left
|
|||
pilne | nice | 00:47 | |
00:48
kybr joined
|
|||
Xliff | m: say +!() | 00:49 | |
camelia | 1 | ||
Xliff | m: say ! +!() | ||
camelia | False | 00:50 | |
Xliff | m: say ! ! +!() | ||
camelia | True | ||
Xliff | m: say ! ! !() + ! !() | ||
camelia | 1 | ||
Xliff | m: say ! !() + ! !() | ||
camelia | 0 | ||
Xliff | m: say ! !() ~ ! !() | 00:51 | |
camelia | FalseFalse | ||
Xliff | m: say !() + !() + !() + !() | ||
camelia | 4 | ||
Xliff | m: say !() + !() + !() + !() ~ !() + !() | ||
camelia | 42 | ||
Xliff | :P | ||
say () | 00:52 | ||
m: say () | |||
camelia | () | ||
Xliff | m: say (!() + !() + !() + !() ~ !() + !()) / 2 | 00:54 | |
camelia | 21 | ||
timotimo | is / 2 allowed? | ||
Xliff | say "42" / 2 | ||
m: say "42" / 2 | |||
camelia | 21 | ||
timotimo | you can * ! !() | ||
Xliff | m: say (!() + !() + !() + !() ~ !() + !()) / (!() + !()) | 00:55 | |
camelia | 21 | ||
Xliff | m: say (!() + !() + !() + !() ~ !() + !()) / !() + !() | ||
camelia | 43 | ||
Xliff | m: say !() + !() + !() + !() ~ !() + !() / !() + !() | ||
camelia | 43 | ||
Xliff | m: say !() + !() + !() + !() ~ !() + !() / (!() + !()) | ||
camelia | 41.5 | ||
Xliff | m: say (!() + !() + !() + !() ~ !() + !()) / (!() + !()) | 00:56 | |
camelia | 21 | ||
Xliff | This is 'urtin' me brayne. | ||
timotimo | m: say +(()+()) | 01:00 | |
camelia | 0 | ||
timotimo | ah of course | ||
m: say +(!()) | |||
camelia | 1 | 01:01 | |
timotimo | oh, no need for that | ||
01:03
Xliff left
|
|||
irced spontaneously combusts. | 01:09 | ||
pilne | if a different low-level language than c, exposes a c abi, would nativecall theoretically work with it? | 01:10 | |
timotimo | sure | 01:11 | |
Elronnd | pilne: it even works with high-level languages other than c that expose c abis | 01:16 | |
irced says "far out" as he waves his hand in front of his face. | 01:17 | ||
pilne | i think perl6 is the best example of an "anti bondage-and-discipline" language i've ever seen | ||
Elronnd | nah that's just how c abi works | ||
at least in this case | 01:18 | ||
irced leaves a trail of flames. | |||
Elronnd eats the flames | |||
irced must be hallucinating. | 01:19 | ||
pilne | i mean, perl6 encourages writing code in a way that is completely natural to how the programmer is thinking, and provides incredible tools for interfacing with other langauges. | ||
Elronnd | I mean, I agree with you in general, but nativecall is nothing special | 01:20 | |
in fact, it's kind of mediocre when you get to more complicated c libs | |||
pilne | fair enough | 01:21 | |
irced | Elronnd: in other words, it can become a lot of work to implement a c library with a gazillion functions? | 01:22 | |
pilne | i haven't dove deep at all... i'm still coming back to things after realizing that since i *am* just a hobbyist doing this for fun, there's absolutely no reason for me to learn a language i'm not having fun with (: | ||
Elronnd | irced: gazillion functions are fine, but if you want to pass complex buffer or pointer types then it gets hairy | ||
irced | Elronnd: oh i see, like type casting a pointer maybe? | 01:23 | |
Elronnd: or not, that can all be done in the library as needed. | 01:24 | ||
Elronnd | well, as an example, one time I had a c library that had a bunch of nested structs and unions | ||
irced scratches his chin. | |||
Elronnd | and I gave up trying to implement it in perl6, because you have to make a separate named class for each one whereas it can all be inline in c | ||
pilne | that does sound a bit icky | 01:25 | |
irced | Elronnd: oh, i see. i only perused the native call docs as of yet, and i recall some details that would lead me to agree with you. | ||
Elronnd: so i guess the solution would be to wrap the library with your own library that maybe defines macros for such ... or simply pointers. | 01:28 | ||
Elronnd: seems plausible | 01:29 | ||
Elronnd: assuming macro calls are possible. just thinking out loud here. | |||
Elronnd: so like a struct that flattens the nested structs. | 01:30 | ||
Elronnd: might reduce the "coding footprint". alternatively, you might be able to automate the native call definitions. | 01:31 | ||
Elronnd | yes. All of those are possibilities | ||
automated binding generators are a thing. I don't think they're a thing in perl6 | 01:32 | ||
Macro calls are definitely not possible | |||
in my own project (which is hybrid p6/c), I gave up on actually passing data back and forth, and just use a pointer which is an opaque pointer from the p6 side | |||
irced | automated binding generators can be a custom thing, and not fully automated. | ||
like code generation based on inputs such as a self written list and maybe some rules | 01:34 | ||
Elronnd | that is true | ||
irced | Elronnd: tell us more about native call. what do you mean opaque pointer? | 01:35 | |
Elronnd | on C side I have typedef struct { whatever; } Blah; | 01:36 | |
irced | Ok, starting with struct Blah | ||
Elronnd | Blah *make_bla(); and then bunch of functions that do things with a Blah* instance | ||
on Perl6 side, straight up Pointer bla = make_bla(); | |||
err | |||
my Pointer $bla | |||
irced | ah, so basically you write c in a purist OOP style, no direct attribute access? | 01:37 | |
Elronnd | well | ||
the c code doesn't work like that | |||
only the perl6 code | |||
irced | and you're using pointers to functions in the struct? | ||
Elronnd | no | ||
struct is only for data | |||
irced | as typical. | 01:38 | |
Elronnd | yes | ||
although I do do the OOP func pointer thing in another pure-c project | |||
irced | cool. so the functions that do things with the Blah* instance are in the p6 code? | ||
aside: yeah the OOP function pointer thing is not all bad. | 01:40 | ||
aside: just another way to do things. | |||
aside: though i think it's been frowned upon because it obfuscates debuggers (though this i have not confirmed) | 01:43 | ||
Elronnd | it's been frowned upon? | ||
01:43
noisegul_ joined
|
|||
irced | aside: conceivably could affect optimization | 01:43 | |
Elronnd: just web chatter i've come across. | |||
Elronnd: anyway, thanks for sharing your nativecall experiences! | 01:44 | ||
01:46
noisegul left
01:53
khisanth_ left
01:54
harmil left
02:05
Manifest0 left,
Manifest0 joined
02:06
khisanth_ joined
02:11
pilne left
02:14
uid9164 joined,
irced left
|
|||
uid9164 | What's the difference between Num, Real, Rat? I want to define $a = 6/7, and $a can be val(str $str). | 02:16 | |
Which type is the most common choice? In c# I only use "single", so I am a bit not used to this. | 02:17 | ||
02:20
epony joined
02:27
crella_ joined,
Cabanossi left
02:31
uid9164 left
02:33
Cabanossi joined
03:19
aindilis left
03:28
aindilis joined
|
|||
crella_ | How should I define a multiline string in perl6 like <xml>? In my country we can't access google legally, so I can hardly get useful result... | 03:36 | |
Elronnd | crella_: can you use startpage.com or duckduckgo.com or bing.com? | 03:49 | |
crella_: anyway, you can just do it. | |||
my $x = "foo | |||
bar | |||
baz"; say $x | |||
^ works fine | 03:50 | ||
crella_: or can you use tor, or a vpn or proxy? | |||
crella_ | bing.com is always ok to me, but bing usually return results about perl5, not 6.. | 03:51 | |
thanks | 03:53 | ||
Elronnd | try startpage, it uses google results | ||
also, see if you can use tor, because it sucks not to be able to use parts of the internet | |||
crella_ | OK, I'm not interested in these.Actually I don't live on coding. | 03:59 | |
Elronnd | plenty of internetage that doesn't have to do with coding though | 04:00 | |
04:22
vike left
04:34
jaldhar joined
04:35
jaldhar_ joined,
jaldhar_ left
04:36
jaldhar_ joined,
jaldhar left
04:39
curan joined
04:41
Itaipu left
04:42
Itaipu joined
04:59
crella_ left,
jaldhar_ left
05:00
jaldhar_ joined
05:06
molaf joined
05:09
jaldhar_ left
05:10
jaldhar_ joined
05:11
jaldhar_ left
05:12
jaldhar_ joined
05:16
vike joined
05:39
lizmat_ left
05:46
|oLa| joined
|
|||
discord6 | <Aearnus> hey, the docs for FatRat say the denominator can be 0, but it doesn't work in practice docs.perl6.org/type/FatRat#(Ration...method_new | 05:50 | |
05:51
Aearnus joined
|
|||
Aearnus | p6: FatRat.new(10, 0) | 05:51 | |
camelia | ( no output ) | ||
Aearnus | huh. on mine it says `Attempt to divide by zero when coercing Rational to Str` | 05:52 | |
timotimo | that's when you try to "use" the value | 05:54 | |
m: FatRat.new(10,0).gist.say | |||
camelia | Attempt to divide by zero when coercing Rational to Str in block <unit> at <tmp> line 1 |
||
timotimo | m: FatRat.new(10,0).perl.say | ||
camelia | FatRat.new(1, 0) | ||
timotimo | creating it is fine, but when you try to stringify, it blows up, much like a Failure | 05:55 | |
Aearnus | ahh | ||
so | |||
timotimo | which the REPL does, of course | 05:56 | |
Aearnus | p6: FatRat(10,0).numerator.say | ||
camelia | 2 | ||
Aearnus | oop | ||
p6: FatRat.new(10,0).numerator.say | |||
timotimo | huh | ||
camelia | 1 | ||
timotimo | yeah | ||
Aearnus | ah okay, there's the functionality mentioned by the docs | ||
timotimo | m: FatRat(10,0).perl.say | 05:57 | |
camelia | FatRat.new(2, 1) | ||
timotimo | well, that's weird? | ||
Aearnus | yeah, it, uh, does that | ||
it doesn't matter what params you pass in | |||
i made that mistake earlier | |||
timotimo | haha | ||
Aearnus | spent a solid 10 minutes debugging it | ||
06:00
reportable6 left
|
|||
timotimo | m: say 10.FatRat(0).perl | 06:02 | |
camelia | FatRat.new(10, 1) | ||
timotimo | oh | ||
m: say (10,0).FatRat.perl | |||
camelia | FatRat.new(2, 1) | ||
timotimo | m: say (1, 2, 3, 4, 5).FatRat.perl | ||
camelia | FatRat.new(5, 1) | 06:03 | |
timotimo | just the number of elements in the list | ||
Aearnus | ahha that's odd behavior but i'll take it | ||
timotimo | yeah, when you call Type(1, 2, 3) and Type doesn't implement a CALL-ME, it will turn 1, 2, 3 into a list and call the "Type" method on it | ||
06:04
reportable6 joined,
ChanServ sets mode: +v reportable6
|
|||
Kaiepi | wait what? | 06:04 | |
ohh wait | |||
timotimo | github.com/rakudo/rakudo/blob/mast....nqp#L3517 | ||
Kaiepi | yeah i forgot about that behaviour | ||
Aearnus | seems like something that should be documented | 06:05 | |
timotimo | coercers is a really hairy topic | ||
Aearnus | considering someone coming from python for example would definitely make that mistake | ||
timotimo | thinking it'd be a constructor, right? | 06:06 | |
Aearnus | yeah | ||
Kaiepi | reading this part of BOOTSTRAP.nqp answers so many questions i had about how the MOP works | 06:09 | |
06:09
jaldhar_ left
06:10
jaldhar_ joined
|
|||
Kaiepi | like how classes get treated like Any | 06:10 | |
i didn't know roles were Cool | 06:12 | ||
Aearnus | they're pretty cool indeed | ||
(i didn't know they were Cool either) | |||
timotimo | hm, can you even get at the Cool methods in a role? it'd immediately pun, i'd imagine | 06:13 | |
Kaiepi | m: say role {}.^mro | 06:14 | |
06:14
cpan-p6 left
|
|||
camelia | ((<anon|1>)) | 06:14 | |
06:14
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
|
|||
Aearnus | unrelated, but here's a cool trick i just found out to do flatmap/concatmap/monadic bind on lists using slip | 06:14 | |
p6: (1, 2, 3, 4).map: { |($^a xx $^a) } | |||
camelia | ( no output ) | ||
Kaiepi | m: use nqp; say nqp::hllizefor(role {}.^mro, 'perl6') | ||
camelia | ((<anon|1>)) | ||
Kaiepi | oh right i'm forgetting it's anonymous | 06:15 | |
m: say role {}.^methods | |||
camelia | () | ||
06:15
sjm_uk joined
|
|||
Kaiepi | m: say role {}.HOW.^name | 06:16 | |
camelia | Perl6::Metamodel::ParametricRoleHOW | ||
Kaiepi | m: say role {}.^find_method('WHICH').name | 06:17 | |
camelia | WHICH | ||
Kaiepi | so Mu methods can be looked up at least | 06:18 | |
m: say role {}.^find_method('is-prime').name | |||
camelia | No such method 'name' for invocant of type 'Mu'. Did you mean any of these? note take in block <unit> at <tmp> line 1 |
||
timotimo | it's quite possible that you're actually getting punned object's methods with .^find_method | ||
probably want .^lookup instead | |||
Kaiepi | m: say role {}.^lookup('is-prime').name | 06:19 | |
camelia | No such method 'name' for invocant of type 'Mu'. Did you mean any of these? note take in block <unit> at <tmp> line 1 |
||
Kaiepi | yeah, find_method is a Metamodel::RolePunning method | 06:20 | |
m: use nqp; say nqp::istype(role {}, Cool) | |||
camelia | 1 | ||
Kaiepi | weird | ||
timotimo | roles are slippery | 06:21 | |
06:22
jaldhar_ left
|
|||
Kaiepi | good ig, i can't cargo cult their code for monads then | 06:22 | |
06:23
uid9164 joined
|
|||
Kaiepi | at least not completely, they're a decent base for working out how to implement parametric types | 06:25 | |
Aearnus | is there an easy built-in to repeat until something stops changing? | 06:31 | |
timotimo | m: say 1, 2, { ($_ + 1, $_ + 2, $_).pick } ... * == * | ||
camelia | (1 2 2) | ||
Aearnus | trying to implement exploding dice | 06:32 | |
timotimo | m: say 1, 2, { ($_ + 1, $_ + 2, $_).pick } ... * == * | ||
camelia | (1 2 4 5 6 8 10 12 12) | ||
Aearnus | m: sub infix:<d>(Int $n, Int $max) is assoc<left> { (^$max).pick xx $n }; sub infix:<b>(@ds, Int $max) is assoc<left> { @ds.map: -> $d { $d ~~ ($max - 1) ?? |($d, |(1 d $max)) !! $d } }; say 3 d 3 b 3 | ||
timotimo | here's one | ||
camelia | (0 2 0 1) | ||
Aearnus | huh. that's a clever trick, but i'm not sure if it'll work in this situation | ||
(i'm trying to iterate the `@ds.map` statement) | 06:33 | ||
unless.. | 06:34 | ||
m: sub infix:<d>(Int $n, Int $max) is assoc<left> { (^$max).pick xx $n }; sub infix:<b>(@ds, Int $max) is assoc<left> { ({ @ds.map: -> $d { $d ~~ ($max - 1) ?? |($d, |(1 d $max)) !! $d } } ... * == *).tail }; say 3 d 2 b 2 | 06:35 | ||
timotimo | .o( how do i input the looking eyes emoji ) | ||
camelia | (1 1 0 0) | 06:36 | |
Aearnus | hey it works :D | 06:40 | |
m: sub infix:<d>(Int $n, Int $max) is assoc<left> { (^$max).pick xx $n }; sub infix:<b>(@ds, Int $max) is assoc<left> { @ds, { .map: -> $d { $d ~~ ($max - 1) ?? |($d - 1, |(1 d $max)) !! $d } } ... * == * }; say 3 d 4 b 4 | |||
camelia | ((1 1 3) (1 1 2 2) (1 1 2 2)) | 06:41 | |
Aearnus | can't think of a way to make that `3 d 4 b 4` syntax more elegant. in an actual tabletop rpg it'd be written `3d4!` (but `!` was taken) | 06:42 | |
timotimo | so the ! basically means you take the 4 twice, that's why you have 4 b 4? | 06:44 | |
m: sub postcircumfix:<d !>($a, $b) { say $a ~ "d" ~ $b ~ "!" }; 3d4! | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Confused at <tmp>:1 ------> 3($a, $b) { say $a ~ "d" ~ $b ~ "!" }; 3d7⏏054! |
06:45 | |
Aearnus | the ! means "reroll and sum your dice if you rolled the max value" | ||
timotimo | ok, it doesn't like that | ||
m: sub postcircumfix:<d b>($a, $b) { say $a ~ "d" ~ $b ~ "!" }; 3d4b | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Confused at <tmp>:1 ------> 3($a, $b) { say $a ~ "d" ~ $b ~ "!" }; 3d7⏏054b |
||
06:46
lizmat joined
|
|||
Aearnus | hold on, idea. | 06:46 | |
timotimo | it has to be a different unicode class of symbols than letters i believe | ||
Aearnus | m: sub infix:<d>(Int $n, Int $max) is assoc<left> { (^$max).pick xx $n }; sub postcircumfix:<d !>($a, $b) { say $a ~ "d" ~ $b ~ "!" }; say "dice 1: " ~ (3 d 5); (3 d 5 !) | 06:47 | |
*crosses fingers* | |||
timotimo | i do believe postcircumfix has to cuddle at least the thing in front | 06:48 | |
camelia | (timeout)5===SORRY!5=== Error while compiling <tmp> Negation metaoperator not followed by valid infix at <tmp>:1 ------> 3" }; say "dice 1: " ~ (3 d 5); (3 d 5 !7⏏5) expecting any of: infix infix stopper |
||
06:48
[Sno] left
|
|||
timotimo | i wonder what's up with the box camelia's running on, it seems oddly slow | 06:48 | |
20 minutes until jonathan's keynote in riga | 06:51 | ||
i also just watched masak's talk | 07:00 | ||
07:02
lizmat left
|
|||
timotimo | www.youtube.com/watch?v=tenl6JEum5k - it starts RIGHT NOW | 07:05 | |
\o/ | |||
07:22
Sgeo__ joined
|
|||
Aearnus | aearnus.github.io/2019/08/07/d-d-r...-in-perl-6 :D | 07:23 | |
07:25
Sgeo_ left
|
|||
SmokeMachine | hi there! I have a script that rewrite some files... but it's changing the line ending of this files... is it possible to make it do not do that? | 07:27 | |
timotimo | yes, you'll want to turn chomping off on the input side and use print instead of put/say on the output side | ||
SmokeMachine | timotimo: I'm using .IO.slurp and .IO.spurt... how can I turn off the chomping? is there any .slurp option for that? | 07:28 | |
timotimo | oh, slurp and spurt don't do any chomping | ||
in that case you'll probably be using lines? | 07:29 | ||
the lines method on Str doesn't seem to have a "don't chomp" option | |||
so you'll have to .split, i'm afraid | 07:30 | ||
SmokeMachine | no... just .subst the whole file | ||
timotimo | oh | ||
so perhaps it's already changing line endings when it's utf8-decoding | |||
SmokeMachine | timotimo: yes, maybe... | 07:45 | |
timotimo | you can configure decoders to not do newline translation | ||
SmokeMachine | timotimo: any idea of how to fix that? | ||
timotimo | it's been some time since that change landed and i really knew how to work it | ||
this is related to \n vs \r\n vs \r i expect? | |||
SmokeMachine | yes... | 07:46 | |
timotimo | right | ||
well, there is a way | |||
i just forgot what it is | |||
SmokeMachine | :) | 07:47 | |
07:49
rindolf joined
|
|||
SmokeMachine | timotimo: I changed to .slurp: :bin and decode it... it seems to work... | 07:54 | |
timotimo | docs.perl6.org/language/newline - this ought to do it | ||
SmokeMachine | timotimo: in my case, I don't know what's the line ending before opening the file... | 07:56 | |
timotimo | ah | ||
SmokeMachine | the :bin seems to be working... | ||
timotimo | fair enough | ||
07:56
antoniogamiz joined
|
|||
antoniogamiz | o/ | 07:56 | |
SmokeMachine | timotimo: thank you very much! | 07:57 | |
timotimo | you're quite welcome | ||
07:59
Sauvin left
08:00
sauvin joined
08:06
chloekek joined,
Aearnus left
|
|||
chloekek | wiki.haskell.org/IRC_channel still mentions #perl6, but does this still make sense? I rarely see people talk about functional programming or Pugs here. | 08:10 | |
Elronnd | I thought perl6 was supposed to be a bad lisp, a bad haskell, a bad ml, a bad python, bad javascript, bad whatever-else? | 08:12 | |
antoniogamiz | Kaiepi: thanks for your last PR to the documentation, I did not know I could do that with enums | 08:16 | |
discord6 | <Aearnus> Elronnd: not bad, but the worst /s | 08:17 | |
<Aearnus> sorry about that reputation ahaha | 08:18 | ||
<Aearnus> definitely a bit of type systems/functional programming buzz here though. i'd say it makes sense. there's a huge overlap in the perl6 and haskell communities | 08:19 | ||
cpan-p6 | New module released to CPAN! Supply::Timeout (0.0.2) by 03CONO | 08:20 | |
Kaiepi | np antoniogamiz | 08:21 | |
m: use MONKEY-TYPING; class Foo {}; role Bar { has $.bar = 1 }; augment class Foo does Bar {}; say Foo.new.bar | 08:35 | ||
camelia | P6opaque: no such attribute '$!bar' on type Foo in a Foo when trying to get a value in method bar at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
antoniogamiz | can I override the gist method of a enum? | 08:36 | |
08:37
[Sno] joined
|
|||
Kaiepi | if you use a regular method, i think you can | 08:37 | |
antoniogamiz | mmm ty | ||
Kaiepi | m: class Foo does Enumeration { method gist(Foo:D: --> Str:D) { 'ayy lmao' } }; say Foo.new.gist | 08:38 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Cannot have a multi candidate for 'gist' when an only method is also in the package 'Foo' at <tmp>:1 |
||
Kaiepi | or not | ||
antoniogamiz | ups haha | ||
08:38
zakharyas joined
|
|||
Kaiepi | m: class Foo does Enumeration { multi method gist(::?CLASS:D:) { 'ayy lmao' } }; say Foo.new.gist | 08:39 | |
camelia | ayy lmao | ||
antoniogamiz | gooood | ||
:D | |||
08:39
satori__ left
08:43
dolmen joined
08:47
epony left
|
|||
uid9164 | I know little about python, ruby and lua. And I often define a variable and declare its type, though sometimes perl6 reports some type error and I have to delete the declartion to let the script run. | 08:50 | |
The last time I gave up writing a perl5 script is because I cannot search a method to change a string variable into a int. The subroutine is a bit long and I has no way but to change the variable type... | 08:52 | ||
08:53
mahafyi left,
Ven`` joined
|
|||
uid9164 | I said something in a wrong way just now. I was going to print a string as an int or inversely, but I couldn't find out a method on all common search engines. | 08:55 | |
08:56
mahafyi joined
08:57
Ven`` left
09:02
Aearnus joined
|
|||
Aearnus | uid9164: in perl6 you can use the `.Int` or `.Num` methods | 09:02 | |
m: say <10>.Int; say <10>.Int.WHAT | 09:03 | ||
camelia | 10 (Int) |
||
09:06
[Sno] left
09:08
Ven`` joined
|
|||
chloekek | Or the + prefix operator. | 09:09 | |
uid9164 | The problem I met was not just that simple.. | ||
<perl5 code> use strict; use warnings; use Math::Round; my $a = '2.603';print round($a,1); | 09:12 | ||
09:12
cpan-p6 left
|
|||
uid9164 | <output> 31 (???) I had no idea then. So I chose another language. | 09:12 | |
09:12
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
09:13
Black_Ribbon left
|
|||
Aearnus | you might have better luck getting help in #perl if perl 5 specifically is what you need | 09:14 | |
09:17
epony joined
|
|||
Ven`` | tadzik: we got `is succinct` to work for the non-side-effecting use cases 🎉 | 09:18 | |
09:25
pilne joined
09:28
Ven`` left
09:29
lizmat joined
|
|||
tyil | can I use `perl6 --target` with a specific target to just generate the .precomp stuff without actually running the application itself? | 09:29 | |
09:29
satori__ joined
|
|||
tyil | I want to load the precomp stuff in a Docker image for a program, so I can hopefully improve startup times of the application in docker | 09:30 | |
09:31
Ven`` joined
|
|||
chloekek | Ven``: wat is dat | 09:31 | |
Ven`` | chloekek: close to scheme/racket syntax-rules, auto-quoted, etc | 09:33 | |
`@succinct macro swap(a, b) { my t = a; a = b; b = t; }` i.e. | |||
SmokeMachine | Ven``: I'm curious... could you give a perl6 example of use? | 09:36 | |
Ven`` | SmokeMachine: well, see swap^ right here. then you can do `my a = 1; my b = 2; swap(a, b);` | ||
09:37
pat_js joined
|
|||
SmokeMachine | Ven``: ok, but what about th `is succinct`? | 09:37 | |
Ven`` | SmokeMachine: if you didn't h ave `is succinct`, here's how you'd write it: `macro swap(a, b) { quasi { my t = {{{a}}}; {{{a}}} = {{{b}}}; {{{b}}} = {{{a}}}; } }` | 09:38 | |
SmokeMachine | Ven``: oh! 007?! now I think I got it! | 09:39 | |
Ven`` | yes, 007, hence why the sigils are missing. sorry, the original message was for tadzik with whom we'd talked about it already :P | ||
SmokeMachine | Ven``: sorry, I was looking for the `is succinct`... I didn't realise that it was the `@succinct`... | 09:40 | |
Ven`` | yeah, the syntax is gonna change in 007 (there's an open PR...) | 09:41 | |
SmokeMachine | Ven``: thanks! very good! :) | ||
Ven`` | 😊 | ||
SmokeMachine | Ven``: how does it work? do it uses the AST generated by the macro body as the macro return? | 09:43 | |
Ven`` | SmokeMachine | ||
oops, new keyboard, not used to it yet, sorry. | |||
SmokeMachine | :) | 09:44 | |
09:44
Aearnus left
|
|||
Ven`` | it wraps the succinct macro's body inside of an unquote, and then walks the code to find and replace references to the macro's args | 09:44 | |
09:44
lizmat left
|
|||
Ven`` | and unquote them (for now it's pretty dumb about it) | 09:44 | |
chloekek | Ven``: ah I see. | 09:46 | |
09:46
lizmat joined
|
|||
chloekek | I haven't used macros yet. | 09:46 | |
But I have a use for them (Template::Classic). | |||
SmokeMachine | Ven``: hum... that's what masak was referring when he was talking about different kinds of variables that should or should not be quoted some time ago? | ||
Ven`` | SmokeMachine well, I suppose? in succinct macros, only the arguments need to be unquoted | 09:47 | |
in normal macros you might have generated ast nodes from outside the quasi which you woukd then need to unquote in the body of the quasi | |||
Geth | ¦ problem-solving: AlexDaniel assigned to rba Issue pl6anet.org will be discontinued breaking "Recent Blog Posts" on perl6.org github.com/perl6/problem-solving/issues/86 | 09:49 | |
¦ problem-solving: AlexDaniel assigned to maettu Issue pl6anet.org will be discontinued breaking "Recent Blog Posts" on perl6.org github.com/perl6/problem-solving/issues/86 | |||
SmokeMachine | Ven``: won't succinct macros be more common then non succinct macros? | 09:50 | |
Ven`` | SmokeMachine: maybe? it's hard to tell right now. if you want to manipulate the AST you've been passed, then you're gonna need non-succinct | 09:52 | |
so simple macros are probably gonna be succinct yes, the rest probably nto | |||
scheme/racket's syntax-rules are very powerful however, but we don't (yet?) have multi-macros, so..:) | |||
(when you define a syntax-rule in scheme/racket you can pattern match on several different patterns and generate different results based on that) | 09:57 | ||
09:57
lizmat left
09:58
AlexDaniel joined,
pilne left
10:00
pilne joined
10:04
[Sno] joined
10:11
mowcat joined
10:12
[Sno] left
10:15
leont joined
10:19
Ven`` left
10:23
Ven`` joined
10:25
pilne left
10:26
uid9164 left
10:36
ravenousmoose left
10:38
tilpner joined,
tilpner_ left
10:40
uid9164 joined
10:41
dolmen left
10:49
ravenousmoose joined
10:53
lizmat joined
|
|||
uid9164 | Hi, I think of a problem about math and programming. If anyone is interested in it ? My native language isn't English so I may express not quite exactly. | 10:56 | |
a is a decimal with limited digits. M is a set of (x,y) when |x/y-a| < E, and the E is a fixed decimal. '||' stands for absolute value. Please find out the specific (x,y) that let (x+y) get to the minimum value. | |||
I've think out a method but I'm not confident to solve the problem. And I don't know how to test it automatically. | 10:58 | ||
antoniogamiz | is M finite? | 11:00 | |
and what do you mean by "decimal"? a digit in the decimal part of a numbert? or a rational number? | 11:01 | ||
uid9164 | Wait a minute. | 11:02 | |
a is a number with limited digits and a < 0. M is a infinite set of (x,y) when |x/y-a| < E, and the E is a fixed small value. '||' stands for absolute value. Please find out the specific (x,y) that let (x+y) get to the minimum value. | 11:03 | ||
For example, when I want to find the (x,y) when a is 0.11688. | 11:04 | ||
antoniogamiz | mm are you sure this problem is computable? | 11:05 | |
uid9164 | When using the method provided from rosettacode.org/wiki/Convert_decim...ational#C, it returns 475/4064 | ||
But I want the result as 9/77. In fact, 9/77=0.11688312,475/4064=0.11687992 | 11:06 | ||
I am aware of the difference between a native English speaker and a foreigner... | 11:08 | ||
antoniogamiz | if you want the 0.2939 form, try using .Num | 11:10 | |
m: say (9/77).Num | |||
camelia | 0.11688311688311688 | ||
uid9164 | pastebin.com/MS87pr83 | 11:13 | |
11:19
MARTIMM joined
11:23
zakharyas left
11:25
uid9164 left
11:27
pat_js left,
[Sno] joined
11:32
lizmat left
11:37
lizmat joined
11:48
kentnl left
11:53
antoniogamiz left
11:55
lizmat left
11:56
dolmen joined
12:00
reportable6 left,
reportable6 joined,
ChanServ sets mode: +v reportable6
12:01
Ven`` left
12:06
Ven`` joined
12:07
thundergnat joined
|
|||
thundergnat | m: my $a = .11688; .say for $a.nude, $a.Num.Rat.nude; | 12:07 | |
camelia | (1461 12500) (484 4141) |
||
12:13
lucasb joined
12:14
thundergnat left
|
|||
moritz | m: my $a = .11688; .say for $a.nude, $a.Num.Rat(1e-9).nude | 12:20 | |
camelia | (1461 12500) (1461 12500) |
||
12:22
mensvaga joined
12:23
pat_js joined
12:29
molaf left
12:37
sena_kun joined,
sena_kun left,
[Sno] left
12:38
Ven`` left,
jkramer joined
|
|||
jkramer | Hello | 12:38 | |
12:39
Ven`` joined
12:40
Ven`` left
|
|||
moritz | hi jkramer | 12:41 | |
jkramer | Is there in a regex to try all possible alternatives and not just go with the longest? | 12:44 | |
m: my @s = <a aa abb>; say 'aabb' ~~ m/^ (@s)+ $/ | |||
camelia | False | ||
jkramer | Like in this example, it would match if it tried a + abb, but it goes with aa first and then abb won't match. | ||
m: my @s = <a aa abb>; say 'aabb' ~~ m:exhaustive/^ (@s)+ $/ | 12:45 | ||
camelia | () | ||
timotimo | m: my @s = <a aa abb>; say 'aabb' ~~ m:ov:ex/^ (@s)+ $/ | ||
camelia | () | 12:46 | |
jkramer | m: say 'aabb' ~~ m:exhaustive/^ (a || aa || abb)+ $/ | ||
camelia | (「aabb」 0 => 「a」 0 => 「abb」) |
||
jkramer | With || it works but @ interpolation seems to use | which does LTM | ||
timotimo | m: my @s = <a aa abb>; say 'aabb' ~~ m:ov:ex/^ (||@s)+ $/ | 12:47 | |
camelia | () | ||
timotimo | that is supposed to use || with interpolation i think | ||
jkramer | Is there a pretty way to use || with an array, ie. without typing all elements of the array into the regex manually? :) | ||
12:49
El_Che joined
|
|||
jkramer | m: say 'aabb' ~~ m:exhaustive/^ (a || aa || abb || ab || b || bb)+ $/ | 12:50 | |
camelia | (「aabb」 0 => 「a」 0 => 「a」 0 => 「b」 0 => 「b」 「aabb」 0 => 「a」 0 => 「a」 0 => 「bb」 「aabb」 0 => 「a」 0 => 「abb」 「aabb」 0 => 「a」 0 => 「ab」 0 => 「b」 「aabb」… |
||
12:51
mowcat left
|
|||
jkramer | timotimo: Can't find anything about ||@ in the docs | 12:51 | |
timotimo | m: my @s = <a aa abb>; say 'aabb' ~~ m:ov:ex/^ (|| @s)+ $/ | ||
camelia | () | ||
timotimo | hmm | ||
El_Che | lo | 12:52 | |
12:55
Doc_Holliwood joined
13:04
lizmat joined,
Ven`` joined,
Ven`` left
13:08
aaronwells joined
13:09
chloekek left
13:12
Ven`` joined,
curan left
13:13
Ven`` left
13:15
AlexDaniel left
13:16
satori__ left
13:21
zakharyas joined
13:24
dolmen left
13:27
dolmen joined
13:28
AlexDaniel joined,
dolmen left
13:31
Ven`` joined
13:33
aaronwells left
|
|||
tyil | can anyone tell me why `prove6 -l` complains about a missing plan in my subtest (gitlab.com/tyil/perl6-app-assixt/-...69462200), even though it looks to me like there's clearly a plan in there? (gitlab.com/tyil/perl6-app-assixt/b...fig.t#L24) | 13:35 | |
it's surely to be something silly that I'm staring too hard at to notice :I | |||
timotimo | is something outputting on stdout perhaps? | ||
13:35
aaronwells joined,
ChoHag joined
|
|||
tyil | does that interfere with prove6? because there is some output, yes | 13:36 | |
timotimo | BEGIN plan :skip-all<set AUTHOR_TESTING=1 to run bin tests> unless %*ENV<AUTHOR_TESTING>; | ||
tyil | I could work around it by adding a silent option, though | ||
timotimo | BEGIN may be the wrong choice here? | ||
tyil | I'm unsure, I copied that ages ago from someone else :p | ||
timotimo | well, it's not really like test files would be precompiled | ||
tyil | but if stdout stuff interferes with prove6, I can work around that | 13:37 | |
with some effort, but at least I have some possible pointer now | |||
timotimo | and i don't think skip-all will cause the rest of the file from being run | ||
prevent* | |||
tyil | it causes the rest of the tests to be ignored, which is Good Enough for me here | 13:38 | |
13:38
dolmen joined
|
|||
timotimo | OK | 13:38 | |
13:38
Ven`` left
|
|||
timotimo | i'm not sure what's going wrong with that test :( | 13:38 | |
tyil | I'm going to add a --silent option and see if that helps | 13:39 | |
it seems to indeed resolve the issue for the small test I just re-ran with all output commented | 13:40 | ||
so I have something to improve, thanks :D | |||
timotimo | yeah, it could be confusing the tap parser when there's output on stdout | ||
13:42
pat_js left
13:45
Ven`` joined,
mowcat joined
|
|||
cpan-p6 | New module released to CPAN! Gnome::GObject (0.13.16) by 03MARTIMM | 13:45 | |
13:46
lizmat left
13:49
natrys joined
13:55
Ven`` left
13:57
Ven`` joined
13:59
Ven`` left,
lizmat joined
14:01
[Sno] joined
14:02
lizmat left
14:04
wamiks joined
14:07
ravenousmoose left
14:08
mowcat left
14:12
Ven`` joined
|
|||
wamiks | Hi, I am confused. I created a unit module within which are both subs and classes. I can't seem to call new on one of the classes from within one of the subs. This is true even if I use its full name:ie Mdl1::Mdl2::myClass.new() I get "can't find symbol &myClass". OTOH, I have calling one of the subs works. Is this expected? How do I debug why my sub can't find my class? | 14:14 | |
14:15
dolmen left
|
|||
timotimo | "cannot find symbol &myClass" means it's trying to find a sub by that name | 14:16 | |
there's clearly something wrong there | |||
14:16
[Sno] left
|
|||
timotimo | without seeing the code, i don't think i'll be able to help | 14:16 | |
wamiks | Thx. If I paste the same call in the REPL it works. | 14:17 | |
timotimo | could be it's complaining about &myClass only because it tried to find myClass without & earlier and failed that too? | 14:18 | |
wamiks | Yeah, I would have to pull that code out to show you, it's a bit involved. Is there something debuging you can suggest to get some visibility what that function sees? | 14:19 | |
timotimo | you could try ".say for MY::.keys" | 14:20 | |
14:21
dolmen joined
|
|||
wamiks | :) I did try something similar. | 14:21 | |
It seems to just be the variables defned in that scope. | 14:22 | ||
14:22
Ven`` left
|
|||
timotimo | could also look at OUR:: | 14:23 | |
14:24
dolmen left
|
|||
wamiks | The class is in OUR::.keys | 14:26 | |
timotimo | if worst comes to worst, you can get at it that way | ||
wamiks | ahh, ok. just 'myClass.new()' give 'undeclared name' | 14:27 | |
haha, OUR did it. Cool! Thx! | 14:28 | ||
14:30
AlexDaniel left
|
|||
wamiks | Any thoughts why it is this way? | 14:30 | |
14:30
zakharyas left
|
|||
timotimo | i mean, if the class is inside a different pair of curly braces, it wouldn't be lexically available where you're trying to use it | 14:31 | |
but your question doesn't suggest that is the case | |||
14:34
Ven`` joined
14:35
ravenousmoose joined
|
|||
jdv79 | whatever or start aren't bad names either:) | 14:35 | |
*star | |||
camelia being 4 syllables is meh but whatever | 14:36 | ||
14:36
aaronwells left,
Ven`` left
|
|||
timotimo | let's call it "What" | 14:36 | |
"what programming language are you going to use for this project?" - "yes." | |||
jdv79 | haha | 14:37 | |
timotimo | "what ain't no language i ever heard of" | ||
Doc_Holliwood | module XX { sub xx { "X" } } | ||
When I try to "use" this rakudo tells me the symbox xx not being found | |||
*symbol. | 14:38 | ||
timotimo | you have to "is export" the sub for it to become visible when "use"d | ||
Doc_Holliwood | tried that | ||
14:38
dolmen joined
|
|||
jdv79 | star is 4 chars and one syllable though and isn't a stopword;) | 14:39 | |
14:40
antoniogamiz joined
|
|||
wamiks | @timotimo, braces-wise it's a sibling to the function. it 'does' a role which is also at the same scope, not sure if that matters. | 14:40 | |
timotimo | there's already a programming language called "star" | ||
14:40
tokomer joined
|
|||
Doc_Holliwood | you mean as in < module XX { sub xx is export { "X" } } >? | 14:41 | |
jdv79 | oh:( | ||
Doc_Holliwood | same error | ||
jdv79 | i googled star comp lang and skimmed and didn't notice | ||
timotimo | oh, you'll perhaps want to have it an our sub and then XX::xx | ||
Star seems to be made by the same person who made Go! | 14:42 | ||
14:42
dolmen left
|
|||
Doc_Holliwood | Ah, progress. Now I get "Cannot import symbol $xx from XX, because it already exists in this lexical scope" | 14:43 | |
timotimo | you mean &xx perhaps? | ||
14:43
[Sno] joined
|
|||
Doc_Holliwood | No, it's referring to the $xx in < sub EXPORT (*@args) { %( '$xx' => XX::xx() ) } > | 14:44 | |
timotimo | oh, you have an EXPORT sub | ||
Doc_Holliwood | module XX { our sub xx { "X" } } | 14:45 | |
still complains about $xfoox already existing in the scope | |||
which is weird | |||
14:45
ravenousmoose left
|
|||
timotimo | without the actual full code i won't be able to help :( | 14:45 | |
Doc_Holliwood | That is the full code | 14:46 | |
That is XX.pm I run it using perl6 -MXX -e "use XX" | |||
and get the aforementioned error | |||
timotimo | why do you import XX twice? | ||
Doc_Holliwood | right. | 14:47 | |
right, right. *ahemm* | |||
14:53
wamiks left
14:54
MARTIMM left
14:55
dolmen joined
14:57
Sgeo_ joined
14:59
aaronwells joined
15:01
Sgeo__ left
15:06
sjm_uk left
15:07
Sgeo__ joined
15:10
Sgeo_ left
15:14
[Sno] left
15:19
Sgeo joined
|
|||
Kaiepi | m: my constant Foo = role Bar:ver<0.0.1>:auth<github:Kaiepi>:api<6.d> {}.^specialize(Mu, Bar); say Foo.^ver | 15:21 | |
camelia | BEGIN TIME EXCEPTION IS AT <tmp> at 1 EXCEPTION: Could not instantiate role 'Bar': 5===SORRY!5=== Error while compiling <tmp> An exception occurred while evaluating a constant at <tmp>:1 Exception details: 5===SORRY!5=== Error… |
||
Kaiepi | m: my constant Foo = role Bar:ver<0.0.1>:auth<github:Kaiepi>:api<6.d>[::T] {}.^specialize(Mu, Bar); say Foo.^ver | ||
camelia | (Mu) | ||
15:21
Sgeo__ left
|
|||
Kaiepi | m: my constant Foo = role Bar:ver<0.0.1>:auth<github:Kaiepi>:api<6.d>[::T] {}.^specialize(Mu, Bar); say Foo.^auth | 15:21 | |
camelia | |||
Kaiepi | m: my constant Foo = role Bar:ver<0.0.1>:auth<github:Kaiepi>:api<6.d>[::T] {}.^specialize(Mu, Bar); say Foo.^api | ||
camelia | 15:22 | ||
Kaiepi | should these be set on Perl6::Metamodel::ConcreteRoleHOW like its name is? the class already does the role for them | ||
*roles | 15:23 | ||
nah wait, role is right | |||
15:23
Sgeo_ joined
15:25
zakharyas joined
15:26
Sgeo left
15:27
sjm_uk joined
15:32
zakharyas left,
aaronwells left
|
|||
Kaiepi | shit, wrong channel | 15:33 | |
15:33
zakharyas joined
|
|||
gfldex | m: package P { our regex r { .+ } }; say 'match' ~~ /<P::r>/; | 15:33 | |
camelia | No such method '!cursor_init' for invocant of type 'P' in block <unit> at <tmp> line 1 |
||
gfldex | how do I access r ? | ||
timotimo | gfldex: i'd just bind it to an alias | 15:35 | |
gfldex | timotimo: should what I do work? | 15:36 | |
timotimo | i think that's syntax for when you're taking a grammar's regexes | ||
so it'll probably try to .^find_method or something | |||
gfldex | if I put it into a grammar I get a different error. | 15:37 | |
15:38
satori__ joined
|
|||
Doc_Holliwood | m: VM.osname.say | 15:38 | |
camelia | linux | ||
Doc_Holliwood | I'm thinking about adding Win32 support to my github.com/holli-holzer/perl6-Test-Color | 15:42 | |
15:42
wildtrees joined
|
|||
gfldex | m: package P { our regex r { .+ } }; say 'match' ~~ P::r; | 15:43 | |
Doc_Holliwood | That would require bundling some C-code though | ||
camelia | Too few positionals passed; expected 1 argument but got 0 in regex r at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
gfldex | m: package P { constant r = regex { .+ } }; say 'match' ~~ P::r; | ||
camelia | 「match」 | ||
gfldex | o.O | ||
15:43
MARTIMM joined
|
|||
Doc_Holliwood | So, how would I write an "XS.Module" if yiz will? Can zef make a C-project? | 15:43 | |
15:43
wildtrees left
|
|||
timotimo | we have LibraryMake | 15:44 | |
15:44
wildtrees joined
|
|||
timotimo | what do you need that NativeCall doesn't provide, out of curiosity? | 15:44 | |
Doc_Holliwood | The windows console does not support ANSI escape sequences | 15:46 | |
But there is a project named ansicon | 15:47 | ||
15:48
wildtrees left,
wildtrees joined
|
|||
Doc_Holliwood | So i was thinking I could bundle that and have zef build it | 15:48 | |
Kaiepi | Doc_Holliwood, you can use LibraryMake | 15:49 | |
Doc_Holliwood | Yes, tx. Looking into it | ||
16:05
Sgeo__ joined
16:06
dolmen left
16:09
Sgeo_ left
16:15
antoniogamiz left
16:22
antoniogamiz joined
16:34
Sgeo_ joined
16:37
Sgeo__ left
16:38
scotticles joined
16:41
mowcat joined
16:45
EuAndreh[m] left,
sergiotarxz[m] left,
rba[m] left,
matiaslina left,
Matthew[m] left,
unclechu left,
lance_w[m] left
16:46
Demos[m] left,
Seance[m] left,
Guest48765 left,
folex left,
mack[m] left,
epony left,
TravisRt2botio[m left,
AlexDaniel` left
16:48
zingzhang left
16:49
rindolf left
|
|||
Doc_Holliwood | I am trying to find the source of the prove6 script. but when I open the one in bin i see "CompUnit::RepositoryRegistry.run-script("prove6", :$name, :$auth, :$ver)" | 16:50 | |
where to go from there? | |||
16:50
leont left
16:52
AlexDaniel` joined
|
|||
El_Che | Hi AlexDaniel` | 16:55 | |
16:58
zingzhang joined
17:05
EuAndreh[m] joined,
TravisRt2botio[m joined,
lance_w[m] joined,
Matthew[m] joined,
rba[m] joined,
Guest35100 joined,
sergiotarxz[m] joined,
mack[m] joined,
Demos[m] joined,
Seance[m] joined,
folex joined,
unclechu joined,
matiaslina joined
17:12
Sgeo_ left,
Sgeo_ joined
17:16
Xliff joined
17:25
xinming_ left
|
|||
Xliff | \o | 17:29 | |
17:31
Black_Ribbon joined
17:35
mahafyi left
17:36
Aearnus joined
|
|||
vrurg | Xliff: o/ | 17:42 | |
Xliff | vrurg: How goes 3113? | 17:44 | |
vrurg | Which 3113? Ah, that old one... ;) | 17:45 | |
Playing with your problem. For now the problem is I don't understand yet what it should be. | 17:46 | ||
Xliff | Oh. Yay? | ||
I've boiled it down to this: If there is an error why isn't it being reported? | 17:47 | ||
Said error must occur if another compunit is being dynamically loaded because it works when loaded on its own. | |||
vrurg | That's what I wanna see. First of all, your `try require` masks the problem. | ||
Xliff | Yeah. Everybody says that. However, that's the only way I can get it to assign. | 17:48 | |
vrurg | Xliff: you don't need to assign it this way. ::("Module") is what you need to see that the module is not loaded. | ||
Xliff | Still results in the same thing. | 17:49 | |
Tell you what. I will rework the bug case your way and see if it helps. | |||
vrurg | But the CATCH would step in then. Because currently it caches exploded Failure from symbol resolution. | 17:50 | |
Xliff | Yes, but wouldn't that at least explain the problem? | 17:52 | |
vrurg | I'd like to test on 2019.03 and on the HEAD, but the former is still installing dependencies. So, I can't test my hypothesis yet. | ||
Xliff | OK. I will hold off until you need me, then. | ||
vrurg | Xliff: what happens now (as I see it): import fails, an exception gets thrown. ::("Module") returns a Failure with "NoSuchSymbol" by default – and this is what you get when require fails. try throws away the actual exception, it's not stored in ::("Module") Failure as one might expect. | 17:54 | |
2019.03 behaves the same. Ok. | 17:55 | ||
Xliff | vrurg: The one problem I see with that explanation is this: If that were so... it would NOT work in isolation. | 17:56 | |
The module loads by itself, so it can't be a "NoSuchSymbol" issue. | |||
18:00
reportable6 left
18:01
reportable6 joined,
ChanServ sets mode: +v reportable6
18:03
zakharyas left
|
|||
vrurg | Xliff: something is definitely going on there. I'm just not sure yet where exactly it happens. If you make a deliberate error in CopySnapshot it is reported back normally. | 18:06 | |
18:07
irced joined
|
|||
Xliff | Is CopySnapshot the only module loaded? | 18:08 | |
I'm still wondering if the root cause is GetTemplateLaunchData + anything else. | |||
vrurg | Xliff: looks like the cause is in chain of uses. I wonder at which depth level it happens. | 18:10 | |
Xliff | Oh, wow! | ||
A missed circular use case? | 18:11 | ||
vrurg | No, nothing is being lost. I was changing a wrong module. | 18:16 | |
So, I went as deep as to LaunchTemplateTagSpecification inserting "die" – and it always bounces back if I use CATCH { }; require ::($module). | |||
18:18
rindolf joined
|
|||
vrurg | Xliff: so, get rid of try, do just require, use CATCH in the same scope and at the end bind the ::($module) to a hash key. That works. | 18:18 | |
Xliff | \o/ | 18:19 | |
vrurg: Give me 30 minutes max to get my hands out of the guts of another project and I will verify. | |||
vrurg | Xliff: I would comment on the issue, you'll find the corrected script code in it. | 18:20 | |
BTW, I'm amazed by the number of modules in the project. Did you use an automation to produce them? Because if it's all manual work then you're one of the craziest and most patient people I ever seen. :) | 18:22 | ||
Xliff | :D | 18:23 | |
Automation to get them created, then hand corrected. | |||
So a bit of both? | |||
Dude.. that's my groove. Just look at all of the projects on github. :> | |||
18:24
Sgeo__ joined
|
|||
irced | what project are you guys discussiong, Xliff & vrurg ? | 18:26 | |
vrurg | irced: Amazon::AWS::EC2 | ||
Xliff | github.com/Xliff/p6-Amazon-AWS-EC2 | ||
irced | vrug, Xliff: thankws | ||
Xliff | Also... github.com/Xliff/p6-GtkPlus | 18:27 | |
Also... github.com/Xliff/p6-GooCanvas | |||
... github.com/Xliff/p6-Clutter | |||
:> | |||
... github.com/Xliff/p6-WebkitGTK | |||
... github.com/Xliff/p6-SourceViewGTK | |||
18:28
Sgeo_ left
|
|||
vrurg | Aha, sure! (can't find approriate emoji for being shocked :) ) | 18:28 | |
irced | Xliff: nice | ||
Xliff | And the blocker... the grandpappy... | 18:29 | |
... github.com/Xliff/p6-Pango | |||
vrurg | Xliff: BTW, how hard is it to do the same for Amazon MWS? | ||
Xliff | MWS? | ||
linky? | |||
irced | xliff: thanks for mentioning unpinned | 18:30 | |
Xliff | irced? | ||
vrurg | Xliff: Marketplace API. | ||
irced | Xliff: i didn't see p6-Pango on the pinned at github.com/Xliff | ||
Xliff | Oh. Yeah. I wish they had more pinned slots. | 18:31 | |
All of this would be pinned. | |||
vrurg: Actually... not that difficult for MWS | |||
vrurg | Ok, I know who to ask then if I need it. :) | ||
Xliff | LOL! Sure thing. | 18:32 | |
irced | vrurg: which project impressed you with the number of modules? i am interested in seeing how big projects are glued together :-) | ||
😃 | |||
Xliff | When I say "not that difficult" I mean "slightly difficult unless I can pull out the data from docs.developer.amazonservices.com/e...estDetails for automation" | ||
El_Che | AlexDaniel`: going for consensus (everyone) instead of a majority or even consent (most people agree and those who don't don't veto it) for PR is a bold step :) | ||
Xliff | irced: The largest, in terms of number of modules is Amazon-AWS-EC2. | 18:33 | |
p6-GTKPlus is second. | |||
vrurg | irced: Amazon. Scrolling through the list of Types modules makes bored at thrid swipe up... :D | ||
irced laughs. | |||
Xliff | github.com/Xliff/p6-Amazon-AWS-EC2...ration.pm6 | 18:34 | |
Main script: github.com/Xliff/p6-Amazon-AWS-EC2...eClass.pl6 | |||
irced | vrurg: so i'm looking at the META6.json file, sorry if i am interrupting your guyz investigation btw | 18:35 | |
Xliff | vrurg: Actually... weirdness still persists. | ||
irced | vrurg: which file were you looking at (scrolling) | ||
Xliff | After making your changes... if I use only GetLaunchTemplateData, it works just fine. | ||
If I add CopySnapshot, I get: No such symbol 'Amazon::AWS::EC2::Action::GetLaunchTemplateData' | 18:36 | ||
vrurg | Xliff: BTW, I would suggest using `unit class` in favor of `class ... is export`. It's cleaner in many way. `is export` may have obscure side effects when used outside of a package. | ||
irced: we're over with it, I think. Luckily, it's not something in rakudo, after all. | |||
Xliff | unit class uses OUR semantics? | ||
vrurg | Xliff: yes. | 18:37 | |
Xliff | k | ||
vrurg | And it makes code cleaner and more, to say, logical. | 18:38 | |
18:38
tokomer left
|
|||
Xliff | OK. | 18:39 | |
irced | vrurg: so thanks for taking time to share this with me. what file had the long list of modules ? | ||
Xliff | irced: github.com/Xliff/p6-Amazon-AWS-EC2.../EC2/Types | ||
vrurg: After moving GetLaunchTemplateData to "unit class..." I get "No such symbol 'Amazon::AWS::EC2::Action::GetLaunchTemplateData'" | 18:40 | ||
That happens ONLY if I load CopySnapshot prior. | |||
18:40
Sgeo_ joined
|
|||
Xliff | If I load CopySnapshot AFTER GetLaunchTemplateData... it works! | 18:41 | |
wtf? | |||
vrurg | Xliff: I get :Malformed has at /Users/vrurg/src/Perl6/p6-Amazon-AWS-EC2/lib/Amazon/AWS/EC2/Response/GetLaunchTemplateDataResponse.pm6 (Amazon::AWS::EC2::Response::GetLaunchTemplateDataResponse):14 | ||
irced | vrurg: i see. yes, it is impressive. thanks again. and thanks Xliff. | ||
vrurg | irced: I was actually scrolling in Atom's file panel. ;) | 18:42 | |
Xliff | vrurg: Perl6 --version? | ||
irced | vrurg: i don't know atom from Adam but it is just a midnight commander type deal right? | ||
vrurg | Xliff: This is Rakudo version 2019.07.1-130-ga7302f0a4 built on MoarVM version 2019.07.1-72-g352ae27e4 | 18:43 | |
irced | vrurg: or like vim's Explore | ||
18:43
Sgeo__ left
|
|||
Xliff | vrurg: OK, thanks. I am rebuilding moar-blead | 18:43 | |
vrurg | irced: images.app.goo.gl/ST5FSa6rjKsxK6tw8 – that rectangle on the left. ;) | 18:44 | |
Xliff: I don't think it's related. | |||
18:44
empee0 joined
|
|||
vrurg | Xliff: can you commit your changes to the test branch? | 18:44 | |
Xliff | Sure. One sec. | ||
irced | vrurg: oh i see, so the list length really made an impression there. got it. 😄 | 18:45 | |
vrurg | Xliff: I have changed all declaration in the files I touched to units. | 18:46 | |
Xliff | Oh, LOL! | 18:47 | |
OK. Pushed. | |||
vrurg | And I see what the problem is. With unit you must use the full class name. `is export` exports it's short form. | ||
irced | Xliff: so you're a big fan of gtk. seems to be true to its cross-platform mission only lately imho. | 18:48 | |
Xliff | irced: Heh! | ||
vrurg | Either you must regenerate things to utilize full names or stick to 'class is export' | ||
Xliff | vrurg: Ah. OK. | ||
irced | Xliff: which is of course good. and i guess you considered Qt ? | ||
Xliff | Kinda depending on the short form. | ||
vrurg | Full names are preferable unless you're 100% sure there won't be name clashes in short names. | 18:49 | |
Xliff | "Amazon::AWS::EC2::Action ...." gets kinda long in the tooth after a while. Yes, I am tracking the short names to minimize (if not eliminate) clashes. | ||
irced | Xliff: err, i think that is c++ as opposed to C so guessing not | ||
Xliff | irced: Yes, I am considering Qt. That's a while off, though. | 18:50 | |
irced | Xliff: ambitious. why stop there? GLUT! | 18:51 | |
Xliff | vrurg: Of course, there is still the issue of order. | ||
Why does GetLaunchTemplateData work fine if it is loaded before CopySnapshot?!? | |||
vrurg | Xliff: that's a mistery. And it doesn't matter wether it's unit or is export declared. Weird. | 18:52 | |
Xliff | Yep! Hence the bug description.... | 18:53 | |
irced | Xliff: looks like i lost you on GLUT | 18:54 | |
Xliff | irced: Hunh? Did you say something? | 18:55 | |
github.com/Xliff/p6-COGL | 18:56 | ||
My current WIP | |||
irced examines. | |||
Xliff | This might be a better starting point: www.cogl3d.org/ | 18:57 | |
irced | Xliff: ah, yes. well, seems to me GLUT is all about the graphics and interfaces (inputs) (whereas gtk and qt are that and so much more) but cogl is specific about the graphics (sans the interfacing). | 18:59 | |
Xliff: but the emphasis is on 3D of course in GLUT and cogl. | 19:00 | ||
Xliff | Yep. | ||
So COGL should tied you over until someone does GLUT. | |||
8-) | |||
irced | Xliff: I see, there is no specific thing GLUT would phenotypically provide when you have those two working. | 19:02 | |
19:02
epony joined
|
|||
timotimo | what'd you need glut for when we have sdl2? | 19:04 | |
Freeglut 3.0.0 [Released: 7 March 2015] | |||
heh. | |||
irced | thanks for chiming in timotimo, and for sharing that library! | 19:05 | |
Xliff | timotimo: Don't you start. | ||
Between you and vrurg, my dance card is punched! | |||
irced | now you can give Xliff two more projects to divide his time with. and that's not a problem if he can divide time itself. | 19:06 | |
timotimo | sdl is already there, though | ||
Xliff | irced: Nope. Don't have a knife sharp enough. Wanna make one for me? ;) | ||
irced | Xliff: i dunno, if i ever get to mt olympus perhaps someone can fashion one for me and one for you | 19:07 | |
Xliff: so i'll do my best | |||
timotimo | am i not removing projects from xliff's theoretical list of stuff to make? | 19:09 | |
Xliff | I saw a something get tossed onto the pile, only to be yanked off. Methinks it was made of straw. | 19:10 | |
timotimo | yeah, feel free to ignore glut | ||
19:11
Aearnus left
|
|||
irced | timotimo: depends on the goal. gtk+ has a + in it for a reason, it provides to much. but if one were to just focus on the symmetric set difference of {gtk+} (-) {sdl} then you are actually removing elements from the gtk+ but the difference is probably added back | 19:12 | |
timotimo | i'm not sure what you're trying to tell me here :) | 19:13 | |
irced | timotimo: it's ELEMentary. anyway... | ||
modules.perl6.org/dist/SDL2::Raw:cpan:TIMOTIMO | 19:14 | ||
looks like something i may want to get into! thanks again! | |||
19:20
mowcat left
|
|||
Xliff | CoglQuaternion?!? WTF? | 19:20 | |
timotimo | what's wrong with that? | ||
quaternions are used a whole lot in 3d math for rotation-y things | 19:21 | ||
Xliff | "Use the word 'Quaternion' in an object." -- Me crosses off bucket list. | ||
irced | oops, i used the wrong set notation to describe this.. .. | 19:25 | |
irced thinks | |||
basically, timotimo, xliff has gtk+ for UI+ and COGL for 3d but if you add sdl you get the same as COGL plus more. so you can remove COGL but work is replaced and even more might be added. | 19:28 | ||
but you remove some of gtk+ ui functions | |||
with sdl ui | 19:29 | ||
so theoretically i think the work would be about the same | |||
ignoring the "even more might be added" for now. | 19:30 | ||
timotimo | cogl goes on top of sdl nicely | 19:31 | |
if you bind cogl, you don't have to write bindings for opengl | |||
irced | actually, i might revise what i said, adding sdl can replace cogl. and gtk+ UI can be accomplished by cogl. so, i am leaning towards your first assertion. | ||
vrurg | Xliff: this is really funny. If CopySnapshot is require'd first then seond require leaves us with... CopySnapshot in the symbol table! And no ides where GetLaunchTemplateData is imported into then... | 19:32 | |
timotimo | i've got a particle system in SDL2 and i have to either loop over every point and set color and render a dot or i can only have a single color for all dots | ||
in cogl i can just set up a few buffers, say "one of them has colors in them" and fire off the whole bunch at once | 19:33 | ||
irced | anyway, since you're working on interfacing with sdl in perl6 then Xliff definitely doesn't need to add that to his list. | 19:34 | |
19:35
ufobat joined
|
|||
ufobat | within a regex i can have { } and inbetween there could be code that gets invoked, but the return value does not mean anything, there are not really sideeffects? | 19:36 | |
irced | timotimo: so great, Xliff's cogl and timotimo's sdl can work together. thanks for sharing! | 19:37 | |
19:37
netrino joined
|
|||
ufobat | and i could also have {} :codegoeshere; the ';' ends the code. | 19:38 | |
i wasnt able to find an explanation for this in the docs :-( | |||
Xliff | vrurg: Should change back to the class block form and see what happens? | 19:39 | |
vrurg | Xliff: it doesn't matter. I did already. | ||
Xliff | OK | 19:40 | |
vrurg | Xliff: though I'm afraid `is export` without a wrapping package might contribute to the problem. It's only a guess, though. | 19:41 | |
I generally dislike package-less units. They make me suspicious. ;) | 19:42 | ||
Xliff | Yeah. I will have to change things around. | ||
ufobat | ah jj had already opend issues about that on the docs repo | 19:43 | |
irced | ufobat: have you seen any side effects from the return value? | 19:44 | |
ufobat: anyway, block code doesn't recognize return (pure block) | |||
ufobat: so the parser can consider the context and determine whether to do the block or not "do" the block into its final evaluated expression | 19:45 | ||
ufobat: so in the context of a regex, i don't think it looks for what the {} evaluates to. | 19:46 | ||
ufobat: it just calls a block | |||
ufobat | i haven't seen sideeffects, no | ||
19:47
sjm_uk left
|
|||
ufobat | in such a block I could also call $/.made() to avoid having an action class? | 19:47 | |
irced | ufobat: i'll see if i can address that (new that i am) but let me illustrate firstly a block code routine vs sub | 19:50 | |
m: my &blockcode := { 2 + 2}; say "{blockcode} is equal to -42"; | 19:51 | ||
camelia | 4 is equal to -42 | ||
irced | m: my &blockcode := { return 2 + 2}; say "{blockcode} is equal to -42"; | ||
camelia | Attempt to return outside of any Routine in block <unit> at <tmp> line 1 |
||
irced | my &subroutine := sub routinecode { return 2+2+ }; say "{routinecode} is equal to -42"; | 19:52 | |
m: my &subroutine := sub routinecode { return 2+2+ }; say "{routinecode} is equal to -42"; | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing required term after infix at <tmp>:1 ------> 3outine := sub routinecode { return 2+2+ 7⏏5}; say "{routinecode} is equal to -42"; expecting any of: prefix term |
||
irced | m: my &subroutine := sub routinecode { return 2+2 }; say "{routinecode} is equal to -42"; | 19:53 | |
camelia | 4 is equal to -42 | ||
irced | there might be some superfluous code there but you see a block is different from a return | ||
from a routine | |||
m: my &subroutine := sub routinecode { return 2+2 }; say "{subroutine} is equal to -42"; | 19:54 | ||
camelia | 4 is equal to -42 | ||
irced | as for $/.made() to avoid having an action class that is currently beyond me, anyone else? | 19:56 | |
ufobat: i'll see if i can address that (new that i am) but let me illustrate firstly a block code >---routine----< err not routine vs sub | 19:57 | ||
ufobat | thanks :) | ||
irced | hth | 19:58 | |
ufobat | m: say "AABCDE" ~~ / (\w) {} $0 / | 20:00 | |
camelia | 「AA」 0 => 「A」 |
||
ufobat | say "AABCDE" ~~ / (\w) {} <?before A> / | ||
m: say "AABCDE" ~~ / (\w) {} <?before A> / | |||
camelia | 「A」 0 => 「A」 |
||
ufobat | m: "AABCDE" ~~ / (\w) {} <?before $0> / | ||
camelia | ( no output ) | ||
ufobat | is this a bug in the regex engine? | ||
irced | and just to say a little more about block code vs routine code, when parsing say "{blockcode}", say will look at the last statement in blockcode, not a return value (in blockcode). it doesn't have to, but it is does. regex on the other hand doesn't have to and doesn't. | 20:01 | |
20:07
antoniogamiz left
|
|||
irced | disclaimer: i am still learing the regex ropes, so the blockcode vs subroutine code may only serve to clarify some things not explain everything. as for the bug question | 20:09 | |
m: "AABCDE" ~~ m:global/ (\w:) {} <?before $($0)> / | |||
camelia | ( no output ) | ||
irced | m: "AABCDE" ~~ m/ (\w:) {} <?before $($0)> / | 20:10 | |
camelia | ( no output ) | ||
irced | m: "AABCDE" ~~ m/ (\w) {} <?before $($0)> / | ||
camelia | ( no output ) | ||
irced | m: say "AABCDE" ~~ m/ (\w) {} <?before $($0)> / | ||
camelia | 「A」 0 => 「A」 |
||
irced | m: say "AABCDE" ~~ m/ (\w) {} <?before $0> / | ||
camelia | False | ||
irced | m: say "AABCDE" ~~ / (\w) {} <?before $0> / | 20:11 | |
camelia | Nil | ||
20:11
jtpalmer joined
|
|||
irced | m: say "AABCDE" ~~ m/ (\w) {} <?before $($0)> / | 20:13 | |
camelia | 「A」 0 => 「A」 |
||
irced | ufobat: see that? | ||
20:13
[Sno] joined
|
|||
ufobat | m: say "AABCDE" ~~ m/ (\w) {} <?before <$0>> / | 20:15 | |
camelia | 「A」 0 => 「A」 |
||
ufobat | ahh nice, irced! | ||
irced | There are four ways you can interpolate a string into regex as a pattern. That is using $pattern, $($pattern), <$pattern> or <{$pattern.method}>. | ||
^ docs.perl6.org/language/regexes | |||
ufobat | yeah found that on the docs too :D | ||
thank you | |||
irced | ufobat: hth | 20:16 | |
of course, one of the four ways states $pattern, but when referring to a match, it looks like one of the alternatives apply. | 20:23 | ||
you could even do this | 20:25 | ||
m: say "AABCDE" ~~ m/ (\w) {} <?before {$0}> / | |||
camelia | 「A」 0 => 「A」 |
||
irced | but that seems like undefined regex behavior to me | 20:26 | |
ufobat | that confuses me, because why does it now check the content of the last expression of that block | ||
irced | outside of <?before ...> using the backreference like that won't work | 20:29 | |
20:29
MARTIMM left
|
|||
ufobat | but that is an inconsistency? | 20:30 | |
not saying that i would expect it to work outside of <?before> | 20:31 | ||
irced | i think the assertion does not allow for ALL patterns | ||
so it is in a "class" of its own | |||
checking the docs for something more substantial than that :-p | 20:32 | ||
20:34
pilne joined
20:38
[Sno] left
|
|||
irced | well, some experimentation shows that backreferences such as {$0} are as expected ignored in a m/ ... / | 20:38 | |
20:39
[Sno] joined
|
|||
irced | not the backreferences themselves mind you, just the block | 20:42 | |
20:43
noisegul_ left
|
|||
irced is experimenting. | 20:44 | ||
20:51
ufobat_ joined
20:55
ufobat left
21:06
scotticles left,
spider_apocalyps joined
21:43
zingzhang left
|
|||
irced | ufobat_: it is inconsistent. | 21:44 | |
ufobat_: but it is consistently inconsistent. 😃 | 21:45 | ||
ufobat_ | :D | ||
21:47
natrys left
|
|||
irced | btw, a do subroutine accepts a block as an argument so that say "{do {blockcode}} is equal to 1" happens to work. but again, do itself is a routine that returns the last evaluated expression of the blockcode... just to show there is at least consistency in that part of the language 😃 | 21:49 | |
though do is not a traditional subroutine, at any rate, it behaves like a "routine" vs "block" | 21:50 | ||
m: my &blockcode := { 2 + 2}; say "{do {blockcode} is equal to -42"; | 21:51 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> 3ckcode := { 2 + 2}; say "{do {blockcode}7⏏5 is equal to -42"; expecting any of: infix infix… |
||
irced | m: my &blockcode := { 2 + 2}; say "{do {blockcode}} is equal to -42"; | ||
camelia | 4 is equal to -42 | ||
irced needs a vision exam | |||
21:52
Summertime left
|
|||
irced | m: my &blockcode := -> $a, $b { $a + $b}; say "{do {blockcode(2,2)}} is equal to -42"; | 21:52 | |
camelia | 4 is equal to -42 | ||
irced | m: my &blockcode := -> $a, $b { $a + $b}; say "{blockcode(2,2)} is equal to -42"; | ||
camelia | 4 is equal to -42 | ||
21:53
Summertime joined
|
|||
irced | m: my &blockcode := -> $a, $b { return $a + $b }; say "{blockcode(2,2)} is equal to -42"; | 21:54 | |
camelia | Attempt to return outside of any Routine in block <unit> at <tmp> line 1 |
||
irced | m: my &blockcode := -> $a, $b { return $a + $b }; say "{do {blockcode(2,2)}} is equal to -42"; | 21:55 | |
camelia | Attempt to return outside of any Routine in block <unit> at <tmp> line 1 |
||
irced | oops | ||
scratch that statement about do. | |||
21:56
eseyman left
|
|||
irced | or revise it anyway. | 21:56 | |
m: my &blockcode := -> $a, $b { return $a + $b }; say "{do {2 +2}} is equal to -42"; | 21:58 | ||
camelia | 4 is equal to -42 | ||
irced | so do does not call return after all | ||
but behaves like a subroutine in that the block can return | 21:59 | ||
22:00
eseyman joined
|
|||
irced | but that's not blockcode, which itself rejects the return keyword | 22:00 | |
22:00
Summertime left
|
|||
irced | leaving it again up to the parser to read the last evaluated expression in a "blockcode" | 22:01 | |
so blockcode passed into do is still blockcode, which will never have a return statement. of course, a do statement can return the last evaluated expression of the blockcode. | 22:03 | ||
so there is still consistency | |||
irced whew | |||
22:05
zingzhang joined,
Sgeo_ left
22:06
Sgeo_ joined
|
|||
irced | and talking about do as a subroutine was probably wrong. it instead takes a block of code (not a parameter that is blockcode :p) that can return | 22:07 | |
but in the end it's what the outer blockcode/routine is that matters | 22:10 | ||
22:10
spider_apocalyps left
|
|||
irced | so still a regex although it can have routines and do's nested and handle returns, the code block itself does not "return" and errors if a return statement is seen in its outermost part | 22:10 | |
so regex doesn't look for a return value and doesn't care about the last evaluated expression. though as we observed, a { } run in an interpolated assertion will read the last evaluated expression. nevertheless, it won't look for a return value since { return ... } is invalid | 22:15 | ||
22:16
rindolf left
22:17
cpan-p6 left
22:18
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
|
|||
irced | so in an interpolated assertion, we are no longer in the main pattern, but we are in a pattern with a slightly different role it seems, one where { } is run and its last evaluated expression is substituted into the interpolation | 22:18 | |
so it's best to think that anything "quoted" can be adverbially modified and an interpolated assertion is a special kind of "quote" is my stance | 22:20 | ||
john_parr | Has rakudo given up on targetting the JVM? It’s hard to find any recent developmentsin that area. | 22:22 | |
irced | i am using interpolated assertion to refer to lookbehind etc | 22:23 | |
i suppose only Rakudo folks can answer that? | 22:24 | ||
john_parr | I imagine some of them are here and aren’t pedantic autistic cunts? | ||
irced | who are you calling a cunt? | 22:25 | |
anyway, why is openjdk not in active development? | |||
john_parr | nobody in particular | ||
yeah, sure, openjdk is. | |||
irced | i asked a similar question here and learned that the jvm uses openjdk | 22:26 | |
Xliff | Java™ is going closed source, so OpenJDK is the only way left. | ||
So expect interest in the JVM to wane a bit. | 22:27 | ||
irced | therefore, Rakudo i assume is using OpenJDK | ||
john_parr | I’m sure the same opcodes would be emitted either way, why would it matter about the licensing around any particular java implementation? | ||
Xliff | Coz ppl don't like being sued? | ||
john_parr | LOL. I’ll come back on Monday. | 22:28 | |
john_parr slams door shut behind him. | |||
irced | hmmph | ||
Xliff | I would suggest everyone stop feeding john_parr if he continues to act like a troll. :( | 22:29 | |
tobs | john_parr: I know that the continuous integration keeps testing the JVM and people try to fix build errors there, but I haven't heard of dedicated efforts to improve it. I'm not paying attention to it, though, so sorry if I overlook someone's work on it. | 22:30 | |
john_parr | tobs: ah! thanks for the interesting answer. good to know! | ||
irced | tobs: thanks tobs for putting it into perspective | 22:31 | |
22:34
lizmat joined
22:40
empee0 left
|
|||
irced | revision 100000 do blocks also do not allow "return" statements. | 22:41 | |
22:42
Sgeo__ joined
|
|||
irced | one do's or not do's blockcode. one calls routines may "return" and if no return is specified, returns True, regardless of the last evaluated expression. | 22:44 | |
22:46
Sgeo_ left
|
|||
irced | err, returns last evaluated expression or expression explicitly returned | 22:51 | |
22:59
lucasb left
23:10
AlexDaniel joined
23:31
_jrjsmrtn joined
23:32
__jrjsmrtn__ left
23:53
leont joined
|