SmokeMachine | Logic::Ternary sent to Zef... :) | 00:04 | |
00:19
japhb left
00:20
ds7823 left
00:29
Aedil joined
00:35
japhb joined
00:37
MasterDuke joined
|
|||
m_zero | trand and then, course tror and trxor or if you prefer triand, trior, and trixor | 00:40 | |
(and for bonus, these are fun to say out loud! 😁 ) | 00:41 | ||
00:57
japhb left
|
|||
SmokeMachine | I released and3, or3, xor3, not3 and so3... | 00:59 | |
01:16
hulk left
01:17
kylese joined
|
|||
SmokeMachine | raku.land/zef:FCO/Logic::Ternary | 01:18 | |
01:23
japhb joined
01:36
japhb left
01:41
japhb joined
01:42
MasterDuke left
01:47
japhb left
02:12
japhb joined
02:15
kylese left
02:16
kylese joined
03:06
arkiuat left
03:09
arkiuat joined
03:13
arkiuat left
03:25
arkiuat joined
|
|||
Voldenet | SmokeMachine: I think and3 for regular `Bool:U, Bool::True, Bool::False` values would be more obvious | 03:32 | |
m: sub infix:<and3>($x, $y) { return False if $x eqv False; return False if $y eqv False; return Bool unless $x.defined; return Bool unless $y.defined; $x and $y }; my @v = (Bool, False, True); for (@v X @v) -> ($x, $y) { say ($x,$y,$x and3 $y).map(*.gist) } | 03:37 | ||
camelia | ((Bool) (Bool) (Bool)) ((Bool) False False) ((Bool) True (Bool)) (False (Bool) False) (False False False) (False True False) (True (Bool) (Bool)) (True False False) (True True True) |
||
Voldenet | I'm sure it can be more elegantly written maybe by even mapping Bool:U to Logic::Ternary::Unknown | 03:41 | |
current problem with Logic::Ternary is that it overrides Bool making it very non-obvious trap | 03:46 | ||
m: enum Ternary ( False => -1, Unknown => 0, True => +1 ); sub thing(Bool $x) { say $x }; thing(True) # uhhhh | 03:47 | ||
camelia | ===SORRY!=== Error while compiling <tmp> Calling thing(Ternary) will never work with declared signature (Bool $x) at <tmp>:1 ------> => +1 ); sub thing(Bool $x) { say $x }; <HERE>thing(True) # uhhhh |
||
Voldenet | also `Unknown` should become `Bool:U`, not False | 03:49 | |
after coercing | |||
but really coercing should be done for internal logic, because Bool is enough | 03:50 | ||
m: multi sub infix:<and3>(Bool $x, Bool $y) { given any($x, $y) { when * eqv False { False }; when not .defined { Bool }; default { $x and $y }} }; my @v = (Bool, False, True); for (@v X @v) -> ($x, $y) { say ($x,$y,$x and3 $y).map(*.gist) } | 04:03 | ||
camelia | ((Bool) (Bool) (Bool)) ((Bool) False False) ((Bool) True (Bool)) (False (Bool) False) (False False False) (False True False) (True (Bool) (Bool)) (True False False) (True True True) |
||
Voldenet | m: multi sub infix:<and3>(Bool $x, Bool $y) { any($x, $y) eqv False ?? False !! $x and $y }; my @v = (Bool, False, True); for (@v X @v) -> ($x, $y) { say ($x,$y,$x and3 $y).map(*.gist) } | 04:26 | |
camelia | ((Bool) (Bool) (Bool)) ((Bool) False False) ((Bool) True (Bool)) (False (Bool) False) (False False False) (False True False) (True (Bool) (Bool)) (True False False) (True True True) |
||
Voldenet | m: multi sub infix:<and3>(Bool $x, Bool $y) { any($x, $y) !eqv False && $x and $y }; my @v = (Bool, False, True); for (@v X @v) -> ($x, $y) { say ($x,$y,$x and3 $y).map(*.gist) } | 04:29 | |
camelia | ((Bool) (Bool) (Bool)) ((Bool) False False) ((Bool) True (Bool)) (False (Bool) False) (False False False) (False True False) (True (Bool) (Bool)) (True False False) (True True True) |
||
04:40
Aedil left
04:41
simcop2387 left
04:44
Aedil joined
04:51
simcop2387 joined
04:52
silug4 left
05:00
silug4 joined
05:20
halloy9957 joined
06:05
abraxxa joined
06:14
timo2 left
06:17
timo2 joined
06:31
halloy9957 left
|
|||
melezhik. | . | 06:36 | |
06:55
arkiuat left
06:59
arkiuat joined
07:04
arkiuat left
|
|||
SmokeMachine | Voldenet: Bool:U is already mapped to Unknown (github.com/FCO/Logic-Ternary/blob/...kumod#L59) | 07:11 | |
Voldenet: yes, you will need to use Bool::* if you need to use boolean values. But I don't see it as a problem... | 07:12 | ||
Voldenet | but raku is dynamic language, it's not java where you can count on types | 07:15 | |
m: enum X <True>; sub Y(Bool $x) { }; sub Z($x) { Y($x) }; Z(True) # consider this | 07:17 | ||
camelia | Type check failed in binding to parameter '$x'; expected Bool but got X (X::True) in sub Y at <tmp> line 1 in sub Z at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Voldenet | redefining those is a bit like redefining Int or Bool | 07:18 | |
m: enum X<Bool>; say Bool::True; # this is what I mean | |||
camelia | Could not find symbol '&True' in 'X' in block <unit> at <tmp> line 1 |
||
07:23
arkiuat joined
|
|||
Voldenet | Yes, you can still access it through CORE::Bool::True, but it's still messy code | 07:24 | |
so I'd still use Bool:U and actual Bool values, because they already exist | 07:25 | ||
07:28
arkiuat left,
Sgeo left
|
|||
SmokeMachine | Voldenet: about Unknown -> Bool:U, I plan to do that... I only forgot about it on 0.0.2... | 07:37 | |
Voldenet | it'd work, but I'd say that the module shouldn't export True/False by default either way | 07:40 | |
in fact, I think the following should be valid: `use Logic::Ternary;; sub foo(Logic::Ternary() $_) { .say }; foo(Bool); foo(Bool::True); foo(Bool::False);` | 07:45 | ||
so, `True` and `False` from Bool are being used, you can convert things to and from Logic::Ternary but it doesn't override True/False anyhow | 07:46 | ||
07:57
arkiuat joined
08:02
arkiuat left
08:20
lichtkind joined
08:30
arkiuat joined,
melezhik joined
|
|||
melezhik | Sparky ci has switched to Rakudo 2025.10 , if someone wants to test their modules against fresh Rakudo … | 08:30 | |
08:35
arkiuat left
08:59
derpydoo joined
09:04
arkiuat joined
09:08
arkiuat left
09:31
arkiuat joined
09:36
arkiuat left
|
|||
El_Che | . | 10:01 | |
10:05
arkiuat joined
10:07
apac joined
10:13
arkiuat left
10:32
arkiuat joined
10:35
apac left
10:37
arkiuat left
10:39
apac joined
10:49
swaggboi left
11:06
arkiuat joined
11:09
melezhik left
11:11
derpydoo left,
arkiuat left
11:25
apa_c joined,
apac left
11:33
arkiuat joined
11:34
apa_c left
11:40
arkiuat left
11:53
arkiuat joined
11:55
apa_c joined
12:27
apa_c left
12:35
apa_c joined
12:54
apa_c left
12:58
arkiuat left
13:11
arkiuat joined
13:15
arkiuat left
13:20
apa_c joined
13:25
apac joined
13:28
apa_c left
|
|||
librasteve | o/ | 13:34 | |
13:34
arkiuat joined
13:35
apac left
13:39
arkiuat left
13:57
arkiuat joined
14:10
tgt joined
14:47
tgt left
15:21
tgt joined
15:28
apac joined
|
|||
[Coke] | not really a zef question but: if I do zef look META6 in powershell, and then hit ^C for some reason... the shell gets VERY confused, and keeps asking me More? More? More? - if this were bash, I'd try 'stty sane', but it looks completely messed up - only option is to open another powershell, run zef look again. | 15:54 | |
(and after the ^C, I appear to back in the original powershell, not the zef look shell) | |||
ah, ^Z helps. | |||
... ah, no, it's just not asking me more any more, still borked. | 15:55 | ||
ugexe | exit so shell(%*ENV<SHELL> // %*ENV<ComSpec> // %*ENV<COMSPEC>, :cwd($dist-path)) ?? 0 !! 1; | 15:56 | |
that is what zef does for zef look | |||
16:00
tgt left
16:26
silug4 is now known as silug
16:28
tgt joined
|