🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku Set by ChanServ on 14 October 2019. |
|||
sacomo | RaycatWhoDat: I'm using golang with NativeCall. Seems to work fine. Not sure what the most common language is though. | 00:17 | |
00:25
sacomo left
00:27
sacomo joined
01:05
pecastro left
02:11
sourceable6 left,
bisectable6 left,
benchable6 left,
coverable6 left,
tellable6 left,
evalable6 left,
nativecallable6 left,
quotable6 left,
committable6 left,
notable6 left,
linkable6 left,
bloatable6 left,
squashable6 left,
shareable6 left,
releasable6 left,
statisfiable6 left,
unicodable6 left,
greppable6 left
02:12
bloatable6 joined,
notable6 joined,
quotable6 joined,
greppable6 joined,
unicodable6 joined,
nativecallable6 joined
02:13
bisectable6 joined,
tellable6 joined,
evalable6 joined,
committable6 joined,
linkable6 joined,
coverable6 joined,
sourceable6 joined,
statisfiable6 joined
02:14
releasable6 joined,
squashable6 joined,
benchable6 joined
|
|||
moon-child | RaycatWhoDat: c | 02:14 | |
02:14
shareable6 joined
02:21
webstrand joined
02:52
ape666` joined
03:05
ape666` left
03:19
ape666 left
03:22
ape666 joined
03:26
Celelibi left
03:50
aborazmeh joined,
aborazmeh left,
aborazmeh joined
03:52
ape666 left
04:08
__jrjsmrtn__ left
04:09
__jrjsmrtn__ joined
04:23
Celelibi joined
04:39
aborazmeh_ joined,
aborazmeh_ left,
aborazmeh_ joined,
aborazmeh left,
aborazmeh_ is now known as aborazmeh
04:41
leont left
05:34
rindolf joined
05:50
brtastic joined
06:06
aborazmeh left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
notandinus | what is the |n| operator called? if n is positive it returns n, if not then it makes it positive, i thought it was called the modulus operator | 06:15 | |
06:19
brtastic left
|
|||
RaycatWhoDat | Absolute value | 06:21 | |
06:34
sena_kun joined
|
|||
notandinus | ah yes | 06:37 | |
and abs routine handles it | 06:39 | ||
m: my @t = -1, -2; say abs(@t); | 06:40 | ||
camelia | 2 | ||
notandinus | my @t = -1, -2; say @t.map(*.abs); | 06:42 | |
evalable6 | (1 2) | ||
notandinus | loop {} | ||
m: loop{} | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Whitespace required after keyword 'loop' at <tmp>:1 ------> 3loop7⏏5{} |
||
notandinus | m: loop {} | ||
hmm is there a timeout? | |||
camelia | (timeout) | 06:43 | |
notandinus | nice | ||
06:44
brtastic joined
|
|||
notandinus | can i make an int bound to a range? like say i make $t bound to 1 - 2 then $t++ after 2 will loop it back to 1 | 06:48 | |
if $t == -1 then $t-- will loop it back to 2 | |||
guifa2 | notandinus no, although you could write your own class that lets you | 06:55 | |
notandinus | i see, thanks | 06:57 | |
guifa2 | Not sure the exact context you have for it, but I think most people tend to only make adhoc ranges which makes such a thing fairly moot. Personally, I rarely if ever store them in a variable (only time I do, I think, is when I'm subs to accept them as arguments) | 06:59 | |
notandinus | tokens will be faster than regex right? | 07:08 | |
if i write both token and regex in a way that regex too doesn't backtrack then will token still be fast? | 07:11 | ||
07:13
jmerelo joined
07:36
parabolize left
|
|||
guifa2 | a token is literally just a regex with the :ratchet option applied | 07:38 | |
token { foo } == regex { :r foo } | 07:39 | ||
07:43
aborazmeh left
|
|||
guifa2 | Egads, my CLDR compiler finally finished.... 5 hours later. | 07:43 | |
jmerelo | Did you check out today's advent calendar article? raku-advent.blog/2020/12/12/day-12...u-feeling/ | ||
guifa2: did it work? | 07:44 | ||
07:45
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
guifa2 | jmerelo: yes! It's not *quite* ready for release, and unfortunately I'll be out of town for a week or so so it maybe will be ready around new years | 07:45 | |
jmerelo | guifa2++ | ||
guifa2 | But all of the precalculations are well worth it | ||
When using it as a module, it's a literal order of magnitude or two faster to access stuff | 07:46 | ||
and load | |||
And the data files are smaller too! | |||
07:56
aborazmeh left
|
|||
notandinus | jmerelo: it has a typo in second code block | 07:58 | |
await $one-second should be $one-second-passed | 07:59 | ||
raku-bridge | <frost> Hi, I think there is a mistake in today's advent calendar article. In the second example code, it should be await $one-second-passed | ||
jmerelo | notandinus: let me check that | ||
guifa2 | Yup, definitely a typo | 08:01 | |
raku-bridge | <frost> Haha, someone has noted it. | ||
08:05
eseyman left
|
|||
jmerelo | notandinus: should be good now. Thanks for the heads up! | 08:07 | |
08:09
eseyman joined
|
|||
notandinus | yw, | 08:11 | |
hmm rss feeds also get updated with the changes | |||
moon-child | notandinus: btw, you can just | ||
jmerelo | notandinus: they should feed from the same SSOT :-) | ||
moon-child | m: print [-1, -2].map(&abs) | 08:12 | |
camelia | 1 2 | ||
moon-child | fewer lexemes to think about | ||
notandinus | moon-child: i see, thanks | 08:14 | |
08:14
cpan-raku left
08:16
cpan-raku joined,
cpan-raku left,
cpan-raku joined
08:28
RaycatWhoDat left
|
|||
sacomo | hi all, anyone have a way of listing all of the modules / dependencies / dependency's dependencies, etc that a script uses? | 08:51 | |
08:51
brtastic left
08:53
stoned75 joined
|
|||
tadzik | RAKUDO_MODULE_DEBUG=1, if that's still a thing :) | 08:57 | |
09:07
Altai-man joined
09:09
sena_kun left
|
|||
notandinus | what does raku mean by this: paste.debian.net/hidden/52f9b8a2/ ? | 09:20 | |
code included in it ^ | |||
if i move @directions inside of the sub routine then the error goes away | |||
all of this is in sub MAIN, | |||
if i move both outside of sub MAIN then the error goes away | |||
09:24
stoned75 left
|
|||
guifa2 | jmerelo: okay crazy, | 09:41 | |
I'm actually BEATING the built in .Str for DateTime | |||
imgur.com/a/wqR1pvf | 09:42 | ||
guifa2 pats himself on back | |||
09:50
aborazmeh joined,
aborazmeh left,
aborazmeh joined
09:52
sjm_uk joined
|
|||
jmerelo | guifa2++ | 09:59 | |
10:07
jmerelo left
10:11
RaycatWhoDat joined
10:12
sjm is now known as sjm_mobile
10:13
sjm_mobile left
10:18
sjm_mobile joined
10:22
guifa2 left
10:23
patrickb joined
10:32
Sgeo left,
wamba joined
10:35
aindilis` joined
|
|||
notandinus | ok i understood that, it was because @directions needs to be defined before the subroutine is called | 10:36 | |
10:39
aindilis left
10:44
asymptotically joined
10:47
domidumont joined
10:57
Black_Ribbon left
10:58
aborazmeh left
11:02
sjm_uk left
|
|||
xinming_ | m: my $t = 0; for 3 .. 5 { my $a = 10 + $_; FIRST $t = $a; $a.say; }; "value: $t".say; | 11:12 | |
camelia | 13 Use of uninitialized value element of type Any in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. 14 15 value: in block <unit> at <tmp> line 1 |
||
xinming_ | In this example, the $a in FIRST will get Nil, What is the right way to achieve this please? | 11:13 | |
I know I can doing something like, if $t == 0 { $t = $a }; But I wish to understand wether we can have FIRST DWIM | 11:14 | ||
moritz | $t ||= $a ? | 11:15 | |
11:15
sjm_mobile left
|
|||
xinming_ | moritz: Nope, what actually I want is doing something with FIRST phaser. | 11:16 | |
I just realized, maybe I can't do that. | |||
moritz | FIRST runs before the code in the loop body | 11:22 | |
xinming_ | Yea, I just realized that. :-) | 11:23 | |
Need real world example to learn the lesson. | |||
11:24
v_m_v joined
|
|||
notandinus | can i make amulti sub based on return value? | 11:27 | |
moritz | notandinus: no | ||
notandinus | i see | ||
moritz | that would break causility | ||
*causality | 11:28 | ||
notandinus | what does that mean? | 11:29 | |
oh if i specify the return value type in signature, should be possible then right? | |||
moritz | consider a(b()). If &a and &b are both multis, things get complicated | 11:33 | |
in Perl, context flowed inwards; the caller told the callee which context (list, item, void) it expected | |||
Raku takes the opposite approach: routines return objects, and those objects can know how to be usable in different contexts | 11:34 | ||
also, consider this: multi sub a(returns Int) {}; multi sub a(returns Str) { }; multi b(Int, Str) {}; multi b(Str, Int) {}; b(a(), a()) | 11:35 | ||
just a simple example of an ambiguity if we allow dispatch based on return values | 11:36 | ||
it's even worse if there are multis with many arguments, which are the return values from other multis | |||
notandinus | ah i see, makes sense, thanks | 11:37 | |
moritz | then you have, in the worst case, and NP problem trying to solve which multi to call :-) | ||
11:39
MasterDuke joined
|
|||
notandinus | hmm | 11:40 | |
m: sub l ($t?) { say 'hi' } l(); | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> 3sub l ($t?) { say 'hi' }7⏏5 l(); expecting any of: infix infix stopper statement … |
||
notandinus | sub l ($t?) { say 'hi' }; l(); | 11:41 | |
evalable6 | hi | ||
notandinus | oh i was wondering why it was failing | ||
hmm this still fails with `raku -e` | 11:42 | ||
says missing block at 'sub l(HERE' | |||
is -e and what evalable6 does different? | 11:43 | ||
.tell lizmat links to book "using raku" and "perl 6 at a glance" need to be updated in r/rakulang sidebar | 11:48 | ||
tellable6 | notandinus, I'll pass your message to lizmat | ||
notandinus | can we specify multiple return signatures ? something like " --> Int|Bool"? | 11:54 | |
lizmat | notandinus thanks for the nudge, fixed | 11:56 | |
re Junctions in return sigs, no, you can't, at least not atm | 11:57 | ||
notandinus | lizmat: hmm raku.online doesn't seem to work, | ||
andrewshitov.com/perl6-at-a-glance/ | |||
andrewshitov.com/contents/ | 11:58 | ||
lizmat | that's the link I just put in? | ||
notandinus | oh are you using the new reddit? | ||
lizmat | argh I need to change that at two place? | ||
which URL do you use ? | |||
notandinus | i'm using the old one | 11:59 | |
not sure if both are different | |||
MasterDuke | m: subset IB where Int|Bool; sub a(--> IB) { return "ab" }; a | ||
camelia | Type check failed for return value; expected IB but got Str ("ab") in sub a at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
notandinus | on old one i see raku.online links which don't work | ||
12:00
Jack joined
|
|||
MasterDuke | notandinus: you can, but have to use a pre-defined subset | 12:00 | |
notandinus | this works: andrewshitov.com/using-perl6/ | 12:01 | |
12:01
Jack left
|
|||
notandinus | MasterDuke: i see, makes sense | 12:01 | |
i'll checkout subset | |||
12:02
raiph joined
12:03
JackChidley joined
|
|||
JackChidley | I have noticed an error in the Linux installation instructions on rakudo.org/star/source any idea where to report this? | 12:04 | |
Never mind - I've just spotted the Issue Tracker at the top of the page | 12:06 | ||
notandinus | rakudo.org/issue-trackers | ||
:) | 12:07 | ||
12:07
stoned75 joined
12:09
v_m_v left
12:10
sjm_mobile joined
12:13
natrys joined
12:15
JackChidley left,
wamba left
|
|||
lizmat | notandinus fixed links in old reddit as well | 12:16 | |
notandinus | lizmat: thanks, so they are different sidebars? | 12:17 | |
lizmat | apparently, I needed to change it in 2 places | ||
which took a little figuring out | |||
12:17
v_m_v joined
12:20
sjm_uk joined
12:23
guifa2 joined,
guifa2 left,
aindilis` left
12:26
natrys left
12:28
v_m_v left
|
|||
notandinus | what would be better, a state or global var ? | 12:32 | |
i have a subroutine that will push to a variable but i want it to remember previous pushes so that it can return quickly without recomputing | 12:33 | ||
kinda like memoization | |||
so should i make that array a state or global var ? | |||
12:36
natrys joined
12:47
Kaiepi left
12:49
sjm_mobile left
|
|||
notandinus | what causes this: paste.debian.net/hidden/8776c48f (code included) | 12:52 | |
with every push the previous push value changes | |||
even though .say confirms that the values i'm pushing is different | 12:53 | ||
line before represents what i'm pushing and line after the array after the push, every push is changing all previous values | 12:54 | ||
12:56
Kaiepi joined,
wamba joined
12:58
raiph left
|
|||
notandinus | it works as expected when i change the pushed data to hash but i want to keep it an array | 13:01 | |
hmm works fine when i make it .Array, it was .List | 13:02 | ||
what causes list to behave like this? | |||
13:08
sena_kun joined
|
|||
coldpress | my guess is: the wrong behavior is because all elements refer to the same object, pass-by-reference. The correct behavior with .Array is because each element now refers to different objects. | 13:10 | |
13:10
Altai-man left
|
|||
notandinus | ah i see, let me check that | 13:11 | |
coldpress: yeah that is it, i checked by not pushing but changing the value | 13:13 | ||
13:13
sjm_mobile joined
|
|||
notandinus | hmm so the fix is to push .Array? | 13:13 | |
coldpress | not sure how .Array is different from .List, maybe the perl monks here can explain | ||
lizmat | perl monks ? | 13:16 | |
notandinus | here: | ||
docs.raku.org/language/list#Assigning | |||
Assignment of a list to an Array is eager. | |||
raku monks | |||
can i make it non-eager? | 13:17 | ||
coldpress | lizmat: perlmonks.org/ | 13:19 | |
lizmat | coldpress: I know of Perl Monks, have been a monk for a long time until a very vocal part of the monastery made me decide to leave | 13:20 | |
notandinus | is it becuase of that thing i linked? ^ i'm not sure how that would affect pushes | ||
lizmat | notandinus: am currently too busy to look into your question, hope someone else will pick up | 13:21 | |
notandinus | i see, it's fine | 13:22 | |
13:50
b2gills left
13:56
aborazmeh joined,
aborazmeh left,
aborazmeh joined
14:09
leont joined
14:18
MRH joined
14:26
aindilis joined
14:49
b2gills joined
15:13
pecastro joined
15:15
aborazmeh left
15:18
parabolize joined
15:40
raiph joined
15:42
wamba left
|
|||
raiph | notandinus: ping | 15:43 | |
tellable6 | hey raiph, you have a message: gist.github.com/b7b231f18a67a9fed1...25b37b40c1 | ||
Geth | doc: uzluisf++ created pull request #3731: Rework the Iterating page |
15:50 | |
raiph | notandinus: An `Array` is a subtype of `List` but their behaviours are also complementary. | ||
15:51
wamba joined
|
|||
raiph | notandinus: `Array`s zig in several ways where `List`s zag. | 15:51 | |
notandinus: This is true of their literals. | 15:52 | ||
15:52
aluaces left
|
|||
raiph | notandinus: If you switch your code from pushing `($pos-y, $pos-x)` to `[$pos-y, $pos-x]` you'll find it works. | 15:53 | |
15:53
sjm_uk left
|
|||
raiph | notandinus: This is because the `Array` literal constructor just takes the *values* contained in the Scalar`s `$pos-x` and `$pos-y` and puts those values into its own fresh `Scalar`s. | 15:56 | |
notandinus: Whereas the `List` literal constructor does *not* by default put values in `Scalar`s -- but if you list one, it stores that instead of the value it contains. | 15:58 | ||
15:59
guifa2 joined
|
|||
raiph | .tell notandinus colabti.org/irclogger/irclogger_lo...12-12#l306 | 16:00 | |
tellable6 | raiph, I'll pass your message to notandinus | ||
16:00
guifa2 left
16:02
aindilis left
|
|||
raiph | notandinus: (I guess that should be "stores the listed `Scalar` *as well as* the value it contains, but the point is that that value can then change.) | 16:03 | |
coldpress | Is it weird if my 2D-Array algo is > 2x slower with CArrays, compared to Raku Arrays? | 16:06 | |
The 2D Array has 100 rows and 100 columns | 16:07 | ||
16:13
schlaftier joined
16:14
Celelibi left
|
|||
raiph | coldpress: No. It all depends on the details. cf www.nntp.perl.org/group/perl.perl6...g8857.html | 16:19 | |
16:20
domidumont left
16:23
stoned75 left
16:25
aluaces joined
16:27
domidumont joined
16:28
stoned75 joined
|
|||
tbrowder | hi, anyone still using Padre for Perl projects? | 16:36 | |
16:45
v_m_v joined
|
|||
lizmat | tbrowder: feels like #raku is the wrong channel to ask ? | 16:45 | |
16:46
aindilis joined
|
|||
tbrowder | well, we have a lot of | 16:46 | |
yepper | 16:47 | ||
16:53
Celelibi joined
17:02
tbrowder left
17:03
tbrowder joined,
tbrowder left
17:05
guifa2 joined
17:06
raiph left
17:07
Altai-man joined
17:10
sena_kun left
|
|||
codesect` | is there a way to use `#` as on of the characters with the TR operator? | 17:19 | |
m: say (TR/a#/AB/ with 'ab#c') | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Please backslash # for literal char or put whitespace in front for comment at <tmp>:1 ------> 3say (TR/a#7⏏5/AB/ with 'ab#c') |
||
codesect` | m: say (TR/a\#/AB/ with 'ab#c') | ||
camelia | Ab#c | ||
codesect` | ^^^^ doesn't error, but it doesn't work | 17:20 | |
(the .trans method works fine, so it's not a big deal; just currious) | 17:21 | ||
17:25
guifa2 left
|
|||
lizmat | m: say (TR/ a '#' /AB/ with 'ab#c') | 17:27 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Please backslash # for literal char or put whitespace in front for comment at <tmp>:1 ------> 3say (TR/ a '#7⏏5' /AB/ with 'ab#c') |
||
[Coke] | I've tried a few iterations locally, don't see one that works with # | 17:28 | |
17:34
asymptotically left
|
|||
codesect` | interesting. Thanks to you both | 17:44 | |
17:56
morayj joined
|
|||
morayj | Someone's uploaded a module for Raku to cpan called Game::Amazing (a couple of days ago) and it's not appeared on modules.raku.org Does something else need to be done, or is there an interval? | 17:58 | |
Altai-man | morayj, I am not 100% sure, but I'd say its META json is invalid: github.com/arnesom/raku-game-amazi...6.json#L18 | 18:09 | |
Altai-man sent a PR | 18:11 | ||
morayj | Altai-man: Great...thanks! | 18:12 | |
Altai-man | morayj, you are welcome | 18:13 | |
18:23
morayj left
|
|||
Altai-man | rba, ping? | 18:28 | |
18:32
v_m_v left
18:34
sjm_mobile left
18:35
domidumont left
18:37
sjm_mobile joined
18:42
wamba left
18:43
wamba joined
18:47
leont left
18:49
sjm_mobile left,
sjm_mobile joined
18:52
Altai-man left,
Sgeo joined
18:54
sena_kun joined
|
|||
patrickb | I currently fail to make a script access resource files. Shouldn't `raku -I. bin/some-script.raku` be able to do `%?RESOURCES<some-file>.slurp`? (There is a META6.json listing the file) | 18:56 | |
tellable6 | 2020-12-10T23:21:41Z #raku <melezhik> patrickb: at some point I was trying to help tony-o as well, he is aware, with new eco system stuff . For example - sparrowhub.io/search?q=function | ||
2020-12-11T16:23:57Z #raku <tony-o> patrickb sent you an email | |||
18:57
ingy left,
ingy joined
18:58
asymptotically joined
19:11
brtastic joined
|
|||
Geth | doc/eval-2905: 3cca92e7b2 | (Stoned Elipot)++ | doc/Type/independent-routines.pod6 Document EVAL $check and $filename parameters - ref #2905 - Add a small introduction to EVAL routine's description - Bring EVAL prototype (mostly) in sync with Rakudo's current implementation - Also mention EVALFILE's $check parameter - Use 'Perl' word - Use '.raku' filename suffix |
19:25 | |
doc: stoned++ created pull request #3733: Document EVAL $check and $filename parameters |
|||
19:36
wamba left
19:42
cpage left
19:44
cpage joined
|
|||
codesect` | why is this allowed? | 19:50 | |
m: my uint64 $a = -5; say $a | |||
camelia | -5 | ||
sena_kun | codesect`, as far as I heart, support of native types like this one is kind of ad-hoc and is known to be troublesome. | 19:53 | |
*heard | |||
20:04
aborazmeh joined,
aborazmeh left,
aborazmeh joined
20:18
MRH left,
wamba joined
|
|||
MasterDuke | the signed native types are better than the unsigned, and the unsized are better than the sized. (better in the sense of working more like they're supposed to) | 20:19 | |
20:24
dataangel joined
20:31
afresh1 left
20:35
afresh1 joined
20:41
sjm_mobile left
20:52
brtastic left
21:07
Altai-man joined
21:10
sena_kun left
21:14
stoned75 left
21:25
stoned75 joined
|
|||
Geth | doc/eval-2905: d6b231a6b4 | (Stoned Elipot)++ | doc/Type/independent-routines.pod6 Unformat Perl word |
21:29 | |
21:42
rindolf left
21:46
asymptotically left
21:47
asymptotically joined
21:49
Geth left,
Geth joined
22:03
Altai-man left
22:07
patrickb left
22:10
ajdplaysalto joined
22:11
natrys left
22:42
ajdplaysalto left
22:56
stoned75 left
23:14
aborazmeh left
23:19
rir joined
23:20
finsternis left
23:52
moon-child is now known as heats-flamesman
23:53
heats-flamesman is now known as moon-chilled
|