Re: std.file.readText() extra Line Feed character

2014-12-18 Thread ketmar via Digitalmars-d-learn
On Thu, 18 Dec 2014 09:18:35 + Colin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Why does std.file.readText() append a Line Feed char onto the end of the string? I have a file with the following contents in it: Name = Int Other=Float One More =

Re: Why do std.traits use template foo(args...) instead of foo(alias arg) ?

2014-12-18 Thread ketmar via Digitalmars-d-learn
On Thu, 18 Dec 2014 15:52:06 + Low Functioning via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Thursday, 18 December 2014 at 15:48:02 UTC, Mathias LANG wrote: An exemple being fullyQualifiedName:

Re: Why do std.traits use template foo(args...) instead of foo(alias arg) ?

2014-12-18 Thread ketmar via Digitalmars-d-learn
On Thu, 18 Dec 2014 11:26:20 -0500 Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On 12/18/14 11:21 AM, ketmar via Digitalmars-d-learn wrote: On Thu, 18 Dec 2014 15:52:06 + Low Functioning via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: Referring to alias parameters in a mixin template

2014-12-17 Thread ketmar via Digitalmars-d-learn
On Wed, 17 Dec 2014 02:34:15 + aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 17 December 2014 at 02:12:52 UTC, anonymous wrote: Sure, straight forward: mixin template makeProperty(T, string name, alias func) { mixin(T %s()

Re: Asssociative Array by Key-Value-Pair

2014-12-15 Thread ketmar via Digitalmars-d-learn
On Mon, 15 Dec 2014 17:37:13 + Tobias Pankrath via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I think we should require byKeys and byValues to iterate the elements in the same order. Than we can just zip them for the pairwise iteration. Would this impose a

Re: Asssociative Array by Key-Value-Pair

2014-12-15 Thread ketmar via Digitalmars-d-learn
On Mon, 15 Dec 2014 13:01:10 -0500 Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: but i agree that this requirement should be documented. and i bet it will not, 'cause this will support principle of least astonishment, which is completely alien for

Re: Asssociative Array by Key-Value-Pair

2014-12-15 Thread ketmar via Digitalmars-d-learn
On Mon, 15 Dec 2014 13:47:58 -0500 Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On 12/15/14 1:10 PM, ketmar via Digitalmars-d-learn wrote: On Mon, 15 Dec 2014 13:01:10 -0500 Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn

Re: Asssociative Array by Key-Value-Pair

2014-12-15 Thread ketmar via Digitalmars-d-learn
On Mon, 15 Dec 2014 21:32:23 + Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 15 December 2014 at 18:55:13 UTC, bearophile wrote: Now this yields tuples: assert(aa.byPair!Tuple.array == aa.pairs!Tuple); But I'd really like tuples as built-ins for D

Re: Odd Error Message

2014-12-15 Thread ketmar via Digitalmars-d-learn
On Mon, 15 Dec 2014 22:09:28 + CraigDillabaugh via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Given the following program: import std.string; import std.stdio; void main() { File file = File(blah.txt, r); while( !(file.eof()) count 10 )

Re: std.array oddness

2014-12-14 Thread ketmar via Digitalmars-d-learn
On Sun, 14 Dec 2014 05:15:43 + earthfront via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Saturday, 13 December 2014 at 06:40:41 UTC, ketmar via Digitalmars-d-learn wrote: auto names = File(names.txt) .byLine!(char,char)(KeepTerminator.no

Re: How can I define a label inside a switch?

2014-12-14 Thread ketmar via Digitalmars-d-learn
On Sun, 14 Dec 2014 18:24:39 + MachineCode via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I used to do it in C but in D it's giving this compile error message: switch case fallthrough - 'use goto case;' if intended Here's the code: switch(value) { // alof of

Re: How can I define a label inside a switch?

2014-12-14 Thread ketmar via Digitalmars-d-learn
On Sun, 14 Dec 2014 18:48:15 + Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Sunday, 14 December 2014 at 18:41:54 UTC, MachineCode wrote: The labels are disabled then? I find that goto case case_value ugly and prefer goto labelName; but if it's the only way to

Re: std.array oddness

2014-12-13 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 10:01:49 + bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: no, you are using `.byLine` incorrectly. ;-) `.byLine` reuses it's internal buffer for each line, so you have to copy that buffer. A simple solution is to use byLineCopy (that

Re: std.array oddness

2014-12-13 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 12:07:27 + thedeemon via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Saturday, 13 December 2014 at 06:40:41 UTC, ketmar via Digitalmars-d-learn wrote: .map!a.idup That can be just .map!idup. it depends of compiler version, as `idup

Re: std.array oddness

2014-12-12 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 05:15:08 + earthfront via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Am I using array incorrectly? no, you are using `.byLine` incorrectly. ;-) `.byLine` reuses it's internal buffer for each line, so you have to copy that buffer. like this: import

Re: Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-12 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 07:03:22 + Andrey Derzhavin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hello! We have object, for example, objA. ObjectAType objA = new ObjectAType(...); // we have a many references to objA void someFunction1(...) { // destroying

Re: Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-12 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 07:03:22 + Andrey Derzhavin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: p.s. you can emulate weak links if this is what you want to have. i.e. references to object that will not stop GC to collect that object and which will be auto-nullified if the

Re: Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-12 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 07:03:22 + Andrey Derzhavin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: p.p.s. please-please-please don't invent other hacks with `rt_attachDisposeEvent()`! such hackery will not do you good in the long term. signature.asc Description: PGP signature

Re: Garbage collector collects live objects

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 08:32:12 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 02:43:19 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 09 Dec 2014 17:18:44 + Ruslan Mullakhmetov via Digitalmars-d-learn

Re: Derelict / SDL error

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 08:59:36 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Adding that reveals that I need to add SDL_image 2.0 (I didn't know that that wasn't a part of the standard SDL install) so I've compiled that too. I now get the error: Unsupported

Re: Template mixin enum stringof

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 11:52:11 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Consider the following: --- enum Foo { BAR, } mixin template S(string s_) { enum s = s_; } void main() { mixin S!(Foo.BAR.stringof); // Error: identifier

Re: Template mixin enum stringof

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 12:35:44 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 12:08:34 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 10 Dec 2014 11:52:11 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn

Re: Garbage collector collects live objects

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 12:52:22 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 08:46:12 UTC, Ruslan Mullakhmetov wrote: yes. that was the mistake. also after fixing bug in Blk Attributes printing i got more

Re: Garbage collector collects live objects

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 13:03:21 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 12:52:24 UTC, Ruslan Mullakhmetov wrote: why and how this happens? can anybody explain it to me? I tried to extract this and saw NO

Re: Template mixin enum stringof

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 13:58:20 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 12:57:16 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 10 Dec 2014 12:35:44 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn

Re: Template mixin enum stringof

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 14:32:12 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: mixin template S(alias fld) if (is(typeof(fld) == enum)) { import std.conv : to; enum s = to!string(fld); // BAR // or this: //import std.traits :

Re: Garbage collector collects live objects

2014-12-09 Thread ketmar via Digitalmars-d-learn
On Tue, 09 Dec 2014 14:52:53 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 9 December 2014 at 14:23:06 UTC, Steven Schveighoffer wrote: On 12/9/14 8:54 AM, Ruslan Mullakhmetov wrote: Hi, I experience very strange problem: GC

Re: Garbage collector collects live objects

2014-12-09 Thread ketmar via Digitalmars-d-learn
On Tue, 09 Dec 2014 17:18:44 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: thanks, I got it: either C++ or D dtors are minefield =) and in D this is filed *made* of mines. ;-) but i still have no clue how to overcome GC =( why do you want to fight

Re: how to access a ftp sever with socket

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 8 Dec 2014 17:16:23 +0800 (CST) michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hello Anyone: i am trying make a ftp client with socket,i have tried std.net.curl,but i cont stand with so many try-catch structure in my code,i am not familiar with

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Sorry this is a bit off topic but as there doesn't seem to be an active forum for Derelict atm This simple test code is giving me an error 'Error executing command run: Program

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 13:16:37 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:08:58 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 08 Dec 2014 12:53:10 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 13:37:20 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The program now works from a terminal as expected (!) BUT when SDL_RenderCopy is called SDL_GetError() shows an 'error code' (or just some address/value as it is different each time).

Re: Derelict / SDL error

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Mon, 08 Dec 2014 14:13:54 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 8 December 2014 at 13:48:27 UTC, Mike Parker wrote: import std.conv : to; writeln( Error: , to!string( SDL_GetError() )); Cleaner! ah, sure. i just wanted to use libc's

Re: @property usage

2014-12-08 Thread ketmar via Digitalmars-d-learn
On Tue, 09 Dec 2014 07:31:20 + Nicholas Londey via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: as this can break some invalid code (the code where people using properties as functions) Does @property ever make sense for a free floating function? I would have thought

Re: @property usage

2014-12-06 Thread ketmar via Digitalmars-d-learn
On Sat, 06 Dec 2014 15:23:10 -0800 Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Thursday, December 04, 2014 10:21:10 uri via Digitalmars-d-learn wrote: Hi All, Do you guys use @property much, or is it largely ignored/avoided? @property is used

Re: Template bug with second mixin?

2014-12-05 Thread ketmar via Digitalmars-d-learn
On Fri, 05 Dec 2014 09:19:27 + Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I think I mimized the coding too much. What I actually want to achieve is to generate read methods in the structure for different data types (Ubyte, short, int): I thought the

Re: @property usage

2014-12-04 Thread ketmar via Digitalmars-d-learn
On Thu, 04 Dec 2014 10:21:10 + uri via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Do you guys use @property much, or is it largely ignored/avoided? i'm using it alot for the things that looks like properties. ;-) the thing is looking like a property if it works almost as

Re: Template bug with second mixin?

2014-12-04 Thread ketmar via Digitalmars-d-learn
On Fri, 05 Dec 2014 07:06:34 + Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hi, following coding fails to compile with 2.066.0 and 2.067.0-b1. This is a bug, or? source\app.d(9): Error: mixin app.Data.insertReadMethods!(readTinyInt, ubyte) is not

Re: Template bug with second mixin?

2014-12-04 Thread ketmar via Digitalmars-d-learn
On Fri, 05 Dec 2014 07:06:34 + Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hi, following coding fails to compile with 2.066.0 and 2.067.0-b1. This is a bug, or? source\app.d(9): Error: mixin app.Data.insertReadMethods!(readTinyInt, ubyte) is not

Re: threading issues with D - C - Python

2014-12-03 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 20:41:46 + Michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 3 December 2014 at 06:11:56 UTC, Ellery Newcomer wrote: are you looking at this pyd: https://bitbucket.org/ariovistus/pyd I'm looking at this one, which is what

regular expression engine and ranges

2014-12-02 Thread ketmar via Digitalmars-d-learn
Hello. is there any decent regular expression engine which works with input ranges? under decent i mean good D code, [t]nfa and no backtracking. support for captures and greedy/non-greedy modes are must. i found that some popular regex libraries and std.regex are sure that the only data layout

Re: regular expression engine and ranges

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Tue, 02 Dec 2014 22:47:05 + MrSmith via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: IIRC, there was a request for ranged regex in phobos somewhere. Is there anything simple that can be easily ported? i don't think so. i.e. there are either very simple and barely usable

Re: threading issues with D - C - Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 01:07:42 + Michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I'm fairly sure I have tackled both of these issues, but it still seems like Python threads and D threads don't mix well. When running the same functions from D, I am able to get no

Re: Why the DMD Backend?

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 01:48:53 + MachineCode via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Sunday, 30 November 2014 at 02:07:16 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 29 Nov 2014 22:57:52 -0300 Ary Borenszweig via Digitalmars-d-learn digitalmars-d

Re: threading issues with D - C - Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 02:21:45 + Michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Thanks for this. Its definitely a step in the right direction. Would you mind explaining a bit more about the problem here, if you can? I don't fully understand why the garbage

Re: Why the DMD Backend?

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 3 Dec 2014 08:14:53 +0530 Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Heh -- fine for whatever compiler tools *you* create, but if someone else creates it, and is willing to distribute it under a more liberal license, why should you find it

Re: threading issues with D - C - Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 02:52:27 + Michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Okay. Well I am already not passing any D-allocated data. I'm specifically creating variables/arrays on the C-stack, and then passing the pointer of that to D and overwriting the data

Re: threading issues with D - C - Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 02:52:27 + Michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: by using from C code i mean that your main program is not written in D, it has no D `main()` and so on. i.e. you wrote, for example, some .a library in D and now you want to use that

Re: threading issues with D - C - Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 01:07:42 + Michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: all in all, you'd better not mixing D code with alien mulththreaded code and not using .a/.so libraries written in D in another language until you are familiar with D runtime and GC. those

Re: threading issues with D - C - Python

2014-12-02 Thread ketmar via Digitalmars-d-learn
On Wed, 03 Dec 2014 01:07:42 + Michael via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: btw, Adam Ruppe's D Cookbook has a chapter which describes how to call D library from C code. don't remember if it describes threading, though. signature.asc Description: PGP signature

Re: general questions on reference types versus value types...

2014-12-01 Thread ketmar via Digitalmars-d-learn
On Mon, 01 Dec 2014 20:22:59 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Could anybody explain why there is opinion that stack is fast and the heap is slow. All of them are located in the same memory. So the access time should be equal. could anybody

Re: Still not D standard yet ?

2014-11-29 Thread ketmar via Digitalmars-d-learn
On Sat, 29 Nov 2014 10:35:32 + bachmeier via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Saturday, 29 November 2014 at 09:03:13 UTC, Ledd wrote: Do you really think that a system language, or just a language that aims to be popular, can possibly discard the idea

Re: Why the DMD Backend?

2014-11-29 Thread ketmar via Digitalmars-d-learn
On Sat, 29 Nov 2014 15:37:32 + Joakim via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: build time for the whole DMD compiler with standard library, using G++: 100 seconds. yea, no kidding. gdc: i don't even want to think about that, way t long. ldc: not that

Re: How to initialise array of ubytes?

2014-11-29 Thread ketmar via Digitalmars-d-learn
On Sat, 29 Nov 2014 21:28:36 +0100 Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Dne Sat, 29 Nov 2014 21:10:41 +0100 Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsal(a): I'm trying to do this: ubyte[MAPSIZE][MAPSIZE] map = 1;

Re: Why the DMD Backend?

2014-11-29 Thread ketmar via Digitalmars-d-learn
On Sat, 29 Nov 2014 22:57:52 -0300 Ary Borenszweig via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: besides, i don't want to use anything llvm-related. Why not? let's say that there is some ideological reasons. signature.asc Description: PGP signature

Re: Why the DMD Backend?

2014-11-28 Thread ketmar via Digitalmars-d-learn
On Fri, 28 Nov 2014 19:59:39 + Xinok via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Given that we have GDC with the GCC backend and LDC with the LLVM backend, what are the benefits of keeping the DMD compiler backend? build time for the whole DMD compiler with standard

Re: Why does hello world not compile in safe?

2014-11-28 Thread ketmar via Digitalmars-d-learn
'cause `writeln`() is not @safe, as you can read in the following compiler message: source/app.d(5): Error: safe function 'D main' cannot call system function 'std.stdio.writeln!(string).writeln' signature.asc Description: PGP signature

Re: Error: cannot return non-void from void function

2014-11-27 Thread ketmar via Digitalmars-d-learn
On Thu, 27 Nov 2014 13:07:58 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Full function look like this: auto parseConfig() { auto config = Ini.Parse(getcwd ~ \\ ~ config.ini); string txtlinks = getcwd ~ \\ ~ config.getKey(input_links);

Re: Error: cannot return non-void from void function

2014-11-27 Thread ketmar via Digitalmars-d-learn
On Thu, 27 Nov 2014 17:22:35 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: ah, that's it! as spec says, D determines function return value from the first 'return' statement it seen. in your case this is `return;`, so function return type is

Re: Best way to add slash to tail of the path

2014-11-27 Thread ketmar via Digitalmars-d-learn
On Thu, 27 Nov 2014 18:05:37 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Sometimes it's path string may do not have tail slash of the path Compare: string path = C:\\folder\\name string path = C:\\folder\\name\\ in case if I need to append file name to

Re: Best way to add slash to tail of the path

2014-11-27 Thread ketmar via Digitalmars-d-learn
On Thu, 27 Nov 2014 20:02:40 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: see std.path, it contains alot of useful things. I looked there, but found only buildNormalizedPath, but it's not for such situation... take a second look then. ;-) you'll find

Re: Best way to add slash to tail of the path

2014-11-27 Thread ketmar via Digitalmars-d-learn
On Thu, 27 Nov 2014 20:20:24 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: take a second look then. ;-) you'll find `buildPath()` here too. Not better: string foo = D:/code/txtDownloader; writeln(foo); foo = foo.buildPath; foo ~=

Re: Best way to add slash to tail of the path

2014-11-27 Thread ketmar via Digitalmars-d-learn
On Thu, 27 Nov 2014 20:42:31 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Could you quote for me part of docs where it's written? I really can't understand about what you are taking. right here: http://dlang.org/phobos/std_path.html#buildPath do you see

Re: Error: cannot return non-void from void function

2014-11-27 Thread ketmar via Digitalmars-d-learn
On Thu, 27 Nov 2014 21:14:57 + Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: import core.runtime; import std.c.process; writeln(Can't find input file with list of links.); Runtime.terminate();

Re: Error: cannot return non-void from void function

2014-11-27 Thread ketmar via Digitalmars-d-learn
On Thu, 27 Nov 2014 22:25:10 +0100 Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Dne Thu, 27 Nov 2014 22:21:52 +0100 ketmar via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsal(a): On Thu, 27 Nov 2014 21:14:57 + Daniel Kozak via

Re: @property method needs ()

2014-11-24 Thread ketmar via Digitalmars-d-learn
On Mon, 24 Nov 2014 06:56:08 + Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hi, in following example the @property method needs the () otherwise compiler error for row 24 is thrown. I cannot judge, whether the compiler behaves correct or not. Kind regards

Re: Sum informations in file....

2014-11-24 Thread ketmar via Digitalmars-d-learn
On Mon, 24 Nov 2014 19:04:34 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I can't understand why foreach loop produce every line by line, while it's fuctional analog print lines on one string: the two samples are not the same, they doing completely different

Re: Sum informations in file....

2014-11-24 Thread ketmar via Digitalmars-d-learn
On Mon, 24 Nov 2014 11:41:43 -0800 Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On 11/24/2014 11:30 AM, ketmar via Digitalmars-d-learn wrote: File.byLine returns *output* *range*. Although the range is used for outputting, it is still an InputRange. :) ah

Re: How does this work?

2014-11-23 Thread ketmar via Digitalmars-d-learn
On Sun, 23 Nov 2014 22:51:48 + Freddy via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I know what this does, but can someone explain how it works? static if((typeof((inout int=0){ }))); it was here somewhere. this is, as you can see, a lambda. `typeof()` can

Re: How to pass static array to function not by value?

2014-11-22 Thread ketmar via Digitalmars-d-learn
On Sat, 22 Nov 2014 18:20:44 +0400 drug via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I tried to pass pointer to static array but it didn't work. i tried it right now and it works. if you really want to get some help, you'd better give us something to start with. i.e. your

Re: How to pass static array to function not by value?

2014-11-22 Thread ketmar via Digitalmars-d-learn
On Sat, 22 Nov 2014 15:45:51 + Eric via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Maybe this is not so lame because change() can take any length of static array. void change (int[] arr) { arr[1] = 42; } void main () { int[$] a = [1, 2, 3]; change(a);

Re: How to pass static array to function not by value?

2014-11-22 Thread ketmar via Digitalmars-d-learn
On Sat, 22 Nov 2014 08:07:31 -0800 H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Sat, Nov 22, 2014 at 05:57:30PM +0200, ketmar via Digitalmars-d-learn wrote: On Sat, 22 Nov 2014 15:45:51 + Eric via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: How to pass static array to function not by value?

2014-11-22 Thread ketmar via Digitalmars-d-learn
On Sat, 22 Nov 2014 20:05:13 +0400 drug via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Does it worth to make some compiler option that for example prohibits passing static array instead of dynamic one without slicing? Who has a lot of breakable correct D code doesn't use

Re: Simple code sample of Nesting Structures. I'm I doing something illegal here?

2014-11-22 Thread ketmar via Digitalmars-d-learn
On Sat, 22 Nov 2014 20:57:05 + WhatMeWorry via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: auto bottom = NestedBottom(2, ['d','o','g']); ah, that good old thingy! there were some debates about locals that shadows fields and how that can introduce some hard-to-catch

Re: write multiple lines without \n with writeln

2014-11-21 Thread ketmar via Digitalmars-d-learn
On Thu, 20 Nov 2014 14:23:23 -0300 Ary Borenszweig via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: This way you avoid silly typing mistakes while at the same time you allow splitting a string across several lines without having to concatenate them at runtime. i bet that

Re: vibe.d problem

2014-11-18 Thread ketmar via Digitalmars-d-learn
On Tue, 18 Nov 2014 08:37:14 -0500 Lázaro Armando via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Thread name: Re: vibe.d problem Mail number: 2 Date: Tue, Nov 18, 2014 In reply to: DigitalmarsD learn On Mon, 17 Nov 2014 16:24:17 -0500 låzaro via Digitalmars-d-learn

Re: InvalidMemoryOperationError@(0)

2014-11-17 Thread ketmar via Digitalmars-d-learn
On Mon, 17 Nov 2014 15:41:25 + Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: ~this() { foreach(cp; this._columns) { } } don't do that in destructors. `_columns` field can be already collected by

Re: vibe.d problem

2014-11-17 Thread ketmar via Digitalmars-d-learn
On Mon, 17 Nov 2014 16:24:17 -0500 låzaro via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Building vibe-d 0.7.20 configuration libevent, build type debug. this is very old. try git HEAD instead, it should help. signature.asc Description: PGP signature

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-13 Thread ketmar via Digitalmars-d-learn
On Thu, 13 Nov 2014 10:08:47 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Interesting though that it never crashes on Linux, only on Windows did this cause problems. seems that libc allocator is not marking free pages as unreadable, and windows libc allocator

Re: have function must pass delegate.

2014-11-13 Thread ketmar via Digitalmars-d-learn
On Thu, 13 Nov 2014 14:02:22 + Spacen Jasset via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: A method call in the GTK API takes a delegate as an argument(addOnActivate) I would like to be able to pass a function instead (address of). What is the solution, at present I

Re: Basically want to make a macro script

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 04:56:39 + Casey via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: D has nothing to do with your task, WinAPI does. and you'll need alot of expirience in reverse engineering, 'cause f... punkbuster shits it's pants almost for anything. it's a rootkit, and

Re: Russian translation of the range term?

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 11:38:50 + thedeemon via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: some languages like F# and Clojure use this term (often shortened to 'seq') послед. rotfl. signature.asc Description: PGP signature

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 12:40:30 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The following causes the DLL to crash on Windows: Input: immutable(short)* data (immutable because in separate thread). // Later core.stdc.stdlib.free(cast(short *)data); (short*

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 12:40:30 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The following causes the DLL to crash on Windows: Input: immutable(short)* data (immutable because in separate thread). // Later core.stdc.stdlib.free(cast(short *)data); (short*

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 14:11:35 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 12 November 2014 at 12:58:19 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 12 Nov 2014 12:40:30 + Chris via Digitalmars-d-learn digitalmars-d-learn

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-12 Thread ketmar via Digitalmars-d-learn
On Wed, 12 Nov 2014 16:03:08 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 12 November 2014 at 14:42:34 UTC, Chris wrote: On Wednesday, 12 November 2014 at 14:26:15 UTC, ketmar via if you can extend C DLL, just add wrapper for `free()` there.

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 11:50:16 + Ivan Kazmenko via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Is there an official translation already? In TDPL, the (very few) occurrences of range are translated as диапазон methinks that последовательность[0] is better, albeit longer. but

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 14:08:36 + Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Another synonym is list. hm... i afraid that it's not suitable. list has a well-defined meaning in programming literature. ranges are definitely not lists (but list can be a range). ah!

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 14:52:55 + Kagamin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I was thinking about list comprehension, which is what programming on ranges is. Isn't it? list is a good term, but it's already taken. so naming range as list will create unnecessary

Re: Network scanner

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 15:35:28 + RuZzz via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: netstat reports that the socket is in the TIME_WAIT or CLOSE_WAIT state. i'm not an expert in winsock, but did you tried to set SO_LINGER to off? signature.asc Description: PGP signature

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 15:38:26 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: What does набор mean literally? What is it? something like (unordered) set of something similar but not same, which can (eventually) be counted and things can be extracted/added. like this.

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 15:38:26 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 11 November 2014 at 15:03:40 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 11 Nov 2014 14:52:55 + Kagamin via Digitalmars-d-learn digitalmars-d-learn

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 16:10:12 + Dicebot via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: последовательность is solid generic term if you are not afraid of making mathematicians mad and it is totally unusable in practice. it's just too long and hard to pronounce to be used

Re: Russian translation of the range term?

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 16:50:23 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 11 November 2014 at 16:15:36 UTC, Dicebot wrote: On Tuesday, 11 November 2014 at 16:14:10 UTC, Chris wrote: Does that entail the concept that ranges (in D) are homogeneous

Re: Destructor/Finalizer Guarantees

2014-11-11 Thread ketmar via Digitalmars-d-learn
On Tue, 11 Nov 2014 22:31:17 + Maxime Chevalier-Boisvert via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: What I want to know is: what guarantees can I expect from destructor behavior? destructors *may* be called eventually. or not. in any order. but never twice. think

Re: Access Violation Tracking

2014-11-10 Thread ketmar via Digitalmars-d-learn
On Mon, 10 Nov 2014 11:13:11 + via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Sunday, 9 November 2014 at 14:45:11 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 09 Nov 2014 09:33:29 -0500 Etienne via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: Instructions for compilation from multiple source files

2014-11-10 Thread ketmar via Digitalmars-d-learn
On Mon, 10 Nov 2014 12:10:36 + Solomon E via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: If there aren't instructions or documentation on how to compile more than one file into a finished D runnable project in a correct way that can grow with larger projects, then I'll

Re: Instructions for compilation from multiple source files

2014-11-10 Thread ketmar via Digitalmars-d-learn
On Mon, 10 Nov 2014 13:29:02 + Solomon E via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: The problem that I'm having with this seems to be with GDC, not the rest of the D community. The following is a quote of the entire amount of information in the GDC man page on the

Re: Instructions for compilation from multiple source files

2014-11-10 Thread ketmar via Digitalmars-d-learn
On Mon, 10 Nov 2014 14:12:12 + Solomon E via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I keep saying I want documentation or specifications. and i keep saying that if you can't find those for you case, you'd better stick with IDE. you keep ignoring the fact that gdc is a

Re: Instructions for compilation from multiple source files

2014-11-10 Thread ketmar via Digitalmars-d-learn
On Mon, 10 Nov 2014 17:18:05 + Solomon E via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I do know about how to use GCC and where the documentation for that is. I know what .o files and .a files are in terms of GCC for C, because there's tons of documentation about that. I

<    3   4   5   6   7   8   9   10   11   >