Hi Bram,
2016/02/08 3:22 "Bram Moolenaar" <Br...@moolenaar.net>:
>
>
> Takuya Fujiwara wrote:
>
> [...]
>
> > >> let json = jsonencode({"key": v:none})
> > >> if json is v:none
> > >> echoerr 'error!'
> > >> return ...
> > >> endif
> > >
> > > Well, let's just return an empty string. Returning a different type
> > > often makes it more complicated.
> >
> > I agree.
> > However, I think "E706: Variable type mismatch" should be removed
> > becase it is not so useful for me...
>
> Where do you get that? Or do you mean that the sticky type checking
> isn't all that useful in general? I've been wondering whether we would
> be better off without it.
I don't think it is useful in lightweight languages
(I don't think *only* a strict type checking is useful).
A strict type checking is useful for a language which has a strong type system.
Because we can detect errors by different types, and so on.
2016/02/08 10:53 "tyru" <tyru...@gmail.com>:
>
> Hi Bram,
>
> 2016/02/08 3:22 "Bram Moolenaar" <Br...@moolenaar.net>:
>
> >
> >
> > Takuya Fujiwara wrote:
> >
> > [...]
> >
> > > >> let json = jsonencode({"key": v:none})
> > > >> if json is v:none
> > > >> echoerr 'error!'
> > > >> return ...
> > > >> endif
> > > >
> > > > Well, let's just return an empty string. Returning a different type
> > > > often makes it more complicated.
> > >
> > > I agree.
> > > However, I think "E706: Variable type mismatch" should be removed
> > > becase it is not so useful for me...
> >
> > Where do you get that? Or do you mean that the sticky type checking
> > isn't all that useful in general? I've been wondering whether we would
> > be better off without it.
>
> I don't think it is useful in lightweight languages
> (I don't think *only* a strict type checking is useful).
> A strict type checking is useful for a language which has a strong type system.
> Because we can detect errors by different types, and so on.
Ah, sorry.
I mean, we can detect errors by different types, and so on *at compile-time*.