🦋 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:10 sena_kun left, Sgeo joined 00:27 yewscion joined 00:32 yewscion left 00:40 LainExperiments left 00:51 LainExperiments joined 01:05 jaguart left, yewscion joined 01:10 yewscion left 01:19 wbooze_ left 01:51 LainExperiments left 02:06 yewscion joined 02:11 yewscion left 02:37 yewscion joined 02:42 yewscion left 02:45 hulk joined 02:46 kylese left 02:56 LainExperiments joined 02:57 yewscion joined 03:02 yewscion left 03:03 yewscion joined 03:05 LainExperiments left 03:08 yewscion left 03:15 hulk left, kylese joined 03:55 Aedil joined 06:05 bdju left 07:51 Sgeo left 08:10 derpydoo joined 08:18 Aedil left 09:07 yewscion joined 09:11 yewscion left 09:17 dakkar joined 09:41 yewscion joined 09:45 yewscion left 10:13 yewscion joined 10:20 jpn joined 10:21 yewscion left 10:32 sena_kun joined 10:41 sena_kun left 10:47 derpydoo left 10:49 Aedil joined 10:52 Aedil left 10:53 Aedil joined 11:22 jpn left 11:23 jpn joined 11:26 yewscion joined 11:31 yewscion left 11:35 phogg left 11:47 yewscion joined 11:53 yewscion left 11:59 yewscion joined 12:03 yewscion left 12:09 wbooze joined 12:18 wbooze left 12:54 jpn left 12:59 yewscion joined 13:04 wbooze joined 13:05 yewscion left 13:17 wbooze left, jpn joined, wbooze joined 13:21 jpn left 13:35 yewscion joined 13:37 jpn joined 13:39 yewscion left 14:10 wbooze_ joined, wbooze left 14:11 wbooze_ is now known as wbooze 15:17 El_Che left 15:18 El_Che joined 15:19 yewscion joined 15:36 vrurg_ joined 15:37 vrurg left 15:43 wbooze left 15:44 jpn left 15:45 jpn joined 15:52 wbooze joined 16:19 wbooze left 16:20 wbooze joined 16:22 jpn left, jpn joined 16:43 wbooze left 17:00 jpn left 17:29 rir joined 17:47 bdju joined 17:48 bdju left 17:52 dakkar left
tbrowder hi, i would like to define some cirumfix operators that would only work if both operands were class objects of the same class. is that possible? example for multiplication: $a = A.new; $b = A.new; $c = $a * $b 17:54
*circumfix
where $c is shiny new object of class A 17:55
*a shiny
lizmat m: sub a(::T $a where !*.defined, T $b where !*.defined) { dd :$a:$b }; a Int, Int 17:57
camelia :a(Int)
:b(Int)
tbrowder my use case is extending core capability of handling real numbers up to base 36
lizmat m: sub a(::T $a where !*.defined, T $b where !*.defined) { dd :$a:$b }; a Int, Str
camelia Type check failed in binding to parameter '$b'; expected Int but got Str (Str)
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat sadly ::T:U syntax is not supported atm
tbrowder ok, then i can work around the but a bit uglier 17:58
just wanted to make sure i wasn't missing something 17:59
extending to base 91
can't think of a practical reason, but interesting thanks to Wolfram and Wikipedia 18:01
and other sources
18:07 bdju joined
tbrowder so now to name a typical method for operator *: "multiply-by", or "times" or ? 18:09
it wll have to have 2 inputs: number, and base 18:10
or another class object
sdomi what's the state-of-the-art HTTP server library / web framework as of right now? 18:26
i'm considering writing my own as an excercise with learning Raku, just wanted to see the prior art :)
(for context: this is my Bash web framework git.sakamoto.pl/laudom/HTTP.sh/ - whatever I end up writing in Raku would probably end up similar in spirit to this) 18:27
tbrowder sdomi: sounds cool to me, but i can't offer and 18:29
*any advice
sdomi thanks anyways :p
tbrowder can anyone help , 18:30
*help me understand diff between "type smileys"? to me the docs don't show the diff between :D and :U for a user class arg 18:32
18:34 wbooze joined
sdomi tbrowder: can you link to the relevant page? I'm curious now 18:40
[Coke] Those in particular are defined, undefined.
like 1 vs Int
docs.raku.org/language/glossary#Type_smiley links to docs.raku.org/language/signatures#...finiteness 18:41
To recap, here is a quick illustration of these type constraints, also known collectively as type smileys: 18:42
(look for that text on the last page, it's got a bunch of code samples)
19:10 phogg joined
tbrowder so i have an object of my class A, i should use: sub foo(A:D $a) {...} to ensure i have the "right stuff" 19:13
the problem with those code samples is it seems to only contrast raku core things 19:15
so the subtleties get in the way
thnx [Coke] 19:19
m: class F {has $.n=1}; my $a = 1; my $b = F.new; sub f(F:D $a) {}; f($a); f($b) 19:23
camelia Type check failed in binding to parameter '$a'; expected F but got Int (1)
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
tbrowder i now think the term 'binding' is part of my confusion. 19:24
le
let me look at the docs again...what would be the purpose of a :U smiley if the arg were undefined? 19:27
a practical example, that is. would it mean "accept anything but the named object? 19:31
m: class F {has $.n=1;}; my $a = 1; sub f(F:U $a) {}; f($a); 19:39
camelia Type check failed in binding to parameter '$a'; expected F but got Int (1)
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
tbrowder m: class F {}; my $a = F.new; sub f(F:U $a) {}; f($a) 19:44
camelia Parameter '$a' of routine 'f' must be a type object of type 'F', not an
object instance of type 'F'. Did you forget a 'multi'?
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
tbrowder that's the confusion in my brain, is there a type object of F? 19:46
outside the core type definitions, is there a use for such in my own class type? hm, maybe in the methods? 19:49
TWEAK? 19:51
19:52 jjido joined 20:02 Aedil left 20:11 yewscion left 20:12 wbooze left
Voldenet practical example would be undefined value handling 20:20
erm, unassigned value
m: class F {}; my F $f; my F $f2 .= new; multi sub f(F:U) { "F:U" }; multi sub f(F:D) { "F:D" }; say (f($f), f($f2));
camelia (F:U F:D)
Voldenet sdomi: Cro, Bailador, Humming-Bird 20:31
sdomi Voldenet: thank you! 20:33
rir [tbrowder] I believe the only special aspect of CORE classes is that they automatically exist. 20:38
20:42 Xliff left
librasteve sdomi: there have been some requests for a Cro middleware module that does HTTP(S) cacheing - just mentioning in case you want to make something that we will grab and use ;-) 20:43
sdomi: btw Bailador is pretty much dead --- Hummingbird is less amibitious that Cro, kind of simple and fast basic option, Cro is more extensive and more capable - both have had relatively recent releases 20:45
sdomi i see! 20:46
no clue how much spoons I actually have for exploring Raku, tried it a year ago, got really excited, but my energy ran out after a few days of fiddling 20:47
(learning absolutely new systems is hard, wouldn't you know...)
20:48 yewscion joined
librasteve yeah - picking up a language and a web framework is a lot to do together ... 20:51
you may want to check out github.com/librasteve/raku-HTMX-Examples - the main branch has all the HTMX examples done with regular Cro templates and the fragments branch has examples rewritten using the new Cro template fragments feature 20:52
20:52 wbooze joined
sdomi neat, this will be helpful :) thank you 20:54
20:55 toridayo joined, toridayo left
librasteve HTMX is very cool for non JS web scaffolds like Cro since it enables a dynamic UX with all the code on the server side 20:55
sdomi yup, i've heard of it before, haven't had a chance to use it yet (but it sounds really cool) 20:56
generally most of my recent web projects are entirely void of JS, just forms and a lot of clever CSS
21:43 wbooze left 21:53 yewscion left 21:54 jjido left 22:03 sena_kun joined 22:48 yewscion joined 22:53 yewscion left 23:01 lizmat left, [Coke]_ joined 23:03 gordonfish left 23:04 gordonfish joined, [Coke] left 23:06 human_blip joined
librasteve hi o/ ... I have a class MyPage {...} and a sub sub mypage(*@a, *%h) { MyPage.new( |@a, |%h ) }; that lets me use the class in a functional context - I would like to generalize this as a class trait, lets say is subbed ... please can someone point me to an example / docs or how to do that with the MOP?? 23:07
23:07 human-blip left
(must sleep - will check back in 8 hours !) 23:07
23:17 thaewrapt left 23:42 Sgeo joined 23:47 wbooze joined 23:54 wbooze left 23:58 thaewrapt joined, thaewrapt left, thaewrapt joined