🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel! Set by lizmat on 6 September 2022. |
|||
00:00
reportable6 left
00:01
reportable6 joined
00:07
abraxxa joined
00:16
bigdata left
00:39
abraxxa left
00:46
moritz left,
moritz joined
01:16
ProperNoun left
01:31
jpn joined
01:36
jpn left
01:42
kjp left,
razetime joined
01:51
MasterDuke joined
02:01
kjp joined
03:01
evalable6 left,
greppable6 left,
unicodable6 left,
nativecallable6 left,
statisfiable6 left,
coverable6 left,
committable6 left,
releasable6 left,
reportable6 left,
tellable6 left,
bisectable6 left,
sourceable6 left,
quotable6 left,
squashable6 left,
shareable6 left,
notable6 left,
nativecallable6 joined
03:02
unicodable6 joined,
statisfiable6 joined,
sourceable6 joined,
notable6 joined,
reportable6 joined,
greppable6 joined,
coverable6 joined,
releasable6 joined
03:03
bisectable6 joined,
evalable6 joined,
squashable6 joined,
committable6 joined
03:04
tellable6 joined,
quotable6 joined,
shareable6 joined
03:07
guifa_ left
03:08
guifa_ joined
03:11
rf left
03:19
jpn joined
03:20
ProperNoun joined
03:24
jpn left
03:50
razetime left
03:51
razetime joined
04:14
razetime left
04:27
guifa_ left
04:32
razetime joined
04:49
jpn joined
04:54
jpn left
05:25
siavash joined
05:44
jpn joined
05:49
jpn left
05:51
jpn joined
05:55
jpn left
06:00
reportable6 left
06:01
reportable6 joined
06:14
jpn joined
|
|||
xinming | github.com/rakudo/rakudo/issues/4132 | 06:52 | |
m: my %h; |%h{}:p.Seq | |||
camelia | ===SORRY!=== MVMArray: Can't pop from an empty array |
||
xinming | for this issue has no response over a long time, Does it mean it won't be fixed? or no need to fix anyway? :-) | 06:53 | |
07:08
jpn left
07:21
Sgeo left
07:25
camelia left,
m_athias left
07:26
nine_ left
07:31
m_athias joined
07:32
nine joined
|
|||
lizmat | weekly: dev.to/finanalyst/rakudoc-revision...mment-4hjb | 07:44 | |
notable6 | lizmat, Noted! (weekly) | ||
tellable6 | hey lizmat, you have a message: gist.github.com/af3259b8eaaa60adc4...af2e39b699 | ||
07:47
ab5tract joined
07:48
camelia joined
07:52
siavash left,
sena_kun joined
07:53
siavash joined
07:56
dakkar joined
07:59
ab5tract left
08:04
ab5tract joined
|
|||
Geth | planet.raku.org: c1abf17b62 | (Elizabeth Mattijsen)++ | perlanetrc Add feed ffor finanalyst, correct feed for bbkr |
08:10 | |
08:14
tea3po left,
tea3po joined
08:24
ab5tract left
08:38
ab5tract joined
08:47
ab5tract left
08:50
razetime left
08:54
Matthew|m joined
|
|||
nemokosch | dev.to is really not bad | 09:45 | |
I mostly mean it from Raku content creator perspective; it's not a bad place to have presence at | 09:51 | ||
lizmat | I agree :-) | 09:52 | |
09:54
evalable6 left
09:56
evalable6 joined
10:04
jpn joined
10:15
ab5tract joined
|
|||
patrickb | o/ There is currently no way to receive a native callback from a library that spaws its own threads, right | 10:57 | |
? | |||
"MoarVM panic: native callback ran in thread (12345) unknown to MoarVM" is the corresponding error... | 10:58 | ||
10:58
ab5tract left
|
|||
lizmat | perhaps ask on #moarvm? | 11:01 | |
patrickb | will do! | ||
11:14
jpn left
11:16
ab5tract joined
11:21
jpn joined
11:28
jpn left
11:37
ab5tract left
12:00
reportable6 left
12:02
reportable6 joined
12:03
jpn joined
12:27
jpn left
12:35
jpn joined
12:37
siavash left
13:16
vrurg_ is now known as vrurg
13:21
ab5tract joined
13:49
ab5tract left
|
|||
lizmat clickbaits rakudoweekly.blog/2023/07/31/2023-...explained/ | 13:55 | ||
14:16
timo left
14:31
timo joined
15:02
ab5tract joined
15:17
ab5tract left
15:29
rf joined,
ab5tract joined
15:39
ab5tract left
15:52
ab5tract joined
15:58
jpn left
15:59
wafflus joined
|
|||
wafflus | how can test be an Int?;Â $test = 5.WHAT; $test.^name; p.s i know this is contrived' i'm just trying to understand things; | 16:11 | |
like for instance if you do the same thing in powershell it is a not a number at all but a typeinfo object which makes more sense to me | 16:13 | ||
tonyo | m: say 5 ~~ Int; # wafflus | 16:15 | |
camelia | True | ||
16:15
razetime joined
|
|||
wafflus | m: say 4 | 16:17 | |
camelia | 4 | ||
wafflus | looks a bit weird to have something be an int and not be at the same time | 16:18 | |
m: my $test = 5.WHAT; given $test {when Int {say "{5+ $test}"}} | 16:27 | ||
camelia | Use of uninitialized value of type Int in numeric context in block at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
tonyo | m: m: my $test = 5; given $test {when Int {say "{5+ $test}"}} | 16:29 | |
camelia | 10 | ||
tonyo | not sure what you mean by be an int and not at the same time | ||
in your test, `$test` == Int, not 5 | 16:30 | ||
wafflus | its says it is an int but what is it's value? how can it be an int? | ||
what is the logic behind allowing it and could it be a potential source of bugs and misunderstandings in less ridiculous examples ? or will it never matter? | 16:32 | ||
tonyo | it's an undefined type when you use `.WHAT` | 16:33 | |
m: my $type = 5.WHAT; say $type.new(6) + 10 | |||
camelia | 16 | ||
16:33
ab5tract left
16:34
dakkar left
|
|||
wafflus | it undefiend but it still says it's an int? | 16:34 | |
tonyo | yes | 16:35 | |
if you are more familiar with another language i may be able to make an analogy | |||
wafflus | i use powershell quite alot and i also use js. the logic behind it does not make sense to me | 16:37 | |
like i said in powersehll it is a typeinfo object it's not a number or undefined | |||
or both | |||
i haven't used js in a while all i remeber is the typeof object which just returns a string | 16:38 | ||
operator i mean | |||
tonyo | yea, so calling .WHAT is like using the `typeof` in js | 16:39 | |
but the semantics for testing if a type is something in raku doesn't track with js.. so doing `say 5 ~~ Int` is equivalent to js: `console.log(typeof(5) === 'number' ? 'True' : 'False')` | 16:40 | ||
in js, you'd also have to test that the number floored or ceiled is the same to also check for an int but that better shows the syntax difference | 16:41 | ||
wafflus | it not the same though is it your checking against string values and also your not assigning them to a variable | ||
tonyo | in raku: `my $a = 5; say $a ~~ Int; # True` in js: `const a = 5; console.log(typeof(a) === 'number' && Math.floor(a) == a ? 'True' : 'False'); // True` | 16:43 | |
if you wanted the exact same syntax in raku you could use: `my $a = 5; say $a.^name eq Int.^name; # True` | 16:44 | ||
wafflus | thanks not sure I understand what your getting at (plus you changed the question) | 16:54 | |
nemokosch | so the primary motive is to allow for typed undefined values | 17:09 | |
Raku takes a big leap and says "okay, the undefined value of type T will be the type object of T itself" | |||
I'm inclined to agree that it is strange but it's not very complicated | 17:10 | ||
wafflus | it certainly is strange :) | 17:12 | |
nemokosch | this also means that if you create a variable my Int $apples, the default value of $apples will be Int, that is, the type object | 17:13 | |
not zero or any concrete value | |||
[Coke] | m: my Int $a; dd $a; my Int $b = 3; dd $b | 17:14 | |
camelia | Int $a = Int Int $b = 3 |
||
[Coke] | (dd is data dumper, a rakudo-specific debugging tool) | ||
that way you don't get the extra confusion of 'say $x', where say is transparently calling a method on the thing to get a printable string. | 17:15 | ||
tonyo | ++ | ||
[Coke] | s/confusion/layer/ | ||
nemokosch | the problem is rather the syntactic burden that now Int both needs to play a type constraint and a value, and these are not always interchangable | 17:18 | |
type smileys kind of help, Int:D clearly means "a concrete Int value expected here" | 17:19 | ||
while Int:U actually means "a type object kind of Int expected here", so in normal cases the Int type object itself (could be a derived type in theory) | 17:20 | ||
wafflus | is this something I need to check for? or is it something that won't ever come up unless deliberately trying to do so? | 17:23 | |
[Coke] | with gradual typing, you can add those restrictions in when you find they are important, and ignore them until then. | 17:24 | |
basically you can write very strict signatures and type everything, or not. | 17:25 | ||
nemokosch | I don't think you will be passing type objects around a lot, except for the "default value" use case | ||
if you want to forbid default values, you can add this Type:D kind of annotation | |||
default as in undefined | 17:26 | ||
the important thing to know is that by default, your variables will start off having these "non-values" | 17:28 | ||
17:28
Ven_de_Thiel joined
|
|||
sometimes they coerce to something meaningful but most of the time they will emit a warning at the very least | 17:28 | ||
Ven_de_Thiel | o/ | ||
17:31
eseyman left
17:33
gcd left
17:34
manu_ joined,
manu_ is now known as eseyman
|
|||
nemokosch | m: my Int $foo; say 5 ~~ $foo; | 17:35 | |
Raku eval | True | ||
17:36
Ven_de_Thiel left
|
|||
wafflus | is there a way to check something is an actual number and not some int type object thing? | 17:37 | |
so that it does not try to do mathematical operations on it and failing | 17:38 | ||
tonyo | you're asking if you can check if it is defined? | 17:39 | |
you can use `.defined` so: `5.defined # True` and `Int.defined # False` | |||
[Coke] | but if you're writing a sub that needs args that are defined, you can do that in the signature. | 17:40 | |
nemokosch | This is a fractal of a topic | 17:41 | |
[Coke] | m: sub zz (Int:D $x) { say $x+3}; zz(4) | ||
camelia | 7 | ||
[Coke] | m: sub zz (Int:D $x) { say $x+3}; zz(Int) | ||
camelia | Parameter '$x' of routine 'zz' must be an object instance of type 'Int', not a type object of type 'Int'. Did you forget a '.new'? in sub zz at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
[Coke] | rather than doing an explicit check in code, use the syntax where possible. | ||
nemokosch | One day you realize that there is method DEFINITE and method defined | ||
[Coke] | but also: | 17:42 | |
nemokosch | The 😄 smileys rely on DEFINITE | ||
[Coke] | Note: you're getting a firehose of information here. beginners don't need to know about some of this. :) | ||
nemokosch | Damn... :D | ||
17:42
razetime left
|
|||
It's enough to get bitten once, and you two immediately said two things that do not quite work the same | 17:44 | ||
wafflus | thanks I may not understand some of it or agree but am always grateful | 17:45 | |
btw who is in control of the bot or is it somekind of AI? | |||
grateful sounds like a word used for someone who likes grating cheese | 17:46 | ||
nemokosch | Let's say, the moderators are | 17:47 | |
[Coke] | It's not AI. there's a repo that has the code driving it. | 17:48 | |
nemokosch | Or you mean the bridge? 😄 | 17:50 | |
17:53
gcd joined
|
|||
[Coke] | ah. discord-raku-bot is one thing, camelia is another. there are *many* bots here | 17:55 | |
17:55
ab5tract joined
18:00
reportable6 left,
ab5tract left
18:02
reportable6 joined
18:04
TieUpYourCamel left
18:16
TieUpYourCamel joined
18:24
ab5tract joined
18:39
cm left,
cm_ joined,
cm_ is now known as cm,
ab5tract left
18:44
rf left
18:45
wafflus left
18:54
rypervenche left
18:57
Ven_de_Thiel joined
19:00
rf joined
19:01
dogbert17 left
19:14
ab5tract joined
19:43
nebuchadnezzar left
19:48
ab5tract left
20:04
Maylay left
20:09
Maylay joined
20:10
Ven_de_Thiel left
20:13
teatwo joined
20:16
tea3po left
20:18
Ven_de_Thiel joined
20:46
Ven_de_Thiel left,
jpn joined
20:55
ProperNoun left
21:18
rf left
21:20
rf joined
21:26
jpn left
21:36
sena_kun left
21:46
jpn joined
21:50
jpn left
21:56
rf left
22:04
jrjsmrtn left,
guifa_ joined,
jrjsmrtn joined
|
|||
librasteve | ie. one day you may want to use the raku Meta Object Protocol (MOP) where DEFINITE is a thing for core devs and maybe yes this is used under the hood to implement smileys ... BUT the general level raku coder will only need to use .definite - the clue is that it's ALL CAPS | 22:21 | |
nemokosch | The problem is that things that look roughly equally important, use different things. Type:D is as much idiomatic as using with or //. It's hard to say that you don't care about one or the other | 22:24 | |
22:26
MasterDuke left
23:07
Sgeo joined
23:10
ProperNoun joined
23:19
daxim left
23:31
daxim joined
|