»ö« 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:00
ggherdov left
|
|||
AlexDaniel | commitatble6: 2015.07.2 my @a = 'a'..'c'; say lazy @a; | 00:00 | |
committable6 | AlexDaniel, ¦«2015.07.2»: a b c | ||
AlexDaniel | BenGoldberg: the change happened somewhere between 2015.07 and 2015.09, but can't tell when exactly | ||
would've been nice to know because the answer is sometimes in the commit message | 00:01 | ||
00:02
jackc2 joined
|
|||
BenGoldberg | Also, the Nil vs Any thing is a bit wierd. | 00:02 | |
00:02
ggherdov joined
|
|||
gfldex_ | AlexDaniel: Nil may be a dd artifact | 00:03 | |
AlexDaniel | BenGoldberg: ↑ | ||
00:05
bjz joined
|
|||
BenGoldberg wonders what would happen if whatever is creating those Nil values were to instead return Empty. | 00:05 | ||
m: say +eager 'a'..'c'; | |||
camelia | rakudo-moar aaec51: OUTPUT«3» | ||
BenGoldberg | m: say +lazy 'a'..'c'; | ||
camelia | rakudo-moar aaec51: OUTPUT«Cannot .elems a lazy list in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
BenGoldberg | m: say +eager lazy 'a'..'c'; | 00:06 | |
camelia | rakudo-moar aaec51: OUTPUT«3» | ||
BenGoldberg | m: .say for lazy 'a'..'c'; | ||
camelia | rakudo-moar aaec51: OUTPUT«abc» | ||
00:06
cdg left
00:10
pierre_ joined
00:15
mcmillhj joined
00:21
bjz left
00:24
mcmillhj left
00:26
bartolin_ joined,
Bucciarati_ joined,
snowman_ left
00:27
rindolf left
00:28
bartolin left,
Bucciarati left
00:36
mcmillhj joined,
pierre_ left
00:44
pierre_ joined
00:46
pierre_ left,
pierre_ joined
01:00
pierre_ left
01:04
eliasr left
01:05
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:08
pierre_ joined
01:12
pierre_ left
01:13
pierre_ joined
01:18
mcmillhj left
01:22
snowman_ joined
01:26
nadim left
01:41
FROGGS_ joined
01:45
FROGGS left,
Jesmaybe joined
01:46
ilbot3 left
01:47
ilbot3 joined
02:00
pierre_ left
02:02
stigo joined
02:07
pierre_ joined
02:12
pierre_ left
02:24
Actualeyes joined
02:28
cpage joined,
john51 joined
02:30
john51 left
02:32
aborazmeh left
02:33
john51 joined
02:35
john51 left
02:38
john51 joined,
pierre_ joined
02:40
john51 left
02:43
john51 joined
|
|||
seatek | oh my god grammars now - one thing keeps leading to another. my head's going to explode. i need to set up a webcam so someone could call an ambulance. like it would matter. oh, my poor monitors! | 02:48 | |
these are looking pretty fun and interesting though | |||
ugh. so much to rewrite now, though, if i use them. and then if i do, i'll be addicted, unable to use anything else ever again. | 02:49 | ||
so good it must be evil | 02:50 | ||
02:51
noganex_ joined,
Jesmaybe left,
pierre_ left
|
|||
seatek | i feel like i've had this dream before | 02:52 | |
02:54
pierre_ joined
02:59
itaipu joined
03:02
andrzejku_ joined
|
|||
seatek | this ».ast stuff feels like voodoo, like something tacked-on as an extra nifty feature. but this is how the language itself is composed? | 03:04 | |
have feeling learning grammars is going to make me learn about lot more in p6 than i can suspect right now | 03:05 | ||
03:05
mcmillhj joined
03:10
_28_ria left
03:11
cognominal joined
03:12
_28_ria joined
03:13
dj_goku joined
03:16
Jesmaybe joined
03:21
itaipu left
03:22
itaipu joined
03:27
itaipu left
03:28
itaipu joined
03:34
mcmillhj left
|
|||
jackc2 | \HELP | 03:38 | |
03:39
jackc2 left
03:41
khw left
03:59
cibs left
04:01
cognominal left,
cibs joined
04:02
andrzejku_ left,
andrzejku_ joined
|
|||
BenGoldberg | m: dd gather take 42; | 04:08 | |
camelia | rakudo-moar aaec51: OUTPUT«(42,).Seq» | ||
04:12
BenGoldberg left
04:13
pierre_ left
04:16
xyf joined
|
|||
xyf | hello. | 04:16 | |
04:17
pierre_ joined
04:23
xyf left
04:25
canopus left
04:29
vendethiel left
04:30
vendethiel joined
04:33
Cabanossi joined
04:34
canopus joined
04:35
brillenfux joined
04:36
itaipu left
04:45
pierre_ left
04:52
wamba joined
05:13
Jesmaybe left
05:16
vendethiel- joined,
vendethiel left
05:17
FROGGS_ left
05:29
skids left
05:46
wamba left,
ufobat joined
05:52
RabidGravy joined
06:00
zacts left
06:03
zacts joined
06:05
abraxxa joined
06:19
Actualeyes left,
neuraload joined
06:22
wamba joined
06:24
firstdayonthejob joined
|
|||
nine | seatek: yes, grammars are just awesome :) | 06:27 | |
06:29
RabidGravy left
06:33
firstdayonthejob left
06:38
cpage_ joined
06:41
broquaint joined
06:42
Actualeyes joined,
literal_ joined,
cpage left,
broquain1 left,
cpage_ is now known as cpage
06:43
wamba left
06:54
dataangel left
06:57
snowman_ left
|
|||
dalek | line-Perl5: b6bc0fc | niner++ | p5helper.c: Fix warning due to unset return value in p5_init_callbacks |
06:58 | |
07:02
wamba joined
07:03
bjz joined
07:08
Actualeyes left
07:11
CIAvash joined
07:13
domidumont joined
07:14
darutoko joined
07:16
bjz left
07:17
domidumont left
07:18
domidumont joined
07:24
Actualeyes joined
07:31
bjz joined
|
|||
lizmat clickbaits p6weekly.wordpress.com/2016/10/24/...ning-star/ | 07:34 | ||
07:35
girafe left
07:42
hchienjo joined
07:44
dakkar joined
07:45
aries_liuxueyang joined
07:47
hchienjo left
07:50
wamba left
07:55
nadim joined,
aries_liuxueyang left
07:57
aries_liuxueyang joined
08:01
jonas3 joined
08:04
seatek left
08:08
pierre__ joined
08:12
dj_goku_ joined,
pierre__ left
08:14
FROGGS joined
08:15
dj_goku left
08:16
aries_liuxueyang left
08:19
FROGGS left
08:24
aries_liuxueyang joined
08:27
pierre_ joined
08:28
aries_liuxueyang left
|
|||
f3ew_ | .win 15 | 08:38 | |
08:41
Bucciarati_ is now known as Bucciarati
|
|||
moritz | lizmat++ | 08:46 | |
08:51
wamba joined
08:56
wamba left,
bjz_ joined
08:58
bjz left,
andrzejku_ left
08:59
andrzejku_ joined
09:05
wamba joined
09:07
andrzejku_ left,
andrzejku_ joined
09:08
literal_ is now known as literal
09:09
grondilu joined
|
|||
grondilu | m: say log(8) %% log(2) | 09:09 | |
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | weird, I get false in local | 09:10 | |
$ perl6 --version | 09:11 | ||
This is Rakudo version 2016.10-37-g127b3be built on MoarVM version 2016.10-15-g715e39a | |||
implementing Perl 6.c | |||
m: print $*VM<version> | |||
camelia | rakudo-moar 84b4c8: OUTPUT«Type VM does not support associative indexing. in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
grondilu | m: print $*VERSION | ||
camelia | rakudo-moar 84b4c8: OUTPUT«Dynamic variable $*VERSION not found in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
grondilu | m: print $?VERSION | ||
camelia | rakudo-moar 84b4c8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$?VERSION' is not declared. Did you mean 'Version'?at <tmp>:1------> 3print 7⏏5$?VERSION» | ||
grondilu | I never ever can remember how to get that | ||
m: say $*PERL | 09:12 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«Perl 6 (6.c)» | ||
grondilu | m: say $*PERL.^methods | ||
camelia | rakudo-moar 84b4c8: OUTPUT«(BUILD VMnames DISTROnames KERNELnames Str gist compiler name auth version signature desc)» | ||
grondilu | m: say $*PERL.version | ||
camelia | rakudo-moar 84b4c8: OUTPUT«v6.c» | ||
grondilu | m: say $*PERL.compiler | ||
camelia | rakudo-moar 84b4c8: OUTPUT«rakudo (2016.10.53.g.84.b.4.c.83)» | ||
09:15
rindolf joined
|
|||
grondilu | m: say log(8) % log(2) | 09:22 | |
camelia | rakudo-moar 84b4c8: OUTPUT«0» | ||
grondilu | I get 0.693147180559945 in local | ||
m: say log(8) % log(2) - log(2) | 09:23 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«-0.693147180559945» | ||
grondilu | I get -1.11022302462516e-16 | ||
p6: say log(8) %% log(2) | 09:24 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | star: say log(8) %% log(2) | ||
camelia | star-m 2016.04: OUTPUT«True» | ||
grondilu | jvm: say log(8) %% log(2) | ||
j: say log(8) %% log(2) | |||
camelia | rakudo-jvm 8d357a: OUTPUT«True» | ||
grondilu tries on his Pi | 09:25 | ||
grondilu gets the correct result there | |||
09:26
aries_liuxueyang joined
09:27
TEttinger left
|
|||
grondilu | m: say map .log %% 2.log ?? '.' !! '!', 1..10; | 09:28 | |
camelia | rakudo-moar 84b4c8: OUTPUT«No such method 'log' for invocant of type 'Any' in block <unit> at <tmp> line 1» | ||
grondilu | m: say map *.log %% 2.log ?? '.' !! '!', 1..10; | ||
camelia | rakudo-moar 84b4c8: OUTPUT«Cannot resolve caller map(Str, Range); none of these signatures match: (&code, + is raw) in block <unit> at <tmp> line 1» | ||
grondilu | m: say join map { .log %% 2.log ?? '.' !! '!' }, 1..10; | 09:29 | |
camelia | rakudo-moar 84b4c8: OUTPUT«» | ||
grondilu | m: say join '', map { .log %% 2.log ?? '.' !! '!' }, 1..10; | ||
camelia | rakudo-moar 84b4c8: OUTPUT«..!.!!!.!!» | ||
grondilu | am I missing something here? | ||
m: say join '', map { .log %% 2.log ?? '.' !! '!' }, 1..20; | |||
camelia | rakudo-moar 84b4c8: OUTPUT«..!.!!!.!!!!!!!.!!!!» | ||
grondilu | m: say join '', map { (.log %% 2.log) ?? '.' !! '!' }, 1..20; | 09:31 | |
camelia | rakudo-moar 84b4c8: OUTPUT«..!.!!!.!!!!!!!.!!!!» | ||
grondilu | m: say join '', map { (1 +< .msb == $_) ?? '.' !! '!' }, 1..20; | 09:32 | |
camelia | rakudo-moar 84b4c8: OUTPUT«..!.!!!.!!!!!!!.!!!!» | ||
grondilu | oh man, I'm so dumb | ||
m: say join '', map { (.log %% 2.log) ?? '.' !! '!' }, 2 <<**<< 1..20; | 09:33 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«.!.!!!.!!!!!!!.!!!!» | ||
grondilu | m: say join '', map { (1 +< .msb == $_) ?? '.' !! '!' }, 2 <<**<< 1..20; | ||
camelia | rakudo-moar 84b4c8: OUTPUT«.!.!!!.!!!!!!!.!!!!» | ||
grondilu | jeez | ||
m: say 2**3 == 1 +< 3 | 09:34 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | m: say 2**6 == 1 +< 6 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | m: say (2**7).msb | ||
camelia | rakudo-moar 84b4c8: OUTPUT«7» | ||
grondilu | m: say (1 +< .msb == $_) given 2**2 | 09:35 | |
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | m: say (1 +< .msb == $_) given 2**3 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | m: say (1 +< .msb == $_) given 2**4 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | m: say (1 +< .msb == $_) for 2 <<**<< 1..5 | 09:36 | |
camelia | rakudo-moar 84b4c8: OUTPUT«TrueFalseTrueFalse» | ||
grondilu | m: say (1 +< .msb == $_) for 2 <<**<< 2..4 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | ?? | ||
m: say (1 +< .msb == $_) for 2 <<**<< [2..4] | 09:37 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«TrueTrueTrue» | ||
grondilu | ???? | ||
m: say join '', map { (1 +< .msb == $_) ?? '.' !! '!' }, 2 <<**<< [1..20]; | |||
camelia | rakudo-moar 84b4c8: OUTPUT«....................» | ||
grondilu | m: say 2 <<**<< 1..20 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«2..20» | ||
grondilu | wat? | ||
* | 09:38 | ||
m: say join '', map { .log %% 2.log ?? '.' !! '!' }, 2 <<**<< [1..20]; | 09:39 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«....................» | ||
09:39
aries_liuxueyang left
|
|||
grondilu | anyway in local I get ..!.!!!.!!!!!!!.!!!! | 09:40 | |
09:46
aries_liuxueyang joined
09:48
maybekoo2 joined
09:56
pierre_ left
10:01
pierre_ joined
10:05
pierre_ left
10:07
maybekoo2 left
10:12
pierre_ joined
|
|||
grondilu | m: my num64 $x = log(8); say $x %% log(2) | 10:20 | |
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu | m: my num64 $x = log(8); say $x %% my num64 $ = log(2) | ||
camelia | rakudo-moar 84b4c8: OUTPUT«True» | ||
grondilu gives up | |||
10:22
itaipu joined
10:30
perlawhirl joined
|
|||
viki | grondilu: True is the correct result. ln(8)/ln(2) is 3, so there's no remainder | 10:34 | |
10:35
pierre_ left
10:38
labster left
|
|||
viki | I don't know how you get ..!.!!!.!!!!!!!.!!!! locally, considering all of those would be powers of 2 and ln(n)/ln(2) would be log₂(n), giving you the original power and no remainder. Are you sure you're escaping shell characters right, if you're running it in the shell? | 10:39 | |
10:40
aries_liuxueyang left
|
|||
viki | m: say 2 <<**<< (1..20) | 10:40 | |
camelia | rakudo-moar 84b4c8: OUTPUT«(2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576)» | ||
10:41
aries_liuxueyang joined,
pierre_ joined
|
|||
moritz | viki: well, ln is a floating point operation, with all the caveats attached | 10:44 | |
m: say map { .log / 2.log }, 2 X** 1..20 | |||
camelia | rakudo-moar 84b4c8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Missing comma after block argument to mapat <tmp>:1------> 3say map { .log / 2.log }, 2 X** 1..207⏏5<EOL>» | ||
moritz | m: say map({ .log / 2.log }, 2 X** 1..20) | 10:45 | |
camelia | rakudo-moar 84b4c8: OUTPUT«Cannot resolve caller map(Seq); none of these signatures match: (&code, + is raw) in block <unit> at <tmp> line 1» | ||
moritz too stupid today | |||
m: say map(*.log / 2.log, 2 X** 1..20) | |||
camelia | rakudo-moar 84b4c8: OUTPUT«Cannot resolve caller map(Seq); none of these signatures match: (&code, + is raw) in block <unit> at <tmp> line 1» | ||
viki | moritz: then log($n, $b) would be entirely broken. The caveats cancel out | ||
moritz | viki: having numerical errors != entirely broken | 10:46 | |
10:46
pierre_ left
|
|||
moritz | m: say log(2**$_, 2) for 1..20 | 10:46 | |
camelia | rakudo-moar 84b4c8: OUTPUT«1234567891011121314151617181920» | ||
moritz | m: say log(2**$_) / log(2) for 1..20 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«1234567891011121314151617181920» | ||
moritz | m: say log(2**$_) / log(2) for 21..50 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«212223242526272829303132333435363738394041424344454647484950» | ||
10:47
Actualeyes left
|
|||
moritz | m: say log(2**$_) / log(2) for 51..80 | 10:48 | |
camelia | rakudo-moar 84b4c8: OUTPUT«515253545556575859606162636465666768697071727374757677787980» | ||
moritz | m: say log(2**$_) / log(2) for 100..119 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«100101102103104105106107108109110111112113114115116117118119» | ||
viki | m: say log(666**$_) / log(666) for 100..119 | 10:49 | |
camelia | rakudo-moar 84b4c8: OUTPUT«100101102103104105106107108109InfInfInfInfInfInfInfInfInfInf» | ||
10:49
b^_^d left
|
|||
moritz | m: say log(2**$_) / log(2) for 150, 200, 250, 300 | 10:49 | |
camelia | rakudo-moar 84b4c8: OUTPUT«150200250300» | ||
moritz | m: say log(2**$_) / log(2) == $_ for 150, 200, 250, 300 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«TrueTrueFalseTrue» | ||
moritz | hah | ||
stringification rounds off small errors | |||
10:49
d^_^b joined
|
|||
viki | I see | 10:50 | |
m: say log(τ**$_) / log(τ) for 100..119 | |||
camelia | rakudo-moar 84b4c8: OUTPUT«100101102103104105106107108109110111112113114115116117118119» | ||
viki | m: say log(τ**$_) / log(τ) == τ for 100..119 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«FalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalse» | ||
viki | m: say log(τ**$_) / log(τ) %% τ for 100..119 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«FalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalse» | ||
viki stands corrected | |||
m: say (log(τ**$_) / log(τ)) %% τ for 100..119 | 10:51 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«FalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalse» | ||
10:51
bjz_ left,
bjz joined
|
|||
viki | m: say (log(τ**$_) / log(τ)).round(10) %% τ.round(10) for 100..119 | 10:52 | |
camelia | rakudo-moar 84b4c8: OUTPUT«TrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrue» | ||
viki | m: say (log(τ**$_) / log(τ)).round(1e10) %% τ.round(1e-10) for 100..119 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«TrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrue» | ||
viki | bah | ||
viki & | |||
10:52
Actualeyes joined
10:57
pierre_ joined
|
|||
grondilu | the weirdest thing to me is that log(8) / log(2) %% 1 is true on my machine | 11:10 | |
and yet log(8) %% log(2) isn't | 11:11 | ||
moritz | does %% coerce its arguments? | 11:12 | |
m: say &infix:<%%>.candidates | 11:13 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«(sub infix:<%%> () { #`(Sub|53188128) ... } sub infix:<%%> ($) { #`(Sub|53188280) ... } sub infix:<%%> (\a, \b) { #`(Sub|53188432) ... })» | ||
moritz | m: say 1.001e0 %% 1 | ||
camelia | rakudo-moar 84b4c8: OUTPUT«False» | ||
11:16
pierre_ left
|
|||
grondilu suspects nqp is to blame | 11:17 | ||
11:18
pierre_ joined
|
|||
grondilu | m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(log(8)), nqp::unbox_n(log(2)))) | 11:19 | |
camelia | rakudo-moar 84b4c8: OUTPUT«0» | ||
grondilu | I get log(2) locally | ||
m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(nqp::log(8)), nqp::unbox_n(nqp::log(2)))) | |||
camelia | rakudo-moar 84b4c8: OUTPUT«===SORRY!===No registered operation handler for 'log'» | ||
grondilu | m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(nqp::log(8e0)), nqp::unbox_n(nqp::log(2e0)))) | 11:20 | |
camelia | rakudo-moar 84b4c8: OUTPUT«===SORRY!===No registered operation handler for 'log'» | ||
grondilu | m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(nqp::log_n(8)), nqp::unbox_n(nqp::log_n(2)))) | ||
camelia | rakudo-moar 84b4c8: OUTPUT«This type cannot unbox to a native number: P6opaque, Int in block <unit> at <tmp> line 1» | ||
grondilu | m: use nqp; say nqp::p6box_n(nqp::mod_n(nqp::unbox_n(nqp::log_n(8e0)), nqp::unbox_n(nqp::log_n(2e0)))) | ||
camelia | rakudo-moar 84b4c8: OUTPUT«0» | ||
grondilu | hum | ||
sorry that's ok | |||
I still get log(2) locally | 11:21 | ||
$ nqp --version | |||
This is nqp version 2016.10-5-gb7335a9 built on MoarVM version 2016.10-15-g715e39a | |||
is there a way to know which nqp version Perl 6 is using with "use nqp;"? | 11:22 | ||
like nqp::version() or something? | 11:23 | ||
timotimo | well nqp::backendconfig()<version> is the moar version at least | 11:24 | |
grondilu | m: use nqp; nqp::backendconfig()<version> | ||
camelia | ( no output ) | ||
grondilu | m: use nqp; say nqp::backendconfig()<version> | ||
camelia | rakudo-moar 84b4c8: OUTPUT«2016.10-15-g715e39a» | ||
timotimo | but really, with "use nqp" you're not actually using nqp | ||
like, you're not using the nqp compiler | |||
you're just asking for nqp::foo ops from the perl6 compiler | 11:25 | ||
tbrowder | ref docs and modules: is this valid in p6: "use Foo 'bar'" where bar is a subroutine in module Foo? | ||
grondilu | yeah but I just want to check I'm using the same locally as in the bot here | ||
turns out I do | |||
timotimo | then you'll want to know the moar version | ||
tbrowder | if so, how should it be exported? | ||
timotimo | tbrowder: needs to be '&bar' at the very least | ||
tbrowder | ok, didn't think of the sigil, thanks! | 11:26 | |
11:27
g4 joined,
g4 left,
g4 joined
11:44
gfldex_ is now known as gfldex
11:47
pierre_ left
|
|||
tbrowder | timtimo: hm, i cannot find any way to do "use Foo <&bar>;". i can't see that it's possible: proof otherwise would be beneficial! | 11:55 | |
11:57
zakharyas joined
|
|||
tbrowder | and the reason it's not may be that a subroutine exported by default in a module is not actually used unless it is explicitly called in a using program--which is a 'good thing' IMHO. | 11:58 | |
timotimo | it would be kind of weird if your program would use all the subs you're not calling for you after exporting | 12:00 | |
"hey, you forgot to use this rm-rf sub, i'll just invoke it for you real quick" | |||
grondilu | lol | 12:01 | |
tbrowder | agreed, but i'm trying to look at the case of the module distributor: what is the best practice for a module with miscellaneous types of subroutines? export all by default? or try to group them with tags? tag each one individually? what if i export sub foo and the user wants his own sub foo, but he wants all the other subs in my module? | 12:09 | |
12:11
CIAvash left
|
|||
tbrowder | or at least he wants to use a subset of all... | 12:11 | |
viki | There's a ticket for use Foo <&bar>; IIRC that only works with require right now | 12:16 | |
tbrowder | viki: ok, some progress! do you know how &bar is exported in that ticket? | 12:18 | |
viki | What do you mean "how"? | ||
It's not implemented yet. | |||
And proposed syntax is exactly that; you give it a list of symbols to export | |||
And IIRC ATM that'd clash with EXPORT sub args | 12:19 | ||
tbrowder | well, inside the module itself. is it "sub bar() is export {" or "sub bar() is export(:sometag) {" or ??? | 12:20 | |
viki | tbrowder: the whole idea is for the user of the module to control what's imported into their namespace. | ||
Right now that's controlled by the module's author and they're free to crap into user's namespace as they wish, which isn't great. | 12:21 | ||
tbrowder: and I guess all symbols marked OK for export can be asked by user individually | 12:22 | ||
tbrowder: there's something in the speculation about it. And I'm sure the ticket references that portion | |||
tbrowder | ok, so that has been the concern i've tried to express, and I'll add that to the docs. got a ticket number? | 12:23 | |
viki | nope | ||
12:23
bjz left
12:24
bjz joined
|
|||
tbrowder | "asked" by user meaning "called" by user? | 12:24 | |
viki | I'd think the mechanism can be implemented by module author right now. Just take symbols via EXPORT and return a Map with them | ||
tbrowder: asked by use Foo <&bar>; | 12:25 | ||
12:25
ggoebel left
|
|||
viki | tbrowder: basically the way Perl 5 does it. | 12:26 | |
tbrowder | hm, i can't see that's currently (as least as described in the docs) any different than marking each sub with "export...", but i'll try to test it. | 12:27 | |
thanks | |||
viki | tbrowder: marking each sub with export would import it on module's use | 12:29 | |
12:29
Khisanth joined,
pierre_ joined
|
|||
viki | tbrowder: and you end up with problems like this: fpaste.scsys.co.uk/537887 | 12:31 | |
12:31
rurban joined
|
|||
viki | tbrowder: I did not ask for `say` to be imported. And sure someone might not do this for `say` but it's easy to accidentally mess up some rare built in no one heard of, but your code actually uses. | 12:31 | |
And now you have a bug in your code and you don't know why. And it's hard to track it down to one of the dozen of used modules that modified a core built in you were using | 12:32 | ||
tbrowder | well i'm glad the problem is recognized, i have been nervous about use of export in my ecosystem modules. what do you recommend for current practice, something like "export(:ALL)" so at least the user has to knowingly import all? | 12:33 | |
dalek | c: 5b70244 | (Francis Grizzly Smit)++ | doc/Type/Str.pod6: fixed sprintf doc missing $a in order of arguments example |
12:34 | |
viki | m: SLICE_HUH 42, [], %, % | ||
camelia | rakudo-moar 84b4c8: OUTPUT«(signal SEGV)» | ||
dalek | c: 763aa8b | (Francis Grizzly Smit)++ | doc/Type/Str.pod6: fixed sprintf doc missing $a in order of arguments example |
12:35 | |
viki | tbrowder: to me that looks like asking the user to do extra typing to get the same behaviour as without it | ||
Don't think I have any recommendations :) | |||
12:35
pierre_ left,
brillenfux left
|
|||
tbrowder | okay, thanks, hope a smart person or persons fix this soonish! | 12:36 | |
but i could tag EVERY sub with a unique tag to force the user to use them explicitly... | 12:37 | ||
what would you as a user of my module think? i think i could even tag them with the subroutine name itself! | 12:39 | ||
viki | Depends on the module. And as I've said, you can implement the use Foo <&bar &ber>; with EXPORT sub: github.com/zoffixznet/perl6-SPEC-F...pm6#L7-L12 | 12:40 | |
well that module almost does it; it doesn't require the &: github.com/zoffixznet/perl6-SPEC-Func#synopsis | |||
My pet peeve in Perl 5 land is module that provide a single function but require you to explicitly import it.... That's where "best practice" trumps common sense. | 12:41 | ||
viki & | |||
tbrowder | but as i read the docs "*@wanted" is the same as marking a sub "export(:wanted)" | 12:42 | |
i agree with the single-sub complaint... | |||
ok, in current rakudo land: i distriube a module where each of 1..N subs is marked "is export(:s1)",..."is export(:sN)" | 12:45 | ||
12:46
harrison_ joined
|
|||
perlpilot | What I want to know is how to explicitly *not* export something that may conflict locally. | 12:46 | |
12:47
harrison_ left
|
|||
tbrowder | well, that would be cool, but it seems that's not possible at the moment. maybe you could make that comment on the ticket i found RT #127305 | 12:48 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127305 | ||
12:54
perlawhirl left
|
|||
gfldex | lizmat: i wrote you a blogpost so you don't have to go and hunt down something unrelated for the next weekly :-> gfldex.wordpress.com/2016/10/25/yo...ou-an-get/ | 12:54 | |
lizmat | an get ? | 12:55 | |
:) | |||
gfldex | i didn't proveread that part it seams :) | ||
lizmat | nice blog :-) | ||
keep them coming :-) | |||
13:00
TheovdH joined
13:01
zakharyas left
|
|||
lizmat | gfldex: re caching "subset C where $ //= ::('M::C');" | 13:01 | |
isn't a bare sigil in that context a state var, so "subset C where $ = ::('M::C')" is maybe enough ? | 13:02 | ||
gfldex | lizmat: i believe so but it's hard to test. Also, I like //= better because it clearly shows my intend. Code golfs are neat, not necessary. :) | 13:04 | |
lizmat | okidoki | 13:05 | |
tbrowder | timotimo:, viki: and perlpilot: i added a comment to that ticket 127305, please critique it when you get a chance | 13:09 | |
13:10
cdg joined,
cdg left,
cdg joined
|
|||
lizmat | tbrowder: if you want to refer to a discussion, you can refer to it in a URL | 13:10 | |
perlpilot | tbrowder: you said what I meant better than I did :) | 13:11 | |
lizmat | tbrowder: you mean: irclog.perlgeek.de/perl6/2016-10-25#i_13461499 ? | 13:12 | |
TheovdH | Hi, is there a way to get consecutive members (i.e. named and unnamed subpatterns) from a Match object? Or do I need to create an explicit action for each rule if I want such a list? | ||
lizmat | if the match object is in $/, you can use $0, $1 and $<named> or is that not what you mean? | ||
perlpilot | TheovdH: if you put them in (), then it's just $/[0], $/[1], $/[2], etc. | 13:13 | |
lizmat | $/[0,1,2] # as a slice | ||
$/<foo bar baz> # named captures as a slice | 13:14 | ||
jnthn | m: say ('bcd' ~~ /(.)$<x>=.(.)/).caps | ||
camelia | rakudo-moar 364e67: OUTPUT«(0 => 「b」 x => 「c」 1 => 「d」)» | ||
13:14
bjz left,
bjz_ joined
|
|||
perlpilot | jnthn++ | 13:14 | |
tbrowder | lizmat: thanks, i'll add that | 13:15 | |
lizmat | tbrowder: you know how to create such a link ? | 13:16 | |
tbrowder | um, no... | ||
but i think i can look at the logs and figure it out | 13:17 | ||
viki | tbrowder: the time stamps in the logs are the links to those lines | 13:20 | |
moritz | TheovdH: .caps might be what you want | 13:21 | |
TheovdH: and .chunks if you want non-captured text too | 13:22 | ||
TheovdH | limat: perlpilot: moritz: Thanks. I need to experiment some more to access elements deeper in the Match object. | 13:24 | |
moritz | TheovdH: if you try to go more than a few levels deep, it might be easier to use action methods that reduce it to a more managable data structure | 13:26 | |
13:26
rurban left
13:27
pierre_ joined
13:35
pmurias joined
|
|||
dalek | c: 9eaf716 | coke++ | xt/aspell.t: add notes on how to make tests pass |
13:35 | |
13:38
aborazmeh joined
13:39
aborazmeh left,
aborazmeh joined
13:43
aborazmeh left
13:46
khw joined
|
|||
TheovdH | lizmat: moritz: What's wrong with something like $/<path><in><parse><tree>[3] ? | 13:47 | |
lizmat | nothing | 13:48 | |
conceptually :-) | |||
moritz | TheovdH: coupling | ||
DrForr waves at TheovdH . | |||
lizmat | moritz: elaborate ? | ||
moritz | lizmat: I like to structure my code to be structured in weakly coupled units, where unit A doesn't need to know about the inner workings of unit B | 13:49 | |
arnsholt | If you ever want to change the grammar, it'll suck | ||
lizmat | ah, ok, yes, agree | 13:50 | |
arnsholt | Since you'll have to change all over the code, rather than localized | ||
moritz | lizmat: but if the parser for a table needs to know how each cell type is parsed internally, they are tightly coupled, changes become a PITA | ||
shoving a well-defined data structure into $/.ast aka $/.made is a very natural mini-API that prevents such tight coupling | 13:51 | ||
13:52
grondilu left
|
|||
TheovdH | moritz: building such an API still requires me to write an action that processes the members consecutively, which is the essence of my problem. | 13:54 | |
moritz: I am aware that I am struggling with Perl6 more than with the concept of parsing. | 13:55 | ||
13:55
colomon joined,
bjz_ left,
grondilu joined
|
|||
arnsholt | TheovdH: Wait, you want to extract a list of *unrelated* captures? | 13:56 | |
moritz | TheovdH: you don't need actions for all named regexes, fwiw | 13:58 | |
TheovdH | arnsholt: consecutive. the members of rule in their original order. | 13:59 | |
arnsholt | Sure, but not related by anything other than being siblings in the parse tree | ||
TheovdH | arnsholt: correct. | 14:00 | |
arnsholt | That seems like a smell to me. Why do you need to do it that way? | ||
jnthn | TheovdH: Do you have a small example of the rule? | ||
If it's something like [<foo> | <bar> | <baz>]* then you may find it neater to factor it as a protoregex | 14:01 | ||
TheovdH | jnthn: silly example: token chars() { <char> $<xyzzy>=':' <char> <char> $<xozzy>='!' } | ||
jnthn | Did you mean for xozzy to be xyzzy (e.g. they're overlapping in name)? | 14:02 | |
arnsholt | If you need to sequence side-effects, that's a pretty clear case for action methods for the subrules invoked | ||
TheovdH | jnthn: no | 14:03 | |
jnthn | OK, just checking | ||
But I don't see why $/.caps in the action method won't give you what's needed | 14:04 | ||
TheovdH | This is probably just my deplorable grasp of Perl 6, but how would I just join the members? | ||
14:04
Upasaka joined
|
|||
jnthn | What, you just want the whole string that this rule matched? | 14:04 | |
moritz | that's ~$/ | ||
DrForr | D*mn, if I weren't in a meeting I'd be able to make some suggestions... | ||
arnsholt | But *why*? What is it that makes it important to process siblings in order of mention in the rule? | 14:05 | |
TheovdH | jnthn: Aaah. I think you are right. | 14:07 | |
14:07
skids joined
14:08
dmaestro joined
|
|||
TheovdH | jnthn: moritz: Yes. It was my struggle with Perl6 operators. | 14:09 | |
tbrowder | lizmat and viki: thanks, i see the link in the logs | ||
TheovdH | ansholt: I am working on systematic conversion of some input. By default everything is maintained in order. | 14:11 | |
dmaestro | Is there another channel for rakudo-specific user experience questions, or is this the right place? | 14:14 | |
lizmat | dmaestro: this is the right place | ||
dmaestro | Thank! | 14:15 | |
I tried to upgrade to the latest rakudo star on my MacBook, and the downloadable .dmg is for Mac OS X 10.12 - any chance of providing an El Capitan build (10.11), since Sierra is pretty new and I may not upgrade real soon. | 14:16 | ||
Here's what I get: | 14:17 | ||
its-MacBook-Pro-DLS:~ douglasschrag$ perl6 -v dyld: lazy symbol binding failed: Symbol not found: _clock_gettime Referenced from: /Applications/Rakudo/lib/libmoar.dylib (which was built for Mac OS X 10.12) Expected in: /usr/lib/libSystem.B.dylib dyld: Symbol not found: _clock_gettime Referenced from: /Applications/Rakudo/lib/libmoar.dylib (which was built for Mac OS X 10.12) Expected in: /usr/lib/libSystem.B.dylib Trace/BPT | |||
viki | stmuk_: ping ^ | ||
tbrowder | 6 ref RT #127305: the IRC thread-start link was added to the ticket | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127305 | ||
14:22
pierre_ left,
pierre_ joined
|
|||
viki | dmaestro: stmuk_ is the Rakudo Star release manager, maybe when they're around they can help out. | 14:28 | |
dmaestro | Thanks, I'll keep looking. | ||
dalek | c: 8970224 | (Tom Browder)++ | doc/Language/modules.pod6: add some more info on module import vs. export |
14:30 | |
14:31
rindolf left
14:36
rindolf joined
14:37
snowman_ joined
14:38
CIAvash joined
14:43
darutoko left
14:51
jonas3 left
15:03
cdg left
|
|||
Ulti | dmaestro: Sierra isn't much of a change FYI, if you update XCode to the latest version under 10.11 you are in for a world of hurt if you dont also upgrade to 10.12 | 15:04 | |
dmaestro: in fact you have that error | |||
15:04
g4 left
|
|||
Ulti | I couldnt even build Rakudo on 10.11 with the latest XCode because of that linking error | 15:05 | |
I gave up fixing it because there are so many other reported issues | |||
15:07
pierre_ left
|
|||
geekosaur | you can download the xcode 7 clt from developer.apple.com downloads area and reinstall them over the xcode 8 tools | 15:07 | |
that's the official workaround until xcode 8.1 ships | |||
15:08
domidumont left
|
|||
Ulti | lame | 15:14 | |
skids wonders how apple devs pronounce "clt" :-) | |||
Ulti | but yeah I have had nothing go wrong just moving to Sierra, I haven't even rebuilt my homebrew stuff | ||
15:17
wamba left
|
|||
dalek | c: 2d88020 | (Tom Browder)++ | doc/Language/modules.pod6: correct errors after trying actual code Seems as if module import/export is very flexible, but a little tedious on the export side (which can be easily automated) by the user until rakudo does it for you). |
15:20 | |
15:21
FROGGS[mobile] joined
|
|||
viki | skids: "silt" :) | 15:21 | |
15:28
rudolfochrist joined
|
|||
dmaestro | Ulti: Thanks for the info. It's just really disruptive to _require_ a MacOS X upgrade to install Rakudo Star. It's not that hard for me, but I do need to schedule IT assistance on my work MacBook; and I've used XCode and could do what's needed, but I can't see the worth - how many other users might be turned off by that? The best alternative for most users of El Capitan would be just to stick with *2016.07 | 15:32 | |
But I _want_ the concurrency fixes Jonathon worked so hard on :-) | 15:33 | ||
viki | .oO( there's always sauce... ) |
15:34 | |
As in monthly compiler releases: rakudo.org/downloads/rakudo/ | |||
15:34
bsk_ joined
|
|||
mst | dmaestro: we don't require an OS X upgrade | 15:35 | |
dmaestro: however, you have upgraded to a version of XCode that will not work without an OS X upgrade | |||
dmaestro: if you downgrade XCode to a working version I'd expect it to build fine | |||
15:36
bsk_ left
|
|||
dmaestro | Well, only to install from the Rakudo* .dmg !! No, I'm not using XCode to install. Anyway, if I have to work at the build level, I'll be doing it on Linux. | 15:36 | |
mst | hm? | ||
oh, sorry, hmmm | |||
it may be possible to re-rev the dmg with an older version of XCode or whatever | |||
but we're now into "too much mac specific stuff" for me to have a good opinion | |||
so my apologies for the noise | 15:37 | ||
dmaestro | I want it on my work laptop only to facilitate learning, not really a need. | ||
mst: no problem :-) | |||
dalek | c: 7eef1f4 | (Tom Browder)++ | doc/Language/modules.pod6: clarify tag separator comments in the example |
||
15:49
abraxxa left,
CIAvash left
15:59
cognominal joined
16:16
wamba joined,
rurban joined
16:29
nicq20 joined,
canopus left
|
|||
nicq20 | Hello! o/ | 16:29 | |
viki | \o | 16:30 | |
[Coke] | dmaestro: if you're willing to install xcode, we can step you through a build from source, which doesn't solve the original problem, but would get you something to play with; also, if you have docker installed, you can run perl6-in-docker. | 16:34 | |
16:35
canopus joined
16:39
nicq20 left
16:40
dakkar left
16:49
cdg joined
16:52
wamba left
|
|||
dmaestro | Coke: Thanks for the offer, I'm interested in trying since I do have XCode installed already. | 16:56 | |
16:56
Actualeyes left
|
|||
dmaestro | That's if v7.3.1 isn't too out-of-date. | 16:58 | |
17:00
Actualeyes joined
17:08
rurban left
17:15
rurban joined
17:16
rurban left
|
|||
[Coke] | I'm on 8.0 on 10.11.6 | 17:19 | |
17:43
rurban joined,
domidumont joined
17:52
rurban left
17:56
cdg left
|
|||
dalek | c: 0ce48fe | (Tom Browder)++ | doc/Language/modules.pod6: capitalize first word in a sentence |
18:01 | |
dmaestro | Coke: Looks like I need to update to get a better 'tar' - so I'll go with 8.0 | 18:12 | |
18:17
lostinfog joined
18:20
dmaestro left
18:21
dmaestro joined,
cibs left
18:22
RabidGravy joined,
rudolfochrist left
18:23
cibs joined
18:27
FROGGS joined,
FROGGS[mobile] left
18:33
andrzejku joined
18:39
wamba joined
|
|||
viki | mst: what's considered a distro for PSIXDISTS? ( re github.com/perl6/ecosystem/issues/255 ) | 18:41 | |
mst: like, what's blowing up? Is it making automatic releases from each git repo commit or what? | 18:42 | ||
DrForr! | 18:43 | ||
mst | viki: you'd want to ask ranguard about that, I just got involved because he was about to stop trying after your original responses suggested nobody cared :P | ||
viki | :( | 18:44 | |
mst | I think he may be on holiday at the moment though, so what I'd suggest is that you ask questions on the ticket | 18:45 | |
and then I'll kick him to have a look when he's got sufficient internet | |||
18:46
labster joined
|
|||
viki | mst: but what's amusing is he proved my point. Here he's added the "mandatory" meta test but never actually ran it so the repo still contains a META error: github.com/drforr/perl6-Perl6-Parser/pull/1 | 18:46 | |
18:46
setty1 joined
18:48
sufrostico left
|
|||
mst | viki: well, yes, but that point was nothing to do with what we were actually discussing | 18:50 | |
viki | Considering the ticket is titled "Module list should check modules META.info is correct" I thought it did. | 18:51 | |
Or rather, considering the poposition was to make it a requirement that a module that's added to ecosystem has Test::META as prepres, I thought it id. | 18:52 | ||
DrForr's module has Test::META as prereq, yet has broken META, ergo making Test::META a mandatory requirement for ecosystem membership doesn't solve any problems. | |||
</grumpy> | |||
[Coke] | I love the word "poposition", and we have to make that mean something | ||
mst | viki: no, the Test::Meta-as-requirement was nothing to do with ranguard or I | 18:54 | |
viki: it was when you started going on about that as if ranguard had proposed it that he noped out | |||
gfldex | [Coke]: see dict.leo.org/ende/index_de.html#/se...&pos=0 | ||
18:55
girafe joined
|
|||
gfldex | so it's basically where you bum is | 18:55 | |
mst | viki: you inventned a 'proposition to make Test::META a requirement' - that was the problem. nobody ever wanted that, it made no sense, and then you shouted at other people for it making no sense :P | ||
viki: meanwhile, what we *actually* want is a modulelist that is *probably* uploadable | |||
TheovdH | arnsholt: as a first exercise I created a routine that takes a Match object and writes a parse tree. Example of a projection where order is relevant. | 18:56 | |
viki | mst: well, that's what I see from this. RabidGravy said there's Test::META and ranguard says can ecosystem-team make it a requirement to META.list: i.imgur.com/3QcjvPD.png | 18:57 | |
18:57
nicq20 joined
|
|||
nicq20 | Hello o/ | 18:57 | |
viki | \o | ||
mst | viki: oh, yes, sorry, RabidGravy suggested it | ||
viki: I'm sorry that the ecosystem team proposed a solutioln the ecosystem team didn't like, but that still isn't ranguard's fault | 18:58 | ||
viki | I'll wait for ranguard to comment on the ticket. I suspect modules.perl6.org dist builder can generate a list of modules that "probably upload" | ||
It already has a JSON validator. Needs a checker that source URL actually has source... not sure what else. | 18:59 | ||
mst | viki: point, basically, is that for us it was us: "here's a problem" you: "ok, here's the solution" us: "ok, could you require the solution then" you: "THAT ISN'T A SOLUTION" us: "wtf?" | ||
viki | :} | ||
mst | can you see how it reads like that from outside? | ||
viki | Yes. | ||
mst | anyway, now we've established that we're all idiots, hopefully we can get somewhere :) | 19:00 | |
19:02
toolforger1 joined
|
|||
El_Che in his best Dr Phil's voice: so, mst, when did you discovered you were an idiot? Did it hurt? | 19:02 | ||
mst | I find it's the sort of thing one doesn't so much discover as remember, repeatedly | 19:07 | |
[Coke] | OW! (oh, right) | ||
breinbaas | (IQ is an imaginary number) | 19:08 | |
RabidGravy | so what data is it the PSIXDIST is trying to consume? | ||
toolforger1 | \o/ | 19:09 | |
Anybody got an idea how to best wrap one's mind around the rakudo-for-jvm buildchain? | 19:10 | ||
psch | toolforger1: what do you mean? the chain is quite a bit shorter than the one for rakudo-moar :) | ||
toolforger1 | Well, I am having trouble understanding the makefile | 19:11 | |
19:11
dylanwh_ is now known as dylanwh
|
|||
dalek | href="https://modules.perl6.org:">modules.perl6.org: 64878f9 | (Zoffix Znet)++ | lib/ModulesPerl6/DbBuilder/Dist/Source/GitLab.pm: Mark GitLab dists as always fresh We need a proper check for when new commits arrive, but for now, mark each dist fetch as fresh so postprocessor run properly. |
19:12 | |
toolforger1 | I find it difficult to combine the information from Configure.pl, makefile.in, and the various scripts that Configure calls | ||
viki | toolforger1: what are you trying to accomplish? | ||
toolforger1 | Oh... wait... I'm wrangling NQP, not Rakudo | 19:13 | |
I want to extract the regex part of NQP so it becomes useful to Java guys | |||
viki | ooooooh | 19:14 | |
psch | toolforger1: oh, that was on the ml recently i think? | ||
toolforger1 | (maybe that's foolish) | ||
:-) | |||
Yeah, I talked about it there | |||
Patrick was helpful but obviously code is better than words :-) | 19:15 | ||
psch | toolforger1: i'd start from the other end. as in, try to load a CompUnit containing only QRegex from Java | ||
toolforger1: the EvalServer should give at least a rudimentary how to load CompUnits, although i suspect that QRegex doesn't have an entryQbid | |||
toolforger1 | Issue is that the Java class name is some hex thing - looks like an SHA hash or something | ||
so the interface is going to be 100% unstable | |||
psch | $ find . -iname 'QRegex*jar' | 19:16 | |
./install/share/nqp/lib/QRegex.jar | |||
toolforger1 | Oh, it's in a jar already? | ||
psch | yeah | ||
might still be you have that same problem you mentioned when loading it though :) | |||
toolforger1 | How does the NQP runtime find the right class name? | 19:17 | |
psch | i think that's bootclassloader shenanigans..? | 19:18 | |
toolforger1 | Being a Java guy myself, I can answer that with a solid "no" | ||
19:18
girafe left
|
|||
toolforger1 | Class loaders are just another namespace hierarchy, essentially | 19:19 | |
psch | well, QRegex.jar is a basically a compilation unit for nqp | ||
toolforger1 | plus the ability to load stuff from whatever bytestream source you want, be it files, URLs, or zip file elements | 19:20 | |
psch | so it's, in a way, nqp bytecode wrapped in java bytecode | ||
toolforger1 | so I'd need the bytecode interpreter as well, but that's easy to find out | ||
psch | yeah, that's how i hacked together a half-backed attempt for perl6-in-a-jar | 19:21 | |
toolforger1 | These jars consist of a class plus something serialized, NQP bytecode I've been assuming | ||
psch | as in, wrap the whole rakudo interpreter into a single jar, make that interpret the precompiled .class that was output by rakudo before... | 19:22 | |
Ulti | dmaestro: well I always just use rakudobrew personally.. building Rakudo doesnt take very long and that way you can play with the latest perf improvements everyone here delivers weekly | ||
toolforger1 | I wanted to try and cut down; a full Perl6 interpreter in a .jar just to get new-style regexes seemed a bit over the top | 19:23 | |
19:23
acrussell joined
|
|||
psch | yeah, i'd agree with that | 19:23 | |
i'm not sure how much you can get around the concept itself though, considering lots of the regex engine is written in nqp | 19:24 | ||
as in, you might have to at least ship a (potentially stripped) nqp runtime | |||
toolforger1 | Yeah, you'd need as much of the NQP runtime as necessary to run regex | ||
Looking at the NQP docs, there's quite a lot of bytescodes that are definitely unnecessary. I don't know how easy it would be to strip the unneded bytecodes out though | 19:25 | ||
btw I am seeing a whole slew of QRegex jars | |||
DrForr | viki: I'm working on some talk proposals, but /msg me what's going wrong and I'll fix it tomorrow. | ||
viki | DrForr: just a trailing comma that isn't valid JSON. I sent a PR | 19:26 | |
psch | from the rakudo build dir i have 6, 4 of which are build artifacts | ||
or, well, bootstrap | |||
DrForr | Thanks, which module? | ||
viki | DrForr: github.com/drforr/perl6-Perl6-Parser/pull/2 | ||
DrForr | Ah. Glad to know people are actually looking at that :) | 19:27 | |
viki | FWIW, I found it by looking at modules.perl6.org/update.log :} | ||
toolforger1 | four in gen/jvm/stage[12], two in src/vm/jvm/stage0, and (NQPP[56])?QRegex.jar in the nqp directory itself | ||
DrForr | Done. | ||
viki | \o/ | 19:28 | |
psch | toolforger1: well, QRegex is the base regex language, the prefix should be self-explanatory | ||
DrForr | I'll keep that in mind, but gotta get these proposals out the door. | ||
psch | toolforger1: so you'd need QRegex and NQPP6Regex i think | ||
toolforger1 | Yeah - P5 regexes are already covered via PCRE, it's the P6 ones that I find awesome | 19:29 | |
viki | :D | ||
toolforger1 | Ah... the ones in stage2 are identical to the ones in gen/jvm/stage2 | 19:30 | |
psch | stage0 and stage1 are bootstrap steps | ||
well, i suppose technically stage2 is too :) | 19:31 | ||
toolforger1 | hehe | 19:32 | |
Eek. Main class is in default package. | 19:33 | ||
Best practice is to put it in a package that you own the domain name for, so this should go to org.perl, or org.rakudo, or org.perl6 | 19:34 | ||
Fortunately there are tools that can take a class file and its dependencies, and move everything to a different package | 19:35 | ||
psch | org.perl6.nqp | ||
is where everything else should sit | 19:36 | ||
toolforger1 | Changing the package name would probably be easier :-) | ||
psch | well, minus org.objectweb.asm | ||
and other deps too of course vOv | |||
toolforger1 | Yeah, the pulled-in libraries should stay where they are | ||
psch | i think this is the appropriate moment for "patches welcome", isn't it? :) | ||
toolforger1 | Well, I'd need to know where the code is that writes these classes :-) | 19:37 | |
psch | grepping for ClassWriter instances should narrow it down significantly | ||
it's probably not org.perl6.nqp.sixmodel.P6Opaque though :) | 19:38 | ||
[Coke] | I would recommend rakudo.org if we have to pick one. | ||
toolforger1 | perl6.org or rakudo.org is essentially a question of who's responsible for managing the namespace | 19:40 | |
psch | [Coke]: well, the rakudo-jvm specific java files for the perl6 binary sit in org.perl6.rakudo | ||
namespace that is | |||
[Coke] | ok. | 19:41 | |
psch | s/binary/runtime/ | ||
[Coke] dusts off his java for work. | |||
toolforger1 | If NQP's usefulness is restricted to Rakudo, then it should be org.perl6.rakudo.nqp | ||
psch | it's not | 19:42 | |
there's a somewhat working python implementation on nqp | |||
El_Che | the parrot dream is alive, it seems | ||
FROGGS | *g* | ||
samcv | has anybody had issues with vim's perl6 syntax highlighting? i notice it being pretty slow, so for larger files i'm using the 'perl' syntax highlighting instead | 19:43 | |
dalek | osystem: c98e552 | RabidGravy++ | META.list: Add Monitor::Monit See github.com/jonathanstowe/Monitor-Monit |
||
toolforger1 | Is there a chance of any other perl6 subproject to be named NQP? | ||
samcv | there may be nothing i can do about this, but was wonering your experiences | ||
toolforger1 | If no, org.perl6.nqp would be fine | ||
FROGGS | org.perl6.nqp is correct, aye | ||
toolforger1 | Okay, that goes into the patch | 19:44 | |
(assuming I manage to write one) | |||
FROGGS | toolforger1++ | ||
viki | samcv: BTW, you gave me an email address to add to book mailing list... I'm no longer writing one. Contact moritz isntead. | ||
samcv | ok thanks for letting me know | ||
dalek | href="https://modules.perl6.org:">modules.perl6.org: 960c08c | (Zoffix Znet)++ | lib/ModulesPerl6/DbBuilder/Dist/PostProcessor/METAChecker.pm: Add METAChecker postprocessor Add extra checks to validate distributions in the Ecosystem. Part of the PSIXDISTS indexing issue github.com/perl6/ecosystem/issues/255 |
19:45 | |
toolforger1 | I am seeing ClassWriter references in nqp/runtime, nqp/sixmodel, and nqp/jav2bc - where should I look first? | ||
psch | sixmodel is the object model, so that writes nqp and rakudo level classes | 19:46 | |
jast2bc is the compilation step after we turn a QAST into a JAST | 19:47 | ||
well, runtime is only interop, to C and Java respectively | 19:48 | ||
so, probably jast2bc i think? :) | |||
toolforger1 | looking... | ||
"public static JavaClass buildClass()" seems pretty spot on | 19:49 | ||
goes down to JastCompiler.compileJast | 19:50 | ||
arnsholt | Yeah, jast2bc is what you want | 19:51 | |
sixmodel is to generate Java classes backing 6model classes at compile-time | 19:52 | ||
Not sure what's in runtime off-hand | |||
19:52
itaipu left
|
|||
psch | NativeCallOps and BootJavaInterop | 19:52 | |
arnsholt | Right, so some bits of NativeCall and JVM interop in there too | 19:53 | |
toolforger1 | I hope that these aren't necessary for Regex :-) | ||
arnsholt | Ah, right. The NativeCall bits are for callbacks | ||
dmaestro | Ulti: Thanks, I took the opportunity to try out the basic toolchain and (with [Coke]'s help) was able to build rakudo. | ||
toolforger1 | the NativeCall stuff I mean | ||
arnsholt | Nope =) | ||
toolforger1 | Yeah, I'd leave out callbacks initially; maybe add callbacks into Java later | 19:54 | |
dmaestro | I learned that upgrading XCode does not automatically install the command-line tools ;-) | ||
19:54
domidumont left
|
|||
toolforger1 | JVMInterop is probably for converting between Perl and Java strings | 19:55 | |
arnsholt | Not quite. It's for calling Java code from Perl 6 code | ||
19:55
cdg joined
|
|||
arnsholt | Like NativeCall is for C | 19:55 | |
psch | j: use java::lang::System:from<JavaRuntime>; System.get_out.println("hi") | 19:56 | |
camelia | rakudo-jvm 8d357a: OUTPUT«hi» | ||
toolforger1 | Hmm... seems like it is useful for callbacks | ||
19:56
girafe joined
|
|||
psch | ^^^ that's a lot BootJavaInterop and some RakudoJavaInterop | 19:56 | |
19:56
canopus left
|
|||
toolforger1 | Most of the work is probably packaging everything so it interoperated with the Java ecosystem | 19:57 | |
I.e. upload to Maven Central, use dependencies instead of the 3rdparty directory | |||
psch | RakudoJavaInterop mostly matters to not have to write "method/println/(Ljava/lang/String;)V" | ||
oh, and probably some marshalling from rakudo Str to java.lang.String | |||
toolforger1 | Yeah, this needs to be somewhere, maybe in a common subpackage | 19:58 | |
19:58
canopus joined
|
|||
toolforger1 | That's easy to figure out | 19:58 | |
It's the entry points that are hard to find | |||
The call graph inside Java is easy with the right Eclipse tooling | 19:59 | ||
19:59
itaipu joined
|
|||
toolforger1 | finding the dependencies from NQP bytecode would be hard again | 19:59 | |
19:59
ufobat left
|
|||
toolforger1 | Heh. I most definitely want a Maven or Gradle build instead of the 3rdparty stuff. Eclipse will then automagically retrieve the sources from Maven Central with the right tooling. | 20:00 | |
(not just Eclipse, every Java-capable IDE can do this) | 20:01 | ||
arnsholt | Yeah, making the JVM build use more Java standard tools is on my list of things I'd like to do | ||
psch | that would be nice | 20:02 | |
toolforger1 | I can definitely lend a hand with this | ||
psch | although i'm pretty used to doing it the way i've been doing it... :) | ||
arnsholt | But just integrating stuff into the extant Makefile was *so* much easier when the JVM backend landed =) | ||
toolforger1 | ;-P | ||
You know how programmers acquire bad karma :-P | |||
DrForr | Proposal 1 for OSCON Austin going out... | ||
toolforger1 | (not that I'd have done it very differently if I weren't intimately familiar with the toolchains in question) | 20:03 | |
arnsholt | Yeah, none of us are | ||
Thus the Makefile =) | |||
And it's complicated by the fact that only *part* of the build is in Java-land | 20:04 | ||
toolforger1 | I can contribute that knowledge | ||
arnsholt | Excellent! | ||
This is how open source progresses =) | |||
toolforger1 | :-) | ||
You add a dependence on the build tool | |||
There are two that I am familiar with, Maven and Gradle | 20:05 | ||
arnsholt | Anyways, I suspect what we'll want is an incantation that builds the Java bits, and then that invocation can be called from the Makefile to build that part of the project | ||
toolforger1 | Maven is probably unsuitable, it is extremely strict in how to set up the build, and essentially requires you set up your own Maven repository on a well-known server | ||
arnsholt | Yeah, that might be a bit of an obstacle | 20:06 | |
The strictness can probably be dealt with though, since we mostly only care about the output JARs | |||
toolforger1 | Gradle, you can package a stub that will automatically download the Gradle tool, all declared dependencies, put them into a local cache so they won't get downloaded again (cache is SHA1-secured), and runs the buildscript | ||
Maven's main strictness is that you have a lifecycle with a fixes set of steps | 20:07 | ||
DrForr | From gradle to crave? | ||
toolforger1 | *fixed | ||
arnsholt | (Another thing I've been wanting to look into is making the compiler JARs fat JARs, so that they can be invoked as just "java -jar nqp.jar @args" rather than the classpath hackery we have today) | ||
toolforger1 | so if you want to insert an extra step, you need to contort everything with Maven | ||
psch | arnsholt: fwiw, i've ripped bootclasspath out of rakudo | ||
toolforger1 | Fatjars are easy with both Gradle and Maven | ||
psch | arnsholt: not sure how that'd go with nqp though | 20:08 | |
toolforger1 | well, sort of - fatjars offer unique challenges | ||
20:08
ufobat joined
|
|||
toolforger1 | i.e. you need a good fatjar tool, then you invoke it fr | 20:09 | |
the application integrator simply invokes that tool as a plugin | |||
If you upload the jars to Maven Central, then both Maven and Gradle can download and use the thing | |||
arnsholt | Yeah, that's the bits I haven't figured out =) | 20:10 | |
toolforger1 | so you can leave it to the application integrator whether they want a fatjar, a bunch of class files, a bunch of jars, jars-packages-into-war, or whatever packaging option there is | ||
arnsholt | I just know that the current state of affairs annoys me =) | ||
toolforger1 | I.e. the good news is that you do not need to worry about fatjars in Java land, you just need to upload to Maven Central | 20:11 | |
Maven Central will archive all old versions that are not marked as SNAPSHOT, so callers can use whatever old version they need for build stability | |||
arnsholt | toolforger1: Oh, if you want to look at the build process without actually building all of the things, make -n does a dry run | 20:12 | |
toolforger1 | or if they hunt a bug, they can always reproduce an old build, without having to archive the old jars themselves | ||
arnsholt | That should give you an idea of what goes on | ||
toolforger1 | Been there, done that, went into MEGO mode :-D | ||
arnsholt | Good, good | ||
Anyways, bedtime here for me | |||
toolforger1 | I think the best approach would be to use a "gradle build" call inside the makefile | 20:13 | |
arnsholt | If you prod me during business-ish hours CET tomorrow I'll probably respond without too much delay | ||
In case of more questions | |||
toolforger1 | CET time here myself | ||
arnsholt | (But psch has more up-to-date info than me. It's been a while since I worked on the JVM code) | 20:14 | |
toolforger1 | 1:30 commute time, so I tend to be on late-ish and not too quick doing stuff (unfortunately) | ||
will be back tomorrow - g'night arnsholt | |||
arnsholt | No rush, this is open source after all | ||
psch | ehh, my brain's learning objective c currently | ||
arnsholt | Just so that you know when you have the best probability of catching me =) | 20:15 | |
psch | so i'd have to look for most in-depth things | ||
toolforger1 | @arnsholt ok, that's what I meant to communicate, too :-) | ||
Good luck with ObjC, psch... you have my sympathy | |||
psch | well, at least it's a job i guess :) | 20:16 | |
toolforger1 | Heh. I am currently doing Appway. | ||
20:17
TEttinger joined
|
|||
toolforger1 | "Full-fleged BPMN tool", but not really enterprise-ready - does not integrate with any sane SCM because sources are saved as SHA1-identified XML | 20:17 | |
I.e. XML files that have SHA1 hashes as filename | |||
psch | why does corp like xml so much..? | ||
toolforger1 | It's standard. | 20:18 | |
psch | right. it also does everything i suppose | ||
so it always works! | |||
toolforger1 | An extensible one - if you sh*tty customer sends you XML with nonstandard fields, you can easily identify and ignore them | ||
psch | anyway, gonna get bedwards too, CET waits for no one o/ | ||
toolforger1 | \o/ | ||
20:19
wamba left
|
|||
toolforger1 | I'd still prefer YAML, but ah well I'm not going to be asked | 20:19 | |
off to bed for me, too | |||
g'night all! | |||
20:20
toolforger1 left
20:22
andrzejku__ joined
20:24
Brock is now known as awwaiid
|
|||
dalek | line-Python: 981960c | (Brock Wilcox)++ | / (3 files): Add an option to EVAL to differentiate eval vs file mode. Python!!! |
20:25 | |
line-Python: 5bb1d89 | (Brock Wilcox)++ | / (5 files): Merge remote-tracking branch 'origin/master' into fix-EVAL Explicitly call python2 in installation Some environments have python point to python3. In these environments the installation fails. |
|||
20:25
dalek left,
dalek joined,
ChanServ sets mode: +v dalek
|
|||
line-Python: 82c41f0 | niner++ | / (2 files): Merge branch 'explicit-path' of github.com/parabolize/Inline-Python |
|||
20:32
ufobat left
20:33
itaipu left
20:35
nicq20 left
|
|||
masak | how likely is `python2` to be available on a system? | 20:35 | |
it's on mine, but I had never heard of it before :) | |||
pmurias | psch: what do you mean by nqp bytecode? | 20:37 | |
samcv | i have python2 on my system, and python is python 3 | ||
@masak | |||
depends on the distro though | |||
geekosaur | www.python.org/dev/peps/pep-0394/ | ||
so I expect it will be fairly reliable | |||
samcv | usually doing python2 is more catchall than 'python' | 20:38 | |
i'm pretty sure even distros where 'python' uses python2 still have a symlink called python2 pointing to it | |||
20:39
bjz joined,
rurban joined
|
|||
grondilu has 'python2' on his debian/stretch | 20:39 | ||
dalek | line-Python: cf7956e | (Brock Wilcox)++ | README.md: Update README with EVAL example and fixed travis link |
20:42 | |
line-Python: 0660c00 | niner++ | README.md: Merge pull request #13 from awwaiid/master Update README with EVAL example and fixed travis link |
|||
masak | today's autopun spotting: twitter.com/nixcraft/status/662040529362784256 | 20:54 | |
timotimo | "trick or syncookie" <3 | ||
20:57
Zoffix joined
|
|||
Zoffix | 20:57 | ||
vendethiel- | timotimo: but cookies are for the dark side :o | ||
timotimo | ohai ven | ||
masak | vendethiel-! \o/ | 20:58 | |
vendethiel- | o/ | ||
20:59
inra joined
21:01
andrzejk1 joined,
inra left
21:04
skids left
|
|||
grondilu | oh that's interesting. Remember how I got False in local with log(8) %% log(2) ? I've tried compiling MoarVM with clang instead of the default gcc, turns out with that version I get true. | 21:09 | |
so maybe gcc is to blame | |||
I'm using gcc (Debian 5.4.1-3) 5.4.1 20161019 | |||
Zoffix | grondilu, is floating point noise supposed to be deterministic? | 21:10 | |
21:10
RabidGravy left
|
|||
vendethiel- | Zoffix: yeah, hardware specific | 21:11 | |
maybe UB | |||
Zoffix | Ah | 21:12 | |
21:13
kurahaupo__ joined
|
|||
timotimo | something might have shuffled the order of floating point calculations around | 21:14 | |
grondilu: i'd be interested to know if the result changes when you execute the same code enough that it gets jitted | |||
though i'm not sure if we have jit-implementations of much of the floating point arithmetic | |||
addition and subtraction for sure, but maybe not logarithms | 21:15 | ||
21:15
bjz_ joined,
bjz left
|
|||
Zoffix | m: log(8) %% log(2) or die for ^1000_0000 | 21:15 | |
camelia | ( no output ) | ||
colomon | why would you expect log(8) %% log(2) to work? | ||
Zoffix | ? | ||
What does "to work" mean in this context? | 21:16 | ||
21:16
rindolf left
|
|||
colomon | it’s an int/rat operator and you’re passing it floats? | 21:16 | |
vendethiel- | grondilu: I'm interested in knowing if it changes depending on gcc/clang's optimization level :P | ||
Zoffix | Yeah, that's the issue. We get different results for same input | 21:17 | |
On different builds of the same versions of rakudo/moar | |||
colomon stops asking questions and pulls up the source | 21:18 | ||
Zoffix | :D | ||
perlpilot | colomon: maybe the expected it result is to complain :) | 21:19 | |
s/it// | |||
21:19
mcmillhj joined,
firstdayonthejob joined
|
|||
Zoffix | m: say gather { take $_ unless log(2**$_) %% log(2) for ^100 } | 21:20 | |
camelia | rakudo-moar 4829f1: OUTPUT«(33 35 37 39 51 55 59 66 70 74 78 81 85 89 95)» | ||
colomon | hmm, there’s an explicit infix:<%> for Num | ||
grondilu | I'm using debian/stretch on a VirtualBox VM, so it should be easily reproducable. | ||
colomon | … and you’ve got to dive into NQP to figure out what it does | 21:21 | |
off the top of my head, I’m thinking infix:<%> makes sense for Nums, but infix:<%%> (which is defined in terms of infix:<%>) does not | 21:22 | ||
Zoffix | I get same results as camelia on two different jessie boxes, on Bodhi box based off ubuntu trusty, and a Windows 10 box | 21:23 | |
colomon | because it amounts to checking a floating point operation for exact equality. | ||
Zoffix | with Bodhi running in Virtual Box | ||
colomon | m: for 1..10 -> $n { say log(2**$n) } | 21:25 | |
camelia | rakudo-moar 4829f1: OUTPUT«0.6931471805599451.386294361119892.079441541679842.772588722239783.465735902799734.158883083359674.852030263919625.545177444479566.238324625039516.93147180559945» | ||
colomon | m: for 1..10 -> $n { say log(2**$n) / log(2) } | ||
camelia | rakudo-moar 4829f1: OUTPUT«12345678910» | ||
colomon | m: for 1..10 -> $n { say log(2**$n) / log(2) - $n } | ||
camelia | rakudo-moar 4829f1: OUTPUT«0000000000» | ||
colomon | hmm | 21:26 | |
masak | m: for 1..10 -> $n { say log(2**$n) / log(2) == $n } | ||
camelia | rakudo-moar 4829f1: OUTPUT«TrueTrueTrueTrueTrueTrueTrueTrueTrueTrue» | ||
masak | hmmmmm :) | ||
masak .oO( coincidence? I think not! ) | |||
colomon | I’m inclined to think so | 21:27 | |
masak | colomon: I'm torn on the infix:<%%> for Nums thing | 21:28 | |
colomon: on the one hand, I would never even think to do that | |||
colomon: on the other hand, maybe it would make sense for some Nums; for example Nums that are sums of powers of 1/2 | 21:29 | ||
colomon | m: for 1..10 -> $n { say log(3**$n) / log(3) } | ||
camelia | rakudo-moar 4829f1: OUTPUT«12345678910» | ||
masak | I think what you're seeing for those really small numbers is simply double precision being more than enough to end up on the integer precisely | 21:30 | |
perlpilot thinks there should be a different operator for %% on Num | |||
masak | m: say log(3 ** 100) / log(3) | ||
camelia | rakudo-moar 4829f1: OUTPUT«100» | ||
masak | perlpilot: why? it's doing the same numeric operation | ||
colomon | masak: isn’t log(2) an irrational number? | ||
masak | perlpilot: a lot of operations on Num are inexact by nature | 21:31 | |
perlpilot | masak: I don't have a good rationale. It just feels righter to me. | ||
masak | colomon: yes, but that likely all gets lost in the fuzz and froth of doubles | ||
21:31
bjz_ left
|
|||
masak | perlpilot: I think I only approve of an explosion of operators when the operators are actually spiritually different. Perl typically ends up doing a rather good job of using *the same* operator for things that are conceptually the same thing. | 21:32 | |
perlpilot | masak: but, perhaps I'm still reeling from being surprised that it worked in the first place, so it still feels foreign to me. | ||
21:33
Zoffix left
|
|||
masak | heh | 21:33 | |
colomon | masak: but it’s really weird for the fuzz and froth of doubles to just cancel out and leave you nice integer answers. | ||
masak | well, I do agree that it working in the first place was probably to some extent lucky happenstance | ||
colomon: yes, I can't fully explain that. but I don't mind much, either | |||
m: say .1e0 + .2e0 == .3e0 | 21:34 | ||
camelia | rakudo-moar 4829f1: OUTPUT«False» | ||
masak | there, better now? :P | ||
perlpilot | colomon: Maybe it's only really weird for those of us who were brought up learning the foibles of floating point ... maybe it's "natural" if you ignore the fact that computers are involved :) | 21:35 | |
masak | objection. I was brought up learning the foibles of floating point. | 21:36 | |
I'm aware of the dangers of loss of precision. I would expect someone using infix:<%%> on Num to be similarly aware. | |||
that's why I said it might still make sense if you limit yourself to Nums which are sums of powers of 1/2. | 21:37 | ||
21:38
colomon_ joined
|
|||
masak | m: say 0.5e0 %% 0.125e0 # I would expect this to always be True, no matter how crappy the Num precision | 21:38 | |
camelia | rakudo-moar 4829f1: OUTPUT«True» | ||
21:39
colomon left,
colomon_ is now known as colomon
|
|||
colomon | but it seems ill-advised to allow an operation that is only well-defined for a tiny percentage of the possible arguments to it. | 21:44 | |
21:45
pmurias left
|
|||
grondilu | FYI it would never have occurred to me to use %% with floating points, but TimToady used it on RosettaCode. | 21:47 | |
(not that I want to point fingers or anything :) ) | |||
colomon is guessing he wanted to know if any integer was a power of two | 21:50 | ||
m: for 1..200 -> $n { say log(2**$n) / log(2) == $n } | 21:52 | ||
camelia | rakudo-moar 4829f1: OUTPUT«TrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueFalseTrueFalseTrueTrueTrueTrueTrueTr…» | ||
kurahaupo__ | m: say 0.1 %% 0.01 | ||
camelia | rakudo-moar 4829f1: OUTPUT«True» | ||
colomon | yeah, bad plan | ||
21:53
inra joined
21:54
espadrine joined
21:56
acrussell left,
colomon left,
colomon joined
22:05
rurban left
|
|||
grondilu | colomon: it was for the Fractran example in RC, but possibly some places else as well. | 22:10 | |
I think testing for power-of-two-ness should rather be 2**.msb == $_ | |||
22:14
inra left
|
|||
grondilu | or maybe .base(2).comb.one == 1 | 22:14 | |
22:15
TheovdH left
|
|||
grondilu | m: say join "", map { .base(2).comb.one == 1 ?? '.' !! '!' }, 1 .. 10; | 22:15 | |
camelia | rakudo-moar 4829f1: OUTPUT«..!.!!!.!!» | ||
grondilu | ouch | 22:16 | |
22:16
colomon left,
colomon joined
|
|||
grondilu | m: say join "", map { .base(2).comb.one == 1 ?? '.' !! '!' }, 2 <<**<< [1 .. 10]; | 22:17 | |
camelia | rakudo-moar 4829f1: OUTPUT«..........» | ||
22:18
setty1 left
|
|||
colomon | m: sub is-power-of-two(Int $n) { 2 ** $n.msb == $n }; for ^200 -> $n { say is-power-of-two(2 ** $n); } | 22:19 | |
camelia | rakudo-moar 4829f1: OUTPUT«TrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrueTrue…» | ||
22:20
bjz joined
|
|||
colomon | m: sub is-power-of-two(Int $n) { 2 ** $n.msb == $n }; (^200).map(-> $n { say is-power-of-two(2 ** $n) }).categorize-list.say | 22:22 | |
camelia | rakudo-moar 4829f1: OUTPUT«No such method 'categorize-list' for invocant of type 'Seq' in block <unit> at <tmp> line 1» | ||
colomon | m: sub is-power-of-two(Int $n) { 2 ** $n.msb == $n }; (^200).map(-> $n { say is-power-of-two(2 ** $n) }).List.categorize-list.say | ||
camelia | rakudo-moar 4829f1: OUTPUT«No such method 'categorize-list' for invocant of type 'List' in block <unit> at <tmp> line 1» | ||
colomon needs to finish making noms rather than sort out what stupid thing he is doing wrong there | 22:23 | ||
22:23
dmaestro left
22:24
espadrine is now known as espadrine_,
espadrine_ is now known as espadrine`,
espadrine` is now known as espadrine
22:28
andrzejku__ left,
andrzejku left,
andrzejk1 left
22:31
BenGoldberg joined
|
|||
grondilu | m: sub is-power-of-two(Int $n) { 2**$n.msb == $n }; (^200).map({ is-power-of-two(2**$_)}).bag | 22:33 | |
camelia | rakudo-moar 4829f1: OUTPUT«No such method 'bag' for invocant of type 'Seq' in block <unit> at <tmp> line 1» | ||
grondilu | m: sub is-power-of-two(Int $n) { 2**$n.msb == $n }; (^200).map({ is-power-of-two(2**$_)}).Bag | ||
camelia | ( no output ) | ||
grondilu | m: sub is-power-of-two(Int $n) { 2**$n.msb == $n }; (^200).map({ is-power-of-two(2**$_)}).Bag.say | ||
camelia | rakudo-moar 4829f1: OUTPUT«bag(True(200))» | ||
22:34
bjz left
22:37
grondilu left
22:40
espadrine left
22:42
bjz joined
22:45
cibs left
|
|||
dalek | href="https://modules.perl6.org:">modules.perl6.org: 8f32095 | (Zoffix Znet)++ | lib/ModulesPerl6/DbBuilder/Dist/PostProcessor/METAChecker.pm: Make METAChecker check source URL only for fresh dists |
22:46 | |
22:46
cibs joined
22:47
bjz left
|
|||
viki | m: for 77..79 -> $n { say log(2**$n) / log(2) == $n } | 22:48 | |
camelia | rakudo-moar 4829f1: OUTPUT«TrueFalseTrue» | ||
viki | masak: ^ yeah, it's a coincidence | ||
s: &infix:<%%>, \(2e0, 2e0) | 22:49 | ||
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/4829...ic.pm#L220 | ||
viki | m: dd 2e0.Real | ||
camelia | rakudo-moar 4829f1: OUTPUT«2e0» | ||
viki | m: dd 2e0.narrow | ||
camelia | rakudo-moar 4829f1: OUTPUT«2» | ||
22:51
skids joined,
itaipu joined
22:52
mcmillhj left,
firstdayonthejob left
|
|||
viki | .categorize-list is only available on Baggies and Maps | 23:00 | |
colomon | viki++ | ||
23:03
sufrostico joined
|
|||
viki | m: sub is-power-of-two(Int $n) { (2 ** ($n.msb//0)) == $n }; (% .categorize-list: {is-power-of-two $_}, ^2000){True}.say | 23:06 | |
camelia | rakudo-moar 4829f1: OUTPUT«[1 2 4 8 16 32 64 128 256 512 1024]» | ||
viki | m: sub is-power-of-two(Int $n) { (2 ** ($n.msb//0)) == $n }; ^2000 .categorize(*.&is-power-of-two){True}.say | 23:07 | |
camelia | rakudo-moar 4829f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unexpected block in infix position (missing statement control word before the expression?)at <tmp>:1------> 3}; ^2000 .categorize(*.&is-power-of-two)7⏏5{True}.say expecting any of: …» | ||
viki | your mother | ||
m: sub is-power-of-two(Int $n) { (2 ** ($n.msb//0)) == $n }; (^2000).categorize(*.&is-power-of-two){True}.say | |||
camelia | rakudo-moar 4829f1: OUTPUT«[1 2 4 8 16 32 64 128 256 512 1024]» | ||
23:09
itaipu left
23:10
lostinfog left
|
|||
viki | m: ^2000 .grep({$_ == 2 ** (.msb//0)}).say | 23:12 | |
camelia | rakudo-moar 4829f1: OUTPUT«(1 2 4 8 16 32 64 128 256 512 1024)» | ||
23:24
vendethiel- left,
kurahaupo__ left
23:25
cognominal left
23:52
geraud left
|