On Sat, 29 Oct 2011 17:42:54 -0400, Robert Jacques wrote:
>
> Variant var = 1;
> var.mark = true;
>
> if(var.mark) {
> // Do DB NULL stuff
> } else {
> // Do DB value stuff
> }
>
> But how is that different from this:
>
> Variant var = 1;
> var.nullify;
>
> if(var.isNull) {
> //
On Sat, 29 Oct 2011 16:23:11 -0400, Steve Teale
wrote:
On Fri, 28 Oct 2011 23:50:37 -0400, Robert Jacques wrote:
[snip]
I read through my answers again, and they seem to me to be perfectly
valid responses to your questions. It's just that you are insisting on
the use of terms like nullify a
On Fri, 28 Oct 2011 23:50:37 -0400, Robert Jacques wrote:
> On Fri, 28 Oct 2011 10:22:37 -0400, Steve Teale
> wrote:
>> On Fri, 28 Oct 2011 00:35:45 -0400, Robert Jacques wrote:
>
> [snip]
>
>>> Speaking as the one making over variant, let me see if I understand
>>> your use case. Similar to ty
On 29.10.2011 04:04, Steven Schveighoffer wrote:
I don't like Variant having this behavior when it's only of specific
use. Variant is not a database-only type.
Here's another idea:
struct DBNull(T) { }
Where T is the type for the column. i.e.:
row.column = DBNull!int;
Now, you have your f
On Fri, 28 Oct 2011 10:22:37 -0400, Steve Teale
wrote:
On Fri, 28 Oct 2011 00:35:45 -0400, Robert Jacques wrote:
[snip]
Speaking as the one making over variant, let me see if I understand your
use case. Similar to typecons.Nullable, you want to be able to test any
type for isNull and be to
On Friday, October 28, 2011 19:04 Steven Schveighoffer wrote:
> I don't like Variant having this behavior when it's only of specific use.
> Variant is not a database-only type.
Agreed. Unless such a change has a real use case beyond databases, I do not
think that it should be built into Variant.
On Thu, 27 Oct 2011 14:06:47 -0400, Steve Teale
wrote:
On Thu, 27 Oct 2011 13:58:54 -0400, Steven Schveighoffer wrote:
On Thu, 27 Oct 2011 13:53:02 -0400, Steve Teale
wrote:
On Thu, 27 Oct 2011 13:09:43 -0400, Steven Schveighoffer wrote:
On Thu, 27 Oct 2011 12:58:57 -0400, Steve Teale
On Fri, 28 Oct 2011 01:00:28 -0400, Kagamin wrote:
> SQL uses `NULL` for all types.
Yes, but if you set a particular column value to NULL, it does not wipe
away the column's meta-data.
> Did you try Algebraic - type-restricted version of Variant?
SQL implementations tend to use structure types
On Fri, 28 Oct 2011 00:35:45 -0400, Robert Jacques wrote:
> On Thu, 27 Oct 2011 14:06:47 -0400, Steve Teale
> wrote:
>> On Thu, 27 Oct 2011 13:58:54 -0400, Steven Schveighoffer wrote:
>>> On Thu, 27 Oct 2011 13:53:02 -0400, Steve Teale
>>> wrote:
On Thu, 27 Oct 2011 13:09:43 -0400, Steven S
On Fri, 28 Oct 2011 10:23:03 +0100, Regan Heath
wrote:
On Thu, 27 Oct 2011 19:06:47 +0100, Steve Teale
wrote:
On Thu, 27 Oct 2011 13:58:54 -0400, Steven Schveighoffer wrote:
Why wouldn't you just wrap variant if you want to introduce a nullable
variant type? Why does Variant have to be m
On Thu, 27 Oct 2011 19:06:47 +0100, Steve Teale
wrote:
On Thu, 27 Oct 2011 13:58:54 -0400, Steven Schveighoffer wrote:
Why wouldn't you just wrap variant if you want to introduce a nullable
variant type? Why does Variant have to be muddied with requirements for
database API? Database null is
Steve Teale Wrote:
> > Any reason making a custom NULL type wouldn't work? i.e:
> >
> > struct NULL {}
> >
> > Variant var = NULL;
> >
> > assert(var.type == typeof(NULL));
>
> I don't think that is any improvement on hasValue(). It would tell you
> the particular value was null, but would no
On Thu, 27 Oct 2011 14:06:47 -0400, Steve Teale
wrote:
On Thu, 27 Oct 2011 13:58:54 -0400, Steven Schveighoffer wrote:
On Thu, 27 Oct 2011 13:53:02 -0400, Steve Teale
wrote:
On Thu, 27 Oct 2011 13:09:43 -0400, Steven Schveighoffer wrote:
On Thu, 27 Oct 2011 12:58:57 -0400, Steve Teale
wrot
On Thu, 27 Oct 2011 18:35:19 +, kennytm wrote:
> Just store a std.typecons.Nullable!T in the Variant.
Mmm - works to some extent, but by the time you'd wrapped it to make the
semantics half comprehensible I think it would have been better to simply
wrap VariantN to add an extra bool.
Steve
Steve Teale wrote:
> How big a deal would it be to add a NULL indicator to the VariantN struct.
>
> I use the term NULL as opposed to null deliberately. Variant already
> provides the hasValue() method, which can serve as a null indicator. But
> in using it as a parameter in database modules, i
On Thu, 27 Oct 2011 13:58:54 -0400, Steven Schveighoffer wrote:
> On Thu, 27 Oct 2011 13:53:02 -0400, Steve Teale
> wrote:
>
>> On Thu, 27 Oct 2011 13:09:43 -0400, Steven Schveighoffer wrote:
>>
>>> On Thu, 27 Oct 2011 12:58:57 -0400, Steve Teale
>>> wrote:
>>>
On Thu, 27 Oct 2011 16:16:26
On Thu, 27 Oct 2011 13:53:02 -0400, Steve Teale
wrote:
On Thu, 27 Oct 2011 13:09:43 -0400, Steven Schveighoffer wrote:
On Thu, 27 Oct 2011 12:58:57 -0400, Steve Teale
wrote:
On Thu, 27 Oct 2011 16:16:26 +0200, Alex Rønne Petersen wrote:
On 27-10-2011 15:50, Steve Teale wrote:
Surely
On Thu, 27 Oct 2011 13:09:43 -0400, Steven Schveighoffer wrote:
> On Thu, 27 Oct 2011 12:58:57 -0400, Steve Teale
> wrote:
>
>> On Thu, 27 Oct 2011 16:16:26 +0200, Alex Rønne Petersen wrote:
>>
>>> On 27-10-2011 15:50, Steve Teale wrote:
>
> Surely Variant.init should do the trick?
On Thu, 27 Oct 2011 12:58:57 -0400, Steve Teale
wrote:
On Thu, 27 Oct 2011 16:16:26 +0200, Alex Rønne Petersen wrote:
On 27-10-2011 15:50, Steve Teale wrote:
Surely Variant.init should do the trick?
Dmitry,
Are you talking about the new std.variant - I don't see 'init'
currently.
Stev
On Thu, 27 Oct 2011 16:16:26 +0200, Alex Rønne Petersen wrote:
> On 27-10-2011 15:50, Steve Teale wrote:
>>>
>>> Surely Variant.init should do the trick?
>>
>> Dmitry,
>>
>> Are you talking about the new std.variant - I don't see 'init'
>> currently.
>>
>> Steve
>
> He is probably referring to th
> Any reason making a custom NULL type wouldn't work? i.e:
>
> struct NULL {}
>
> Variant var = NULL;
>
> assert(var.type == typeof(NULL));
I don't think that is any improvement on hasValue(). It would tell you
the particular value was null, but would not tell you what type it was.
In a typic
On Thu, 27 Oct 2011 10:16:26 -0400, Alex Rønne Petersen
wrote:
On 27-10-2011 15:50, Steve Teale wrote:
Surely Variant.init should do the trick?
Dmitry,
Are you talking about the new std.variant - I don't see 'init' currently.
Steve
He is probably referring to the 'init' property on the
On Thu, 27 Oct 2011 09:12:26 -0400, Steve Teale
wrote:
How big a deal would it be to add a NULL indicator to the VariantN struct.
I use the term NULL as opposed to null deliberately. Variant already
provides the hasValue() method, which can serve as a null indicator. But
in using it as a para
On 27-10-2011 15:54, Steve Teale wrote:
I'm not sure having three possible states in Variant is a good idea, but
maybe I'm not quite following.
Doesn't it already carry type information when not set to a value?
- Alex
Don't believe so. If you haven't set any value, hasValue() will return
fal
On 27-10-2011 15:50, Steve Teale wrote:
Surely Variant.init should do the trick?
Dmitry,
Are you talking about the new std.variant - I don't see 'init' currently.
Steve
He is probably referring to the 'init' property on the *type*, i.e.
int.init and so on.
- Alex
>
> I'm not sure having three possible states in Variant is a good idea, but
> maybe I'm not quite following.
>
> Doesn't it already carry type information when not set to a value?
>
> - Alex
Don't believe so. If you haven't set any value, hasValue() will return
false, so it is kind of null, a
>
> Surely Variant.init should do the trick?
Dmitry,
Are you talking about the new std.variant - I don't see 'init' currently.
Steve
On 27-10-2011 15:12, Steve Teale wrote:
How big a deal would it be to add a NULL indicator to the VariantN struct.
I use the term NULL as opposed to null deliberately. Variant already
provides the hasValue() method, which can serve as a null indicator. But
in using it as a parameter in database
On 27.10.2011 17:12, Steve Teale wrote:
How big a deal would it be to add a NULL indicator to the VariantN struct.
I use the term NULL as opposed to null deliberately. Variant already
provides the hasValue() method, which can serve as a null indicator. But
in using it as a parameter in database
How big a deal would it be to add a NULL indicator to the VariantN struct.
I use the term NULL as opposed to null deliberately. Variant already
provides the hasValue() method, which can serve as a null indicator. But
in using it as a parameter in database modules, it would be useful to be
able
30 matches
Mail list logo