From 3d914c959f8fb57b7b4a1c30b0bea0a03c130138 Mon Sep 17 00:00:00 2001 From: matthias314 Date: Wed, 14 Aug 2024 16:43:29 -0400 Subject: [PATCH 1/2] remove redundant `print` method for `Splat` --- base/operators.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/operators.jl b/base/operators.jl index 2c8070b44d704..7adf193fa81db 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -1339,8 +1339,7 @@ struct Splat{F} <: Function Splat(f) = new{Core.Typeof(f)}(f) end (s::Splat)(args) = s.f(args...) -print(io::IO, s::Splat) = print(io, "splat(", s.f, ')') -show(io::IO, s::Splat) = print(io, s) +show(io::IO, s::Splat) = print(io, "splat(", s.f, ')') ## in and related operators From 2d9869ed76430a1b0c5ed84fd1b3c5ca5ad85c73 Mon Sep 17 00:00:00 2001 From: matthias314 <56549971+matthias314@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:29:42 -0400 Subject: [PATCH 2/2] use `show` for showing `splat` function instead of `print` Co-authored-by: Jameson Nash --- base/operators.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/operators.jl b/base/operators.jl index 7adf193fa81db..d01902e302359 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -1339,7 +1339,7 @@ struct Splat{F} <: Function Splat(f) = new{Core.Typeof(f)}(f) end (s::Splat)(args) = s.f(args...) -show(io::IO, s::Splat) = print(io, "splat(", s.f, ')') +show(io::IO, s::Splat) = (print(io, "splat("); show(io, s.f); print(io, ")")) ## in and related operators