Re: approxEqual() has fooled me for a long time...

2010-10-21 Thread Robert Jacques
On Thu, 21 Oct 2010 00:19:11 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 10/20/10 16:33 CDT, Don wrote: Walter Bright wrote: Andrei Alexandrescu wrote: On 10/20/10 13:42 CDT, Walter Bright wrote: Don wrote: I'm personally pretty upset about the existence of that

Re: d-mode for Emacs

2010-10-21 Thread Gour
On Wed, 20 Oct 2010 16:38:49 -0700 Brad == Brad Roberts wrote: Brad Why house it outside the emacs source repository? Get it Brad incorporated into the primary distribution channel for emacs Brad itself and everyone wins, no? I think it's good idea to have d-mode shipped with Emacs, but to

Re: approxEqual() has fooled me for a long time...

2010-10-21 Thread Lars T. Kyllingstad
On Wed, 20 Oct 2010 23:28:07 +0200, Don wrote: [...] I don't like the idea of having an absolute error by default. Although it is sometimes appropriate, I don't think it should be viewed as something which should always be included. It can be highly misleading. I guess that was the

Re: approxEqual() has fooled me for a long time...

2010-10-21 Thread Lars T. Kyllingstad
On Wed, 20 Oct 2010 23:33:54 +0200, Don wrote: Walter Bright wrote: Andrei Alexandrescu wrote: On 10/20/10 13:42 CDT, Walter Bright wrote: Don wrote: I'm personally pretty upset about the existence of that function at all. My very first contribution to D was a function for floating point

Re: d-mode for Emacs

2010-10-21 Thread Gour
On Wed, 20 Oct 2010 19:39:12 -0500 Andrei == Andrei Alexandrescu wrote: Andrei If that's feasible, sure! Does anyone know the right people? Afaik, it involves getting written signed papers from all the contributors sent to FSF...iow, it's not so easy and therefore I believe that for now it's

Re: The Next Big Language

2010-10-21 Thread Jonathan M Davis
On Wednesday 20 October 2010 22:47:15 Paulo Pinto wrote: Eiffel does have templates, as in generic types. Or do you mean the compile time trick that C++ templates allow, thus opening the door for the meta programming done at compile time? Templates and generics are two separate - albeit

Re: blog: Overlooked Essentials for Optimizing Code

2010-10-21 Thread Peter Alexander
On 20/10/10 2:59 PM, Bruno Medeiros wrote: I don't mean to offend anyone, but if you CS degree (at least for the last decade or so), doesn't teach about points 1 and 2 above as part of core curricula, then it's a pretty crappy CS degree. The same is probably also true for other related degrees

Re: approxEqual() has fooled me for a long time...

2010-10-21 Thread Lars T. Kyllingstad
On Wed, 20 Oct 2010 23:19:11 -0500, Andrei Alexandrescu wrote: So here's a plan of attack: 1. Keep feqrel. Clearly it's a useful primitive. 2. Find a more intuitive interface for feqrel, i.e. using decimal digits for precision etc. The definition in std.math: the number of mantissa bits

Re: A quotation from Reddit

2010-10-21 Thread so
These features are must have for a modern language, falling back to a dynamic language for scripting is understandable but reflection? One another thing is the environment you like to work with and this is his real point IMHO. He likes to work in a dynamic typed environment like Python, and

Re: approxEqual() has fooled me for a long time...

2010-10-21 Thread bearophile
Andrei Alexandrescu: 2. Find a more intuitive interface for feqrel, i.e. using decimal digits for precision etc. The definition in std.math: the number of mantissa bits which are equal in x and y loses 90% of the readership at the word mantissa. You want something intuitive that people can

Re: Spec Clarification: Template Alias Parameters

2010-10-21 Thread Steven Schveighoffer
On Wed, 20 Oct 2010 22:03:18 -0400, dsimcha dsim...@yahoo.com wrote: Template alias parameters tend to do some strange stuff when used to alias variables. For example, this works: import std.algorithm, std.stdio; void main() { uint[] arr = [1,2,3,4,5]; uint num = 3; bool

Re: blog: Overlooked Essentials for Optimizing Code

2010-10-21 Thread bearophile
Peter Alexander: I don't really think of CS that way. To me, CS is to practical programming as pure math is to accounting, i.e. I don't think CS should be teaching about profiling because that's what software engineering is for. They are two different worlds in my opinion. If you wanted to

Re: approxEqual() has fooled me for a long time...

2010-10-21 Thread bearophile
If you assume that a reader of those docs may know what the FP mantissa is, ... Sorry, I meant: If you assume that a reader of those docs may not know what the FP mantissa is, ...

@noreturn property

2010-10-21 Thread Iain Buclaw
A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about this. Currently in D2, you must either have a 'return' or 'assert(0)' statement at the end of a function body. It would be nice however if you can give hints

Re: @noreturn property

2010-10-21 Thread Bernard Helyer
Thoughts? I really, really like the idea.

Re: @noreturn property

2010-10-21 Thread bearophile
Iain Buclaw: @noreturn void fatal() { print(Error); exit(1); } See also the same feature in GNU C: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bnoreturn_007d-function-attribute-2455 Bye, bearophile

Re: A summary of D's design principles

2010-10-21 Thread Bruno Medeiros
On 17/09/2010 23:39, retard wrote: Fri, 17 Sep 2010 14:33:30 -0700, Walter Bright wrote: retard wrote: FWIW, if you're picking up one of the most used languages out there, their list won't differ that much: Exactly. Much of that can be summed up as D being intended for professional

Re: @noreturn property

2010-10-21 Thread Lars T. Kyllingstad
On Thu, 21 Oct 2010 11:54:26 +, Iain Buclaw wrote: A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about this. Currently in D2, you must either have a 'return' or 'assert(0)' statement at the end of a

Re: @noreturn property

2010-10-21 Thread Steven Schveighoffer
On Thu, 21 Oct 2010 08:52:35 -0400, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: On Thu, 21 Oct 2010 11:54:26 +, Iain Buclaw wrote: A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about this.

Re: typedef keyword?

2010-10-21 Thread F.Almeida
Extensions to turn typedef into a more useful construct have already been proposed, but discussion on this has not evolved much since. My first, naive, idea was shown here: http://www.digitalmars.com/webnews/newsgroups.php? art_group=digitalmars.Darticle_id=114489 Both the syntax and the rules

Re: @noreturn property

2010-10-21 Thread Iain Buclaw
== Quote from Lars T. Kyllingstad (pub...@kyllingen.nospamnet)'s article On Thu, 21 Oct 2010 11:54:26 +, Iain Buclaw wrote: A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about this. Currently in D2,

Re: @noreturn property

2010-10-21 Thread Lars T. Kyllingstad
On Thu, 21 Oct 2010 09:14:01 -0400, Steven Schveighoffer wrote: On Thu, 21 Oct 2010 08:52:35 -0400, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: On Thu, 21 Oct 2010 11:54:26 +, Iain Buclaw wrote: A few standard library functions, such as 'abort' and 'exit', cannot return.

Re: A summary of D's design principles

2010-10-21 Thread Justin Johansson
On 21/10/2010 11:13 PM, Bruno Medeiros wrote: On 17/09/2010 23:39, retard wrote: Fri, 17 Sep 2010 14:33:30 -0700, Walter Bright wrote: retard wrote: FWIW, if you're picking up one of the most used languages out there, their list won't differ that much: Exactly. Much of that can be summed

Re: A summary of D's design principles

2010-10-21 Thread retard
Thu, 21 Oct 2010 13:13:54 +0100, Bruno Medeiros wrote: On 17/09/2010 23:39, retard wrote: Fri, 17 Sep 2010 14:33:30 -0700, Walter Bright wrote: retard wrote: FWIW, if you're picking up one of the most used languages out there, their list won't differ that much: Exactly. Much of that can

Re: d-mode for Emacs

2010-10-21 Thread Graham Fawcett
On Thu, 21 Oct 2010 08:43:22 +0200, Gour wrote: On Wed, 20 Oct 2010 19:39:12 -0500 Andrei == Andrei Alexandrescu wrote: Andrei If that's feasible, sure! Does anyone know the right people? Afaik, it involves getting written signed papers from all the contributors sent to FSF...iow, it's

Re: @noreturn property

2010-10-21 Thread Justin Johansson
On 21/10/2010 10:54 PM, Iain Buclaw wrote: A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about this. Currently in D2, you must either have a 'return' or 'assert(0)' statement at the end of a function body. It

Re: A summary of D's design principles

2010-10-21 Thread Justin Johansson
On 22/10/2010 12:26 AM, retard wrote: Thu, 21 Oct 2010 13:13:54 +0100, Bruno Medeiros wrote: On 17/09/2010 23:39, retard wrote: Fri, 17 Sep 2010 14:33:30 -0700, Walter Bright wrote: retard wrote: FWIW, if you're picking up one of the most used languages out there, their list won't differ

Re: A summary of D's design principles

2010-10-21 Thread Bruno Medeiros
On 15/09/2010 18:58, Andrei Alexandrescu wrote: A coworker asked me where he could find a brief document of D's design principles. This was after I'd mentioned the no function hijacking stance. I think it would be a great idea if the up-and-coming www.d-programming-language.org contained such a

Re: A summary of D's design principles

2010-10-21 Thread Bruno Medeiros
On 21/10/2010 14:28, Justin Johansson wrote: On 21/10/2010 11:13 PM, Bruno Medeiros wrote: On 17/09/2010 23:39, retard wrote: Fri, 17 Sep 2010 14:33:30 -0700, Walter Bright wrote: retard wrote: FWIW, if you're picking up one of the most used languages out there, their list won't differ that

[debate] About D's pretension for homoiconicicity

2010-10-21 Thread Justin Johansson
Nothing about this subject line is purported to be true or false or otherwise conjectured; the subject is simply proposed as a topic for debate. The formal subject proposed for debate is D's advanced meta-programming capabilities essentially makes it (D) as if it were a homoiconic language, and

Re: @noreturn property

2010-10-21 Thread Daniel Gibson
Leandro Lucarella schrieb: Iain Buclaw, el 21 de octubre a las 11:54 me escribiste: A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about this. Currently in D2, you must either have a 'return' or 'assert(0)'

Duck typing for structs

2010-10-21 Thread Ash Logan
Hello all, I was experimenting with Kenji Hara's interfaces.d, and I thought it would be interesting to be able to adapt not just objects but struct values to an interface. So I came up with a hacky solution, adapter.d, and put it on Google Docs at http://goo.gl/Y7Oa in case anyone is

Re: @noreturn property

2010-10-21 Thread Iain Buclaw
== Quote from Leandro Lucarella (l...@llucax.com.ar)'s article Iain Buclaw, el 21 de octubre a las 11:54 me escribiste: A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about this. Currently in D2, you must

Re: [debate] About D's pretension for homoiconicicity

2010-10-21 Thread Ellery Newcomer
Doo de doo.. *google homoiconic*... program representation is data structure of primitive type of language or somesuch Hm. templates are advance metaprogramming capabilities, string mixins are quite primitive, and ctfe is too immature to say one way or the other. In my mind, the advantage

Re: [debate] About D's pretension for homoiconicicity

2010-10-21 Thread Simen kjaeraas
Justin Johansson n...@spam.com wrote: The formal subject proposed for debate is D's advanced meta-programming capabilities essentially makes it (D) as if it were a homoiconic language, and brings with it all the advantages of homoiconic languages. Hardly true. While it may be possible to

Re: @noreturn property

2010-10-21 Thread Iain Buclaw
== Quote from Daniel Gibson (metalcae...@gmail.com)'s article Leandro Lucarella schrieb: Iain Buclaw, el 21 de octubre a las 11:54 me escribiste: A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about

Re: [debate] About D's pretension for homoiconicicity

2010-10-21 Thread Andrei Alexandrescu
On 10/21/10 9:51 CDT, Justin Johansson wrote: Nothing about this subject line is purported to be true or false or otherwise conjectured; the subject is simply proposed as a topic for debate. The formal subject proposed for debate is D's advanced meta-programming capabilities essentially makes

Re: @noreturn property

2010-10-21 Thread bearophile
Ezneh: I saw something that can be good too about returned values in Nimrod : http://force7.de/nimrod/tut1.html#discard-statement Hope the explanation is sufficient. This way, the programmer knows when he throws away a returned value. I think that could be great too. In C-like languages

Re: Duck typing for structs

2010-10-21 Thread bearophile
Ash Logan: but I wanted to see what the D community thought of it. Just a question. Aren't lines like: if (is(typeof(candidate) == const)) Better as static ifs? Bye, bearophile

Re: A summary of D's design principles

2010-10-21 Thread bearophile
Bruno Medeiros: Rather, the big benefit of the statement above would be to reduce certain wasteful discussions or comments that pop-up occasionally in which someone proposes some Pythonesque change that might benefit small programs but would be crap for medium/large ones. I suggest to

Re: blog: Overlooked Essentials for Optimizing Code

2010-10-21 Thread Rainer Deyke
On 10/21/2010 02:02, Peter Alexander wrote: I don't really think of CS that way. To me, CS is to practical programming as pure math is to accounting, i.e. I don't think CS should be teaching about profiling because that's what software engineering is for. They are two different worlds in my

Re: @noreturn property

2010-10-21 Thread Rainer Deyke
On 10/21/2010 05:54, Iain Buclaw wrote: @noreturn void fatal() { print(Error); exit(1); } Thoughts? This looks wrong to me. 'fatal' returns type 'void', except that it doesn't. I would prefer this: null_type fatal() { print(Error); exit(1); } Here 'null_type' is a type

Re: @noreturn property

2010-10-21 Thread Iain Buclaw
== Quote from Rainer Deyke (rain...@eldwood.com)'s article On 10/21/2010 05:54, Iain Buclaw wrote: @noreturn void fatal() { print(Error); exit(1); } Thoughts? This looks wrong to me. 'fatal' returns type 'void', except that it doesn't. I would prefer this: null_type

Re: @noreturn property

2010-10-21 Thread Andrei Alexandrescu
On 10/21/10 12:21 CDT, Rainer Deyke wrote: Feel free to think of a better name than 'null_type'. It's a theory classic called none or bottom. It's the bottom of the subtyping lattice, the subtype of all possible types, a type that can never be instantiated. The feature is nice to have but

The Language I Wish Go Was

2010-10-21 Thread Walter Bright
http://news.ycombinator.com/item?id=1814887 Some commentary on D there.

Re: @noreturn property

2010-10-21 Thread Leandro Lucarella
Daniel Gibson, el 21 de octubre a las 17:15 me escribiste: You want to include in the language what you can do (or at least could) do in GDC using: pragma(GNU_attribute, noreturn)) void fatal() { print(Error); exit(1); } ? Obviously he wants a portable way to do this

Re: The Language I Wish Go Was

2010-10-21 Thread Juanjo Alvarez
On Thu, 21 Oct 2010 10:51:14 -0700, Walter Bright newshou...@digitalmars.com wrote: http://news.ycombinator.com/item?id=1814887 Some commentary on D there. I always enjoy a good rant about some language. When I'm intrigued by some language rants are the first things I google. I wish

Re: The Language I Wish Go Was

2010-10-21 Thread Adam D. Ruppe
On Thu, Oct 21, 2010 at 09:21:31PM +0200, Juanjo Alvarez wrote: I wish Go, sorry, D had named arguments too. Its a simple feature that nuke a trunkload of function overloading. Would a solution like this be acceptable to you? void func(int a, int b) {} call!(func, a, 10, b, 20); Doing

Re: approxEqual() has fooled me for a long time...

2010-10-21 Thread Walter Bright
Robert Jacques wrote: Since D has the is operator, does it make sense to actually 'fix' == to be fuzzy? I don't think so, because nobody will ever agree on what fuzzy means. Arbitrarily setting a meaning for it will perpetuate the notion that floating point operations have seemingly random

Re: A quotation from Reddit

2010-10-21 Thread Paulo Pinto
Why? There are many static languages that support reflection, plugin systems and meta-objects. Actually one of my disapointments with D was that after reading the TDPL I did not found any example of such features in D. -- Paulo so s...@so.do wrote in message news:op.vkw5qztw7dt...@so-pc...

Re: The Next Big Language

2010-10-21 Thread Paulo Pinto
Sorry but I still don't get it. Do you mean that the types that erased and the same code is generated? Then let me say that .Net generics get generated on the fly and JITed for each different type. Eiffel and Modula-3 generics also have specific generated code for each type. The major

Re: The Language I Wish Go Was

2010-10-21 Thread bearophile
Juanjo Alvarez: I wish Go, sorry, D had named arguments too. Its a simple feature that nuke a trunkload of function overloading. I use named arguments every day in Python, they make the code more readable and safer at the calling point, because there's less risk of passing wrong data. And

Re: The Next Big Language

2010-10-21 Thread Gary Whatmore
What's the difference between: type polymorphism parametric polymorphism ad-hoc polymorphism generics c++ templates d style templates other templates (are there?) Does Java and C# have type polymorphism or generics or templates? What's the real name and how to compare? Is D most expressive? I

Re: The Next Big Language

2010-10-21 Thread Gary Whatmore
I forgot Scala. They say Scala can @specialize without type erasure and it has variance polymorphism. What are these? Sounds as if Scala is getting closer to C++/D (instantiation and link-time optimization) and we need to fight back to make our language more expressive. - G.W. Gary Whatmore

Re: The Next Big Language

2010-10-21 Thread Simen kjaeraas
Paulo Pinto pj...@progtools.org wrote: Sorry but I still don't get it. Do you mean that the types that erased and the same code is generated? Then let me say that .Net generics get generated on the fly and JITed for each different type. Eiffel and Modula-3 generics also have specific

Re: The Next Big Language

2010-10-21 Thread bearophile
Gary Whatmore: I forgot Scala. They say Scala can @specialize without type erasure and it has variance polymorphism. What are these? Sounds as if Scala is getting closer to C++/D (instantiation and link-time optimization) and we need to fight back to make our language more expressive.

Re: The Language I Wish Go Was

2010-10-21 Thread Juanjo Alvarez
On Thu, 21 Oct 2010 15:45:55 -0400, bearophile bearophileh...@lycos.com wrote: On the other hand, currently there are many D2 features that are unfinished and buggy, so adding even more stuff is not a good idea. And I think named arguments are a purely additive change. So Walter may add them

Re: A summary of D's design principles

2010-10-21 Thread Juanjo Alvarez
On Thu, 21 Oct 2010 15:26:14 +0100, Bruno Medeiros brunodomedeiros+s...@com.gmail wrote: * And as for what D programmers think of other languages, well, it seems I guess D view of C++ could be rendered as an alcoholic father while D view of C++ would be a fashion victim son.

Re: The Language I Wish Go Was

2010-10-21 Thread bearophile
Juanjo Alvarez: expanding a dictionary as named arguments to a function is pretty useful too, but since in D's hashes the values must be of the same type for a declared hash it would be less useful, except for Variant[string] hashes maybe, which is a little convoluted. In D2 there are

Re: [debate] About D's pretension for homoiconicicity

2010-10-21 Thread Nick Sabalausky
Ellery Newcomer ellery-newco...@utulsa.edu wrote in message news:i9pnta$21...@digitalmars.com... Then there's the fact that the compiler doesn't represent code as strings. If the compiler exposed the AST, all this might be less of an issue. ASTs aren't a primitive type, but D's library

Re: @noreturn property

2010-10-21 Thread Nick Sabalausky
Iain Buclaw ibuc...@ubuntu.com wrote in message news:i9p9li$282...@digitalmars.com... A few standard library functions, such as 'abort' and 'exit', cannot return. However there is no way in DMD to let the compiler know about this. Currently in D2, you must either have a 'return' or 'assert(0)'

Re: @noreturn property

2010-10-21 Thread bearophile
Nick Sabalausky: One of the nice things about that is you don't have to provide a fake return type. For instance, with your @noreturn: @noreturn int foo() would be legal, but wouldn't make any sence. And in a way, even @noreturn void foo() isn't great since a void return value suggests

Looking for champion - std.lang.d.lex

2010-10-21 Thread Walter Bright
As we all know, tool support is important for D's success. Making tools easier to build will help with that. To that end, I think we need a lexer for the standard library - std.lang.d.lex. It would be helpful in writing color syntax highlighting filters, pretty printers, repl, doc generators,

Re: struct field alignment

2010-10-21 Thread Trass3r
http://www.digitalmars.com/d/2.0/attribute.html#align Over time, it has become clear to me that there are only two useful alignments: align // set to whatever the C ABI alignment is align(1) // pack everything in, no alignment padding I think any other alignments should be

Re: Looking for champion - std.lang.d.lex

2010-10-21 Thread Ellery Newcomer
and how about 6. ctfe compatible ?

Re: The Next Big Language

2010-10-21 Thread retard
Thu, 21 Oct 2010 16:00:11 -0400, Gary Whatmore wrote: What's the difference between: type polymorphism parametric polymorphism ad-hoc polymorphism generics c++ templates d style templates other templates (are there?) Does Java and C# have type polymorphism or generics or templates?

Re: The Next Big Language

2010-10-21 Thread retard
Thu, 21 Oct 2010 22:26:20 +, retard wrote: Thu, 21 Oct 2010 16:00:11 -0400, Gary Whatmore wrote: What's the difference between: type polymorphism parametric polymorphism ad-hoc polymorphism generics c++ templates d style templates other templates (are there?) Does Java and C#

How to work with an arbitrary input range?

2010-10-21 Thread Adam D. Ruppe
I've seen the requirement tossed around a few times that functions should work with arbitrary input ranges. What, exactly, does this mean? My first impression is: void myFunction(T)(T t) if(isInputRange!(T)) {} But I don't see how that actually works in practice. Suppose my function parses

Re: Associative array .get with .init as default second argument

2010-10-21 Thread Torarin
2010/10/18 bearophile bearophileh...@lycos.com: In what cases is this useful? Are you able to show me an example of situation where it is useful? Bye, bearophile Bearophile, I probably didn't make it very clear, so I'll try again: Now: if (headers.get(transfer-encoding, ) == chunked)

Re: @noreturn property

2010-10-21 Thread Leandro Lucarella
bearophile, el 21 de octubre a las 17:35 me escribiste: Nick Sabalausky: One of the nice things about that is you don't have to provide a fake return type. For instance, with your @noreturn: @noreturn int foo() would be legal, but wouldn't make any sence. And in a way, even @noreturn

Re: Duck typing for structs

2010-10-21 Thread Ash Logan
On 10/21/2010 12:58 PM, bearophile wrote: Just a question. Aren't lines like: if (is(typeof(candidate) == const)) Better as static ifs? Bye, bearophile Probably they are; this was my first try at compile-time functions, and while writing it I kept crossing the line between what could and

Re: Looking for champion - std.lang.d.lex

2010-10-21 Thread Jonathan M Davis
On Thursday, October 21, 2010 15:01:21 Walter Bright wrote: As we all know, tool support is important for D's success. Making tools easier to build will help with that. To that end, I think we need a lexer for the standard library - std.lang.d.lex. It would be helpful in writing color syntax

Re: The Next Big Language

2010-10-21 Thread bearophile
retard: - Complex integer types: Just L. - Safety features: it misses integral overflow tests and static contract checking (and many other things done by C lint tools, etc). - Evaluation strategies: by need was present, but I think it's now deprecated. - Polymorphism: template template

Re: The Next Big Language

2010-10-21 Thread retard
Thu, 21 Oct 2010 19:30:50 -0400, bearophile wrote: retard: - Safety features: it misses integral overflow tests and static contract checking (and many other things done by C lint tools, etc). The list was describing the type system of the language. I can't agree these are all part of the

Re: The Next Big Language

2010-10-21 Thread retard
Thu, 21 Oct 2010 19:30:50 -0400, bearophile wrote: retard: - Complex integer types: Just L. - Safety features: it misses integral overflow tests and static contract checking (and many other things done by C lint tools, etc). - Evaluation strategies: by need was present, but I think it's

Re: The Next Big Language

2010-10-21 Thread Jonathan M Davis
On Thursday, October 21, 2010 12:45:32 Paulo Pinto wrote: Sorry but I still don't get it. Do you mean that the types that erased and the same code is generated? Then let me say that .Net generics get generated on the fly and JITed for each different type. Eiffel and Modula-3 generics

Re: Looking for champion - std.lang.d.lex

2010-10-21 Thread bearophile
Jonathan M Davis: So, as long as you're not in a hurry, I'm up for it, but I can't guarantee anything even approaching fast delivery. You may open the project here: http://github.com/ And then other people may help you along the way. Bye, bearophile

Re: How to work with an arbitrary input range?

2010-10-21 Thread Simen kjaeraas
Adam D. Ruppe destructiona...@gmail.com wrote: [snip] Anyway, what's the right thing to do here? I'd say: void fun( T )( T t ) if ( isInputRange!T is( ElementType!T == dchar ) ) {} -- Simen

Re: The Next Big Language

2010-10-21 Thread retard
Thu, 21 Oct 2010 16:51:03 -0700, Jonathan M Davis wrote: Now, as I said, C++ and D are the only languages I know of which use templates. That doesn't mean that other languages do not. Looking at the wikipedia page on template metaprogramming, it lists other languages such as Eiffel and ML, so

Re: @noreturn property

2010-10-21 Thread Iain Buclaw
== Quote from Leandro Lucarella (l...@llucax.com.ar)'s article bearophile, el 21 de octubre a las 17:35 me escribiste: Nick Sabalausky: One of the nice things about that is you don't have to provide a fake return type. For instance, with your @noreturn: @noreturn int foo() would be

Re: How to work with an arbitrary input range?

2010-10-21 Thread Jonathan M Davis
On Thursday, October 21, 2010 16:56:48 Simen kjaeraas wrote: Adam D. Ruppe destructiona...@gmail.com wrote: [snip] Anyway, what's the right thing to do here? I'd say: void fun( T )( T t ) if ( isInputRange!T is( ElementType!T == dchar ) ) {} Though I'd suggest using

Re: How to work with an arbitrary input range?

2010-10-21 Thread Jonathan M Davis
On Thursday, October 21, 2010 15:32:45 Adam D. Ruppe wrote: I've seen the requirement tossed around a few times that functions should work with arbitrary input ranges. What, exactly, does this mean? My first impression is: void myFunction(T)(T t) if(isInputRange!(T)) {} But I don't

Re: How to work with an arbitrary input range?

2010-10-21 Thread Simen kjaeraas
Jonathan M Davis jmdavisp...@gmx.com wrote: void fun( T )( T t ) if ( isInputRange!T is( ElementType!T == dchar ) ) {} Though I'd suggest using Unqual!(ElementType!T). You're right, of course. -- Simen

Re: The Next Big Language

2010-10-21 Thread Jonathan M Davis
On Thursday, October 21, 2010 17:05:45 retard wrote: Thu, 21 Oct 2010 16:51:03 -0700, Jonathan M Davis wrote: Now, as I said, C++ and D are the only languages I know of which use templates. That doesn't mean that other languages do not. Looking at the wikipedia page on template

Re: Looking for champion - std.lang.d.lex

2010-10-21 Thread Russel Winder
On Thu, 2010-10-21 at 19:51 -0400, bearophile wrote: Jonathan M Davis: So, as long as you're not in a hurry, I'm up for it, but I can't guarantee anything even approaching fast delivery. You may open the project here: http://github.com/ And then other people may help you along the

Re: Looking for champion - std.lang.d.lex

2010-10-21 Thread Jonathan M Davis
On Thursday, October 21, 2010 17:24:34 Russel Winder wrote: On Thu, 2010-10-21 at 19:51 -0400, bearophile wrote: Jonathan M Davis: So, as long as you're not in a hurry, I'm up for it, but I can't guarantee anything even approaching fast delivery. You may open the project here:

Re: How to work with an arbitrary input range?

2010-10-21 Thread Andrei Alexandrescu
On 10/21/10 17:32 CDT, Adam D. Ruppe wrote: I've seen the requirement tossed around a few times that functions should work with arbitrary input ranges. What, exactly, does this mean? My first impression is: void myFunction(T)(T t) if(isInputRange!(T)) {} But I don't see how that actually

Re: How to work with an arbitrary input range?

2010-10-21 Thread Jonathan M Davis
On Thursday, October 21, 2010 17:13:32 Simen kjaeraas wrote: Jonathan M Davis jmdavisp...@gmx.com wrote: void fun( T )( T t ) if ( isInputRange!T is( ElementType!T == dchar ) ) {} Though I'd suggest using Unqual!(ElementType!T). You're right, of course. It can be quite baffling to

Simple @tagged attribute for unions

2010-10-21 Thread bearophile
I have suggested yet another attribute, @tagged: http://d.puremagic.com/issues/show_bug.cgi?id=5097 Bye, bearophile

Re: @noreturn property

2010-10-21 Thread Rainer Deyke
On 10/21/2010 11:37, Iain Buclaw wrote: Not sure what you mean when you say that void has only one possible value. To me, 'void' for a function means something that does not return any value (or result). Are you perhaps confusing it with to, lets say an 'int' function that is marked as

Re: struct field alignment

2010-10-21 Thread Robert Jacques
On Sun, 17 Oct 2010 23:38:34 -0400, Walter Bright newshou...@digitalmars.com wrote: Robert Jacques wrote: Although I have a solution that works well for me, the one thing I lament about not having a canonical D way of expression align(8)/align(16), even at only a meta-information level,

Re: Simple @tagged attribute for unions

2010-10-21 Thread Andrei Alexandrescu
On 10/21/2010 08:41 PM, bearophile wrote: I have suggested yet another attribute, @tagged: http://d.puremagic.com/issues/show_bug.cgi?id=5097 Bye, bearophile And almost exactly six hours ago: On the other hand, currently there are many D2 features that are unfinished and buggy, so adding

Re: The Next Big Language

2010-10-21 Thread Walter Bright
retard wrote: Thu, 21 Oct 2010 19:30:50 -0400, bearophile wrote: retard: - Safety features: it misses integral overflow tests and static contract checking (and many other things done by C lint tools, etc). The list was describing the type system of the language. I can't agree these are all

Re: Simple @tagged attribute for unions

2010-10-21 Thread Jonathan M Davis
On Thursday 21 October 2010 20:04:16 Andrei Alexandrescu wrote: On 10/21/2010 08:41 PM, bearophile wrote: I have suggested yet another attribute, @tagged: http://d.puremagic.com/issues/show_bug.cgi?id=5097 Bye, bearophile And almost exactly six hours ago: On the other hand,

Re: Looking for champion - std.lang.d.lex

2010-10-21 Thread Walter Bright
Jonathan M Davis wrote: You mean that you're going to make someone actually pull out their compiler book? ;) Not really, you can just use the dmd lexer source as a guide. Should be straightforward. So, as long as you're not in a hurry, I'm up for it, but I can't guarantee anything even

Re: Looking for champion - std.lang.d.lex

2010-10-21 Thread Jonathan M Davis
On Thursday 21 October 2010 15:01:21 Walter Bright wrote: 5. generally follow along with the C++ one so that they can be maintained in tandem Does this mean that you want a pseudo-port of the C++ front end's lexer to D for this? Or are you looking for just certain pieces of it to be similar?

Re: Looking for champion - std.lang.d.lex

2010-10-21 Thread Jonathan M Davis
On Thursday 21 October 2010 15:12:41 Ellery Newcomer wrote: and how about 6. ctfe compatible ? That would seem like a good idea (though part of me cringes at the idea of a program specifically running the lexer (and possibly the parser) as part of its own compilation process), but for

Re: The Next Big Language

2010-10-21 Thread Paulo Pinto
I can get the same benefict from functional languages+generics, or dynamic languages. Simen kjaeraas simen.kja...@gmail.com wrote in message news:op.vkxy6xx2vxi...@biotronic-pc.lan... Paulo Pinto pj...@progtools.org wrote: Sorry but I still don't get it. Do you mean that the types that

Re: The Next Big Language

2010-10-21 Thread Jonathan M Davis
On Thursday 21 October 2010 22:42:47 Paulo Pinto wrote: I can get the same benefict from functional languages+generics, or dynamic languages. lisp macros aside, I've never seen anything that could ever come close to D templates in terms of their flexiblity and power for code generation. I'm

Re: Building dwt2 (DMD2 + Windows)

2010-10-21 Thread Jacob Carlborg
On 2010-10-21 11:54, Sam Hu wrote: torhu Wrote: It's not possible to build the whole thing yet, I just use xfbuild to build instead of the rakefile. Only the Windows code is updated for D2. Is anybody here getting the dwt for D2 workable already? I haven't managed to build DWT with D2.

  1   2   >