[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestion about Collection


Le dim. 5 oct. 2025 à 19:05, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> a écrit :

> Le 05/10/2025 à 14:30, Fabien Bodard a écrit :
> > Hi Benoit,
> >
> > I think a standard way to disable the collection autoremoving for null
> > entry will be interesting.
> >
> > You have used an inherited class to do that in JSON... but finally why
> > not just add a function to the collection instance ?
> >
> > Dim c as Collection
> > c.AllowNull = true (Default = false for back compatibilty)
> >
> > --
> > Fabien Bodard
>
> I think that it is useless for actual programs. I mean making a
> difference between "no value" and Null.
>
> I follow that not just in Collection, but everywhere in Gambas. For
> example, there is no difference between "no string" and a zero-length
> string.
>
> I had to make the difference with JSON, because (alas), JSON (and
> Javascript) makes a difference between "no value" (undefined) and null
> value.
>
> I never found that distinction useful since the first time I wrote my
> first program when I was... I don't remember... A long time ago.
>
> In Gambas, I only allow "undefined" values with the 'IsMissing()'
> special function, for optional arguments.
>
> And new trending cult languages (like Rust) tend to forbid at runtime
> not only undefined, but null too, by detecting them at compilation time.
>
> Regards,
>
>
My fault, actually.
I started a reply to your email, and in the process, I noticed a design
error in my way of passing parameters via a collection.

I'm using a 'Value' input that can only be filled in, or null if it's
missing... so no worries.









> --
> Benoît Minisini.
>
>
>

-- 
Fabien Bodard

Follow-Ups:
Re: Suggestion about CollectionBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
Suggestion about CollectionFabien Bodard <gambas.fr@xxxxxxxxx>
Re: Suggestion about CollectionBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>