30 Jan 2023
Zephyr conflict is determined by the regex match there 15:31
and must maintain the order
raschip I would have a map from the key into lists of 2 elements, the contents and the order. After using the hash, it's easy to construct the original list in order 15:32
:(**@rest, *%rest) i can do that without hash
stevied should I file an issue about the new() method in the docs?
might as well 15:33
Zephyr hmm, having the order as a value makes sense indeed, lemme try. thanks btw
Nemokosch yep, you can - just please check if there are already issues of that sort 15:35
sounds essential enough, related to how these signatures are collected
:(**@rest, *%rest) are there a "callable with signature" type like Callable[(...), ...] in python or (...) => ... in typescript 15:47
Nemokosch the pointy block?
there are anonymous subs and pointy blocks 15:48
:(**@rest, *%rest) a type that matches callables with specific signatures
Nemokosch hmm 15:49
:(**@rest, *%rest) it would be useful for callbacks 15:50
Nemokosch the Callable role can have parameters, not sure if they can cover the signature as well 15:51
I can only see the returns argument 16:00
actually if I think about it, Callable in itself doesn't know signatures
:(**@rest, *%rest) raku conveniently ignored specialized callback type 😭 while almost all langs with typing support it 16:07
Nemokosch you know, sometimes I wonder what was first: the chicken or the egg 16:18
power users/devs not really using types, or types being kind of lacky 16:19
the thing is, Raku's type system is a bit different from Python's or especially Typescript's
Typescript is basically a preprocessor language, nothing was expensive because at the end of the day, 95% of its code is going to get discarded in favor of plain old untyped Javascript 16:22
iirc Python types are also for the linter, basically 16:23
also, as far as I can remember, Python types are quite messy and inconvenient, both regarding how to obtain them and how the syntax needed to be adopted
in Raku, types naturally evolve with the language 16:24
just slower than the content or the syntax itself
:(**@rest, *%rest) yea but doesn't that say anything about the lack of specialized callback types 16:35
Nemokosch In those languages, this is just a formality 16:38
in Raku, it kind of needs to evolve with the actual data structures
khm, khm, Hash
did you know that the "typed" hash is in fact a different data structure from a banal default Hash? 16:39
more accurately, it mixes in roles that add code to handle certain behavior
:(**@rest, *%rest) raku's is more like php in terms of gradual typing or the other way around coincidentally php also doesn't support signatures on functions
real 16:40
Nemokosch iirc PHP also tries to do runtime checks and stuff
rather than linting
:(**@rest, *%rest) something like Hash[Str, Int]? 16:41
Nemokosch yes 16:56
github.com/rakudo/rakudo/blob/main...Object.pm6 16:58
> my role Hash::Object[::TValue, ::TKey]
:(**@rest, *%rest) Hash[Str, Int] is different from Hash hmm
Nemokosch well, it's a Hash that has this role mixed in 16:59
hence overriding certain behavior
:(**@rest, *%rest) omg generic types
Nemokosch "generic types"
"weak typing"
when do these terms ever end? 😭
let's give them funny Raku-ish names instead
:(**@rest, *%rest) type-capturing types 😳 17:00
i hope signatured callbacks get added in next version tho 17:08
though i don’t know how to represent it 17:09
Callable[:(Int, Str, Bool)]?