Re: Optimize my code =)

2014-02-18 Thread Stanislav Blinov
On Tuesday, 18 February 2014 at 07:50:23 UTC, bearophile wrote: Stanislav Blinov: http://dpaste.dzfl.pl/9d7feeab59f6 Few small things should still be improved, but it's an improvement. Perhaps it needs to use a reference counting from Phobos. COW for matrices? Aw, come on... :) LDC

Re: Question about CPU caches and D context pointers

2014-02-18 Thread Dicebot
None of your buffers are on stack in both examples. As those are dynamic arrays you only get pointer + length as value and data itself resides on heap in some unknown location. It can be in cache too, of course, if it has been used actively, but it can't be verified based on this simple

Re: Optimize my code =)

2014-02-18 Thread Stanislav Blinov
On Tuesday, 18 February 2014 at 07:45:18 UTC, bearophile wrote: Stanislav Blinov: that explicit ctor for Dimension is completely unnecessary too. I like a constructor(s) like that because it catches bugs like: auto d = Dimension(5); Hmmm... yeah, ok, not completely unnecessary :)

Importing text file, path not found

2014-02-18 Thread Tolga Cakiroglu (tcak)
I am testing with the import expression. I am using the -J flag while compiling. dmd app.d -J/home/user/include void main(){ auto test = json.parseJSON( import(/home/user/include/test.json) ); } 1. Because I am giving the full path of that file to be imported. But compiler is

Re: foreach/iota countdown

2014-02-18 Thread Sergei Nosov
On Tuesday, 18 February 2014 at 05:21:24 UTC, Brian Schott wrote: On Monday, 17 February 2014 at 19:22:38 UTC, simendsjo wrote: Should the following two uses be a compile-time error? foreach(i; 10 .. 0) // Never executes foreach(i; iota(10, 0)) // .. neither does this I would like the

Re: Importing text file, path not found

2014-02-18 Thread Tolga Cakiroglu (tcak)
On Tuesday, 18 February 2014 at 08:45:16 UTC, Tolga Cakiroglu (tcak) wrote: I am testing with the import expression. I am using the -J flag while compiling. dmd app.d -J/home/user/include void main(){ auto test = json.parseJSON( import(/home/user/include/test.json) ); } 1. Because I am

Re: Optimize my code =)

2014-02-18 Thread bearophile
Stanislav Blinov: allocationTest ... Time required: 1 sec, 112 ms, 827 μs, and 3 hnsecs multiplicationTest ... Time required: 1 sec, 234 ms, 417 μs, and 8 hnsecs Physics teaches us that those experimental measures are expressed with a excessive precision. For such benchmarks

Re: Optimize my code =)

2014-02-18 Thread bearophile
Stanislav Blinov: LDC yields roughly the same times. This is surprising. To me as well. I haven't yet tried to dig deep though. I have compiled your code with (a single module, 32 bit Windows): dmd -wi -vcolumns -O -release -inline -noboundscheck matrix3.d ldmd2 -wi -O -release -inline

Re: Optimize my code =)

2014-02-18 Thread Stanislav Blinov
On Tuesday, 18 February 2014 at 08:50:23 UTC, bearophile wrote: Stanislav Blinov: LDC yields roughly the same times. This is surprising. To me as well. I haven't yet tried to dig deep though. I have compiled your code with (a single module, 32 bit Windows): dmd -wi -vcolumns -O

Re: Importing text file, path not found

2014-02-18 Thread bearophile
Tolga Cakiroglu (tcak): 1. Because I am giving the full path of that file to be imported, compiler is complaining about that it cannot find the file. If I remove the path, and leave the file name only, it works. Am I doing something wrong, or bug? 2. Why do I need to tell compiler where to

Re: Importing text file, path not found

2014-02-18 Thread Dicebot
On Tuesday, 18 February 2014 at 08:45:16 UTC, Tolga Cakiroglu (tcak) wrote: 1. Because I am giving the full path of that file to be imported. But compiler is complaining about that it cannot find the file. If I remove the path, and leave the file name only, it works. Am I doing something

Re: std.range.equal or == in isPalindrome

2014-02-18 Thread bearophile
Per Nordlöw: Why isn't equality == operator used here instead? In some cases I'd even like to use ~ instead of chain(). Bye, bearophile

Re: std.range.equal or == in isPalindrome

2014-02-18 Thread Stanislav Blinov
On Tuesday, 18 February 2014 at 09:31:55 UTC, Per Nordlöw wrote: I'm curious to why we need std.range.equal in cases such as bool isPalindrome(Range)(in Range range) if (isBidirectionalRange!Range) { return range.retro.equal(range); } Why isn't equality == operator used here instead?

Re: std.range.equal or == in isPalindrome

2014-02-18 Thread Stanislav Blinov
On Tuesday, 18 February 2014 at 09:34:41 UTC, bearophile wrote: In some cases I'd even like to use ~ instead of chain(). Range interface should be minimal. Don't forget that user types can provide range interface and still benefit from operator overloading for different purposes.

Interface file is generated wrong

2014-02-18 Thread Tolga Cakiroglu (tcak)
I have written a module as below: file: lib.d import core.sys.posix.dlfcn; private static this(){} private static ~this(){} public shared class Apps{ } --- This code is compiled with -H flag to generate an interface file. Generated interface file is below: file: lib.di // D import

Re: Importing text file, path not found

2014-02-18 Thread Tolga Cakiroglu
On Tuesday, 18 February 2014 at 09:24:50 UTC, Dicebot wrote: On Tuesday, 18 February 2014 at 08:45:16 UTC, Tolga Cakiroglu (tcak) wrote: 1. Because I am giving the full path of that file to be imported. But compiler is complaining about that it cannot find the file. If I remove the path, and

Re: Interface file is generated wrong

2014-02-18 Thread Stanislav Blinov
On Tuesday, 18 February 2014 at 10:07:37 UTC, Tolga Cakiroglu (tcak) wrote: Bug? Yup. (I don't know if I should immediately file a bug when I think it is a bug without asking what other people thinks.) 1) Do a seach in bugzilla 2) If the search doesn't show anything similar, file it 3)

Re: Importing text file, path not found

2014-02-18 Thread Dicebot
On Tuesday, 18 February 2014 at 10:10:14 UTC, Tolga Cakiroglu wrote: Hmm. Should I understand the sandbox as if I am going to be compiling someone else's code, only looking at -J flags will be enough to make sure it is not using any of my private files? It is the intention. I can't guarantee

Re: Optimize my code =)

2014-02-18 Thread Stanislav Blinov
...And if I define opEquals as it was made by Robin, i.e. like this: bool opEquals(ref const Matrix other) const pure nothrow { version (all) { if (dim != other.dim) return false; foreach(immutable i, const ref e; data) if (e != other.data[i])

Re: foreach/iota countdown

2014-02-18 Thread Ivan Kazmenko
/home/alaran/tmp/test.d(5:16)[warn]: 3 is larger than 2. This slice is likely incorrect. /home/alaran/tmp/test.d(6:22)[warn]: 20 is larger than 10. Did you mean to use 'foreach_reverse( ... ; 10 .. 20)'? Isn't foreach_reverse being deprecated? Oh. If so, what would be the right way to

Re: foreach/iota countdown

2014-02-18 Thread bearophile
Sergei Nosov: Isn't foreach_reverse being deprecated? The idea was discussed a little, but it's not deprecated, and probably it will not be deprecated. Bye, bearophile

Re: Interface file is generated wrong

2014-02-18 Thread Tolga Cakiroglu
On Tuesday, 18 February 2014 at 10:15:51 UTC, Stanislav Blinov wrote: On Tuesday, 18 February 2014 at 10:07:37 UTC, Tolga Cakiroglu (tcak) wrote: Bug? Yup. (I don't know if I should immediately file a bug when I think it is a bug without asking what other people thinks.) 1) Do a seach

Re: std.range.equal or == in isPalindrome

2014-02-18 Thread bearophile
Stanislav Blinov: Range interface should be minimal. I agree. But I didn't mean to ask for that operator in the Range protocol. I think some ranges should define a ~ operator. It's easy to write a chainable trait. I did that for my nonstandard D1 library. Bye, bearophile

Re: 64 bit size_t

2014-02-18 Thread Steve Teale
Rather than change it to int/ulong, just change it to 'size_t len = parent.children.length+1' (or auto instead of size_t). This way it's proper for both 32-bit and 64-bit and you don't need to worry about architecture. If you do need a signed version, you can use ptrdiff_t. Yup, that's what

Re: std.range.equal or == in isPalindrome

2014-02-18 Thread Per Nordlöw
On Tuesday, 18 February 2014 at 10:47:33 UTC, bearophile wrote: Stanislav Blinov: Range interface should be minimal. I agree. But I didn't mean to ask for that operator in the Range protocol. I think some ranges should define a ~ operator. It's easy to write a chainable trait. I did that

Re: std.range.equal or == in isPalindrome

2014-02-18 Thread Per Nordlöw
On Tuesday, 18 February 2014 at 11:39:12 UTC, Per Nordlöw wrote: On Tuesday, 18 February 2014 at 10:47:33 UTC, bearophile wrote: Stanislav Blinov: Range interface should be minimal. I agree. But I didn't mean to ask for that operator in the Range protocol. I think some ranges should define

[video tutorial] Refactoring the number guessing game

2014-02-18 Thread simendsjo
http://youtu.be/yhK7zvnWmiU

Re: [video tutorial] Implementing a simple number guessing game

2014-02-18 Thread John Colvin
On Tuesday, 18 February 2014 at 07:19:05 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 07:06:11 UTC, Suliman wrote: On Monday, 17 February 2014 at 13:35:34 UTC, simendsjo wrote: http://youtu.be/2Co65Ftxfdo Thanks! But could you use bigger fonts and more contrast color scheme for

Re: [video tutorial] Implementing a simple number guessing game

2014-02-18 Thread Mengu
On Monday, 17 February 2014 at 13:35:34 UTC, simendsjo wrote: http://youtu.be/2Co65Ftxfdo did i mention i loved your tutorials? keep up the great work.

Re: [video tutorial] Implementing a simple number guessing game

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 13:39:38 UTC, John Colvin wrote: On Tuesday, 18 February 2014 at 07:19:05 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 07:06:11 UTC, Suliman wrote: On Monday, 17 February 2014 at 13:35:34 UTC, simendsjo wrote: http://youtu.be/2Co65Ftxfdo Thanks! But

Re: [video tutorial] Implementing a simple number guessing game

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 13:46:11 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 13:39:38 UTC, John Colvin wrote: On Tuesday, 18 February 2014 at 07:19:05 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 07:06:11 UTC, Suliman wrote: On Monday, 17 February 2014 at 13:35:34

Re: [video tutorial] Implementing a simple number guessing game

2014-02-18 Thread John Colvin
On Tuesday, 18 February 2014 at 13:47:22 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 13:46:11 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 13:39:38 UTC, John Colvin wrote: On Tuesday, 18 February 2014 at 07:19:05 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread Rikki Cattermole
On Tuesday, 18 February 2014 at 13:00:09 UTC, simendsjo wrote: http://youtu.be/yhK7zvnWmiU Would you be interested in doing a Lets make series on ApplyYourDLang? As this falls under this heading.

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 14:16:27 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 13:00:09 UTC, simendsjo wrote: http://youtu.be/yhK7zvnWmiU Would you be interested in doing a Lets make series on ApplyYourDLang? As this falls under this heading. Combining efforts is

Re: [video tutorial] Implementing a simple number guessing game

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 14:04:50 UTC, John Colvin wrote: On Tuesday, 18 February 2014 at 13:47:22 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 13:46:11 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 13:39:38 UTC, John Colvin wrote: On Tuesday, 18 February 2014 at

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread Rikki Cattermole
On Tuesday, 18 February 2014 at 14:19:47 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 14:16:27 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 13:00:09 UTC, simendsjo wrote: http://youtu.be/yhK7zvnWmiU Would you be interested in doing a Lets make series on

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 14:20:44 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 14:19:47 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 14:16:27 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 13:00:09 UTC, simendsjo wrote: http://youtu.be/yhK7zvnWmiU

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread Rikki Cattermole
On Tuesday, 18 February 2014 at 14:25:33 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 14:20:44 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 14:19:47 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 14:16:27 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 14:36:17 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 14:27:19 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 14:25:33 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 14:20:44 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread Rikki Cattermole
On Tuesday, 18 February 2014 at 14:36:17 UTC, simendsjo wrote: I'll be more than happy to place the videos elsewhere, but I don't want to commit to a large ongoing project as I'm pretty busy with school too. Posting your ideas somewhere would be nice though. What I was thinking was, for a

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 14:42:22 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 14:36:17 UTC, simendsjo wrote: I'll be more than happy to place the videos elsewhere, but I don't want to commit to a large ongoing project as I'm pretty busy with school too. Posting your

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread Rikki Cattermole
On Tuesday, 18 February 2014 at 14:48:53 UTC, simendsjo wrote: Not sure I'm able to connect.. When pressing the link, it turns up for my G+ user. If I log in as the YouTube user and go to that link, I still turn up as the G+ user. Why on earth won't Google let me merge the accounts?... I

Re: Interface file is generated wrong

2014-02-18 Thread Steven Schveighoffer
On Tue, 18 Feb 2014 05:47:41 -0500, Tolga Cakiroglu t...@pcak.com wrote: On Tuesday, 18 February 2014 at 10:15:51 UTC, Stanislav Blinov wrote: On Tuesday, 18 February 2014 at 10:07:37 UTC, Tolga Cakiroglu (tcak) wrote: Bug? Yup. (I don't know if I should immediately file a bug when I

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 14:51:28 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 14:48:53 UTC, simendsjo wrote: Not sure I'm able to connect.. When pressing the link, it turns up for my G+ user. If I log in as the YouTube user and go to that link, I still turn up as the G+

Re: [video tutorial] Refactoring the number guessing game

2014-02-18 Thread Rikki Cattermole
On Tuesday, 18 February 2014 at 15:14:09 UTC, simendsjo wrote: On Tuesday, 18 February 2014 at 14:51:28 UTC, Rikki Cattermole wrote: On Tuesday, 18 February 2014 at 14:48:53 UTC, simendsjo wrote: Not sure I'm able to connect.. When pressing the link, it turns up for my G+ user. If I log in as

Re: Optimize my code =)

2014-02-18 Thread Kapps
On Tuesday, 18 February 2014 at 09:05:33 UTC, Stanislav Blinov wrote: allocationTest ... Time required: 2 hnsecs (o_O) identityMatrixTest ... Time required: 4 hnsecs (o_O) LDC is probably detecting that you're never actually using the results of the operation and that none of

Re: std.range.chunk without length

2014-02-18 Thread Stephan Schiffels
On Thursday, 13 February 2014 at 17:41:37 UTC, monarch_dodra wrote: On Thursday, 13 February 2014 at 14:45:44 UTC, bearophile wrote: Stephan Schiffels: It would be actually easy to implement chunks without the save function, by using an internal buffer, which would however make this

Re: Interface file is generated wrong

2014-02-18 Thread Tolga Cakiroglu
On Tuesday, 18 February 2014 at 15:02:38 UTC, Steven Schveighoffer wrote: On Tue, 18 Feb 2014 05:47:41 -0500, Tolga Cakiroglu t...@pcak.com wrote: On Tuesday, 18 February 2014 at 10:15:51 UTC, Stanislav Blinov wrote: On Tuesday, 18 February 2014 at 10:07:37 UTC, Tolga Cakiroglu (tcak) wrote:

trace GC work

2014-02-18 Thread Ruslan Mullakhmetov
Hi, Is it possible to trace GC allocation calls to determine times of program death and have some stats? So i want the following information: - garbage collection starts at {time} - garbage collection stops at {time} - (optionally) gc took {time}, collected {size} bytes thanks.

Re: Question about CPU caches and D context pointers

2014-02-18 Thread Casper Færgemand
On Tuesday, 18 February 2014 at 08:11:04 UTC, Dicebot wrote: None of your buffers are on stack in both examples. As those are dynamic arrays you only get pointer + length as value and data itself resides on heap in some unknown location. That. struct S {} class C {} S[] s1; // fat pointer

Re: Question about CPU caches and D context pointers

2014-02-18 Thread Dicebot
On Tuesday, 18 February 2014 at 18:13:24 UTC, Casper Færgemand wrote: S[2] s2; // array of two structs, plus a length? Storing length is not needed for static arrays because it is known, well, statically. I tested some prime sieves both in C++ and D. They worked fastest with dynamic arrays

What learning resources are available?

2014-02-18 Thread Mark Isaacson
Hi everyone - I'm a D newbie with a very strong C++ background looking to get started. I've read The D Programming Language a couple of times now, but I've heard rumblings at several points in time from several people that some if its contents are now out of date or no longer reflect best

Re: What learning resources are available?

2014-02-18 Thread simendsjo
On Tuesday, 18 February 2014 at 19:17:55 UTC, Mark Isaacson wrote: Hi everyone - I'm a D newbie with a very strong C++ background looking to get started. I've read The D Programming Language a couple of times now, but I've heard rumblings at several points in time from several people that some

Re: What learning resources are available?

2014-02-18 Thread H. S. Teoh
On Tue, Feb 18, 2014 at 07:17:53PM +, Mark Isaacson wrote: Hi everyone - I'm a D newbie with a very strong C++ background looking to get started. I've read The D Programming Language a couple of times now, but I've heard rumblings at several points in time from several people that some if

Re: Question about CPU caches and D context pointers

2014-02-18 Thread Etienne
On 2014-02-18 1:13 PM, Casper Færgemand shortt...@hotmail.com wrote: On Tuesday, 18 February 2014 at 08:11:04 UTC, Dicebot wrote: I tested some prime sieves both in C++ and D. They worked fastest with dynamic arrays with a size matching the L1 cache. I presume the instructions are located

Re: Question about CPU caches and D context pointers

2014-02-18 Thread Dicebot
On Tuesday, 18 February 2014 at 19:55:20 UTC, Etienne wrote: On 2014-02-18 1:13 PM, Casper Færgemand shortt...@hotmail.com wrote: On Tuesday, 18 February 2014 at 08:11:04 UTC, Dicebot wrote: I tested some prime sieves both in C++ and D. They worked fastest with dynamic arrays with a size

Re: What learning resources are available?

2014-02-18 Thread John Colvin
On Tuesday, 18 February 2014 at 19:17:55 UTC, Mark Isaacson wrote: Hi everyone - I'm a D newbie with a very strong C++ background looking to get started. I've read The D Programming Language a couple of times now, but I've heard rumblings at several points in time from several people that some

Re: trace GC work

2014-02-18 Thread Ali Çehreli
On 02/18/2014 10:10 AM, Ruslan Mullakhmetov wrote: Hi, Is it possible to trace GC allocation calls to determine times of program death and have some stats? So i want the following information: - garbage collection starts at {time} - garbage collection stops at {time} - (optionally)

Re: What learning resources are available?

2014-02-18 Thread Tobias Pankrath
On Tuesday, 18 February 2014 at 19:17:55 UTC, Mark Isaacson wrote: Hi everyone - I'm a D newbie with a very strong C++ background looking to get started. I've read The D Programming Language a couple of times now, but I've heard rumblings at several points in time from several people that some

Cannot get frame pointer to sort

2014-02-18 Thread Tobias Pankrath
-- struct Set(alias less = a b, T) { import std.algorithm; import std.functional; alias lessFun = binaryFun!(less); int[] someContents; this(R)(R r) { sort!(lessFun)(someContents); } } unittest { auto as2 =

Re: trace GC work

2014-02-18 Thread Mike
On Tuesday, 18 February 2014 at 18:10:40 UTC, Ruslan Mullakhmetov wrote: Hi, Is it possible to trace GC allocation calls to determine times of program death and have some stats? So i want the following information: - garbage collection starts at {time} - garbage collection stops at

Re: Cannot get frame pointer to sort

2014-02-18 Thread Stanislav Blinov
On Tuesday, 18 February 2014 at 22:28:08 UTC, Tobias Pankrath wrote: What's wrong? This looks like a bug to me, seeing as string predicate works. Although I don't get how you supply default template parameter for Set before explicit one :)

Re: Optimize my code =)

2014-02-18 Thread Robin
Hiho, I am happy to see that I could encourage so many people to discuss about this topic to not only give me interesting answer to my questions but also to analyse and evaluate features and performance of D. I have fixed the allocation performance problem via a custom destructor method

UDA initialize a user defined type attribute field

2014-02-18 Thread Arjan
When a user defined type is used as an attribute like this: // the attribute struct MyAttrib { immutable string name; imuttable int sz; immutable string defaultvalue; } // using the attribute class Data { // field 'id' has attribute MyAttrib with name and sz set to 'fancy name'

Re: UDA initialize a user defined type attribute field

2014-02-18 Thread Adam D. Ruppe
On Tuesday, 18 February 2014 at 23:43:56 UTC, Arjan wrote: But how do I only set the MyAttrib.defaultvalue? You could do it by adding a constructor to MyAttrib that only takes one string and fills it in that way.

Re: Optimize my code =)

2014-02-18 Thread bearophile
Robin: the existance of move semantics in C++ and is one of the coolest features since C++11 which increased and simplified codes in many cases enormously for value types just as structs in D. I guess Andrei doesn't agree with you (and move semantics in C++11 is quite hard to understand).

Re: UDA initialize a user defined type attribute field

2014-02-18 Thread Arjan
On Tuesday, 18 February 2014 at 23:46:28 UTC, Adam D. Ruppe wrote: On Tuesday, 18 February 2014 at 23:43:56 UTC, Arjan wrote: But how do I only set the MyAttrib.defaultvalue? You could do it by adding a constructor to MyAttrib that only takes one string and fills it in that way. But what

Re: UDA initialize a user defined type attribute field

2014-02-18 Thread bearophile
Arjan: MyAttrib instances may be initialized like this: auto myattrib = { defaultvalue:null }; But this seems not possible when using MyAttrib as attribute. This could become a D enhancement request. I guess the field MyAttrib.defaultvalue will be assigned the value fancy name?

Re: UDA initialize a user defined type attribute field

2014-02-18 Thread Ali Çehreli
On 02/18/2014 03:43 PM, Arjan wrote: When a user defined type is used as an attribute like this: // the attribute struct MyAttrib { immutable string name; imuttable int sz; immutable string defaultvalue; } // using the attribute class Data { // field 'id' has attribute

Re: Optimize my code =)

2014-02-18 Thread Stanislav Blinov
On Tuesday, 18 February 2014 at 23:36:12 UTC, Robin wrote: Another thing which is hopefully a bug in the current language implementation of D is the strange behaviour of the transpose method with the only line of code: return Matrix(this).transposeAssign(); Matrix(this) not compiling when