It's just syntax. Eliminating syntax noise is fine. Code should
look
like what it does.
Not if "eliminating noise" equals to making things harder to
understand.
When you say (int x) { return x; } it's clear about what it is, a
_function_ without name.
No, please, template instantiation. Specialization is something
completely different, and doesn't happen at the call site.
Sorry, my fault. I'm a non-native english speaker.
What I meant is calling function(args)
I think it's called instantiation.
On Thursday, 19 July 2012 at 14:31:53 UTC,
trav...@phare.normalesup.org (Christophe Travert) wrote:
"q66" , dans le message (digitalmars.D:172716), a écrit :
(so instead of calling a(b(c(d(e(f) you can just call
a.b.c.d.e.f())
rather f.e.d.c.b.a, if you omit the empty parenthesis after
ea
Array gets sorted, then doubles are removed (uniq) and then
everything is converted to a string (map).
Everything was recently introduced around 2.059.
Ok, but what is map!(). What's the point of the exclamation mark,
is it a template specialization?
Hi,
I'm an occasional lurker on the D forums just to see where the
language is going,but I'm a little puzzled. In another thread I
found this code
auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x => x.to!string);
I don't understand whats going on here. Int array is getting
sorted, then Uniqued, th
I read somewhere that D arrays rely
on the GC which may not be desirable in certain situations (OS
programming etc).
Can you let me know what you think as you are seemingly the chief
Phobos developer.
Thank you,
Petr Janda
I see. Thank you.
I do have a couple of questions about myNew and myDelete though.
T ret = emplace!(T, Args)(objMem, args);
return ret; // return new custom allocated Object
So emplace runs the constructor of T.
1) Does emplace return a copy of T?
2) Is Object "ret" constructed as a copy(via c
non-garbage
collected classes work makes me a bit cautious.(could someone please
explain too)
Also, how much slower is D2 compared to C++? Will D2 final have
comparable performance?
Thanks
Petr Janda
> Go back to read my post again, it doesn't contain the name "LDC".
But LDC is the D frontend for LLVM right, so wouldn't it be more useful to talk
about LDC rather than LLVM?
I don't think the intention is to split GC allocation/construction into to
expressions.
Only heap allocation/construction and heap deallocation/destruction.
It should be duly noted that features that can't be used without garbage
collection ie. D Arrays?
There should have an alternative that maybe
> Keep in mind that this would probably also be legal code:
> Foo f = new(alloc!Foo()) Foo();
Well I think the goal, according to Andrei, is to split allocation/construction
and deallocation/destruction.
>> dealloc(mp); //deallocate memory
>Again, this would require anybody who wants to manage me
Looking at TDPL, placement new can actually take a memory address.
So Im thinking why not do this:
void* mp = alloc!Foo(); // allocate raw memory off the C heap to hold Foo.
Foo* f = new(mp) Foo(); // construct an object in the memory pointed to by mp
and then
clear(f); // call destructor on f,
You said:
Foo f2 = create!Foo(f2)
But I don't like the fact that f2 is mentioned twice.
I would prefer the exact same behaviour as C++:
Class* c = new Class(); // allocate on the umanaged heap and run the default
constructor
delete c; // run destructor and deallocate
objects to be allocated on
So what was the conclusion(if any) reached on how to allocate/deallocate
objects on the C heap -
equivalent of C++ new and delete keywords?
The summary i've reached so far:
1) "new" allocates on GC heap, and manually freeing memory allocated to GC's
heap is not a good
idea be it either via dele
I would be interested to see what other think about this.
Sounds pretty cool for me!
Thanks,
Petr
15 matches
Mail list logo