On 2011-09-22 22:54, Andrei Alexandrescu wrote:
On 9/21/11 5:17 PM, Walter Bright wrote:
I've collected a few from various languages for comparison:
[snip]
I think we should do the following:
1. Introduce a new token "=>"
2. Add this rewrite to the grammar:
symbol => expression
translates
On 2011-09-22 23:08, bearophile wrote:
Andrei Alexandrescu:
A function literal should be comparable to another for equality.
Are you willing to explain me why, and show an use case?
Bye,
bearophile
When using lambdas as event handlers:
class Foo
{
event[] events;
void registerEve
"Jacob Carlborg" wrote in message
news:j5h98l$ors$1...@digitalmars.com...
> What I'm saying is that you can ignore the returned value of a delegate
> therefore I think it should be possible implicitly convert a delegate
> returning a value, to a delegate returning void. The same for function
>
On 2011-09-22 23:46, Walter Bright wrote:
On 9/22/2011 1:13 PM, Jacob Carlborg wrote:
I function/delegate that returns a value should be implicitly
converted to a
function/delegate that returns void.
That doesn't work in some cases - consider a function that returns an
object that the caller
Robert Jacques:
> What I worry about though is variable hijacking rules. e.g.
>
> auto b = 5;
> reduce!\a+b(map!\a+b([1,2,3,4));
Right, it's a bit too much magical and inflexible for my taste.
bye,
bearophile
On 9/22/2011 4:39 AM, bearophile wrote:
Walter:
You're right. Logical const is only a convention, since it cannot be
enforced by the compiler.
Even if it can't be enforced in 100% of the cases, I think it's still useful.
So you need to look at the situation from a bit wider point of view.
I
"Andrei Alexandrescu" wrote in message
news:j5gv0j$825$1...@digitalmars.com...
> http://www.reddit.com/r/programming/comments/kooiy/dangling_else_yet_again/
>
> Andrei
"It works by keeping track of any lexically enclosing statement that is
looking for an else clause, so if an else clause is fou
On Thu, 22 Sep 2011 18:59:31 -0400, Jason House
wrote:
std.algorithm already introduces a sort of lambda syntax...
map!"a+b"(...) or map!q{a+b}(...)
If D is looking for its own style of short lambda, maybe implicit use of a and
b could be extended.
Candidates:
a+b
{a+b}
f{a+b}
auto{a+b}
auto
Okay. The review period for the region allocator is over (actually, it was
over about 2 days ago, but I've been busy and forgot to post about it). So,
the question is: Is it ready for a vote, or does it need further revision and
review?
Looking over the thread, it's not at all clear to me that
On 9/22/11 9:11 PM, so wrote:
On Fri, 23 Sep 2011 02:40:11 +0300, Andrei Alexandrescu
wrote:
On 9/22/11 6:00 PM, so wrote:
On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu
wrote:
I think we should put swizzle in std.numeric once and for all. Is
anyone interested in taking up that ta
http://www.reddit.com/r/programming/comments/kooiy/dangling_else_yet_again/
Andrei
On Fri, 23 Sep 2011 02:40:11 +0300, Andrei Alexandrescu
wrote:
On 9/22/11 6:00 PM, so wrote:
On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu
wrote:
I think we should put swizzle in std.numeric once and for all. Is
anyone interested in taking up that task?
You mean some helper fu
On 09/22/2011 01:17 AM, Walter Bright wrote:
I've collected a few from various languages for comparison:
D
(a,b) { return a + b; }
I prefer to make "return" optional as the argument type
Timon Gehr:
> Furthermore, DMD does not do any advanced optimizations
In Haskell there are ways to add library-defined optimizations, with rewrite
rules:
http://www.haskell.org/haskellwiki/Playing_by_the_rules
http://www.haskell.org/haskellwiki/GHC/Using_rules
There are also papers about this.
You might wan to play with GC.reserve.
Sent from my iPhone
On Sep 22, 2011, at 4:35 PM, Timon Gehr wrote:
> On 09/22/2011 02:29 PM, Christophe wrote:
>> "Nick Sabalausky" , dans le message (digitalmars.D:145002), a écrit :
For example, in Haskell, map (correctly) has the signature:
On 09/22/2011 11:46 PM, Walter Bright wrote:
On 9/22/2011 1:13 PM, Jacob Carlborg wrote:
I function/delegate that returns a value should be implicitly
converted to a
function/delegate that returns void.
That doesn't work in some cases - consider a function that returns an
object that the call
On 9/22/11 6:00 PM, so wrote:
On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu
wrote:
I think we should put swizzle in std.numeric once and for all. Is
anyone interested in taking up that task?
You mean some helper functions to be used in user structures?
I was thinking of a templat
On 09/22/2011 02:29 PM, Christophe wrote:
"Nick Sabalausky" , dans le message (digitalmars.D:145002), a écrit :
For example, in Haskell, map (correctly) has the signature:
map :: (a -> b) -> [a] -> [b]
but in D, std.map has the signature (expressed in some Haskell/D
pseudocode)
map :: (a -
On Fri, 23 Sep 2011 02:00:50 +0300, so wrote:
It refuses to except a few things which i think it should.
accept...
On Thu, 22 Sep 2011 17:07:25 +0300, Andrei Alexandrescu
wrote:
I think we should put swizzle in std.numeric once and for all. Is anyone
interested in taking up that task?
You mean some helper functions to be used in user structures? Because i
don't know of any structure in std.numerics t
std.algorithm already introduces a sort of lambda syntax...
map!"a+b"(...) or map!q{a+b}(...)
If D is looking for its own style of short lambda, maybe implicit use of a and
b could be extended.
Candidates:
a+b
{a+b}
f{a+b}
auto{a+b}
auto a+b
Personally, I like the 2nd or 3rd one. The second is v
On 09/22/11 16:08, bearophile wrote:
Andrei Alexandrescu:
A function literal should be comparable to another for equality.
Are you willing to explain me why, and show an use case?
An important application is optimizing for specific lambdas (e.g.
equality). For example, a substring search u
On Thursday, September 22, 2011 14:47 Andrei Alexandrescu wrote:
> On 9/22/11 4:13 PM, dsimcha wrote:
> > I'd much rather see the bugs in the current lambda syntax get fixed (e.g.
> > http://d.puremagic.com/issues/show_bug.cgi?id=4724) rather than spend
> > more time bikeshedding.
>
> That's not a
On 9/22/11 4:13 PM, dsimcha wrote:
I'd much rather see the bugs in the current lambda syntax get fixed (e.g.
http://d.puremagic.com/issues/show_bug.cgi?id=4724) rather than spend more time
bikeshedding.
That's not an either-or choice, and of course improving current lambdas
(btw that's not a p
On 9/22/2011 1:13 PM, Jacob Carlborg wrote:
I function/delegate that returns a value should be implicitly converted to a
function/delegate that returns void.
That doesn't work in some cases - consider a function that returns an object
that the caller must destruct. Or even just returns a stru
On 9/22/2011 2:03 PM, Steven Schveighoffer wrote:
On Thu, 22 Sep 2011 16:54:55 -0400, Andrei Alexandrescu
wrote:
4. Add this rewrite to the grammar:
(comma_separated_parms) => expression
translates to
(comma_separated_parms) => expression
Am I missing something here?
I like easy rewrit
---
Cristi Cobzarenco
BSc in Artificial Intelligence and Computer Science
University of Edinburgh
Profile: http://www.google.com/profiles/cristi.cobzarenco
On 22 September 2011 22:03, Steven Schveighoffer wrote:
> On Thu, 22 Sep 2011 16:54:55 -0400, Andrei Alexandrescu
> wrote:
>
>
>> 4. Add t
On 9/22/11 4:03 PM, Steven Schveighoffer wrote:
On Thu, 22 Sep 2011 16:54:55 -0400, Andrei Alexandrescu
wrote:
4. Add this rewrite to the grammar:
(comma_separated_parms) => expression
translates to
(comma_separated_parms) => expression
Am I missing something here?
I am. The rewrite sh
Denis Shelomovskij:
> Is it? Every conditional branch can break CPU command queue and slow
> down execution. Anyway, I saw same problem not far-away (2^n sized
> OpenGL textures).
Hours ago Don has written a comment in one of my enhancement requests that is
related to this topic:
http://d.pure
Andrei Alexandrescu:
I have missed to answer a small part:
> On 9/21/11 5:22 PM, bearophile wrote:
> > This is why I have asked for functions like amap/afilter in Phobos,
> > because in many situations in D you need an array instead of a lazy
> > range.
>
> I don't think that was being asked.
I
I'd much rather see the bugs in the current lambda syntax get fixed (e.g.
http://d.puremagic.com/issues/show_bug.cgi?id=4724) rather than spend more time
bikeshedding.
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
> On 9/21/11 5:17 PM, Walter Bright wrote:
> > I've co
Andrei Alexandrescu:
> A function literal should be comparable to another for equality.
Are you willing to explain me why, and show an use case?
Bye,
bearophile
On Thu, 22 Sep 2011 16:54:55 -0400, Andrei Alexandrescu
wrote:
4. Add this rewrite to the grammar:
(comma_separated_parms) => expression
translates to
(comma_separated_parms) => expression
Am I missing something here?
-Steve
On 9/22/11 3:54 PM, Andrei Alexandrescu wrote:
On 9/21/11 5:17 PM, Walter Bright wrote:
I've collected a few from various languages for comparison:
[snip]
I think we should do the following:
[snip]
I can't believe I forgot an all-important aspect.
A function literal should be comparable to
On 9/21/11 5:17 PM, Walter Bright wrote:
I've collected a few from various languages for comparison:
[snip]
I think we should do the following:
1. Introduce a new token "=>"
2. Add this rewrite to the grammar:
symbol => expression
translates to
(symbol) { return expression; }
3. Add this
or ldc, I thought that could also compile d2
LLVM still doesn't support SEH, though it's being worked on.
On 2011-09-22 18:06, Andrei Alexandrescu wrote:
On 9/22/11 10:42 AM, pillsy wrote:
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s
article
On 9/22/11 1:47 AM, Max Klyga wrote:
Actually Scala doesn't need type declarations in labmda literals. Most
of the time argument types
Andrei Alexandrescu wrote:
> On 9/22/11 10:42 AM, pillsy wrote:
>> == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s
>> article
>>> On 9/22/11 1:47 AM, Max Klyga wrote:
Actually Scala doesn't need type declarations in labmda literals. Most
of the time argument types are
or ldc, I thought that could also compile d2
2011/9/22 Trass3r
> Currently you have to use GDC.
>
Currently you have to use GDC.
Is it posiible to dump AST for given D source file (like "clang++ -cc1
-ast-dump myCoolSrc.cpp", for example)?
On Thursday, September 22, 2011 19:38:25 mok-kong shen wrote:
> I just read that D fits nicely to the 64-bit architecture. Is there
> currently a D compiler that fully exploits the 64-bit hardware under
> Windows 7? I mean e.g. one can have operations in D on unsigned long int of
> 64 bits size tha
I just read that D fits nicely to the 64-bit architecture. Is there currently
a D compiler that fully exploits the 64-bit hardware under Windows 7? I mean
e.g. one can have operations in D on unsigned long int of 64 bits size that
correspond directly to hardware operations so as to achieve high eff
On 21/09/11 6:41 PM, bearophile wrote:
Gor Gyolchanyan:
I'm ready to donate money to sponsor an ad campaign.
Advertising has to be done at the right time and rhythm. Too little and no one
knows you, too much and you risk wasting the single opportunity certain persons
will give you. D doesn'
On 9/22/2011 9:06 AM, Andrei Alexandrescu wrote:
On 9/22/11 10:42 AM, pillsy wrote:
_1 + _2
I'm not exactly a D template metaprogramming pro, but I think this would work
for a lot of common cases.
Such an approach has caused more trouble than benefits in C++.
Besides just looking awfully ha
On 9/22/2011 4:36 AM, Timon Gehr wrote:
Indeed, but it currently only works if the delegate literal is a template
parameter, in which case the literal is actually fully generic, right?
It gets internally rewritten into being a template function.
On 9/22/2011 5:11 AM, a wrote:
It also seems that the compiler
doesn't inline functions containing asm.
That's correct, it currently does not.
Am 22.09.2011, 19:26 Uhr, schrieb Peter Alexander
:
On 22/09/11 7:39 AM, Don wrote:
On 22.09.2011 05:24, a wrote:
How would one do something like this without intrinsics (the code is
c++ using
gcc vector extensions):
[snip]
At present, you can't do it without ultimately resorting to inline
On 22.09.2011 1:53, Timon Gehr wrote:
On 09/21/2011 11:11 PM, Andrei Alexandrescu wrote:
On 9/21/11 3:34 PM, Peter Alexander wrote:
What if foo is a virtual member function? Those can't be templates.
Then it would need to take a dynamic Range as parameter, parameterized
with the element type.
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
> On 9/22/11 10:42 AM, pillsy wrote:
> > == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
[...]
> >> Already does. We're looking for a briefer syntax.
> > What is the problem with just inferring
On 22/09/11 1:38 AM, Walter Bright wrote:
D doesn't have __restrict. I'm going to argue that it is unnecessary.
AFAIK, __restrict is most used in writing vector operations. D, on the
other hand, has a dedicated vector operation syntax:
a[] += b[] * c;
where a[] and b[] are required to not be ov
On 21/09/11 6:15 PM, Mehrdad wrote:
I can't find the thread, but I remember someone (bearophile?) mentioned
that the reason we have transitive const is to support purity.
I don't think I understand why this is necessary, though -- could
someone please explain why we have transitive const, and wh
On 22/09/11 7:39 AM, Don wrote:
On 22.09.2011 05:24, a wrote:
How would one do something like this without intrinsics (the code is
c++ using
gcc vector extensions):
[snip]
At present, you can't do it without ultimately resorting to inline asm.
But, what we've done is to move SIMD into the mach
Jacob Carlborg Wrote:
> * Inferred parameter types
> * Automatically return the last expression
> * No need for ending with a semicolon
> * One line lambdas can omit the braces
>
> Note that Scala can infer the parameter types.
>
> An additional question, do we want/need a new syntax for declari
On 22/09/11 1:34 PM, Vladimir Panteleev wrote:
On Thu, 22 Sep 2011 11:02:27 +0300, Peter Alexander
wrote:
Thanks for the reddit'ing. I launched up google analytics this morning
and noticed a sudden spike. That could only mean one thing :-)
I tried adding your blog to Planet D, but I can't fi
Andrei Alexandrescu:
> Yes :o). http://d.puremagic.com/issues/show_bug.cgi?id=6714
Thank you for adding it, and sorry for not filing it myself in past.
Bye,
bearophile
On 22/09/11 12:39 PM, bearophile wrote:
Andrei Alexandrescu:
The initial submission got junked so I resubmitted:
http://www.reddit.com/r/programming/comments/knn5p/thoughts_on_immutability_in_d/
A logical const can coexist beside the other two (three) kinds of const of D. For
simplicity I u
On 2011/09/23 1:11, Benjamin Thaut wrote:
Is there a way to get a type tuple of all aviable constructors in a class?
class Test {
public:
this(Foo foo){
m_foo = foo;
}
this(bool flop){
}
this(int x, int y){
}
}
For this class I would expect something like ((Foo),(bool),(int,int))
$ cat test
I'm thinking the best way to translate C headers is to run it
through a string processor instead of a compiler.
There's some places where I want the compiler - especially figuring
out the values of some constants - but usually, when translating
C headers, I just copy/paste and find/replace.
Is there a way to get a type tuple of all aviable constructors in a class?
class Test {
public:
this(Foo foo){
m_foo = foo;
}
this(bool flop){
}
this(int x, int y){
}
}
For this class I would expect something like ((Foo),(bool),(int,int))
--
Kind Regards
Benjami
On 9/22/11 10:42 AM, pillsy wrote:
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
On 9/22/11 1:47 AM, Max Klyga wrote:
Actually Scala doesn't need type declarations in labmda literals. Most
of the time argument types are infered.
Already does. We're looking for a
Ideally, you also want to simply convert #ifdefs to static ifs as well. It's
details like this that have convinced me I can manually convert headers in less
time than it takes me to manually post-process the result of an automatic
translator. Sad.
Sent from my iPhone
On Sep 21, 2011, at 2:33
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
> On 9/22/11 1:47 AM, Max Klyga wrote:
> > Actually Scala doesn't need type declarations in labmda literals. Most
> > of the time argument types are infered.
> Already does. We're looking for a briefer syntax.
What is the
Am 22.09.2011, 08:39 Uhr, schrieb Don :
On 22.09.2011 05:24, a wrote:
How would one do something like this without intrinsics (the code is
c++ using
gcc vector extensions):
[snip]
At present, you can't do it without ultimately resorting to inline asm.
But, what we've done is to move SIMD
On Wed, 21 Sep 2011 16:02:53 -0400, Andrei Alexandrescu
wrote:
On 9/21/11 1:49 PM, Don wrote:
On 19.09.2011 18:12, Andrei Alexandrescu wrote:
On 9/19/11 10:46 AM, Robert Jacques wrote:
So, on balance, I'd say the two pointers representation is categorically
worse than the fat pointer represe
On 9/22/11 9:17 AM, Jacob Carlborg wrote:
void foo (int delegate (int, int) a){}
void main ()
{
foo((a, b) { return a +b;});
}
Results in:
main.d(48): Error: undefined identifier a
main.d(48): Error: undefined identifier b
main.d(48): Error: function main.foo (int delegate(int, int) a) is not
On 2011-09-22 16:11, Andrei Alexandrescu wrote:
On 9/22/11 3:49 AM, Jacob Carlborg wrote:
On 2011-09-22 00:50, Andrei Alexandrescu wrote:
On 9/21/11 5:29 PM, bearophile wrote:
Walter Bright:
D
(a,b) { return a + b; }
In D to define a true lambda you need types too:
auto f = (int a,int b){
On 9/22/11 3:49 AM, Jacob Carlborg wrote:
On 2011-09-22 00:50, Andrei Alexandrescu wrote:
On 9/21/11 5:29 PM, bearophile wrote:
Walter Bright:
D
(a,b) { return a + b; }
In D to define a true lambda you need types too:
auto f = (int a,int b){ return a + b; };
No.
Andrei
void foo (int de
On 9/22/11 3:02 AM, Peter Alexander wrote:
On 22/09/11 7:04 AM, Andrei Alexandrescu wrote:
The initial submission got junked so I resubmitted:
http://www.reddit.com/r/programming/comments/knn5p/thoughts_on_immutability_in_d/
Andrei
Thanks for the reddit'ing. I launched up google analytics t
On 9/22/11 1:47 AM, Max Klyga wrote:
Actually Scala doesn't need type declarations in labmda literals. Most
of the time argument types are infered.
Already does. We're looking for a briefer syntax.
Andrei
On 9/22/11 1:39 AM, Don wrote:
On 22.09.2011 05:24, a wrote:
How would one do something like this without intrinsics (the code is
c++ using
gcc vector extensions):
[snip]
At present, you can't do it without ultimately resorting to inline asm.
But, what we've done is to move SIMD into the machi
On 9/22/11 2:35 AM, Walter Bright wrote:
On 9/21/2011 11:47 PM, Max Klyga wrote:
It would be awesome if D infered argument types
for labdas too.
It does, and it is awesome!
C++'s lambdas require the types to be present, which some consider a
large mistake.
Andrei
== Auszug aus Walter Bright (newshou...@digitalmars.com)'s Artikel
> On 9/21/2011 10:56 PM, Benjamin Thaut wrote:
> > Even if I manually allocate v1,v2 and result, the temporary variable that
> > the
> > compiler uses to compute the expression might be unaligned.
> > That is a total killer for SSE
On Thu, 22 Sep 2011 11:02:27 +0300, Peter Alexander
wrote:
Thanks for the reddit'ing. I launched up google analytics this morning
and noticed a sudden spike. That could only mean one thing :-)
I tried adding your blog to Planet D, but I can't figure out how to get an
RSS feed of the D catego
"Nick Sabalausky" , dans le message (digitalmars.D:145002), a écrit :
>> For example, in Haskell, map (correctly) has the signature:
>>
>> map :: (a -> b) -> [a] -> [b]
>>
>> but in D, std.map has the signature (expressed in some Haskell/D
>> pseudocode)
>>
>> map :: (a -> b) -> [a] -> Map!((a ->
> which compiles to a single shufps instruction.
Doesn't it often require additional needless movaps instructions?
For example, the following:
asm
{
movaps XMM0, a;
movaps XMM1, b;
addps XMM0, XMM1;
movaps a, XMM0;
}
asm
{
movaps XMM0, a;
movaps XMM1, b;
a
On 2011-09-22 11:47, Regan Heath wrote:
At one time (2+ years back) I started writing a C lexer, and then C
preprocessor in D. In part to learn about how compilers work and in part
to convert C headers to D (there was no .di at that stage) so I could
interface C. The lexer was no trouble, I even
Le 22/09/2011 12:31, Jonathan M Davis a écrit :
On Thursday, September 22, 2011 11:15:23 Regan Heath wrote:
as results speak louder than proposals I have found.
It's often easy to come up with ideas. The hard part is implementing them, and
in many cases, they need to be implemented to be shown
Andrei Alexandrescu:
> The initial submission got junked so I resubmitted:
>
> http://www.reddit.com/r/programming/comments/knn5p/thoughts_on_immutability_in_d/
A logical const can coexist beside the other two (three) kinds of const of D.
For simplicity I use the "lconst" keyword.
lconst works
On 09/22/2011 09:35 AM, Walter Bright wrote:
On 9/21/2011 11:47 PM, Max Klyga wrote:
It would be awesome if D infered argument types
for labdas too.
It does, and it is awesome!
Indeed, but it currently only works if the delegate literal is a
template parameter, in which case the literal is
Am 21.09.2011, 01:20 Uhr, schrieb Walter Bright
:
On 9/20/2011 2:28 PM, Jonathan M Davis wrote:
On Tue, 20 Sep 2011 15:58:06 -0400, Rishat Galiulin
2) Why D not using functions exceptions specification list like Java?
Checked exceptions have generally been determined to have been a bad
ide
"Peter Alexander" wrote in message
news:j5dhe0$2ln6$1...@digitalmars.com...
>
> For example, in Haskell, map (correctly) has the signature:
>
> map :: (a -> b) -> [a] -> [b]
>
> but in D, std.map has the signature (expressed in some Haskell/D
> pseudocode)
>
> map :: (a -> b) -> [a] -> Map!((a -
On Thursday, September 22, 2011 11:15:23 Regan Heath wrote:
> as results speak louder than proposals I have found.
It's often easy to come up with ideas. The hard part is implementing them, and
in many cases, they need to be implemented to be shown that they're viable and
to iron them out. Also,
On Wed, 21 Sep 2011 22:01:04 +0100, Gor F. Gyolchanyan
wrote:
You're right. I gotta apologize for my over-reaction to D's problems.
It's just,
that i want it to thrive. Maybe i care too much and i make too bit a
deal out of
this. :-)
Never appologise for enthusiasm! :) I had the same e
On Wed, 21 Sep 2011 22:33:06 +0100, Dmitry Olshansky
wrote:
On 22.09.2011 1:14, Gor F. Gyolchanyan wrote:
I had an idea of a D library for including C headers for a while now.
All i need is to make a compile-time C parser for that. This thing
would literally
remove any need for binding.
T
On 2011-09-22 08:47, Max Klyga wrote:
Actually Scala doesn't need type declarations in labmda literals. Most
of the time argument types are infered. It would be awesome if D infered
argument types for labdas too.
Also Java 8 adopted the same lambda syntax as Scala and C#.
To add a few things to
On 2011-09-21 22:20, Andrei Alexandrescu wrote:
On 9/21/11 2:29 PM, Timon Gehr wrote:
On 09/21/2011 06:55 PM, Andrei Alexandrescu wrote:
I'm back from the Strange Loop conference. It's been an interesting
experience. The audience was very diverse, with interest in everything
functional (you'd o
On 2011-09-21 21:02, Gor F. Gyolchanyan wrote:
I didn't know about core.stdc package because it doesn't show u on dpl.org.
The difference is, that some compilers make long 64 bit for 64-bit systems, and
some leave the long 32-bit no matter what.
core.stdc.config handles that.
--
/Jacob Carlbo
"Jonathan M Davis" , dans le message (digitalmars.D:144962), a écrit :
>> - char[], etc. being real arrays.
>
> Which is actually arguably a _bad_ thing, since it doesn't generally make
> sense to operate on individual chars. What you really want 99.999% of
> the time is code points not
On 2011-09-22 00:17, Walter Bright wrote:
I've collected a few from various languages for comparison:
D
(a,b) { return a + b; }
Ruby
->(a,b) { a + b }
C++0x
[](int a, int b) { return a + b; }
C#
(a,b) => a + b
Scala
(a:Int, b:Int) => a + b
Erlang
fun(a, b) -> a + b end.
Haskell
\a b -> a +
On 2011-09-22 00:50, Andrei Alexandrescu wrote:
On 9/21/11 5:29 PM, bearophile wrote:
Walter Bright:
D
(a,b) { return a + b; }
In D to define a true lambda you need types too:
auto f = (int a,int b){ return a + b; };
No.
Andrei
void foo (int delegate (int, int) a){}
void main ()
{
Walter Bright , dans le message (digitalmars.D:144959), a écrit :
> I've collected a few from various languages for comparison:
>
> D
> (a,b) { return a + b; }
Few ideas:
(a,b){ a + b }
Lambdas can avoid to type 'return'.
returning void would be harder, except if to return void, you can ju
On Wednesday, September 21, 2011 10:15:31 Mehrdad wrote:
> I can't find the thread, but I remember someone (bearophile?) mentioned
> that the reason we have transitive const is to support purity.
>
> I don't think I understand why this is necessary, though -- could
> someone please explain why we
On 22/09/11 7:04 AM, Andrei Alexandrescu wrote:
The initial submission got junked so I resubmitted:
http://www.reddit.com/r/programming/comments/knn5p/thoughts_on_immutability_in_d/
Andrei
Thanks for the reddit'ing. I launched up google analytics this morning
and noticed a sudden spike. That
Perhaps bearofile refers to this:
import std.stdio;
string getit(alias runme)() {
return runme("b","da");
}
string getit2(string delegate(string,string) dg) {
return dg("b", "da");
}
void main() {
writefln("this is a %s", getit!((a,b){ return "lam"~a~b; })());
/+
On 9/21/2011 11:47 PM, Max Klyga wrote:
It would be awesome if D infered argument types
for labdas too.
It does, and it is awesome!
On 9/21/2011 8:10 PM, Jesse Phillips wrote:
On Wed, 21 Sep 2011 18:29:34 -0400, bearophile wrote:
Walter Bright:
D
(a,b) { return a + b; }
In D to define a true lambda you need types too: auto f = (int a,int b){
return a + b; };
This is true of C# too and I think is appropriate to m
On 9/21/2011 10:56 PM, Benjamin Thaut wrote:
Even if I manually allocate v1,v2 and result, the temporary variable that the
compiler uses to compute the expression might be unaligned.
That is a total killer for SSE optimizations because you can not hide them away.
Does DMC++ have __declspec(align
Manu Wrote:
> I'd love to try out D on some console systems. Fortunately there are
> some great home-brew scenes available for a bunch of slightly older
> consoles; PSP/PS2 (MIPS), XBox1 (embedded x86), GameCube/Wii (PPC),
> Dreamcast (SH4). They all have GCC compilers maintained by the
> communit
99 matches
Mail list logo