On Friday, 4 March 2016 at 01:13:37 UTC, Ali Çehreli wrote:
On 03/03/2016 04:50 PM, Nicholas Wilson wrote:
> [...]
I think so. Also noting that C-style varargs can only work with
fundamental types (Am I correct there? I am carrying this
assumption from C++.), you may be happier with a
templat
On 03/03/2016 04:50 PM, Nicholas Wilson wrote:
> //f is a File*
> void fwrite(int line = __LINE__)(...)
> {
> f.write("/*",line,"*/ ");
> f.write(_argptr); //prints e.g 7FFF5B055440
> }
> basically i want
> fwrite("1 ","2\t","3\n");
> to print
> /*7*/ 1 23
>
> do I have to it
//f is a File*
void fwrite(int line = __LINE__)(...)
{
f.write("/*",line,"*/ ");
f.write(_argptr); //prints e.g 7FFF5B055440
}
basically i want
fwrite("1 ","2\t","3\n");
to print
/*7*/ 1 23
do I have to iterate through _argptr
On Thursday, 3 March 2016 at 23:58:39 UTC, Yuxuan Shui wrote:
On Thursday, 3 March 2016 at 23:51:16 UTC, Adam D. Ruppe wrote:
On Thursday, 3 March 2016 at 23:46:50 UTC, Yuxuan Shui wrote:
Will typeid(a) is typeid(b) yield different results than
typeid(a) == typeid(b)?
No. Indeed, opEquals on
On Thursday, 3 March 2016 at 23:51:16 UTC, Adam D. Ruppe wrote:
On Thursday, 3 March 2016 at 23:46:50 UTC, Yuxuan Shui wrote:
Will typeid(a) is typeid(b) yield different results than
typeid(a) == typeid(b)?
No. Indeed, opEquals on TypeInfo just calls is itself.
But opEquals also has extra co
On Thursday, 3 March 2016 at 23:46:50 UTC, Yuxuan Shui wrote:
Will typeid(a) is typeid(b) yield different results than
typeid(a) == typeid(b)?
No. Indeed, opEquals on TypeInfo just calls is itself.
Will typeid(a) is typeid(b) yield different results than
typeid(a) == typeid(b)?
On 03/03/2016 05:17 AM, Andrew Edwards wrote:
> On 3/3/16 7:01 PM, MGW wrote:
>> immutable long[string] aa = [
>> "foo": 5,
>> "bar": 10,
>> "baz": 2000
>> ];
>
> The only way this can be done outside the body of a function is if it is
> a manifest constant. This works:
>
> enum long[s
On 03/03/2016 02:06 PM, Jack Stouffer wrote:
This doesn't work either
string func(int a, int[int] b = int[int].init) {
Parentheses around int[int] works though. I don't know whether it's a bug.
string func(int a, int[int] b = (int[int]).init) {
Ali
On Thursday, 3 March 2016 at 22:06:54 UTC, Jack Stouffer wrote:
I want to have one of the parameters on a function be optional.
The problem is, is that it's a AA and D does not seem to
support empty AA literals. Observe:
string func(int a, int[int] b = []) {
return "mem1";
}
void main() {
I want to have one of the parameters on a function be optional.
The problem is, is that it's a AA and D does not seem to support
empty AA literals. Observe:
string func(int a, int[int] b = []) {
return "mem1";
}
void main() {
func(1);
}
$ dmd test
test.d(8): Error: cannot implicitly c
On 03.03.2016 07:12, Shriramana Sharma wrote:
string ta(string s) { return s ~ "1"; }
template ta(string s) { enum ta = ta(s); }
In `ta(s)` here, `ta` is the enum itself again. It's similar to `int x =
x;`. Can't do that, of course.
Add a leading dot to refer to the module level `ta` symbols
On Wednesday, 2 March 2016 at 08:51:07 UTC, Manuel Maier wrote:
Hi there,
I was wondering why I should ever prefer std.range.lockstep
over std.range.zip. In my (very limited) tests std.range.zip
offered the same functionality as std.range.lockstep, i.e. I
was able to iterate using `foreach(ke
On Thursday, 3 March 2016 at 08:58:25 UTC, Shriramana Sharma
wrote:
Hello people and thanks for your replies.
Jonathan M Davis via Digitalmars-d-learn wrote:
You can't overload a function and an eponymous template like
that. They need to have distinct names.
Why is it not possible for the ov
On 3/3/16 7:01 PM, MGW wrote:
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
The only way this can be done outside the body of a function is if it is
a manifest constant. This works:
enum long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
On Wednesday, 2 March 2016 at 20:39:57 UTC, Adam D. Ruppe wrote:
On Wednesday, 2 March 2016 at 12:27:04 UTC, Adrian Matoga wrote:
Is it by design or is it a bug?
And, if it is by design, what is the reason for that?
That's by design. It allows you to override names from a
template mixin like
On Thursday, March 03, 2016 14:28:25 Shriramana Sharma via Digitalmars-d-learn
wrote:
> Hello people and thanks for your replies.
>
> Jonathan M Davis via Digitalmars-d-learn wrote:
> > You can't overload a function and an eponymous template like that. They
> > need to have distinct names.
>
> Why
On Thursday, 3 March 2016 at 10:35:50 UTC, MGW wrote:
The citation from https://dlang.org/spec/hash-map.html
Static Initialization of AAs
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
unittest
{
assert(aa["foo"] == 5);
assert(aa["b
On Thursday, 3 March 2016 at 10:35:50 UTC, MGW wrote:
The citation from https://dlang.org/spec/hash-map.html
Static Initialization of AAs
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
unittest
{
assert(aa["foo"] == 5);
assert(aa["b
The citation from https://dlang.org/spec/hash-map.html
Static Initialization of AAs
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
unittest
{
assert(aa["foo"] == 5);
assert(aa["bar"] == 10);
assert(aa["baz"] == 2000);
}
Judging
On Thursday, 3 March 2016 at 10:01:47 UTC, MGW wrote:
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
... Error: non-constant expression ["foo":5L, "bar":10L,
"baz":2000L]
D associative arrays are a dynamic runtime feature, thus can't be
initialized without runtime
On Thursday, 3 March 2016 at 10:01:47 UTC, MGW wrote:
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
... Error: non-constant expression ["foo":5L, "bar":10L,
"baz":2000L]
I'm not sure there's a way around this except by initialising it
at runtime. So you can't get
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
... Error: non-constant expression ["foo":5L, "bar":10L,
"baz":2000L]
Dne 3.3.2016 v 09:58 Shriramana Sharma via Digitalmars-d-learn napsal(a):
Hello people and thanks for your replies.
Jonathan M Davis via Digitalmars-d-learn wrote:
You can't overload a function and an eponymous template like that. They
need to have distinct names.
Why is it not possible for
Hello people and thanks for your replies.
Jonathan M Davis via Digitalmars-d-learn wrote:
> You can't overload a function and an eponymous template like that. They
> need to have distinct names.
Why is it not possible for the overload to happen? After all, the compiler
should be able to identi
On Thursday, 3 March 2016 at 07:07:55 UTC, Jacob Carlborg wrote:
On 2016-03-02 23:41, Joel wrote:
I don't seem to have a folder 'build' there.
It all seems writable.
Hmm, that's really weird. I guess that's the folder it fails to
write. Is it running as a different user. What if you change
26 matches
Mail list logo