Could someone lay out for me the different ways of doing constants in D (d1,
particularly)? I've heard things about const, final, invariant, and "anonymous
enums"?
In a not-ranged cases body, like in the program below (that doesn't compile),
the switch variable is a compile-time constant, so why doesn't the compile see
x as constant there?
template Foo(uint x) {
static if (x <= 1)
enum Foo = 1;
else
enum Foo = x * Foo!(x - 1);
}
i
On Wed, Feb 11, 2009 at 4:09 PM, Mike L. wrote:
> Could someone lay out for me the different ways of doing constants in D (d1,
> particularly)? I've heard things about const, final, invariant, and
> "anonymous enums"?
>
OK, D1 doesn't have constness in the wa
PM, Mike L. wrote:
> > Could someone lay out for me the different ways of doing constants in D
> > (d1, particularly)? I've heard things about const, final, invariant, and
> > "anonymous enums"?
> >
>
> OK, D1 doesn't have constness in the way t
Thanks, glad to have it all in one place.
In a C program I have a numeric constant SIZE (that is in [1,32]), that I can
define when I compile the code, like this:
gcc -DSIZE=14 ...
How can I do the same thing in D? The solution I have found is to put in the D
code:
version(B1) const SIZE = 1;
version(B2) const SIZE = 2;
version(B3) cons
On 14.11.2010 1:21, bearophile wrote:
In a not-ranged cases body, like in the program below (that doesn't compile),
the switch variable is a compile-time constant, so why doesn't the compile see
x as constant there?
Well, there is fall-through ;) And there still could be goto's.
In essence "c
"bearophile" wrote in message
news:ibn320$2uc...@digitalmars.com...
> In a not-ranged cases body, like in the program below (that doesn't
> compile), the switch variable is a compile-time constant, so why doesn't
> the compile see x as constant there?
In switch statements, you can do stuff lik
bearophile wrote:
In a not-ranged cases body, like in the program below (that doesn't compile),
the switch variable is a compile-time constant, so why doesn't the compile see
x as constant there?
template Foo(uint x) {
static if (x <= 1)
enum Foo = 1;
else
enum Foo = x
Daniel Murphy:
> switch(x)
> {
> case 0:
>break; // what is x here?
> case 1:
>goto case 0:
> }
> etc
You are right. Thank you for all the answers.
Bye,
bearophile
Hello bearophile,
In a not-ranged cases body, like in the program below (that doesn't
compile), the switch variable is a compile-time constant, so why
doesn't the compile see x as constant there?
template Foo(uint x) {
static if (x <= 1)
enum Foo = 1;
else
enum Foo = x * Foo!(x - 1);
}
int bar(
I'm trying to define an array of constant like:
===
immutable string[int] MyDict = [
1: "monday",
2: "tuesday",
];
And I keep having compiler error:
Error1Error: non-constant expression [1:"monday",2:"tuesday"]
C:\Dev\DTest\DTest1\Dexperiment\LCIDs.d9
what can I do?
On Wed, 11 Nov 2009 08:50:48 -0500, bearophile
wrote:
In a C program I have a numeric constant SIZE (that is in [1,32]), that
I can define when I compile the code, like this:
gcc -DSIZE=14 ...
How can I do the same thing in D? The solution I have found is to put in
the D code:
version(B
On Wed, 11 Nov 2009 13:34:32 -0500, Phil Deets wrote:
On Wed, 11 Nov 2009 13:30:17 -0500, Phil Deets
wrote:
On Wed, 11 Nov 2009 08:50:48 -0500, bearophile
wrote:
In a C program I have a numeric constant SIZE (that is in [1,32]),
that I can define when I compile the code, like this:
On Wed, 11 Nov 2009 13:30:17 -0500, Phil Deets wrote:
On Wed, 11 Nov 2009 08:50:48 -0500, bearophile
wrote:
In a C program I have a numeric constant SIZE (that is in [1,32]), that
I can define when I compile the code, like this:
gcc -DSIZE=14 ...
How can I do the same thing in D? The so
Phil Deets wrote:
On Wed, 11 Nov 2009 13:34:32 -0500, Phil Deets wrote:
On Wed, 11 Nov 2009 13:30:17 -0500, Phil Deets
wrote:
On Wed, 11 Nov 2009 08:50:48 -0500, bearophile
wrote:
In a C program I have a numeric constant SIZE (that is in [1,32]),
that I can define when I compile the co
On Wed, 11 Nov 2009 13:45:17 -0500, grauzone wrote:
You can delete your posts to emulate editing...
I didn't know it was possible to delete posts from a newsgroup. How do you
do that?
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Phil Deets wrote:
On Wed, 11 Nov 2009 13:45:17 -0500, grauzone wrote:
You can delete your posts to emulate editing...
I didn't know it was possible to delete posts from a newsgroup. How do
you do that?
I don't know about any other readers, but using Thunderbird just right-click the messa
On Thu, 12 Nov 2009 07:17:57 -0500, Chris Nicholson-Sauls
wrote:
Phil Deets wrote:
On Wed, 11 Nov 2009 13:45:17 -0500, grauzone wrote:
You can delete your posts to emulate editing...
I didn't know it was possible to delete posts from a newsgroup. How do
you do that?
I don't know abo
that GUID constants are declared as enums in the
winapi bindings (see src\druntime\import\core\sys\windows\uuid.d).
Within the dclient.d sample which comes with dmd they are explicitely
defined as GUIDs:
GUID IID_IHello = { 0x00421140, 0, 0, [0xC0, 0, 0, 0, 0, 0, 0, 0x46] };
So maybe they should
I was using a trick with dmd to check for manifest constants
which worked until dmd v2.094. Yesterday I tried it on the latest
compiler and it failed with:
source/introspection/manifestConstant.d(37,28): Error: need this
for name of type string
source/introspection/type.d(156,13): Error
Hello guys!
@("att") int t = 1;
auto b = [ __traits(getAttributes, t) ];
Works.
@("att") enum int t = 1;
auto b = [ __traits(getAttributes, t) ];
Works also.
@("att") const int t = 1;
auto b = [ __traits(getAttributes, t) ];
Doesn't work.
Error: first argument is not a symbol
Why?
Also a li
\r and \n is used many times throughout std.string (and probably other
modules like file).
I assume defining constants were considered:
const CR = '\r';
const LF = '\n';
So why isn't constants used instead?
You need to set it in a static constructor
immutable string[int] MyDict;
static this ()
{
MyDict = cast(string[int]) [
1: "monday",
2: "tuesday"
];
}
thanks!
"Etherous" wrote in message news:is8dbh$n22$1...@digitalmars.com...
You need to set it in a static constructor
immutable string[int] MyDict;
static this ()
{
MyDict = cast(string[int]) [
1: "monday",
2: "tuesday"
];
}
How do I ddoc an enum constant? Putting ddoc comments above
functions and structs woorks fine but ddocing an enum constant
doesn't generate any documentation.
Hi!
I am wondering if there is any way to define constants to pass to
the compiler like in C (especially useful in combination with
Makefiles, for obvious reasons), i.e.:
gcc -DPREFIX=\"/usr/local\" -o myprogram main.c
Like this a program can look for certain files inside
On 03/09/2016 10:35 AM, KlausO wrote:
> IUnknown pUnk;
>
> //
> // Does not compile:
> //
> // Error: function
> core.sys.windows.unknwn.IUnknown.QueryInterface(const(GUID)* riid,
> void** pvObject) is not callable using argument types (const(GUID),
Ok, but what's the intention behind defining GUIDs as enums in the first
place ?
Why not defining them as const(GUID) and let the linker sort them out ?
Is there a recommended way to declare/define constants (e.g. as enums or
consts) ?
In C (separate compilation) they are declar
clare/define constants (e.g. as
enums or consts) ?
Generally, you should use a manifest constant, e.g.
enum myConst = 10;
Unless you need to take the address, then you should use
immutable:
immutable myConst = 10;
The value of a manifest constant is substituted for the symbol at
the point of us
ended way to declare/define constants (e.g. as enums
or consts) ?
Generally, you should use a manifest constant, e.g.
enum myConst = 10;
Unless you need to take the address, then you should use immutable:
immutable myConst = 10;
The value of a manifest constant is substituted for the symbol a
On Thursday, 10 March 2016 at 14:52:16 UTC, KlausO wrote:
For GUIDs you often have to take the address (e.g. for calls to
QueryInterface), so I think phobos does not correctly implement
this.
Yes, that was my meaning.
Is the above pair (const GUID and static member) the right way
to declare
On Thursday, 10 March 2016 at 15:48:14 UTC, Mike Parker wrote:
Personally I would just declare one immutable value in module
scope and be done with it. It really just doesn't matter.
Unless you're following some sort of style guide, personal
preference rules the day. I don't know if Rainers has
On Wednesday, 9 March 2016 at 18:35:31 UTC, KlausO wrote:
So maybe they should be declared as "extern GUID ..." because
they also seem to be defined in windows\lib\uuid.lib which
comes with DMD.
Declarations come from mingw and mingw doesn't have uuid.lib:
https://issues.dlang.org/show_bug.cg
Oh, it was
https://github.com/D-Programming-Language/druntime/pull/1472
On Friday, 5 March 2021 at 08:23:09 UTC, Bogdan wrote:
I was using a trick with dmd to check for manifest constants
which worked until dmd v2.094. Yesterday I tried it on the
latest compiler and it failed with:
source/introspection/manifestConstant.d(37,28): Error: need
this for name of
On Friday, 5 March 2021 at 08:23:09 UTC, Bogdan wrote:
I was using a trick with dmd to check for manifest constants
which worked until dmd v2.094. Yesterday I tried it on the
latest compiler and it failed with:
source/introspection/manifestConstant.d(37,28): Error: need
this for name of
On Friday, 5 March 2021 at 14:42:07 UTC, Petar Kirov [ZombineDev]
wrote:
On Friday, 5 March 2021 at 08:23:09 UTC, Bogdan wrote:
[...]
I suggest this:
enum globalConfig = 32;
int globalValue = 22;
immutable globaImmutablelValue = 22;
enum isManifestConstant(alias symbol) =
http://forum.dlang.org/thread/htuakrtvoyymappje...@forum.dlang.org
Oh, i see, thanks.
P.S. туй васю нигодяй.
On Monday, August 09, 2010 17:24:47 simendsjo wrote:
> \r and \n is used many times throughout std.string (and probably other
> modules like file).
> I assume defining constants were considered:
> const CR = '\r';
> const LF = '\n';
>
> So why isn't
On 10.08.2010 02:46, Jonathan M Davis wrote:
On Monday, August 09, 2010 17:24:47 simendsjo wrote:
\r and \n is used many times throughout std.string (and probably other
modules like file).
I assume defining constants were considered:
const CR = '\r';
const LF = '\n';
So
quot;. It's just going to replace CR with
"\r"
everywhere anyway. You can only do so much to save the programmer from their
own
stupidity and carelessness. Using constants as an attempt to reduce typos is
not
a good move IMHO. The language itself does try and reduce the opportuni
t's just going to replace CR with "\r"
everywhere anyway. You can only do so much to save the programmer from their own
stupidity and carelessness. Using constants as an attempt to reduce typos is not
a good move IMHO. The language itself does try and reduce the opportunity for
stupid
On Monday, August 09, 2010 18:21:21 simendsjo wrote:
> Yeah, I know. I'm really just pointing out very small things here as I
> try to learn the language and library. Still.. I do think that static
> checking is a very good way of eliminating many common bugs. This might
> have been a bad example.
simendsjo:
> Why a runtime error when you can have a compile time error?
Because using the static type system has various kinds of costs that some
people in some situations are not willing to pay.
Bye,
bearophile
On 7/07/2015 1:05 p.m., Vlad Levenfeld wrote:
How do I ddoc an enum constant? Putting ddoc comments above functions
and structs woorks fine but ddocing an enum constant doesn't generate
any documentation.
If:
///
enum MyValue = 8.2f;
does not generate documentation upon its creation, please f
On Tuesday, 7 July 2015 at 03:30:40 UTC, Rikki Cattermole wrote:
On 7/07/2015 1:05 p.m., Vlad Levenfeld wrote:
How do I ddoc an enum constant? Putting ddoc comments above
functions
and structs woorks fine but ddocing an enum constant doesn't
generate
any documentation.
If:
///
enum MyValue
On 18/09/15 3:32 AM, Tim K. wrote:
Hi!
I am wondering if there is any way to define constants to pass to the
compiler like in C (especially useful in combination with Makefiles, for
obvious reasons), i.e.:
gcc -DPREFIX=\"/usr/local\" -o myprogram main.c
Like this a program ca
On Thursday, 17 September 2015 at 15:32:25 UTC, Tim K. wrote:
I am wondering if there is any way to define constants to pass
to the compiler like in C (especially useful in combination
with Makefiles, for obvious reasons), i.e.:
My preference is to make an app.config module that lists these
";
}
/// next (manifest-constant):
public immutable enum gstrWhatever = "...";
```
Are manifest-constants the proper way to go ?
In [http://ddili.org/ders/d.en/enum.html] Ali says:
"We have discussed that it is important to avoid magic constants
and instead to take advantage
I want to embed some info from build system - version info, for
example. I can easily do this with C++ compiler by
`-DVERSION="1.2.3"` but there is no such an option in dmd. So I'm
wondering how do people workaround this?
I see only one way: generate a file and add it to the build (file
might b
How can a class provide it's users with named constants, enums,
types, structs and not just member functions?
hat is the reason for the difference
between unittest constants and module constants?
Thanks,
Dan
Greetings
I tried to initialize a struct member with a function pointer, and
found that DMD2 did not like it. Are not function pointers compile
time constants? And why they should not be?
Regards
- Cherry
On Thu, Aug 05, 2021 at 12:47:06AM +, someone via Digitalmars-d-learn wrote:
> What are the pros/cons of the following approaches ?
1) If the constant is a POD (int, float, etc.), use:
enum myValue = ...;
2) If the constant is a string or some other array:
static immutable s
On Thursday, 5 August 2021 at 01:14:26 UTC, H. S. Teoh wrote:
1) If the constant is a POD (int, float, etc.), use:
enum myValue = ...;
crystal-clear.
2) If the constant is a string or some other array:
static immutable string myString = "...";
crystal-clear.
2) If the co
On 8/4/21 9:14 PM, H. S. Teoh wrote:
Unless you have a specific reason to, avoid using `enum` with string and
array literals, because they will trigger a memory allocation *at every
single reference to them*, which is probably not what you want.
Just want to chime in and say this is NOT true fo
On Thursday, 5 August 2021 at 02:06:13 UTC, Steven Schveighoffer
wrote:
On 8/4/21 9:14 PM, H. S. Teoh wrote:
Unless you have a specific reason to, avoid using `enum` with
string and
array literals, because they will trigger a memory allocation
*at every
single reference to them*, which is prob
On 8/4/21 10:27 PM, someone wrote:
On Thursday, 5 August 2021 at 02:06:13 UTC, Steven Schveighoffer wrote:
On 8/4/21 9:14 PM, H. S. Teoh wrote:
Unless you have a specific reason to, avoid using `enum` with string and
array literals, because they will trigger a memory allocation *at every
single
On Thu, Aug 05, 2021 at 01:39:42AM +, someone via Digitalmars-d-learn wrote:
[...]
> What happens in the following case ?
>
> public immutable enum gudtLocations = [
>r"BUE"d : structureLocation(r"arg"d, r"Buenos Aires"d, r"ART"d),
>r"GRU"d : structureLocation(r"bra"d, r"São Paulo"d, r
On Thursday, 5 August 2021 at 02:43:09 UTC, Steven Schveighoffer
wrote:
The main difference between enums and static immutable is that
the latter has an address at runtime.
This. Gotcha.
So the answer is, depends on what you are going to do with the
data. There are use cases for both. If you
On Thursday, 5 August 2021 at 03:20:17 UTC, H. S. Teoh wrote:
On Thu, Aug 05, 2021 at 01:39:42AM +, someone via
Digitalmars-d-learn wrote: [...]
What happens in the following case ?
public immutable enum gudtLocations = [
r"BUE"d : structureLocation(r"arg"d, r"Buenos Aires"d,
r"ART"d),
On 8/4/21 11:20 PM, H. S. Teoh wrote:
On Thu, Aug 05, 2021 at 01:39:42AM +, someone via Digitalmars-d-learn wrote:
[...]
What happens in the following case ?
public immutable enum gudtLocations = [
r"BUE"d : structureLocation(r"arg"d, r"Buenos Aires"d, r"ART"d),
r"GRU"d : structureL
On Thursday, 5 August 2021 at 10:28:00 UTC, Steven Schveighoffer
wrote:
H.S. Teoh, I know you know better than this ;) None of this is
necessary, you just need `rtValue` for both runtime and CTFE
(and compile time parameters)!
Now, the original question is about *associative arrays*, which
On Thu, Aug 05, 2021 at 03:09:13PM +, someone via Digitalmars-d-learn wrote:
> On Thursday, 5 August 2021 at 10:28:00 UTC, Steven Schveighoffer wrote:
>
> > H.S. Teoh, I know you know better than this ;) None of this is
> > necessary, you just need `rtValue` for both runtime and CTFE (and
> >
On Thursday, 5 August 2021 at 15:26:33 UTC, H. S. Teoh wrote:
On Thu, Aug 05, 2021 at 03:09:13PM +, someone via
Digitalmars-d-learn wrote:
On Thursday, 5 August 2021 at 10:28:00 UTC, Steven
Schveighoffer wrote:
> H.S. Teoh, I know you know better than this ;) None of this
> is necessary,
On Thursday, 5 August 2021 at 16:06:58 UTC, someone wrote:
So if we are talking AA-arrays at compile-time only there
should be nothing wrong with the following code ... right ?
...
private enum pudtLocations = [
r"BUE"d : structureLocation(r"arg"d, r"Buenos Aires"d,
r"ART"d),
r"GRU"d :
On Thursday, 5 August 2021 at 16:24:21 UTC, jfondren wrote:
On Thursday, 5 August 2021 at 16:06:58 UTC, someone wrote:
So if we are talking AA-arrays at compile-time only there
should be nothing wrong with the following code ... right ?
...
private enum pudtLocations = [
r"BUE"d : structure
On Thu, Aug 05, 2021 at 04:53:38PM +, someone via Digitalmars-d-learn wrote:
[...]
> I already assumed that loading the data from file is a goner.
>
> So this leaves me with two choices:
>
> - keep the code as it is incurring higher-than expected
> compilation-time: this is solely used in a m
On 8/5/21 11:09 AM, someone wrote:
On Thursday, 5 August 2021 at 10:28:00 UTC, Steven Schveighoffer wrote:
H.S. Teoh, I know you know better than this ;) None of this is
necessary, you just need `rtValue` for both runtime and CTFE (and
compile time parameters)!
Now, the original question is
On Thursday, 5 August 2021 at 17:12:13 UTC, H. S. Teoh wrote:
[...]
I'd say if the performance hit isn't noticeably bad right now,
don't worry too much about it. You can always replace it later.
One thing I really like about D is how easily refactorable D
code tends to be. If you structure yo
On Thursday, 5 August 2021 at 20:50:38 UTC, Steven Schveighoffer
wrote:
I mean eventually AAs that are reasonably available at compile
time, even though the structure is determined by the runtime,
should be available at compile time. This allows them to be as
usable with static immutable as r
On 8/5/21 5:11 PM, someone wrote:
> Although I have very little experience with D, I second this:
> refactoring, even huge refactors, proved to be far more straightforward
> than I expected.
May I humbly suggest names like Location instead of structureLocation to
make refactoring even more stra
On Friday, 6 August 2021 at 04:57:02 UTC, Ali Çehreli wrote:
On 8/5/21 5:11 PM, someone wrote:
> Although I have very little experience with D, I second this:
> refactoring, even huge refactors, proved to be far more
straightforward
> than I expected.
May I humbly suggest names like Location in
On Thursday, 5 August 2021 at 01:14:26 UTC, H. S. Teoh wrote:
On Thu, Aug 05, 2021 at 12:47:06AM +, someone via
Digitalmars-d-learn wrote:
[...]
1) If the constant is a POD (int, float, etc.), use:
enum myValue = ...;
2) If the constant is a string or some other array:
s
On Friday, 6 August 2021 at 04:57:02 UTC, Ali Çehreli wrote:
May I humbly suggest names like Location instead of
structureLocation to make refactoring even more
straightforward. ;)
just renamed everything like following:
- sWhatever for structures
- iWhatever for interfaces
- cWhatever for c
On 11/4/21 12:43 PM, Andrey Zherikov wrote:
I want to embed some info from build system - version info, for example.
I can easily do this with C++ compiler by `-DVERSION="1.2.3"` but there
is no such an option in dmd. So I'm wondering how do people workaround
this?
I see only one way: generate
de.dlang.org/packages/gen-package-version
Unfortunately git/hg tags is not the only possible source of
manifest constants.
On Thu, Nov 04, 2021 at 05:24:44PM +, Andrey Zherikov via
Digitalmars-d-learn wrote:
> On Thursday, 4 November 2021 at 17:09:31 UTC, Steven Schveighoffer wrote:
> > D doesn't have any equivalent for this.
>
> Is it possible to add this feature having `-C VERSION="1.2.3"` (`-D`
> is already us
On 11/4/21 10:36 AM, H. S. Teoh wrote:
>import __stdin : myversion;
Where can we learn more of that magic? :)
Ali
On Thu, Nov 04, 2021 at 01:17:02PM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 11/4/21 10:36 AM, H. S. Teoh wrote:
>
> > import __stdin : myversion;
>
> Where can we learn more of that magic? :)
[...]
I kinda cheated, because I was the one who implemented dmd's stdin
feature, so
On 1/27/20 3:05 PM, Herbert wrote:
How can a class provide it's users with named constants, enums, types,
structs and not just member functions?
Just declare them inside the class. They then go inside the class
namespace, but are not strictly part of the class instance itself.
e.g.:
fined in a unittest block
works with DEFINITION 1. What is the reason for the difference
between unittest constants and module constants?
Thanks,
Dan
unittest blocks are evaluated at run time, just like your
DEFINITION 2, and unlike your DEFINITION 1 which would be
evaluated at compile time.
Growth2013 = [
AssetReturnType.Interest :
RateCurve([DateRate(Date.min, CcRate(0.007))]),
];
}
However, the same constant, when defined in a unittest block works
with DEFINITION 1. What is the reason for the difference between
unittest constants and module constants?
Thanks,
Dan
unittest
On 02/18/2013 08:59 AM, Lubos Pintes wrote:
> Yesterday I solved similar problem by using enum.
> enum GameInfo[string] games=[
> ...
> ];
Be careful with that though: 'games' is a literal associative array,
meaning that it will be used in the program as if it's copy-pasted in
that location. It
Thank for explanation. I supposed that the enum constant is fixed and
that it is also true for AA.
I will convert my code before I forget. :-).
Dňa 18. 2. 2013 18:22 Ali Çehreli wrote / napísal(a):
On 02/18/2013 08:59 AM, Lubos Pintes wrote:
> Yesterday I solved similar problem by using enum.
On 02/18/2013 09:22 AM, Ali Çehreli wrote:
> static immutable GameInfo[string] games;
>
> static this()
> {
> games = [ "one" : GameInfo(1) ];
> }
And to be honest, I am not sure why I define it as 'static immutable'.
:) Isn't this the same thing?
immutable GameInfo[string] games;
static thi
On 20/02/2011 14:59, d coder wrote:
Greetings
I tried to initialize a struct member with a function pointer, and
found that DMD2 did not like it. Are not function pointers compile
time constants? And why they should not be?
Regards
- Cherry
No a function doesn't have an address unti
Thanks Simon.
"Simon" wrote in message
news:ijrdif$1nn6$1...@digitalmars.com...
> On 20/02/2011 14:59, d coder wrote:
>> Greetings
>>
>> I tried to initialize a struct member with a function pointer, and
>> found that DMD2 did not like it. Are not function pointers co
t function pointers compile
time constants? And why they should not be?
Regards
- Cherry
No a function doesn't have an address until the .exe is loaded into
memory. And with Address space randomisation on 'doze there is no
reasonable way to make a function pointer a compile time val
inter, and
found that DMD2 did not like it. Are not function pointers compile
time constants? And why they should not be?
Regards
- Cherry
No a function doesn't have an address until the .exe is loaded into
memory. And with Address space randomisation on 'doze there is no
reasonable wa
Simon Wrote:
> You could make function pointers compile time constants if:
>
> You disallow ASR
> You disallow them when compiling to a dll
> You disallow in-lining of any function of which you take the address
> You disallow the linker from rearranging functions
> You dis
d coder writes:
> Greetings
>
> I tried to initialize a struct member with a function pointer, and
> found that DMD2 did not like it. Are not function pointers compile
> time constants? And why they should not be?
>
> Regards
> - Cherry
I just want to point out that this
What's the preferred way of declaring run-time constant values in
D from the point of view of
1, compile-time performance
2. run-time performance
3. code-size
4. load-time
5. locality of reference module global or function global (static)
The D Style suggest to camelCase constants, while Java naming
conventions always promoted uppercase letter.
Is there an explanation why D Style chose to use camelCase
instead of all UPPERCASE for constants, was there any technical
problem that would appear while writing in all UPPERCASE
On Mon, 26 Jan 2015 20:04:58 +, Nordlöw wrote:
> What's the preferred way of declaring run-time constant values in D from
> the point of view of
>
> 1, compile-time performance 2. run-time performance 3. code-size 4.
> load-time 5. locality of reference module global or function global
> (st
On Wednesday, 9 May 2018 at 09:51:37 UTC, bauss wrote:
Just because.
To add on to this.
D is not Java, it's not C++, it's not C# etc.
D is D and D has its own conventions.
You're free to write your constants in all uppercase if you want.
I guess if I should come up with a
On Wednesday, 9 May 2018 at 09:38:14 UTC, BoQsc wrote:
The D Style suggest to camelCase constants, while Java naming
conventions always promoted uppercase letter.
Is there an explanation why D Style chose to use camelCase
instead of all UPPERCASE for constants, was there any technical
1 - 100 of 119 matches
Mail list logo