@AliCehreli: you may consider including Jonathan's trick in your book in the
para above this heading:
http://ddili.org/ders/d.en/const_and_immutable.html#ix_const_and_immutable.variable,
%20immutable
Jonathan M Davis via Digitalmars-d-learn wrote:
> yes, having
>
> enum s = ta("s)";
>
> and u
ag0aep6g wrote:
> 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
On Friday, 4 March 2016 at 16:46:35 UTC, Steven Schveighoffer
wrote:
You cannot add or remove keys. You can modify values for
existing keys.
Note, in your code, this would not cause a problem, since
setting hash to null just removes the reference from the local
variable 'hash', it does not
cym13 wrote:
> Note that parentheses are optional when no argument is provided.
Yes I know that but the point is I expected the compiler to identify
ta!"string" to refer to a different symbol than ta("string") where the one
is obviously a template and the other is obviously a function call. The
On 05/03/16 10:35 AM, Yuxuan Shui wrote:
For example
struct A{}
@safe void main(){
import std.stdio;
A a, b;
auto y = typeid(a);
y.name = "Nope, I'm not A";
auto x = typeid(b);
writeln(x);
}
Make changes to TypeInfo will affect all the future typeid() results!
And
For example
struct A{}
@safe void main(){
import std.stdio;
A a, b;
auto y = typeid(a);
y.name = "Nope, I'm not A";
auto x = typeid(b);
writeln(x);
}
Make changes to TypeInfo will affect all the future typeid()
results! And D is OK with that?
IM
On Friday, 4 March 2016 at 15:18:55 UTC, Steven Schveighoffer
wrote:
On 3/3/16 6:58 PM, 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
type
On Thursday, 3 March 2016 at 15:00:10 UTC, Alex Parrill wrote:
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 s
On Wednesday, 2 March 2016 at 02:36:50 UTC, Charles wrote:
is this something that could be accomplished in D with CTFE?
I think I've heard him say that tools should be part of the
language. However, I haven't watched that video and anyway am not
sure how important CTFE would be to this effor
On 3/4/16 8:53 AM, aki wrote:
Is it okay to modify associative array while iterating it?
import std.stdio;
void main() {
string[string] hash = [ "k1":"v1", "k2":"v2" ];
auto r = hash.byKeyValue();
while(!r.empty) {
auto key = r.front.key;
auto value = r.front.va
On Friday, 4 March 2016 at 13:53:22 UTC, aki wrote:
Is it okay to modify associative array while iterating it?
import std.stdio;
void main() {
string[string] hash = [ "k1":"v1", "k2":"v2" ];
auto r = hash.byKeyValue();
while(!r.empty) {
auto key = r.front
On 3/3/16 6:58 PM, 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 TypeInfo just calls is i
On Friday, 4 March 2016 at 14:16:55 UTC, Minas Mina wrote:
On Friday, 4 March 2016 at 13:53:22 UTC, aki wrote:
I think what you can do is extract its contents to an array,
iterate it and modify it as you like, and then insert back to
another associative array. I don't think it's efficient but I
On Friday, 4 March 2016 at 13:53:22 UTC, aki wrote:
Is it okay to modify associative array while iterating it?
import std.stdio;
void main() {
string[string] hash = [ "k1":"v1", "k2":"v2" ];
auto r = hash.byKeyValue();
while(!r.empty) {
auto key = r.front
Is it okay to modify associative array while iterating it?
import std.stdio;
void main() {
string[string] hash = [ "k1":"v1", "k2":"v2" ];
auto r = hash.byKeyValue();
while(!r.empty) {
auto key = r.front.key;
auto value = r.front.value;
On Wednesday, 2 March 2016 at 03:41:57 UTC, sigod wrote:
Very interesting. I wonder what Walter would say about it.
Yeah, I'm curious what others' thoughts on it are for sure.
if m is a string obtained from __traits(allMembers,...)
I can detect if a symbol is an alias by m !=
__traits(getMember,...,m).stringof .it follows that I can use
another (m2; __traits(allMembers,...)) loop to check is
(__traits(getMember,m2) ==__traits(getMember,...,m)) && m !=
__traits(getMe
17 matches
Mail list logo