00:43
lizmat joined
01:26
librasteve_ left
01:36
Manifest0 left
08:50
librasteve_ joined
08:52
stanrifkin joined
08:58
Manifest0 joined
09:15
dakkar joined
10:47
stanrifkin left
12:32
stanrifkin joined
13:31
human-blip left
13:32
human-blip joined
13:57
human-blip left,
human-blip joined
14:15
librasteve_ left
17:35
dakkar left
18:14
stanrifkin left
|
|||
ab5tract | librasteve: I'm still curious about this: usercontent.irccloud-cdn.com/file/.../image.png | 19:40 | |
19:50
librasteve_ joined
|
|||
librasteve | ab5tract: sorry thought I had dodged that one ... going over to IRC to avoid mistranslations | 19:51 | |
librasteve_ | arrives at IRC, here’s what I think I said | ||
m: say &[+](1,2) | 19:52 | ||
camelia | 3 | ||
librasteve_ | then | ||
.oO as in ooooh that’s neat | |||
hope that makes sense now | 19:53 | ||
19:59
uniro joined
20:02
Manifest0 left
|
|||
ab5tract | ahhh | 20:21 | |
that explains it quite perfectly | 20:22 | ||
I'm not sure how we can fix that bridge, but it would be awesome if we can do so | |||
renormalist | Are allomorphs a special feature of the language or is it "just" a predefined use of the normal type system, with those types, the <> operators, etc.? I mostly wonder where that "use the correct value" work is done, like wouldn't it need to train *every* operator to know about allomorphs? | 20:51 | |
m: <42 50e0 100>.^name | 20:53 | ||
camelia | ( no output ) | ||
renormalist | m: dd <42 50e0 100>.^name | ||
camelia | "List" | ||
antononcube | @renormalist That would depend on how you define your operators. (I assume you are making new operators.) | ||
renormalist | actually I'm just reading about it, just trying to understand them, because I think they are what's needed in cases where I want Raku to DWIM like Perl, like on porting Perl code. | 20:54 | |
antononcube | Try this: <42 50e0 100>.map(*.^name) | 20:55 | |
renormalist | and I'm not sure right now if "Allomorphs" is a concept of the Raku language, or a special type, lie IntStr is. | ||
m: dd <42 50e0 100>.map(*.^name) | |||
camelia | ("IntStr", "NumStr", "IntStr").Seq | ||
renormalist | m: dd +«<42 50e0 100>.map(*.^name) | 20:56 | |
camelia | (Failure.new(exception => X::Str::Numeric.new(source => "IntStr", pos => 0, reason => "base-10 number must begin with valid digits or '.'"), backtrace => Backtrace.new), Failure.new(exception => X::Str::Numeric.new(source => "NumStr", pos => 0, reason… | ||
renormalist | m: dd (+«<42 50e0 100>).map(*.^name) | ||
camelia | ("Int", "Num", "Int").Seq | ||
renormalist | m: dd (~«<42 50e0 100>).map(*.^name) | ||
camelia | ("Str", "Str", "Str").Seq | ||
renormalist is here: docs.raku.org/language/numerics#Allomorphs | |||
I formulate it differently: could I create m own "allomorph" behaviour, let's call it "multimorphs", and eg let them handle 3 different values/contexts? | 20:58 | ||
then I would understand Allomorphs are just a particular setup of the normal type system of Raku. Is that the case? | 20:59 | ||
(remember, I'm early beginner level) | |||
antononcube | Allomorph behavior is seen in other languages, but most like the concept of "Allomorph" is just in Raku. (As a programming language concpet.) | 21:01 | |
renormalist | ok | ||
antononcube | Due, at least one of Raku's creators being a linguist, I guess... | ||
renormalist | I will take this as my thinking model for now. Thanks. Back on experimenting. :-) | 21:02 | |
ab5tract | Allomorphs are implemented using normal features of the Raku type system, so you could definitely create your theoretical "multimorphs" | 21:06 | |
the essential pattern is pretty simple, even if the particulars get a bit intricate: github.com/rakudo/rakudo/blob/main...hs.rakumod | 21:07 | ||
antononcube | Hmmm... maybe LLMs can make Raku allomorphs... | 21:18 | |
Although, I cannot comeup with a meaningful allomorph right now. All my ideas are some version of symbolic programming use cases. | 21:19 | ||
ab5tract | It would be an interesting exercise to work on a Multimorph role that could take a list of types as parameters | 21:20 | |
I guess their utlity would likely intersect with "sum" types | 21:21 | ||
librasteve | rakujourney.wordpress.com/2024/04/...s-unicode/ | 21:29 | |
rakujourney.wordpress.com/2023/05/...lomorphia/ | |||
renormalist | ab5tract: thanks, will read and adapt my thinking model. | 21:39 | |
ab5tract: that core.c/allomorphs.rakumod, despite me not getting every detail, is quite the answer, I can somehow see everything I was thinking about. Nice learning for me. Thanks again. | 21:44 | ||
ab5tract | renormalist: cheers! sometimes taking a look at the Rakudo source can be really helpful | 21:48 | |
22:58
cleo left
|