Sorry for interfering. I've gathered statements and expressions which look
like candidates for interface-based generalization. Interface and method
names are just placeholders. Generic interfaces for collections like slice
or map are different beasts. Will post thoughts on them later.
I person
email.com
wrote:
> On Thu, Aug 27, 2020 at 12:53 PM targe...@gmail.com
> wrote:
>
>> Because you then must remember about this specific case *every time *you
>> cast potentially nil pointer variable to interface. Every time you must
>> write `if x != nil { return x; }
nter to interface.
On Thursday, August 27, 2020 at 9:58:21 PM UTC+3 Ian Lance Taylor wrote:
> On Thu, Aug 27, 2020 at 3:53 AM targe...@gmail.com
> wrote:
> >
> > Please don't forget that interface pointer isn't simple. It's a
> so-called "fat pointer"
wrote:
> On Thursday, 27 August 2020 11:39:11 UTC+2, targe...@gmail.com wrote:
>>
>> To me, if `x == nil` and then `y != nil` after `y = x` is much more
>> confusing.
>>
>
> This can happen only if x and y have different types.
> And for different types
> I'm mostly form C++ land
from of course :)
On Thursday, August 27, 2020 at 2:01:33 PM UTC+3 targe...@gmail.com wrote:
> I know this. I'm mostly form C++ land, so you may imagine how many warts
> are there "on the top of the index finger" :)
> I'm
ang-nuts <
> golan...@googlegroups.com> wrote:
>
>
>
>
> On Thu, Aug 27, 2020 at 11:39 AM targe...@gmail.com
> wrote:
>
>> > I'm saying the current situation is less confusing than what you
>> describe, yes.
>> > AIUI, with what you describe, if I
nger's state. If we wanna static implementation, we
just create static variable which is `struct{}` and return pointer to it.
Alas, this approach is no-go because it involves breakage too deep.
On Thursday, August 27, 2020 at 1:14:17 PM UTC+3 axel.wa...@googlemail.com
wrote:
> On Thu, Aug
> On Thu, Aug 27, 2020 at 11:10 AM targe...@gmail.com
> wrote:
>
>> it would definitely. Though price for consistency looks very much
>> acceptable.
>
>
> I don't think "consistency" is at all the right word here. If anything,
> things would get *le
converting a T to a T
changed program behavior
Sorry, didn't get it. Are you saying that nil pointer -> nil interface is
more confusing?
On Thursday, August 27, 2020 at 11:49:16 AM UTC+3 axel.wa...@googlemail.com
wrote:
> On Thu, Aug 27, 2020 at 10:06 AM targe...@gmail.com
> w
Not sure if it was mentioned here, but IMO the main issues isn't nil data
itself, but how easy it's created. It'd be much less of a surprise if
creating nil-data required explicit cast from nil struct pointer to
interface pointer and resulted in just nil interface pointer in case of
implicit ca
10 matches
Mail list logo