Local Extension Method #850
Replies: 9 comments
-
Please could you fix your markdown formatting, as it makes your code hard to
Aside from that, this seems like a sensible suggestion. |
Beta Was this translation helpful? Give feedback.
-
Previous discussion: #799. |
Beta Was this translation helpful? Give feedback.
-
@DavidArno hard to read, maybe? |
Beta Was this translation helpful? Give feedback.
-
Yep, that too! 😀 |
Beta Was this translation helpful? Give feedback.
-
Tagging @agocke |
Beta Was this translation helpful? Give feedback.
-
(Copying the relevant discussion from #1565) @jaredpar commented on the discussion for local functions:
|
Beta Was this translation helpful? Give feedback.
-
Today I've been in a situation where local extension methods would be useful. This is the code I've written without local extension methods:
I think the flow from
but the logic of |
Beta Was this translation helpful? Give feedback.
-
Is it possible to extend any instance method to a static one that takes a "this" reference as a first argument. So instead of 10.ToString() I could write int.ToString(10) And vice versa. I think you can argue with an example of dual static-instance method that probably will break with this change so your answer will be "no" but I already typed all this so probably I'll leave this comment here. |
Beta Was this translation helpful? Give feedback.
-
@Pzixel That is not how extension methods work. Your proposal is different from this suggestion. |
Beta Was this translation helpful? Give feedback.
-
Since we have local function.
why shouldn't we take the "Local Extension Method"?
it like where we use |> in F#:
Beta Was this translation helpful? Give feedback.
All reactions