On Saturday, 12 December 2015 at 07:39:47 UTC, Suliman wrote:
if(a is null)
How to check if variable "is not null" ?
a !is null
or
!(a is null)
if(a is null)
How to check if variable "is not null" ?
In Javascript there is 'undefined', i can do something like:
var a;
if(a === undefined) { a = [1,2,3] }
How such check can be done in D ?
On Thursday, 26 December 2013 at 09:21:39 UTC, Dfr wrote:
In Javascript there is 'undefined', i can do something like:
var a;
if(a === undefined) { a = [1,2,3] }
How such check can be done in D ?
In D, all variables are initialised to the .init value for their
type when declared. If a is a
Thank you for reply.
Here is what i trying to achieve, i have module-wise data
structure, which should exist in form of array and associative
array, but i can't calculate second form on compile time:
const a = [[a,1],[b, 2], ... ];
const string[string] b = a.map!(...).assocArray;
This is
On Thursday, 26 December 2013 at 11:03:17 UTC, Dfr wrote:
Thank you for reply.
Here is what i trying to achieve, i have module-wise data
structure, which should exist in form of array and associative
array, but i can't calculate second form on compile time:
const a = [[a,1],[b, 2], ... ];
On Thursday, 26 December 2013 at 11:03:17 UTC, Dfr wrote:
Here is what i trying to achieve, i have module-wise data
structure, which should exist in form of array and associative
array, but i can't calculate second form on compile time:
const a = [[a,1],[b, 2], ... ];
const string[string] b =
On Thursday, 26 December 2013 at 11:03:17 UTC, Dfr wrote:
It is ok, but i don't want calculate 'b' every time 'come_func'
is called,
so i'd like to do something like this:
int some_func() {
if(b is null) {
b = a.map!(...).assocArray;
}
}
It might not be entirely appropriate