Re: Array expanding

2011-12-18 Thread Jonathan M Davis
On Sunday, December 18, 2011 22:12:07 RenatoL wrote: > Reading the book from Alexandrescu we can find this (page 103-104, > at least in my edition): > > Expanding arrays has a couple of subtleties that concern possible > reallocation of the array. Consider: > > auto a = [87, 40, 10, 2]; > auto b

Re: Array expanding

2011-12-18 Thread RenatoL
This is interesting i didn't know assumesafeappend (as a beginner i've still too much bugs)it is worth of investigation

Re: Array expanding

2011-12-18 Thread bearophile
RenatoL Wrote: > Yes "in pratice" we can make in many different ways but "theoretically > speaking" it seems (to me) a very bug prone behavior not nice. See also this program: import std.stdio; void main() { auto a = [87, 40, 10, 2]; a.length -= 1; auto b = a; // Now a and b refe

Re: Array expanding

2011-12-18 Thread RenatoL
Yes "in pratice" we can make in many different ways but "theoretically speaking" it seems (to me) a very bug prone behavior not nice.

Re: Array expanding

2011-12-18 Thread Timon Gehr
On 12/18/2011 11:12 PM, RenatoL wrote: Reading the book from Alexandrescu we can find this (page 103-104, at least in my edition): Expanding arrays has a couple of subtleties that concern possible reallocation of the array. Consider: auto a = [87, 40, 10, 2]; auto b = a; // Now a and b refer to

Array expanding

2011-12-18 Thread RenatoL
Reading the book from Alexandrescu we can find this (page 103-104, at least in my edition): Expanding arrays has a couple of subtleties that concern possible reallocation of the array. Consider: auto a = [87, 40, 10, 2]; auto b = a; // Now a and b refer to the same chunk a ~= [5, 17]; // Append t

Re: delegate, template and alias

2011-12-18 Thread Philippe Sigaud
On Sun, Dec 18, 2011 at 14:13, Heromyth wrote: > I have a delegate as a parameter in a function which is a template function. > And I want to use alias for the delegate parameter. > Is there a better way for this? I suppose you do *not*want the commented line? You can extract a template paramete

Re: Restrict access to "critical" functions

2011-12-18 Thread Manfred_Nowak
Bystroushaak wrote: > Useful google dork: sandbox. nice: safeD -> sandbox -> VirtualBox Make a virtual machine an integral part of the compiler :-) -manfred

delegate, template and alias

2011-12-18 Thread Heromyth
I have a delegate as a parameter in a function which is a template function. And I want to use alias for the delegate parameter. Is there a better way for this? My demo code: template AsynchronousAction(T) { alias void delegate(T argument) FuncType; } public class TestC { int b =

Re: Download file via http

2011-12-18 Thread Bystroushaak
I've created HTTP client module. It's just http module, no cookies, no https, so if you need something small, try it. https://github.com/Bystroushaak/DHTTPClient On 13.12.2011 18:29, Kai Meyer wrote: > I've been trying to modify the htmlget.d example for std.socketstream > (http://www.d-programmi

Re: Restrict access to "critical" functions

2011-12-18 Thread Bystroushaak
Yep. Useful google dork: sandbox. On 14.12.2011 19:55, mta`chrono wrote: > Maybe you should use a VM to run your restricted applications. Or have a > look a chroot, dchroot or schroot, to setup such stuff. The Programming > Language will not help you in this case!