Skip to content

Commit

Permalink
fix ! on ⩓/⩔ functions
Browse files Browse the repository at this point in the history
  • Loading branch information
aplavin committed Dec 18, 2024
1 parent 5fac3e5 commit 9bea824
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AccessorsExtra"
uuid = "33016aad-b69d-45be-9359-82a41f556fd4"
authors = ["Alexander Plavin <[email protected]>"]
version = "0.1.83"
version = "0.1.84"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand Down
3 changes: 3 additions & 0 deletions src/and_or.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ struct ⩔{F,G}
end
(c::)(x) = c.f(x) || c.g(x)

Base.:(!)(f::) = (!f.f, !f.g)
Base.:(!)(f::) = (!f.f, !f.g)

Base.show(io::IO, f::) = print(io, f.f, "", f.g)
Base.show(io::IO, f::) = print(io, f.f, "", f.g)
6 changes: 3 additions & 3 deletions test/moresyntax.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@testitem "and/or/..." begin
@test (<(5) >(1) >(2))(3)
@test !(<(5) >(1) >(2))(2)
@test (!(<(5) >(1) >(2)))(2)
@test (<(5) >(1) >(2))(2)
@test (<(5) >(1) >(2))(6)
@test !(<(5) >(1) >(2))(0)
@test !(<(5) (x->throw("")))(6)
@test (!(<(5) >(1) >(2)))(0)
@test (!(<(5) (x->throw(""))))(6)
@test (<(5) (x->throw("")))(4)

f = x->x+1
Expand Down

0 comments on commit 9bea824

Please sign in to comment.