[M3devel] Enumeration or subrange value out of range

Dragiša Durić dragisha at m3w.org
Tue Nov 30 10:19:37 CET 2010


On Nov 30, 2010, at 9:32 AM, Jay K wrote:

> > Recently I met these... Isn't it nice, to find your error happening somewhere in some .h file you never heard of?
> 
> 
> The error messages are better these days.

My experience is as recent as Snow Leopard, with 10.6.5 update.

> It is true they were terrible for a long time.
> Don't Modula-3 generics have the same problem?
> At least in the C++ case:
>   - the errors aren't in generated files 

They are generated, but they are exact source you would "generate" for it. Aren't they? And you have them to step through with debugger. At least, I never hit a wall with them, like I did with that .h for vectors.

>   - you don't have to explicitly instantiate everything "in the build system"

That would be a killing experience, to add even more complexity to Makefiles :).

>   - for function templates, you never have to instantiate anything
>  The automatic deduction of function template parameters is very powerful.
>  You have to try it.
>  I *believe* it enables a style of programming similar to ML, esp. when combined with the more recent
>  feature "auto".

A style is something I'd happily trade for discipline. I like to find my place in 10 year old project in minutes, and I like to not think about releases and subreleases of language spec (!??!!?) happening during a lifetime of my project.

> It is also true that templates seem to be largely accidental in what they allow.
> It seems they were designed with two primary applications:
>   std::vector
>   std::min/max

There's folk saying here, it goes like: "To kill an ox for a kilo of meat."

What you can do with these, and what you need to be done with these... It is mostly scope of some more dynamic environment, scripting comes to mind. To put them in compiled environment is just more of C++'s featurism (we can do it, why don't we...)... Your comparison to ML is right on spot. C++ is just mixed philosophy, mixed styles, mixed everything. Mixed results just follow suite.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101130/5b9dab06/attachment-0002.html>


More information about the M3devel mailing list