From c77faa66c48f4a20c3661b31f023c99c3f3f202f Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Sun, 14 Oct 2018 07:58:57 +0200 Subject: [PATCH 1/2] Update docstring on @forward It took me a while to figure out how to forward several functions, where to put commas and where not to put them. This should hopefully make it clear. --- src/macros.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/macros.jl b/src/macros.jl index c940e1b..a5d1576 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -273,7 +273,8 @@ struct Wrapper x end -@forward Wrapper.x Base.sqrt # now sqrt(Wrapper(4.0)) == 2.0 +@forward Wrapper.x Base.sqrt # now sqrt(Wrapper(4.0)) == 2.0 +@forward Wrapper.x (Base.length, Base.getindex, Base.iterate) # several forwarded functions are put in a tuple ``` """ macro forward(ex, fs) From ad3b89b88df37275d3a059e6ffb3cf6fc5763f86 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Tue, 16 Oct 2018 11:15:55 +0200 Subject: [PATCH 2/2] Update macros.jl --- src/macros.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/macros.jl b/src/macros.jl index a5d1576..7e022c1 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -273,8 +273,9 @@ struct Wrapper x end -@forward Wrapper.x Base.sqrt # now sqrt(Wrapper(4.0)) == 2.0 -@forward Wrapper.x (Base.length, Base.getindex, Base.iterate) # several forwarded functions are put in a tuple +@forward Wrapper.x Base.sqrt # now sqrt(Wrapper(4.0)) == 2.0 +@forward Wrapper.x Base.length, Base.getindex, Base.iterate # several forwarded functions are put in a tuple +@forward Wrapper.x (Base.length, Base.getindex, Base.iterate) # equivalent to above ``` """ macro forward(ex, fs)