This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
01:58 razetime joined 03:33 razetime left 04:31 razetime joined 05:47 siavash joined
librasteve f(2) == &f(2) == &f.(2) you can make any sub be a method and you can use the dot (“methodop”) before the parents it’s analogous to something like .= 07:35
or @a[2] == @a.[2] and %h<b> == %h.<b> 07:37
that way you can apply meta operators like the hyper >> 07:38
07:58 razetime left 08:08 razetime joined
nemokosch I think there is a postcircumfix .() operator which in term performs a function call 09:20
eventually the RakuAST parse will help analyze things like that; right now I'm more confident with raku --target=parse 09:21
this unfolds that (as of the non-RakuAST grammar), you get a dotty token which contains a single dottyop token which in turn contains a dot and a postop token 09:33
when the match is processed, it will be simply codegenned as the postop part
so I think it's safe to say that the whole business is for "disambiguation" 09:34
snonux anyone knows if there is a good LSP (language server) for Raku, which could be plugged into editors such as NeoVim, VSCode, Helix..? i did some googling, there seems to be something for VSCode, but not sure if that could be used for NeoVim. 12:02
12:18 razetime left
nemokosch I think bscan's LSP is still the best option 12:25
12:30 sivoais left
snonux i don't node/typescript so well, but i managed to get it running in Helix :-) thanks! 12:48
12:59 siavash left 13:01 sivoais joined
antononcube @nemokosch and @librasteve Thanks! 13:18
@librasteve I strongly consider using your units package(s) to demonstrate some functionalities of LLMs. As far as I can tell you have implemented a full algebra for units manipulation. Do you special objects for holding k-number of units? E.g. something like quantity(5.4, GetUnit(“m / s^2). 13:46
librasteve use Physics::Measure :ALL; my $acc = ♎️'5.4 m / s^2'; my $time = 8s; my $vel = $acc * $time; say $vel; dd $acc; dd $vel; 21:31
43.2m/s
^^ try that 21:32
Speed $vel = Physics::Measure::Speed.new(value => 43.2, units => Unit.new( factor => 1, offset => 0, defn => 'm/s', type => Speed, dims => [1,0,-1,0,0,0,0,0], dmix => ("m"=>1,"s"=>-1).MixHash, names => ['m/s'] ); , error => Error) 21:34
antononcube @librasteve Why "Physics::Measure" depends on "SVG::Plot" ? (Sorry, I am too lazy to look into the source code.) 21:37
21:39 habere-et-disper joined
librasteve raku-advent.blog/2021/12/18/day-18...ee-m-tree/ 21:40
antononcube I remember this -- while reading / scanning it I started thinking "how to imlement random mandlas plots in Raku?" 21:41
habere-et-disper Instead of : 21:43
multi foo ( 0 ) { 0 }
multi foo ( 1 ) { 1 }
Can I write two base cases together something like this :
m: multi foo ( 0 | 1 ) { $_ }
camelia ===SORRY!=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> multi foo ( 0 |⏏ 1 ) { $_ }
expecting any of:
constraint
librasteve m: subset ohone of Int where 0|1; multi bar(ohone $x) {7}; say bar 1; say bar 7; 21:49
Raku eval 7 Exit code: 1 Cannot resolve caller bar(7); none of these signatures matches: (Int $x where { ... }) in block <unit> at main.raku line 1
librasteve m: sub baz( $x where 0|1 ) {'ok'}; say baz 0; 21:51
Raku eval ok
habere-et-disper Subset -- ah great thanks @librasteve 22:54
😀