[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggestion about Collection
[Thread Prev] | [Thread Next]
- Subject: Re: Suggestion about Collection
- From: Fabien Bodard <gambas.fr@xxxxxxxxx>
- Date: Sun, 5 Oct 2025 20:25:52 +0200
- To: user@xxxxxxxxxxxxxxxxxxxxxx
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
Re: Suggestion about Collection | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
Suggestion about Collection | Fabien Bodard <gambas.fr@xxxxxxxxx> |
Re: Suggestion about Collection | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |