Re: with (auto p = new ...)

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
aOn Tuesday, 23 September 2014 at 15:19:59 UTC, Andre wrote: Hi, I just wonder why with (auto p = new ...) is not working. It would be some syntax sugar in this scenario: with (auto p = new Panel()) { parent = this; text = bla;

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 03:08:55 UTC, csmith wrote: Hi everyone, I've got derelict.opengl3.gl3 and derelict.glfw3.glfw3 setup with dub and can get a window to open up and close with glfw3. I can also use glClear(GL_COLOR_BUFFER_BIT); however, beyond this most OpenGL commands fail

Re: How to export a deduced template type to the enclosing scope?

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 22:09:11 UTC, Ali Çehreli wrote: I think similar questions were asked by others in different contexts before. I played with core.thread.Fibre a little bit. As others have done a number of times before, I tried to make the following syntax possible inside

Re: Does remove immutability using cast to pass in a function make sense?

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 02:07:09 UTC, AsmMan wrote: I have this array: static immutable string[] months = [jan, fev, ...]; I need to pass it into canFind(). But it doesn't works with immutables so I need to cast it like in canFind(cast(string[]) months, month) to work. There's a

Re: New changes to DDOC where is the u tag coming from in parent classes?

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Tuesday, 23 September 2014 at 07:26:06 UTC, Gary Willoughby wrote: On Monday, 22 September 2014 at 20:44:25 UTC, Gary Willoughby wrote: Below is a change that results from re-generating my documentation using ddoc. I wonder where the new u tags are coming from that wrap the parent class

Re: New changes to DDOC where is the u tag coming from in parent classes?

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Monday, 22 September 2014 at 20:44:25 UTC, Gary Willoughby wrote: Below is a change that results from re-generating my documentation using ddoc. I wonder where the new u tags are coming from that wrap the parent class name. -div class=module-membersh2a name=Button/aclass span

Re: can't understand why code do not working

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Monday, 22 September 2014 at 19:36:39 UTC, Suliman wrote: Already 1 hour I am looking at example from http://ddili.org/ders/d.en/concurrency.html and my modification of it, and can't understand what's difference? Why it's output only: 1 3 and then do not do nothing! import std.stdio;

Re: Can't get Visual D to come up. No warnings, no errors, no nothing

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Monday, 22 September 2014 at 03:21:44 UTC, WhatMeWorry wrote: Anybody installed Visual D recently? As per the install instructions, I downloaded the Visual Studio isolated Shell 2013 and its integrated package. Everything went smoothly. I then downloaded Visual D and installed it with

Re: Segfault in DMD OSX

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Monday, 22 September 2014 at 16:36:03 UTC, Etienne wrote: I'm having issues with DMD returning exit code -11 rather than compiling my project. I have no idea how to debug this, I'm using Mac OS X 10.9.4 with latest git DMD tagged 2.066, and this project: https://github.com/etcimon/event.d

Re: Cannot deduce from type

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Monday, 22 September 2014 at 14:45:31 UTC, Chris wrote: Why is that? import std.stdio, std.array void main() { auto output = appender!(string); output ~= world!; // output.data.insertInPlace(0, Hello, ); // Doesn't work auto asString = output.data; asString.insertInPlace(0, Hello,

Re: parallel foreach hangs

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Monday, 22 September 2014 at 11:25:53 UTC, Daniel Kozak wrote: this code never end import std.stdio; import std.file; import std.parallelism : parallel; import std.algorithm : filter; void main(string[] args) { foreach(d; parallel(args[1 .. $], 1)) { auto phpFiles =

Re: how to create and compile reesources for dmd 64

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
`On Friday, 19 September 2014 at 22:20:59 UTC, Cassio Butrico wrote: Hello everyone, When I create and compile resouces to 32 works perfect, but when I try to compilat of 64 error LNK1136: invalid or corrupt file. I do not know if it has to do with comverter COFF to OMF. can someone give me a

Re: put string[] into a appender without loop?

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Sunday, 21 September 2014 at 23:41:58 UTC, AsmMan wrote: I'd like to copy an array string into a appender!string() but I can't see how to do this without loop myself over the string array. Is there a native function or should I write it myself? see more example

Re: How does GC.addRange work?

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Saturday, 20 September 2014 at 20:14:36 UTC, Gary Willoughby wrote: How does GC.addRange work? i.e. what is it doing? I'm assuming reading the docs that it adds a range for the GC to scan but what actually happens? Does the GC look into this range and check for the existence of pointers

Re: Unicode arithmetic at run-time

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Sunday, 21 September 2014 at 03:00:34 UTC, Charles McAnany wrote: Friends, I note that there are playing cards in unicode: http://en.wikipedia.org/wiki/Playing_cards_in_Unicode They follow a nice pattern, so I can quickly convert from a rank and suit to the appropriate escape sequence in D.

Re: Cannot deduce from type

2014-09-24 Thread kiran kumari via Digitalmars-d-learn
On Monday, 22 September 2014 at 14:45:31 UTC, Chris wrote: Why is that? import std.stdio, std.array void main() { auto output = appender!(string); output ~= world!; // output.data.insertInPlace(0, Hello, ); // Doesn't work auto asString = output.data; asString.insertInPlace(0, Hello,

isCallable is not an expression

2014-09-24 Thread andre via Digitalmars-d-learn
Hi, following code throws an error when I uncomment method getPropertyDuplicate. getPropertyDuplicate is just a copy of getProperty except the method name. Why these errors are thrown? C:\D\dmd2\windows\bin\..\..\src\phobos\std\traits.d(1257): Error: isCallable!(ge tPropertyDuplicate) is

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread Nicolas F. via Digitalmars-d-learn
Make sure to call DerelictGL3.reload() to get all the OpenGL calls, if you don't, you only get OpenGL 1.1

Remove filename from path

2014-09-24 Thread Suliman via Digitalmars-d-learn
What is the best way to remove file name from full path? string path = thisExePath()

Re: Remove filename from path

2014-09-24 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 10:11:04 UTC, Suliman wrote: What is the best way to remove file name from full path? string path = thisExePath() Seems like dirName in std.path is a good candidate ;) http://dlang.org/phobos/std_path.html#.dirName You'll find many other path manipulation

Re: Remove filename from path

2014-09-24 Thread Suliman via Digitalmars-d-learn
string path = thisExePath() Seems like dirName in std.path is a good candidate ;) http://dlang.org/phobos/std_path.html#.dirName You'll find many other path manipulation functions there. Thanks! But if I want to strip it, how I can cut it?

Re: Remove filename from path

2014-09-24 Thread Suliman via Digitalmars-d-learn
I can't understand how to use strip? For example I would like to cut just extension. path = path.stripRight(exe); Error: no overload matches for stripRight(C)(C[] str) if

Recursive function call

2014-09-24 Thread Suliman via Digitalmars-d-learn
string getFileName() { //чтобы было проще обрабатываемый файл будем хранить рядом с бинариком string filename = chomp(readln()); string path = getcwd(); writeln((path ~ \\ ~ filename)); if (exists(path ~ \\ ~ filename)) return (path ~ \\ ~

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread Mike Parker via Digitalmars-d-learn
On 9/24/2014 12:08 PM, csmith wrote: Hi everyone, Compiling... source/app.d(25): Error: undefined identifier glBegin source/app.d(26): Error: undefined identifier glEnd FAIL .dub/build/application-debug-linux.posix-x86_64-dmd-357CCD4CB91CACEC384AF7BAA514E3A7 myproj

Re: Remove filename from path

2014-09-24 Thread ketmar via Digitalmars-d-learn
On Wed, 24 Sep 2014 10:35:28 + Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I can't understand how to use strip? For example I would like to cut just extension. std.path.setExtension is your friend. signature.asc Description: PGP signature

Re: Remove filename from path

2014-09-24 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 10:35:29 UTC, Suliman wrote: I can't understand how to use strip? For example I would like to cut just extension. path = path.stripRight(exe); Error: no overload matches for stripRight(C)(C[] str) if stripExtension would be your friend here. If you want

Re: Recursive function call

2014-09-24 Thread via Digitalmars-d-learn
How about using a loop? string getFileName() { while(true) { string filename = chomp(readln()); string path = getcwd(); writeln((path ~ \\ ~ filename)); if (exists(path ~ \\ ~ filename)) return (path ~ \\ ~ filename);

Re: Remove filename from path

2014-09-24 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 10:35:29 UTC, Suliman wrote: I can't understand how to use strip? For example I would like to cut just extension. path = path.stripRight(exe); Error: no overload matches for stripRight(C)(C[] str) if strip doens't work that way. It simply removes

Re: Remove filename from path

2014-09-24 Thread ketmar via Digitalmars-d-learn
On Wed, 24 Sep 2014 12:21:40 + monarch_dodra via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Unfortunately, there is no generic function that allows striping of a specific ending range but for strings we have std.string.chomp. signature.asc Description: PGP signature

Re: Recursive function call

2014-09-24 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 10:57:27 UTC, Suliman wrote: string getFileName() { //чтобы было проще обрабатываемый файл будем хранить рядом с бинариком string filename = chomp(readln()); string path = getcwd(); writeln((path ~ \\ ~ filename)); if

Re: Recursive function call

2014-09-24 Thread anonymous via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 10:57:27 UTC, Suliman wrote: string getFileName() { [...] getFilename(); //I need something similar, to call function again. You mistyped the function name, it's getFileName (capital N), and you forgot return. So: return getFileName();

Re: Remove filename from path

2014-09-24 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 12:29:09 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 24 Sep 2014 12:21:40 + monarch_dodra via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Unfortunately, there is no generic function that allows striping of a specific ending range

Re: Remove filename from path

2014-09-24 Thread ketmar via Digitalmars-d-learn
On Wed, 24 Sep 2014 12:39:01 + monarch_dodra via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I missread that documentation. I thought it removed all characters that can also be found in delim. Power to me. ah, i just found this function (really, less than hour ago), that's

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread csmith via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 11:07:56 UTC, Mike Parker wrote: You're using deprecated OpenGL calls. The gl3 module only declares and loads modern OpenGL. If you really want to use the deprecated stuff, change the gl3 import to this: import derelict.opengl3.gl; And call load/reload on

Re: with (auto p = new ...)

2014-09-24 Thread Andre via Digitalmars-d-learn
Enhancement 13526 filed: https://issues.dlang.org/show_bug.cgi?id=13526

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread Nicolas F. via Digitalmars-d-learn
Whoops, I just saw that my earlier answer was totally inaccurate. I was on my phone at the time, so didn't look at the code in detail. On Wednesday, 24 September 2014 at 13:59:41 UTC, csmith wrote: On Wednesday, 24 September 2014 at 11:07:56 UTC, Mike Parker wrote: You're using deprecated

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread csmith via Digitalmars-d-learn
Whoops, I just saw that my earlier answer was totally inaccurate. I was on my phone at the time, so didn't look at the code in detail. No big deal, figured you just missed it / auto response to this kinda question. I did my best to google this question, but wasn't really sure where to

Re: Remove filename from path

2014-09-24 Thread Ali Çehreli via Digitalmars-d-learn
On 09/24/2014 05:21 AM, monarch_dodra wrote: On Wednesday, 24 September 2014 at 10:35:29 UTC, Suliman wrote: I can't understand how to use strip? For example I would like to cut just extension. path = path.stripRight(exe); Error: no overload matches for stripRight(C)(C[] str) if strip

Re: isCallable is not an expression

2014-09-24 Thread Ali Çehreli via Digitalmars-d-learn
On 09/24/2014 01:11 AM, andre wrote: static if (isSomeFunction!(__traits(getMember, typeof(this), m)) Submitted the following bug report: https://issues.dlang.org/show_bug.cgi?id=13528 import std.traits; mixin template MyTemplate() { void foo() { pragma(msg,

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread Nicolas F. via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 16:36:29 UTC, csmith wrote: I came from web development, you're meaning to tell me there's coding outside of writing boilerplate? Jokes aside, figured if I took the time to learn a modern language, I'd be consistent with adding in newer technologies :) In

Re: isCallable is not an expression

2014-09-24 Thread Ali Çehreli via Digitalmars-d-learn
On 09/24/2014 01:11 AM, andre wrote: template MyTemplate() { import std.traits : isSomeFunction, functionAttributes, FunctionAttribute, ReturnType; string[] getPropertyNames() 1) You need a this template parameter: string[] getPropertyNames(this MyType)() 2) Now, replace

Re: with (auto p = new ...)

2014-09-24 Thread ketmar via Digitalmars-d-learn
On Wed, 24 Sep 2014 14:39:25 + Andre via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Enhancement 13526 filed: https://issues.dlang.org/show_bug.cgi?id=13526 i wrote a quickhack-patch for this ER. as it's my first patch that goes outside parser it needs to be reviewed by

Does D has C#'s string.Empty?

2014-09-24 Thread AsmMan via Digitalmars-d-learn
Does D has C#'s string.Empty?