[dmd-internals] Type-checked arrays!

Michel Fortin michel.fortin at michelf.com
Wed Jul 6 04:09:25 PDT 2011


Le 2011-07-05 à 20:15, Walter Bright a écrit :

> On 7/5/2011 4:46 PM, Michel Fortin wrote:
>> 
>> Well, now that I know I can change it to a template.
>> 
>> When I asked a mid-June on this list, I did not get an answer. I decided to go take the most conservative route and not use any C++ feature not already in use elsewhere in the code.
>> 
>> If you say it's okay to use templates then I'll make the change, it's no big deal. I agree it'd be a little cleaner that way, although with typedefs it won't change things much.
> 
> I originally did not use templates because g++ at the time did a terrible job with them. This has gotten much better now.

That's useful to know.

Done, now using a template:

	typedef Array<struct Expression> Expressions;

<https://github.com/michelf/dmd/compare/master...type-checked-arrays>

Ok, so now I'd like to know how long can I expect it might take before integrating in mainline? It's important because this patch is very costly to maintain, as almost every commit I merge into from mainline causes conflicts I must resolve manually.

Also, it's been tested only on OS X. It's not easy for me to work on other platforms, so I guess I'd need someone else to try to compile it on Linux and Windows and fix the type-checking errors for the platform specific parts. Anyone wants to help?

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the dmd-internals mailing list