🦋 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.
wayland76 Hi! I'm asking for a backtrace, and it's correct, except all the filenames are the originally-called filename. Has anyone seen anything like that before? 00:15
It's inside a docker container 00:21
antononcube Sorry, can't help... 01:06
wayland76 No worries -- just wanted to see if it was a known thing. 01:16
wayland76 Hi all! I'm trying to have a variable that can be one or more named flags. My first instinct was to set up a role BitMaskEnumeration (as per the docs), and then, with "enum InitActions does BitmaskEnumeration { InitNone => 0b000, InitCreate => 0b001, InitAlter => 0b010 }" I tried making a variable of type InitActions. Should this allow me to set "create" and "alter" independently, or do I need to use junctions or something for that? 01:33
ie. what's the best way to do a flag variable that can be a combination of named flags, but the flags have to be predeclared -- not just making them up like Assoc keys 01:34
The Bitmask enum seems to work alright when I want to compare values, but when I want to set the Alter value independently of the other values that might already be in the flag variable, I'm not getting anything useful. 01:37
wayland76 Oh, or should I be using a Set? 02:02
No, sets aren't right either. 02:08
avuserow_ wayland76: a class with a bunch of Bool attributes and then a to-bitmask method? 02:27
wayland76 avuserow_: Could end up being my least bad option. 03:09
wayland If I have a variable $x, how do I declare a new variable $y to have the same type as $x? 03:48
lizmat wayland: I don't know of any way in core to do that, but perhaps this: 09:00
m: sub same(::T $a) is raw { my T $ }; my Int $x; my $y := same($x); dd $y
camelia Int $ = Int
lizmat m: sub same(::T $a) is raw { my T $ }; my Int $x; my $y := same($x); $y = 42; dd $y 09:01
camelia Int $ = 42
lizmat m: sub same(::T $a) is raw { my T $ }; my Int $x; my $y := same($x); $y = "foo"; dd $y
camelia Type check failed in assignment; expected Int but got Str ("foo")
in block <unit> at <tmp> line 1
librasteve nice! 09:17
lizmat you actually don't need to have a variable 09:33
m: sub same(::T $a) is raw { my T $ }; my $y := same(666); $y = 42; dd $y
camelia Int $ = 42
librasteve hi - I have a long standing test that goes my \ν = c / λ⏏; but in latest raku 2024.05, I get 15:32
Unrecognized regex metacharacter ; (must be quoted to match literally) at /Users/stephenroe/Library/CloudStorage/Dropbox/GitWorld/raku-Physics-Constants/t/01-tst.rakutest:16 ------> my \ν = c / λ⏏; Unable to parse regex; couldn't find final '/' at /Users/stephenroe/Library/CloudStorage/Dropbox/GitWorld/raku-Physics-Constants/t/01-tst.rakutest:16 ------> my \ν = c / λ;⏏
yes, I am importing c (speed of light) and λ (wavelength) into the namespace along with an overloaded divide '/' 15:33
anyway I'll make an issue 15:34
[Coke] latest is 2024.06, btw. 15:39
librasteve not for me (of you want to be pedantic) ;-) 15:44
(soz)
github.com/rakudo/rakudo/issues/5601 15:54
[Coke] I mention it on the off chance the bug was already fixed. 16:11
lizmat fwiw, I can't reproduce on 2024.06 16:13
[Coke] lizmat: looks like you installed "Physics::Unit", not "Physics::Constant" 16:27
?
lizmat Oops
[Coke] er, "Constants" 16:32
I was able to install Physics::Constants on 2024.06 on mac no issues 16:37
lizmat as well, and have updated the comment [Coke]++ 16:38
[Coke] The test failures happens only with the last two commits applied in your own repo. 16:50
installing the published v1.0.3 is fine, testing the v1.0.3 tag in your repo is fine. Noted on ticket, probably safe to close. 16:51
You should not be using use lib "../lib" in your tests. 16:54
Also: is the new infix / coming from Physics::Measure, which had a 2.0.0 release a week ago? 16:58
[Coke] (Shouldn't matter since reverting the commits in ::Constants avoids the test failure, but maybe there's an interaction there that wouldn't have been triggered with an older version of ::Measure 17:14
tested with 2024.04 on my mac - git HEAD on your repo still fails. 17:30
closed ticket
librasteve thanks for all the rapid help - I can confirm that 2024.06 works ok on my machine 17:41
ingy librasteve: ++ on the TPRC reply :) 19:20
librasteve yw 19:53
librasteve_ crag of the day … `crag '$v^=^([1,2,3],"m/s"); $m=4kg; $p^=$m*$v^; say "p^=$p^”’` 20:10
`p⃗=^(4, 8, 12)kg m/s` 20:11
librasteve ^^ adding vectors, vector notation and speed 20:12
vendethiel I like ^=^ 21:08