On 10/07/14 23:48, "Marc Schütz" " wrote:
Try other immutable variables (int arrays, structs), and non-immutable
ones. They will probably behave differently.
String literals are put directly in the executable and therefore should
be the same. Array literals are dynamically allocated.
--
/Ja
On 10/07/14 22:48, anonymous wrote:
I don't think this is a bug.
Remember that enums have copy-paste semantics. So, this is the
same as comparing literals from different modules. Apparently, in
the same module, a duplicate string literal is optimized out. But
that's not done across the module b
On 10/07/14 22:47, "Marc Schütz" " wrote:
No, this is equivalent to:
void bar (string a)
{
assert(a is "GET");
}
void asd()
{
bar("GET");
}
Enums behave as if their values are copy-n-pasted everywhere they are
used (you probably know that).
Yes, I was thinking that. Then I was thi
On 07/11/2014 01:08 AM, sigod wrote:
> On Thursday, 10 July 2014 at 20:59:17 UTC, simendsjo wrote:
>> Strings behaves a bit odd with is(). The following passes:
>>
>> import std.stdio;
>> void f(string a, string b) {
>> assert(a is b); // also true
>> }
>> void main() {
>> string a = "aoeu"
On Thursday, 10 July 2014 at 20:59:17 UTC, simendsjo wrote:
Strings behaves a bit odd with is(). The following passes:
import std.stdio;
void f(string a, string b) {
assert(a is b); // also true
}
void main() {
string a = "aoeu";
string b = "aoeu";
assert(a is b); // true
f(a
On Thursday, 10 July 2014 at 20:59:17 UTC, simendsjo wrote:
Strings behaves a bit odd with is(). The following passes:
import std.stdio;
void f(string a, string b) {
assert(a is b); // also true
}
void main() {
string a = "aoeu";
string b = "aoeu";
assert(a is b); // true
f(a
On 07/10/2014 10:47 PM, "Marc Schütz" " wrote:
> On Thursday, 10 July 2014 at 20:27:39 UTC, Jacob Carlborg wrote:
>> Here's a code example:
>>
>> module main;
>>
>> import foo;
>>
>> enum Get = "GET";
>>
>> void bar (string a)
>> {
>> assert(a is Get);
>> }
>>
>> void main ()
>> {
>> asd();
On Thursday, 10 July 2014 at 20:27:39 UTC, Jacob Carlborg wrote:
Here's a code example:
module main;
import foo;
enum Get = "GET";
void bar (string a)
{
assert(a is Get);
}
void main ()
{
asd();
}
module foo;
import main;
void asd()
{
bar(Get);
}
Running the above code will c
On Thursday, 10 July 2014 at 20:27:39 UTC, Jacob Carlborg wrote:
Here's a code example:
module main;
import foo;
enum Get = "GET";
void bar (string a)
{
assert(a is Get);
}
void main ()
{
asd();
}
module foo;
import main;
void asd()
{
bar(Get);
}
Running the above code will c