00:22
zenmov left
00:23
zenmov joined
00:53
Aedil joined
01:06
zenmov left
01:59
guifa left
02:06
guifa joined
02:31
hulk joined
02:32
kylese left
02:47
zenmov joined
03:15
hulk left,
kylese joined
|
|||
xinming | m: role TR { has $.x = "xv" }; my $x = "hello"; $x does TR; $x.x.say; $x.^roles.raku.say | 05:03 | |
camelia | xv (TR, Stringy) |
||
xinming | m: role TR { has $.x = "xv" }; my $x = "hello"; $x does TR; $x.x.say; $x.VAR.^roles.raku.say | ||
camelia | xv () |
||
xinming | So the 'does TR' to a variable, actually it modifies the role info to value itself, not the container, right? | 05:04 | |
So with 'does role', we can actually move the value around | |||
guifa | Yes. there be dragons doing that to valuetypes | 05:08 | |
m: role TR { has $.x = "xv" }; my $x = "hello"; $x does TR; my $y = 'hel' ~ 'lo'; say $y.WHAT; my $z = 'hello'; say $z.WHAT | |||
camelia | (Str) (Str+{TR}) |
||
guifa | it will end up being applied to the STRING "hello". Which may or may not internally be the same in $x and $y, causing it not to be applied (and most people probably wouldn't want it to be anyways) | 05:09 | |
xinming | guifa: Thanks, Really good warning about the *tricky* behavior. | 05:11 | |
Seems the constant string is being applied to that role globally | |||
m: multi sub t(:$good where :so) { "Good".say; }; multi sub t(:$good where :!so) { "Not good".say }; t(); | 05:19 | ||
camelia | Not good | ||
xinming | With this example, I found them on my code snippets from chatlog, I know that 'where :!so' in where means something like 'where !*.so', I can't find the explaination about 'where :!so', Anyone here explains pleases? | 05:21 | |
I know there is something like :e :f to IO handles as well | 05:22 | ||
is it internally '$x ~~ :!so' will be transformed to something like !$x.so ?? | 05:23 | ||
guifa | huh i've never seen where :so | 05:38 | |
xinming | Finally I got the answer. | 05:58 | |
If $topic is any other value, the invocant Pair's key is treated as a method name. This method is called on $topic, the Bool result of which is compared against the invocant Pair's Bool value. For example, primality can be tested using smartmatch: | |||
docs.raku.org/type/Pair#method_ACCEPTS | |||
06:00
zenmov left,
zenmov joined
06:04
guifa left
|
|||
xinming | m: role TR { has $.x = "x" }; my $x = ($ = 2 + 1); $x does TR; $x.^roles.raku.say; my $y = 3; $y.^roles.raku.say; | 06:41 | |
camelia | (TR, Real, Numeric) (TR, Real, Numeric) |
||
xinming | m: role TR { has $.x = "x" }; my $x = (($ = 2) + 1); $x does TR; my $y = 3; $y.^roles.raku.say; my $z = ($ = 2)++; $z.^roles.raku.say; | 06:43 | |
camelia | (TR, Real, Numeric) (Real, Numeric) |
||
xinming | Is there a way to make constant 3 not does role globally, but still keeps ability to pass the value 3 with roles around? | 06:45 | |
m: role TR { has $.x = "x" }; my $x = (($ = 2) + 1); $x does TR; my $y = 3; $y.^roles.raku.say; my $z = ++($ = 2); $z.^roles.raku.say; | |||
camelia | (TR, Real, Numeric) (TR, Real, Numeric) |
||
06:45
perlbot left
06:46
simcop2387 left
|
|||
xinming | hmm, 'but' will do what I wanted | 06:47 | |
06:50
perlbot joined,
simcop2387 joined
07:29
zenmov left
07:32
zenmov joined
08:11
zenmov left
08:17
zenmov joined
08:34
Sgeo left
08:40
zenmov left
08:44
zenmov joined
08:45
zenmov left
08:46
zenmov joined
08:47
zenmov left
08:48
zenmov joined
09:09
zenmov left
09:14
dakkar joined
09:26
finanalyst joined
09:31
zenmov joined
|
|||
finanalyst | Is there any one here who can help me add an article to the Advent list. I've only used WordPress for Advent articles and I cant remember what I did last year :) | 09:34 | |
tellable6 | 2024-09-16T11:00:21Z #raku-dev <tbrowder> finanalyst: ^^ | ||
09:38
finanalyst left
09:48
zenmov left
09:50
zenmov joined
|
|||
timo | .o( i can't remember what i did last week ) | 09:54 | |
10:01
finanalyst joined
|
|||
lizmat | finanalyst: if you can put a gist somewhere, I can take that and put it in WP | 10:05 | |
I have weekly experience dealing with WP :-) | |||
finanalyst | sending you an email! | 10:26 | |
10:28
zenmov left
10:33
sena_kun joined
10:37
zenmov joined
10:42
sena_kun left
10:54
rba_ joined
11:02
human-blip left,
coleman left,
japhb left,
rba left,
samebchase left,
sjn left,
cm left,
dano left,
tinita left,
jast left,
rba_ is now known as rba
11:05
human-blip joined,
coleman joined,
japhb joined,
samebchase joined,
sjn joined,
cm joined,
dano joined,
tinita joined,
jast joined
11:13
zenmov left
11:43
gfldex left
11:50
gfldex joined
11:59
finanalyst left
13:29
Xliff joined
|
|||
Xliff | \o | 13:29 | |
Where can I find out what really goes on when you call .new for an Object. I am getting a "Cannot assign to an immutable value" when I make a call to self.bless, but for the life of me I can't seem to track it down. | 13:30 | ||
From what I can tell, it's not in any of my BUILDs or TWEAKs. What else might there be? | 13:31 | ||
lizmat | doesn't an --ll-exception stacktrace tell you more? | 13:41 | |
13:59
guifa joined
14:15
yewscion joined
14:26
finanalyst joined,
guifa left
|
|||
Xliff | Cannot assign to an immutable value | 14:30 | |
at src/vm/moar/dispatchers.nqp:222 (/home/cbwood/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/BOOTSTRAP/v6c.moarvm:) | |||
from /home/cbwood/Work/RacquetAppServer/app/lib/Applications/Bizzell/Inventory/Instance.pm6 (Applications::Bizzell::Inventory::Instance):48 (/home/cbwood/Work/RacquetAppServer/app/lib/.precomp/D69BDF306EBF6CADBB78BF26AE45271D9FD3BB75/CA/CAAB3B2684593984EDC20968A2AA667B2CE6626E:BUILDALL) | |||
Which traces back to this: | 14:32 | ||
my $assign-fallback := -> $cont, $value { | |||
nqp::assign($cont, $value) | |||
} | |||
timo | ah, it's unfortunate that we lose the name related to the container in use there | 14:37 | |
the "cannot assign to immutable value" error is an ad-hoc from inside moar, so it doesn't pass the objects in question | 14:39 | ||
Xliff | It was working before though. So what in application code can slip down to moar code to cause this? | 14:40 | |
timo | could you do a bit of gdb spelunking together with me? | 14:42 | |
Xliff | Sure. | 14:43 | |
Hang on, let me see if I can get this script to put in rakudo-gdb-m | |||
timo | then let's try with a breakpoint in MVM_exception_throw_adhoc and run until we hit the one with the right message | 14:44 | |
Xliff | Actually, I am gdb right now right after the exception is printed. | 14:45 | |
timo | cool | ||
Xliff | OK. Let's go cavin'! | ||
timo | are you still in MVM_6model_container_assign_* or so? | 14:46 | |
or maybe it's in interp.c, there's two instances there as well | |||
Xliff | I think this one is in dispatchers.nqp | ||
So how can I get gdb to not run anything when it loads? | 14:47 | ||
timo | ah, i mean the C level backtrace with "bt" | ||
Xliff | bt full has no stack. | ||
timo | rakudo-gdb-m puts an -ex="run" in the gdb commandline | ||
Xliff | Oh! I can rerun., | ||
timo | you can just "gdb --args rakudo bla bla bla" and it won't immediately run | ||
Xliff | So how can I break at MVM_exception_throw_adhoc? | ||
timo | do you happen to have rr installed? being able to reverse step is amazing | 14:48 | |
`break MVM_exception_throw_adhoc` | |||
Xliff | Undefined command rr | ||
One sec, let me install. | |||
OK, yeah I do have it installed. How should I use it? | 14:49 | ||
timo | neat! | ||
"rr record rakudo bla bla", then after it has exited "rr replay" will drop you in a gdb that behaves like normal but with extra commands for time travel | |||
Xliff | Hmm.... let me see if I can do that real quick. | 14:50 | |
timo | no need to do anything quickly once you have time travel unlocked :D :D | 14:51 | |
should we move this to #raku-dev or query? | 14:53 | ||
Xliff | Sure | 14:55 | |
14:56
Sgeo joined
|
|||
Xliff | bt | 15:23 | |
15:37
tjr joined
16:08
finanalyst left
16:14
guifa joined
17:39
dakkar left
|
|||
Xliff | Cannot resolve caller infix:<===>(Mu:U, Int:U); none of these signatures matches: | 18:16 | |
Why does this not work? Can't this just be a value comparison? Why does Mu not implement === ? | |||
18:24
yewscion left
|
|||
timo | maybe =:= instead? | 18:25 | |
m: say any(1,2,3) === 3 | 18:27 | ||
camelia | any(False, False, True) | ||
timo | m: say any(1,2,3) =:= 3 | ||
camelia | False | ||
18:29
kst left
18:49
sena_kun joined
19:27
guifa left
19:53
guifa joined
20:05
Guest89 joined
20:08
Guest89 left
20:09
guifa left
20:21
Guest89 joined,
Guest89 left
20:28
Guest89 joined
|
|||
Geth | advent: hwayne++ created pull request #120: Article on counting the size of a process state space with Raku |
20:29 | |
20:34
Guest89 left,
Guest89 joined
20:40
Guest89 left
20:49
Aedil left
21:56
sena_kun left
|
|||
patrickb | What's the smallest and most nothing doing raku program you can have? | 22:07 | |
m: 0 | 22:08 | ||
camelia | WARNINGS for <tmp>: Useless use of constant integer 0 in sink context (line 1) |
||
patrickb | That warns | ||
m: my $x | 22:09 | ||
camelia | ( no output ) | ||
nahita3882 | not counting the entirely empty file? | 22:22 | |
m: * | |||
evalable6 | |||
patrickb | m: | 22:23 | |
Empty doesn't work with raku -e | |||
nahita3882 | then my answer is * | 22:24 | |
patrickb | But * is nice. No idea what it's supposed to do though. | ||
nahita3882 | it sinks a Whatever object literal | 22:26 | |
yet doesn't warn not sure why not | |||
antononcube | @patrickb Thanks for referring to me in that GitHub issue! 🙂 | 22:36 | |
I am not sure how much that is “right up my alley”, but I am interested solving the problem you mention. (I have two solutions.) | 22:38 | ||
patrickb | Your welcome! It's nice that asking for your help pleases you. :-) | ||
antononcube | This one: github.com/Raku/RakuDoc-GAMMA/issu...2503481395 | ||
23:02
sorenson left
|
|||
[Coke] | raku -e ''; - this runs here with no output. | 23:14 |