Re: foreach: rvalue aggregate expression not finalized!

2011-02-20 Thread Dmitry Olshansky
idered as bug as it is far from obvious, at least from my point of view. It looks like the manifestation of http://d.puremagic.com/issues/show_bug.cgi?id=3516 vote up ! ;) -- Dmitry Olshansky

Re: OpenGL in D2

2011-02-21 Thread Dmitry Olshansky
best way to OpenGL and such in D, because of the nice way it loads & handles all these weirdness with loading, say, OpenGL extensions. And automatically picking up any suitable shared lib is big win. Anyway, any help would be appreciated, Thanks. Sadly your file goes like rubbish for me, is that base64 ? -- Dmitry Olshansky

Re: "operator" overloading?

2011-02-23 Thread Dmitry Olshansky
_hdc = hdc; } @property HDC getHandle(){ return _hdc; } private: HDC _hdc; } uinttest{ HDC h = cast(HDC)1; canvas c = h;//intitalize h = c; assert(h == c); } -- Dmitry Olshansky

Re: "operator" overloading?

2011-02-23 Thread Dmitry Olshansky
On 23.02.2011 21:48, Simon wrote: On 23/02/2011 18:42, Simon wrote: On 23/02/2011 14:37, Dmitry Olshansky wrote: On 23.02.2011 17:08, %u wrote: Hi everyone, Was hoping someone could help me make sense of this bit of C++ code: class canvas { operator HDC() { return _hdc; } protected: canvas

Re: override to!string

2011-02-25 Thread Dmitry Olshansky
result ~= to!string(data[$-1]); result ~= ')'; return result; } alias data this; } Usage: void main(){ Numbers nums = Numbers([1.1,2.2,3.3]); writefln("%s",nums); nums[0] = 4.4; writefln("%s",nums); } -- Dmitry Olshansky

Re: Problem with std.regex: *+? not allowed in atom

2011-02-26 Thread Dmitry Olshansky
0x0001b12b main + 179 21 test 0x2101 start + 53 -- Dmitry Olshansky

Re: Problem with std.regex: *+? not allowed in atom

2011-02-26 Thread Dmitry Olshansky
On 26.02.2011 19:52, Jacob Carlborg wrote: On 2011-02-26 12:29, Dmitry Olshansky wrote: On 26.02.2011 14:10, Jacob Carlborg wrote: I'm trying to use the std.regex module but when I run my application I get an exception. The exception message says: *+? not allowed in atom The code I ha

Re: Is std.regex.match completely broken?

2011-03-01 Thread Dmitry Olshansky
nges in Phobos. So you should check m.empty before use. P.S. I'm in the process of patching in lookahead regexes, I think I can get them fairly soon. As for lookbehind, well, that's would be somewhat harder it seems. -- Dmitry Olshansky

Re: Problem with std.regex: *+? not allowed in atom

2011-03-01 Thread Dmitry Olshansky
On 27.02.2011 13:41, Jacob Carlborg wrote: On 2011-02-26 19:49, Dmitry Olshansky wrote: On 26.02.2011 19:52, Jacob Carlborg wrote: On 2011-02-26 12:29, Dmitry Olshansky wrote: On 26.02.2011 14:10, Jacob Carlborg wrote: I'm trying to use the std.regex module but when I run my applicat

Re: opDollar()

2011-03-26 Thread Dmitry Olshansky
e second to "height" Now speaking of it's implementation - it's quite broken. The relevant bug report is http://d.puremagic.com/issues/show_bug.cgi?id=3474 (vote up!) Still it's not considered to be a critical one, since you can workaround it by: img[img.width-1,img.height-1] = lastValue; -- Dmitry Olshansky

Re: Custom compare function for array.sort on an integer array?

2011-04-19 Thread Dmitry Olshansky
//www.digitalmars.com/d/2.0/phobos/std_algorithm.html#sort -- Dmitry Olshansky

Re: Custom compare function for array.sort on an integer array?

2011-04-19 Thread Dmitry Olshansky
On 19.04.2011 16:56, Dmitry Olshansky wrote: If you are talking use std.algorithm sort Should be: "If your are talking about D2, then use std.algorithm sort ", ouch :) -- Dmitry Olshansky

Re: std.regex with multiple matches

2011-04-21 Thread Dmitry Olshansky
s1 =", abc, de, fg, hi,"; assert(equal(splitter(s1, regex(", *")), ["","abc","de","fg","hi",""][])) Simply put it gets you range of slices of input separated by regex matches. Since I'm not very familiar with ranges, am I missing some obvious way of doing this with the existing .pre, .hit and .post properties? -Dave -- Dmitry Olshansky

Re: Polymorphic ranges?

2011-05-01 Thread Dmitry Olshansky
for any range in std.range, try inputRangeObject & outputRangeObject. Every such range object is derived from the most suitable interface InputRange, ForwardRange etc. -- Dmitry Olshansky

Re: Is int faster than byte/short?

2011-05-01 Thread Dmitry Olshansky
and then use only the lower 8 or 16 bits of the result. You can >assume that the type conversion takes zero or one clock cycle. In 64-bit systems, there is >only a minimal difference between the efficiency of 32-bit integers and 64-bit integers, as >long as you are not doing divisions. -- Dmitry Olshansky

Re: private template members

2011-05-01 Thread Dmitry Olshansky
ccess private members of the class in the same module. There are some known bugs about it: http://d.puremagic.com/issues/show_bug.cgi?id=3108 <http://d.puremagic.com/issues/show_bug.cgi?id=314> -- Dmitry Olshansky

Re: private template members

2011-05-01 Thread Dmitry Olshansky
Test; Test t = new Test; t.test(); /*ok*/ t.testNonTemplate(); /*error*/ writeln(t.getX()); /* prints 100 */ I am using dmd 2.052 Then it's definitely a bug, it might be a duplicate report but it I suggest to file it anyway. It sill fails on my almost newest DMD from github. -- Dmitry Olshansky

Re: "not an lvalue"

2011-05-01 Thread Dmitry Olshansky
r I think the reason is in your's Vector's operator + overloading which expects ref Vector parameter it seems, though you'd better provide this function code as well. -- Dmitry Olshansky

Re: Polymorphic ranges?

2011-05-01 Thread Dmitry Olshansky
uE0nIwbk Limitations are caused by bug, that is going to get fixed eventually ;) -- Dmitry Olshansky

Re: "not an lvalue"

2011-05-01 Thread Dmitry Olshansky
On 01.05.2011 19:31, Peter Alexander wrote: On 1/05/11 2:53 PM, Dmitry Olshansky wrote: Ehm.. Well, first things first: you shouldn't use classes for lightweight & plain data things like vectors. There are structs for that. In general, structs are value-like objects living on the st

Re: Polymorphic ranges?

2011-05-01 Thread Dmitry Olshansky
t the interfaces defined like that in std.range? One reason might be is that it was implemented under worse compiler condition ;) Seems worthy of a bug report, or better yet a pull request. -- Dmitry Olshansky

Re: github: What to do when unittests fail?

2011-05-23 Thread Dmitry Olshansky
tester first ;) http://d.puremagic.com/test-results/ -- Dmitry Olshansky

Re: CP command used in the phobos windows makefile

2011-05-27 Thread Dmitry Olshansky
p.exe: cannot create regular file `\dmd2\windows\lib': No such file or directory Replacing cp with 'copy' doesn't work either, since copy uses a different syntax. I'm not seeing a CP binary in any of the DigitalMars tools. Yup, overall win32 makefile seems horribly f**ed up. -- Dmitry Olshansky

Re: version(all) block in src/phobos/unittest.d unnecessary?

2011-05-28 Thread Dmitry Olshansky
and debug builds and all modules one by one). -- Dmitry Olshansky

Re: version(all) block in src/phobos/unittest.d unnecessary?

2011-05-28 Thread Dmitry Olshansky
ked very deep. One reason is that win32 had a collection of workarounds for optlink. And that not counting the sheer verbosity of it. Me thinks that if anyone has the skill to bring to shape win32 makefile that would make an awesome pull request. -- Dmitry Olshansky

Re: listener.d: Range violation.

2011-05-29 Thread Dmitry Olshansky
s calling destroySocket in next) but you get your index still incremented (next returns true) so it will point out of array and it won't be equal to reads.length on next step. Try adjusting that == to >= on line 60 to test this theory. -- Dmitry Olshansky

Re: Linking with/Debugging static C/C++ libraries

2011-05-30 Thread Dmitry Olshansky
Regarding the glue code, it is currently maintained by Iain alone. He tends to be quite active though. Right and I've seen this cool option 'use other compiler' in recent VisualD with textbox for command line. So GDC & LDC support is almost there. OT: You are R&D and still use Windoze? ;) -- Dmitry Olshansky

Re: Linking with/Debugging static C/C++ libraries

2011-05-30 Thread Dmitry Olshansky
On 30.05.2011 19:14, Jeff Slutter wrote: On 5/30/2011 10:57 AM, Dmitry Olshansky wrote: It was me who brought it Unilink out of infernal abyss :) See also: http://www.digitalmars.com/d/archives/digitalmars/D/announce/Alternative_linker_win32_64_20086.html Seriously I still suggest to try it

Re: simple syntax issue with template

2011-06-13 Thread Dmitry Olshansky
em out anyway): array.countUntil!"a == b"(element); //same as default array.countUntil(element); another one: removeAt(index); should be array.removeAt(index) or removeAt(array, index); And last but not least there is remove in Phobos, it's just link to it from summary table is constantly getting screwed up. -- Dmitry Olshansky

Re: simple syntax issue with template

2011-06-13 Thread Dmitry Olshansky
void[]) === mmm.. strangely enough the code below succeed! void removeAt(T)(ref T[] array, int index) { if(index < 0 || index >= array.length) return; T[] empty; array.replaceInPlace(index, index + 1, empty); } but T[].init didn't work either?! ho well, thanks! :) -- Dmitry Olshansky

Re: dmdscript osx.mak

2011-06-18 Thread Dmitry Olshansky
hus could be integrated with D projects slightly better. Still if you are up for some hacking give it a try. As for speed, yeah, it's something like around 20-200x slower at various workloads (e.g. numerics in JavaScript and such), so wouldn't recommend if you have performance in mind. -- Dmitry Olshansky

Re: Linker errors on OSX

2011-06-20 Thread Dmitry Olshansky
linker symbols on linux recently, in the end I had to rebuild dmd, druntime & phobos from the latest git master. -- Dmitry Olshansky

Re: Need to do some "dirty" UTF-8 handling

2011-06-25 Thread Dmitry Olshansky
But that just blows up in my face. std.encoding to the rescue? It looks like a well established module that was forgotten for some reason. And here I'm wondering what a function named sanitize could do :) -- Dmitry Olshansky

Re: Need to do some "dirty" UTF-8 handling

2011-06-25 Thread Dmitry Olshansky
On 26.06.2011 3:25, Nick Sabalausky wrote: "Dmitry Olshansky" wrote in message news:iu5n32$2vjd$1...@digitalmars.com... On 26.06.2011 1:49, Nick Sabalausky wrote: "Andrej Mitrovic" wrote in message news:mailman.1215.1309019944.14074.digitalmars-d-le...@puremagic.com...

Re: Centralizable configured compile-time class instantiation

2011-07-13 Thread Dmitry Olshansky
ht of something more like tag based file system, where filetypes and e.g. date of modification are just that - one of myriad of tags, besides any additional that are user/system defined. Though I have never reached any more or less complete design, the idea still thrills me. -- Dmitry Olshansky

Re: Fuzzy string matching?

2011-07-16 Thread Dmitry Olshansky
.ext"; std.regex�is�std.regexp's�replacement. -�Jonathan�M�davis -- Dmitry Olshansky

Re: Search a file skiping whitespace

2011-07-16 Thread Dmitry Olshansky
e) { auto onlyDigitis = array(filter!((x){ return !isWhite(x); })(line)); // this copies all digits to a new array auto result = find(onlyDigits, ... ); //your query here /// } Thanks -- Dmitry Olshansky

Re: Search a file skiping whitespace

2011-07-16 Thread Dmitry Olshansky
On 17.07.2011 0:41, Willy Martinez wrote: == Quote from Dmitry Olshansky (dmitry.o...@gmail.com)'s article If you wish to avoid storing all of this in an array by using e.g. filter _and_ use Boyer-Moore search on it then: No, you can't do that. The reason is that filter is ForwardRan

Re: Search a file skiping whitespace

2011-07-16 Thread Dmitry Olshansky
On 17.07.2011 1:28, Johann MacDonagh wrote: On 7/16/2011 5:07 PM, Dmitry Olshansky wrote: Let's drill down to the problem through this barrage of crap: the problem statement is Error: cannot implicitly convert expression (haystack) of type dchar[] to string So (apparently) the probl

Re: How to get stack trace on Windows?

2011-07-22 Thread Dmitry Olshansky
indows" to update my dbghelp.dll - I'm already compiling/linking in one step, and using -g (also tried -gc) - I tried running the executable through cv2pdb. None of it's working. Last time I've seen stack trace it was due to this command: dmd -debug -g ... -- Dmitry Olshansky

Re: Small problem with multi-line strings

2011-07-22 Thread Dmitry Olshansky
~ concatenate complie-time string for 0 overhead. After all, hardcoded strings are not exactly good thing in the first place. For big formatted texts just use string import : writeln(import("usage.txt")); work like a charm. So IMHO it's a non-issue. -- Dmitry Olshansky

Re: How to get stack trace on Windows?

2011-07-22 Thread Dmitry Olshansky
On 22.07.2011 15:02, Nick Sabalausky wrote: "Dmitry Olshansky" wrote in message news:j0bgt7$176q$1...@digitalmars.com... On 22.07.2011 6:54, Nick Sabalausky wrote: I'm not getting any of the function names on the stack traces. I tried everything I found in here: http://www.di

Re: Need OMF MySQL lib that actually f^*&^ works...

2011-07-22 Thread Dmitry Olshansky
Gh # Import by ordinal, strip unused PE headers -LC:\DMD2\Windows\LIB -zkernel32;advapi32;user32;wsock32;shell32;snn;phobos -Go -- Dmitry Olshansky

Re: Name collision using std.regex and std.array / std.range

2011-07-24 Thread Dmitry Olshansky
t somebody will hit this anytime soon, so now I might roll out a pull request sooner :) -- Dmitry Olshansky

Re: How to get stack trace on Windows?

2011-07-25 Thread Dmitry Olshansky
://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx Hmm I guess I must have forgotten to re-try the cv2pdb trick after I updated dbghelp.dll. That works now. Thanks. Any idea why this trick is needed? For me it works as is, just wondering... -- Dmitry Olshansky

Re: How to get stack trace on Windows?

2011-07-25 Thread Dmitry Olshansky
On 25.07.2011 13:59, Kagamin wrote: Dmitry Olshansky Wrote: Any idea why this trick is needed? For me it works as is, just wondering... Your dbghelp probably recognizes the old CV format. In case anybody wants to check this, my dbghelp.dll is here: http://dl.dropbox.com/u/7100999/dbghelp.7z

Re: optlink options to reduce file size?

2011-07-27 Thread Dmitry Olshansky
ou configured it correctly (should be straightforward, there are examples) -- Dmitry Olshansky

Re: optlink options to reduce file size?

2011-07-27 Thread Dmitry Olshansky
L, it shouldn't be usually. It's possible in case if, for instance, your first version uses more different functions from lib then the second one, in effect linker could pull in less object files from library. -- Dmitry Olshansky

Re: optlink options to reduce file size?

2011-07-27 Thread Dmitry Olshansky
On 27.07.2011 23:35, simendsjo wrote: On 27.07.2011 20:59, q66 wrote: == Quote from Dmitry Olshansky (dmitry.o...@gmail.com)'s article On 27.07.2011 15:21, simendsjo wrote: A simple hello world like dfl application takes 1.2mb. Upx does a great job packing this to 200k, but I wonder if

Re: optlink options to reduce file size?

2011-07-27 Thread Dmitry Olshansky
On 27.07.2011 21:16, simendsjo wrote: On 27.07.2011 15:45, Dmitry Olshansky wrote: On 27.07.2011 15:21, simendsjo wrote: A simple hello world like dfl application takes 1.2mb. Upx does a great job packing this to 200k, but I wonder if there is a way to make optlink generate smaller executables

Re: optlink options to reduce file size?

2011-07-27 Thread Dmitry Olshansky
On 28.07.2011 2:03, simendsjo wrote: On 27.07.2011 23:00, Dmitry Olshansky wrote: On 27.07.2011 21:16, simendsjo wrote: On 27.07.2011 15:45, Dmitry Olshansky wrote: On 27.07.2011 15:21, simendsjo wrote: A simple hello world like dfl application takes 1.2mb. Upx does a great job packing this

Re: Generate array of random values

2011-08-01 Thread Dmitry Olshansky
.algorithm, std.stdio, std.range; void main() { Xorshift rng; rng.seed(unpredictableSeed); writeln(take(rng, 10)); } -- Dmitry Olshansky

Re: Generate array of random values

2011-08-01 Thread Dmitry Olshansky
p; STL extensively I would find this line a very simple and clean solution. Now time is changing and so on... A thought - would amap as a shorthand for array(map... float your boat? One pair of parens off. -- Dmitry Olshansky

Re: Template specification conflict

2011-08-02 Thread Dmitry Olshansky
guous? import std.traits; struct S { this(uint i) {} this(C)(C c) if(isSomeChar!C) {} } void main() {} struct S { this()(uint i) {} this(C)(C c) if(isSomeChar!C) {} } should do it, though it (and workaround) looks like a bug to me. -- Dmitry Olshansky

Re: Template specification conflict

2011-08-02 Thread Dmitry Olshansky
On 02.08.2011 16:06, simendsjo wrote: On 02.08.2011 13:55, Dmitry Olshansky wrote: On 02.08.2011 15:06, simendsjo wrote: The following program gives me "Error: template t.S.__ctor(C) if(isSomeChar!(C)) conflicts with constructor t.S.this at t.d(4)" Is this because char etc can be co

Re: Generate array of random values

2011-08-02 Thread Dmitry Olshansky
generic code would totally expect slice to 1. return the same type as the range itself (or 100% compatible) 2. most of the time not to allocate -- Dmitry Olshansky

Re: Template specification conflict

2011-08-02 Thread Dmitry Olshansky
On 02.08.2011 16:18, simendsjo wrote: On 02.08.2011 14:13, Dmitry Olshansky wrote: On 02.08.2011 16:06, simendsjo wrote: On 02.08.2011 13:55, Dmitry Olshansky wrote: On 02.08.2011 15:06, simendsjo wrote: The following program gives me "Error: template t.S.__ctor(C) if(isSomeCh

Re: Template specification conflict

2011-08-02 Thread Dmitry Olshansky
On 02.08.2011 16:30, simendsjo wrote: On 02.08.2011 14:22, Dmitry Olshansky wrote: On 02.08.2011 16:18, simendsjo wrote: On 02.08.2011 14:13, Dmitry Olshansky wrote: On 02.08.2011 16:06, simendsjo wrote: On 02.08.2011 13:55, Dmitry Olshansky wrote: On 02.08.2011 15:06, simendsjo wrote: The

Re: "" gives an empty string, while "".idup gives null

2011-08-03 Thread Dmitry Olshansky
it has been initialized, but an empty string is also a valid value. Because I shouldn't check for null, I now have to add another field to the struct to see if the array has been initialized. This feels like a really suboptimal solution. length works even for "null" arrays and returns 0. Even cleaner way is to use std.array.empty: char[] abc = null; assert(abc.empty); So there is no uninitialized arrays, there are just different versions of empty slices. -- Dmitry Olshansky

Re: File append limit?

2011-08-05 Thread Dmitry Olshansky
ntly dsicovered (and fixed) bug with OSX Lion, more info here: https://github.com/D-Programming-Language/druntime/pull/42 At any rate it's going to be into the next release, other then waiting for it you can manually build latest dmd/druntime from github. -- Dmitry Olshansky

(int << ulong) == int ?

2011-08-07 Thread Dmitry Olshansky
Just lost the best part of an hour figuring the cause of this small problem, consider: void main() { uint j = 42; ulong k = 1<I though left operand should be promoted to the largest integer in shift expression, isn't it? -- Dmitry Olshansky

Re: (int << ulong) == int ?

2011-08-07 Thread Dmitry Olshansky
mmetric in nature so it really shouldn't do any promotions. Sorry for the noise. -- Dmitry Olshansky

Re: (int << ulong) == int ?

2011-08-07 Thread Dmitry Olshansky
On 08.08.2011 2:07, bearophile wrote: Dmitry Olshansky: Sorry for the noise. It's not noise, and you don't need to be sorry, in my opinion it's a D/DMD design fault. Clang gives an error on code like that: http://blog.llvm.org/2011/05/c-at-google-here-be-dragons.html See the

Re: Tuple [] operator

2011-08-08 Thread Dmitry Olshansky
roblem anyway? Your case seems simple, it means you can't index tuple with variable as index, only with something known at compile time. Replace auto with enum and you are fine, you can even call a function using CTFE to get an index. -- Dmitry Olshansky

Re: COFF support for windows compiler

2011-08-17 Thread Dmitry Olshansky
e folks had trouble linking gtkD library with it. -- Dmitry Olshansky

Re: Should the 2.054 feature about warning on implicit fallthrough include labels?

2011-09-14 Thread Dmitry Olshansky
ot;a label"); } } Label doesn't affect switch statement in any way, e.g. it's not part of case x: synatx, and as such is "fallthrough" like in normal code. So this part works as intended, though I agree with bearophile there are some messy things w.r.t. switch. -- Dmitry Olshansky

Re: Should the 2.054 feature about warning on implicit fallthrough

2011-09-14 Thread Dmitry Olshansky
t a fall through error on this code? Have you run that code? Bye, bearophile -- Dmitry Olshansky

Re: toUTFz and WinAPI GetTextExtentPoint32W

2011-09-21 Thread Dmitry Olshansky
overflowed "negative" lengths. Maybe we can put it here as unsafe and fast version though. Also check std.utf.stride to see if you can get it better, it's the beast behind narrow string popFront. -- Dmitry Olshansky

Re: toUTFz and WinAPI GetTextExtentPoint32W

2011-09-21 Thread Dmitry Olshansky
really depends on what the compiler does. > Yes and no, I think it would be hard to find app that bottlenecks at traversing UTF, on decoding - maybe. Generally if you do a lot calls to stride it's in cache, if not it doesn't matter much(?). Though I'd prefer non-tabulated version In any case, this may not improve walkLength by more than a few percents. Then specializing walkLength to do your unrollable version seems like good idea. -- Dmitry Olshansky

Re: Using pure to create immutable

2011-09-22 Thread Dmitry Olshansky
for (int i = 1; i< array.length; ++i) { end.tail_ = new Cons!T(array[i], null); end = end.tail_; } return result; } If I'm not mistaken only strongly pure functions are working. -- Dmitry Olshansky

Re: Why is std.string.format a c-style variadic function?

2011-09-27 Thread Dmitry Olshansky
ameters or something. Last summer I actually wrote a Replace template to scratch that itch. dmd choked on it pretty quickly too. -- Dmitry Olshansky

Re: How convice people that D it's wonderfull in a hour ?

2011-10-09 Thread Dmitry Olshansky
lace your bet on a few prime features (e.g. 3 like in one of Andrei talk). And then you can casually present a short list of other cool features and say a thing or two about them, not forgetting that there is even more. -- Dmitry Olshansky

Re: compare struct with string member is wield;

2011-10-12 Thread Dmitry Olshansky
7;s the case - define sane opEquals*: bool opEquals(in S s)const{ return str == t.str; } * I haven't followed the timeline of the changes to opEquals that ultimately made things much simpler so you may have to rewrite it as bool opEquals(const ref S s)const in dmd 2.055. -- Dmitry Olshansky

Re: Ranges help

2011-10-12 Thread Dmitry Olshansky
ould this be correct? Or would this be too much? isRandomAccessRange && !isFiniteRange && isBidirectionalRange && hasSlicing isRandomAccessRange should be enough. Also why !isFinite how would one sort infinite range? hasSlicing is needed though. So my take on this would be: isRandomAccessRange && hasSlicing -- Dmitry Olshansky

Re: Looking for documentation of D's lower-level aspects.

2011-10-23 Thread Dmitry Olshansky
her stuff you'd use range, like you'd use iterators in c++. Range gets stack/register allocated pointers directly to data (or close to it, that depends on container) so the only extra cost in reference type compared to value is the first indirect access to construct range and it's negligible. -- Dmitry Olshansky

Re: Looking for documentation of D's lower-level aspects.

2011-10-24 Thread Dmitry Olshansky
On 24.10.2011 5:57, Sean Silva wrote: == Quote from Dmitry Olshansky (dmitry.o...@gmail.com)'s article Less efficient is a moot point. When you do iteration and other stuff you'd use range, like you'd use iterators in c++. Range gets stack/register allocated pointers direct

Re: removing an item from a dynamic array

2011-10-25 Thread Dmitry Olshansky
remove() doesn't work in-place, I think this is a bug or a design bug. Bye, bearophile No, it's not a bug. It's the same as c++ STL remove - it operates on range but not on container. To shrink container, update it's length. -- Dmitry Olshansky

Re: [beginner] Why nothing is printed to stdout ?

2011-10-30 Thread Dmitry Olshansky
no output - WTF? Ahem, it just called that command line tool named test... sh$: ./test wow, now something happens ;) -- Dmitry Olshansky

Re: std.container & ranges

2011-10-31 Thread Dmitry Olshansky
gant. But it is what people want to do and it should not be any harder than necessary. You still can, just use plain range interface with empty/front/popFront. for(auto r = list[]; !r.empty; r.popFront()) { ... } -- Dmitry Olshansky

Re: std.container & ranges

2011-10-31 Thread Dmitry Olshansky
On 31.10.2011 18:38, Steven Schveighoffer wrote: On Mon, 31 Oct 2011 05:16:11 -0400, Dmitry Olshansky wrote: On 31.10.2011 11:16, Tobias Pankrath wrote: Jonathan M Davis wrote: find allows you to do that just fine, and such a remove function would simply be duplicating its functionality

Re: std.container & ranges

2011-10-31 Thread Dmitry Olshansky
passed to remove that it does belong to this list. (i.e. it walks from head till hits it or it's own tail) -- Dmitry Olshansky

Re: std.container & ranges

2011-11-03 Thread Dmitry Olshansky
On 03.11.2011 19:34, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 10:02:22 -0400, Tobias Pankrath wrote: Dmitry Olshansky wrote: And more importantly, it still would be horribly slow O(N^2). Personally, because of that I'd prefer hand-rolled intrusive singly-linked list any time o

Re: std.container & ranges

2011-11-03 Thread Dmitry Olshansky
On 03.11.2011 21:13, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 12:35:36 -0400, Dmitry Olshansky wrote: On 03.11.2011 19:34, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 10:02:22 -0400, Tobias Pankrath wrote: Dmitry Olshansky wrote: And more importantly, it still would be

Re: std.container & ranges

2011-11-03 Thread Dmitry Olshansky
On 03.11.2011 22:37, Steven Schveighoffer wrote: On Thu, 03 Nov 2011 14:08:31 -0400, Dmitry Olshansky wrote: On 03.11.2011 21:13, Steven Schveighoffer wrote: dcollections stipulates that all ranges/cursors can be verified in O(lgn) time or better to belong to a specific container. In some

Re: std.regex named matches

2012-02-20 Thread Dmitry Olshansky
08.02.2012 13:07, James Miller пишет: Hi, I am using std.regex and using the named matches. I would like to be able to get at the names that have matched, since this is library code. e.g. auto m = match("test/2", regex(r"(?P\w+)/(?P\d)")); //either auto names = m.names; //o

Re: std.regex named matches

2012-02-21 Thread Dmitry Olshansky
On 21.02.2012 7:34, James Miller wrote: On 20 February 2012 21:34, Dmitry Olshansky wrote: 08.02.2012 13:07, James Miller пишет: Hi, I am using std.regex and using the named matches. I would like to be able to get at the names that have matched, since this is library code. e.g. auto

Re: Executable size when compiling with GDC

2012-02-22 Thread Dmitry Olshansky
bug builds with MinGW GCC on windows are also enormous. Try release vs debug. -- Dmitry Olshansky

Re: 2.058 broke my build. Is this a bug?

2012-02-24 Thread Dmitry Olshansky
Can anyone help? I will bug report myself tomorrow if it turns out to be a bug for sure. DMD 2.058, 64-bit GNU/Linux -- Dmitry Olshansky

Re: Supporting and signature-checking all foreach variations

2012-02-25 Thread Dmitry Olshansky
. 3. A more general question: Is there any by any chance a way to avoid the redundancy above of defining two opSlice() functions (or two opAssign() functions if I went that route -- one for const and another for ref)? I suspect that the answer is no, but I just wanted to verify. -- Dmitry Olshansky

Re: struct init() method

2012-02-25 Thread Dmitry Olshansky
mishandled it seems. -- Dmitry Olshansky

Re: class templates and static if

2012-02-27 Thread Dmitry Olshansky
; //pseudocode else goto default; } And for the record I seen all of that in assembly listings produced by dmd, when optimizing VM dispatch in std.regex. I had to revisit opcodes layout a bit so that dmd outputs jump table and not a binary-searching like stuff in a tight loop. -- Dmitry Olshansky

Re: class templates and static if

2012-02-28 Thread Dmitry Olshansky
eally - hundreds of cmp xxx je xxx stall pipelines pretty darn well. Though the effect might depend on the code size inside these case branches. BTW tables should be somewhere close, though I haven't checked this. -- Dmitry Olshansky

Re: Dumb question about git

2012-03-01 Thread Dmitry Olshansky
ejects the push. I think push --force should do the trick What's the right thing to do here? Looks like I screwed up my branch history. How do I fix it? Thanks! T -- Dmitry Olshansky

Re: Multiple definition of .../std/regex.d.912_ModuleInfoZ

2012-03-04 Thread Dmitry Olshansky
/include/d/dmd/phobos/std/regex.d.915__unittest_failFiZv' ..proj_dir../F/FEngine/FEngine/bin/Debug/FEngine.a(regex_9_13d8.o):(.text._D39/usr/include/d/dmd/phobos/std/regex.d.915__unittest_failFiZv+0x0): first defined here collect2: ld gab 1 als Ende-Status zurück Exit code 1 -- Dmitry Olshansky

Re: Redis client

2012-03-05 Thread Dmitry Olshansky
because D offers this imperative style and the protocol is so small that doesn't need more a structured approach. Tell me this is wrong! It's up to you in any case. Benefits of extra structure won't show up until the code is quite large. thanks from a newbie :-) Pedro Lacerda You are welcome ! -- Dmitry Olshansky

Re: Shutting down thread with Socket blocking for connection

2012-03-05 Thread Dmitry Olshansky
ll, null, 10) > 0){ //10 usec wait on a socket, may do plain 0 sock.accept(); // no blocking here } set.reset(); set.add(sock); receiveTimeout(dur!"us"(1), (int code){ working = false; }); } } What the heck in such convenient manner you can send it message to bind to another port, etc. -- Dmitry Olshansky

Re: Shutting down thread with Socket blocking for connection

2012-03-05 Thread Dmitry Olshansky
it in phobos though. -- Dmitry Olshansky

Re: Assert and the optional Message

2012-03-09 Thread Dmitry Olshansky
output to "Output" window. Right on the same window where you can choose a debugger (mago/visual studio) IRC. -- Dmitry Olshansky

Re: Sorting char arrays

2012-03-12 Thread Dmitry Olshansky
If it's ASCII then try: sort(a.representation) representation is in std.string IRC. -- Dmitry Olshansky

Re: Math Libraries (and vectors, matrices, etc)

2012-03-13 Thread Dmitry Olshansky
typical 2D/3D vector (or 4D homogenous). But it'd be nice if both can be handled generically without crippling performance losses in the 2D/3D case for game dev. T SciD worths a look, though never used nor had the need to: https://github.com/kyllingstad/scid -- Dmitry Olshansky

  1   2   3   4   5   6   >