Re: isTemplate and isValue?

2015-12-12 Thread Basile B. via Digitalmars-d-learn
On Saturday, 12 December 2015 at 14:17:52 UTC, Shriramana Sharma wrote: Hello. Re my posting just now re AliasSeq being able to contain a template identifier too, I wonder whether it is possible to have a std.traits template to identify whether something is a template or not? In connection

Re: Error 42: Symbol Undefined __lseeki64

2015-12-17 Thread Basile B. via Digitalmars-d-learn
On Thursday, 17 December 2015 at 04:11:56 UTC, tcak wrote: On Wednesday, 16 December 2015 at 18:30:41 UTC, Byron Heads wrote: On Wednesday, 16 December 2015 at 18:21:33 UTC, Byron Heads wrote: On Wednesday, 16 December 2015 at 18:14:35 UTC, Byron Heads I searched the function "__lseek64" under

Re: %s not producing string representation of enum?

2015-12-10 Thread Basile B. via Digitalmars-d-learn
On Thursday, 10 December 2015 at 14:46:26 UTC, Basile B. wrote: On Thursday, 10 December 2015 at 14:24:43 UTC, Shriramana Sharma wrote: Hello. I'm using DMD 2.069.2. As per http://ddili.org/ders/d.en/enum.html the following code is supposed to output the *names* of the suits: import

Re: %s not producing string representation of enum?

2015-12-10 Thread Basile B. via Digitalmars-d-learn
On Thursday, 10 December 2015 at 14:24:43 UTC, Shriramana Sharma wrote: Hello. I'm using DMD 2.069.2. As per http://ddili.org/ders/d.en/enum.html the following code is supposed to output the *names* of the suits: import std.stdio; void main() { enum Suit { spades, hearts, diamonds, clubs

Re: GTKD Cairo get pixel color

2016-01-04 Thread Basile B. via Digitalmars-d-learn
On Friday, 1 January 2016 at 22:00:04 UTC, TheDGuy wrote: On Friday, 1 January 2016 at 19:32:40 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color

Re: Size of Compiled Program

2016-01-04 Thread Basile B. via Digitalmars-d-learn
On Monday, 4 January 2016 at 13:49:03 UTC, Martin Tschierschke wrote: When I was writing a small speed test - D versus Ruby, calculating the first n prime numbers, I realized, that for small n Ruby may be faster, than compiling and executing with D. But for n = 1,000,000 D outperforms Ruby by

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 17:16:10 UTC, TheDGuy wrote: On Tuesday, 5 January 2016 at 16:43:00 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 16:25:01 UTC, TheDGuy wrote: But how do i know which line or column my pixel is in? - study D operator overloading, I've given you the

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 15:04:57 UTC, TheDGuy wrote: But i get "only one index allowed to index char". So it looks like there is no 2D array but just a char. If i try like this: The data is just a contiguous memory area. You have to implement your own opIndexAssign()/opIndex() to

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 16:25:01 UTC, TheDGuy wrote: But how do i know which line or column my pixel is in? - study D operator overloading, I've given you the solution. And what is 't' in 'opIndexAssign'? - t is what you want to assign. It can be an uint or maybe a float[4]. Look at my

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 17:37:04 UTC, TheDGuy wrote: On Tuesday, 5 January 2016 at 17:34:06 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 17:16:10 UTC, TheDGuy wrote: On Tuesday, 5 January 2016 at 16:43:00 UTC, Basile B. wrote: [...] Okay, but what is this? "import iz.memory,

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 18:19:08 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 17:39:41 UTC, Basile B. wrote: IDK, except D I only speek/talk Object Pascal (FPC/Delphi). "I didn't know, apart D, I only speak/talk Object Pascal (FPC/Delphi)." Was what I meant. ^^

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 17:39:41 UTC, Basile B. wrote: IDK, except D I only speek/talk Object Pascal (FPC/Delphi). "I didn't know, apart D, I only speak/talk Object Pascal (FPC/Delphi)." Was what I meant. ^^

Re: Lots of D code

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 00:59:53 UTC, steven kladitis wrote: I have 843 programs written in D. 805 actually create an 32 bit exe in windows 10. I am running the latest D. Some just start to link and the linker disappears. Some just have issues I am not able figure out. I can attach

Re: Convert a hex string into a ubyte[] or OutBuffer

2016-01-07 Thread Basile B. via Digitalmars-d-learn
On Thursday, 7 January 2016 at 21:00:06 UTC, zabruk70 wrote: Hello. In modern phobos ver 2.069.1 exists template hexString https://dlang.org/phobos/std_conv.html#.hexString to convert hex string to bytes. It works in compile time only. But what if i need it in run time? Is the answer in this

Re: Convert a hex string into a ubyte[] or OutBuffer

2016-01-07 Thread Basile B. via Digitalmars-d-learn
On Thursday, 7 January 2016 at 21:00:06 UTC, zabruk70 wrote: Hello. In modern phobos ver 2.069.1 exists template hexString https://dlang.org/phobos/std_conv.html#.hexString to convert hex string to bytes. It works in compile time only. But what if i need it in run time? Is the answer in this

Re: version in enum

2016-01-09 Thread Basile B. via Digitalmars-d-learn
On Saturday, 9 January 2016 at 12:43:32 UTC, Øivind wrote: Hi, Why doesn't this work? Seems like it should: enum { A = 1, version(xx) { B = 2 } } It's not allowed in the grammar but I agree with you, it could be useful. Recent example where it could:

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 21:24:51 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2016 at 21:01:55 UTC, Basile B. wrote: Awww... I'm so sorry. https://youtu.be/uyMUck2RRjw du bist normal oder idiot ? https://www.youtube.com/watch?v=nGLwBCMSXys

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 22:08:52 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2016 at 22:02:47 UTC, Basile B. wrote: du bist normal oder idiot ? https://youtu.be/7kjTXMecCrM Ding dong! https://en.wikipedia.org/wiki/Turing_Award Si tu crois que tu es un génie, il y a de

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 19:13:35 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 18:19:08 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 17:39:41 UTC, Basile B. wrote: IDK, except D I only speek/talk Object Pascal (FPC/Delphi). "I didn't know, apart D, I only speak/talk Object

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 19:47:02 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 19:13:35 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 18:19:08 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 17:39:41 UTC, Basile B. wrote: IDK, except D I only speek/talk Object Pascal

Re: GTKD Cairo get pixel color

2016-01-01 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 23:20:23 UTC, Basile B. wrote: On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context? render to a png back buffer. see

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 23:36:16 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2016 at 23:26:12 UTC, Basile B. wrote: access to pix is easy... This is the learn forum. Maybe one should be able to figure it out without asking, but there is nothing wrong with asking in depth on

Re: GTKD Cairo get pixel color

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 22:40:22 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 22:08:52 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 5 January 2016 at 22:02:47 UTC, Basile B. wrote: du bist normal oder idiot ? https://youtu.be/7kjTXMecCrM Ding dong!

Re: Variable below zero but if statement doesn't grab?

2016-01-05 Thread Basile B. via Digitalmars-d-learn
On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote: On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote: On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote: On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote: On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote:

Re: GTKD Cairo get pixel color

2015-12-30 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 20:44:44 UTC, TheDGuy wrote: Hello, is there any way to get the pixel color of a single pixel by x and y coordinates of a context? render to a png back buffer. see cairo_image_surface_create_for_data then you'll be able to access the data and, at the same

Re: function without "this" cannot be const?

2015-12-20 Thread Basile B. via Digitalmars-d-learn
On Monday, 21 December 2015 at 02:03:14 UTC, Shriramana Sharma wrote: I'm trying to interface to a C function: extern(C) const char * textAttrN(const char * specString, size_t n); and getting the error: Error: function .textAttrN without 'this' cannot be const Please advise as to what I'm

Re: argument type const char* can pass string, buf why const wchar* can not pass wstring

2015-12-26 Thread Basile B. via Digitalmars-d-learn
On Sunday, 27 December 2015 at 03:34:18 UTC, riki wrote: void ccf(const char* str){} void cwf(const wchar* str){} void main() { ccf("aaa");//ok cwf("xxx"w); // error and why ? } IDK but usually the const storage class is used for narrow strings because it allows to pass either

Re: Scope of D packages

2015-12-19 Thread Basile B. via Digitalmars-d-learn
On Saturday, 19 December 2015 at 00:46:12 UTC, cym13 wrote: To be exact it doesn't need the sources, it needs the function signatures and type definitions so the equivalent of C header files. If you don't want to share the full sources with your library you can generate those header files

Re: Set color to a single point in Cairo

2015-12-19 Thread Basile B. via Digitalmars-d-learn
On Saturday, 19 December 2015 at 14:16:23 UTC, TheDGuy wrote: is it possible to set the color of a single pixel with Cairo? Not like you would do with a classic canvas (2d grid), because colors are applied with `cairo_fill()` and `cairo_stroke()` on a particular path. but you can define a

Re: Can't debug my solution

2015-12-19 Thread Basile B. via Digitalmars-d-learn
On Sunday, 20 December 2015 at 01:29:59 UTC, Israel wrote: On Saturday, 19 December 2015 at 20:52:41 UTC, Matheus Reis wrote: Hello, people! I'm Matheus, a 20 y/o game developer who wants to get started with D. It has really caught my attention, and I've been playing with it for some hours

Re: Scope of D packages

2015-12-18 Thread Basile B. via Digitalmars-d-learn
On Friday, 18 December 2015 at 23:20:34 UTC, Jakob Jenkov wrote: I'm coming from Java where "packages" are not that much more than directories. Each class can be exposed or hidden inside a package etc. In Java it is common that an API consists of many packages and subpackages. All classes

Re: argument type const char* can pass string, buf why const wchar* can not pass wstring

2015-12-26 Thread Basile B. via Digitalmars-d-learn
On Sunday, 27 December 2015 at 04:54:07 UTC, Basile B. wrote: it allows to pass either `char[]` or `string[]`: I meant "char[]` or `string", string without square brackets of course...

Re: argument type const char* can pass string, buf why const wchar* can not pass wstring

2015-12-26 Thread Basile B. via Digitalmars-d-learn
On Sunday, 27 December 2015 at 05:29:44 UTC, riki wrote: On Sunday, 27 December 2015 at 04:54:07 UTC, Basile B. wrote: On Sunday, 27 December 2015 at 03:34:18 UTC, riki wrote: void ccf(const char* str){} void cwf(const wchar* str){} void main() { ccf("aaa");//ok cwf("xxx"w); //

Re: Lots of D code

2015-12-28 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 00:59:53 UTC, steven kladitis wrote: I have 843 programs written in D. 805 actually create an 32 bit exe in windows 10. I am running the latest D. Some just start to link and the linker disappears. Some just have issues I am not able figure out. I can attach

are MRV as an optimization well known ?

2015-12-28 Thread Basile B. via Digitalmars-d-learn
While working on a framework, I've found that Multiple Return Values (MRV) are clearly an optimization. I'de like to write a small D blog post about this but I don't know If it's clever enough or if it's a well know fact. My base D material is this: --- #!runnable-flags: -O -boundscheck=off

Re: are MRV as an optimization well known ?

2015-12-28 Thread Basile B. via Digitalmars-d-learn
I mean it's maybe "just" a special case of RVO, since tuples are processed as structs ?

Re: Multiple selective imports on one line

2015-12-28 Thread Basile B. via Digitalmars-d-learn
On Monday, 28 December 2015 at 14:16:36 UTC, Basile B. wrote: On Monday, 28 December 2015 at 14:09:30 UTC, Joakim wrote: I wish dfmt could do this for us, so that you develop with all the modules imported at the top, then run dfmt and it scopes all the imports and adds the selective import of

Re: Multiple selective imports on one line

2015-12-28 Thread Basile B. via Digitalmars-d-learn
On Monday, 28 December 2015 at 14:09:30 UTC, Joakim wrote: I wish dfmt could do this for us, so that you develop with all the modules imported at the top, then run dfmt and it scopes all the imports and adds the selective import of symbols. I've been thinking about implementing a tool to do

Re: are MRV as an optimization well known ?

2015-12-28 Thread Basile B. via Digitalmars-d-learn
On Monday, 28 December 2015 at 12:40:09 UTC, Basile B. wrote: I mean it's maybe "just" a special case of RVO, since tuples are processed as structs ? Also in the second version the stack size is modified by 78 bytes. Not when using MRV.

Re: Variable below zero but if statement doesn't grab?

2015-12-28 Thread Basile B. via Digitalmars-d-learn
On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote: On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote: On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote: Any idea what i am doing wrong? https://www.youtube.com/watch?v=j_VCa-5VeP8 You could post the code also, personnaly

Re: Set color to a single point in Cairo

2015-12-21 Thread Basile B. via Digitalmars-d-learn
On Sunday, 20 December 2015 at 11:16:06 UTC, TheDGuy wrote: On Sunday, 20 December 2015 at 01:17:50 UTC, Basile B. wrote: On Saturday, 19 December 2015 at 14:16:23 UTC, TheDGuy wrote: is it possible to set the color of a single pixel with Cairo? Not like you would do with a classic canvas

Re: Multiple selective imports on one line

2015-12-23 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 19:34:26 UTC, earthfront wrote: On Wednesday, 23 December 2015 at 11:00:19 UTC, Jakob Ovrum wrote: [...] My goal is to import several symbols from different modules on one line. I'm trying to figure out if it's possible or not. It makes the code more concise

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 21:19:14 UTC, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 21:12:11 UTC, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 21:07:12 UTC, Basile B. wrote: [...] Thanks for letting me know! So is what your saying is that an common

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 20:52:05 UTC, Adam D. Ruppe wrote: On Wednesday, 23 December 2015 at 20:49:21 UTC, Taylor Hillegeist wrote: | GRAPICS LIB | +---+---+---+ <- what is this interface |SDL|GDI|OPENGL.| +---+---+---+ SDL, GDI, and OpenGL *are* graphics libs so it

Re: Graphics/font/platform backends with common interfaces?

2015-12-23 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 21:12:11 UTC, Taylor Hillegeist wrote: On Wednesday, 23 December 2015 at 21:07:12 UTC, Basile B. wrote: [...] Thanks for letting me know! So is what your saying is that an common interface is not possible or practical or perhaps useful? It's possible but

Re: Lots of D code

2015-12-22 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 23 December 2015 at 00:59:53 UTC, steven kladitis wrote: I have 843 programs written in D. [...] All of the programs are from RosettaCode.org. The script to compile them generates a log file and you will see a few that the linker just stops No idea why. A few have 64K link

Re: Easier way to add libraries to visual d?

2016-06-07 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 7 June 2016 at 08:49:16 UTC, TheDGuy wrote: On Friday, 3 June 2016 at 16:20:53 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 17:06:03 UTC, Basile B. wrote: colorize works. You meant "serial-port" ? Does Coedit have the possibility to debug? Yes / No? No

Re: Implicit conversion of struct to bool for if (s) operation ?

2016-06-07 Thread Basile B. via Digitalmars-d-learn
On Monday, 6 June 2016 at 15:34:18 UTC, chmike wrote: On Monday, 6 June 2016 at 15:28:35 UTC, John wrote: Thank you John and Adam. That was a quick answer ! Too late but another option would have been to put an alias this on a bool getter: struct Info { bool getStuff() {

Re: Effect of declaring a class immutable ?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 14:12:23 UTC, chmike wrote: I couldn't find any information about this on the dlang web site. What is the effect adding the immutable attribute to a class like this immutable class MyClass { ... } The compiler doesn't complain. Will it add the immutable

Re: Why do some T.init evaluate to true while others to false?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 14:03:16 UTC, ArturG wrote: for example: if(any floatingpoint.init) will be true if(any char.init) also true if("") also true while others are false e.g. string s; if(s) will be false all others are also false or did i miss any? It's a shortcut that works for

Re: Why do some T.init evaluate to true while others to false?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 15:11:50 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 14:03:16 UTC, ArturG wrote: [...] [...] - integral(*): if (i) <=> if (i > 0) I obviously meant: - integral(*): if (i) <=> if (i <> 0) and "<=>" stands for "equivalence"

Re: How to detect/filter modules in __traits(allMembers)?

2016-06-11 Thread Basile B. via Digitalmars-d-learn
On Saturday, 11 June 2016 at 19:45:56 UTC, Random D user wrote: Any good ideas how to do that? I couldn't figure it out in a short amount of time, but I expect that it's possible. I'm probably missing something obvious here. Probably because D's reflection/meta programming facilities are a

Re: Access private member

2016-06-13 Thread Basile B. via Digitalmars-d-learn
On Monday, 13 June 2016 at 07:53:08 UTC, Jacob Carlborg wrote: On 2016-06-13 09:49, Jacob Carlborg wrote: For fields, used .tupleof, for other symbols, use a pointer. Here's an example [1] of accessing a field using the name of the field as a string. It will bypass private. That module

Re: Access private member

2016-06-13 Thread Basile B. via Digitalmars-d-learn
On Monday, 13 June 2016 at 07:43:09 UTC, Pierre wrote: Hi, I would like to know how can i access private member of class from outside ? I think about serialization for instance, serializer must have access to protected attributes. How this is done ? Thank you. You can perform the

Re: Access private member

2016-06-13 Thread Basile B. via Digitalmars-d-learn
On Monday, 13 June 2016 at 11:27:31 UTC, Jacob Carlborg wrote: On 2016-06-13 09:54, Pierre wrote: Thank you i will try it. You don't need to involve the constructor. You can use .tupleof, as I mentioned [1] [2]. [1] http://forum.dlang.org/post/njlohq$1n99$1...@digitalmars.com [2]

Re: Access private member

2016-06-13 Thread Basile B. via Digitalmars-d-learn
On Monday, 13 June 2016 at 15:00:06 UTC, Basile B. wrote: On Monday, 13 June 2016 at 14:30:13 UTC, Basile B. wrote: On Monday, 13 June 2016 at 11:27:31 UTC, Jacob Carlborg wrote: On 2016-06-13 09:54, Pierre wrote: Thank you i will try it. You don't need to involve the constructor. You can

Re: Access private member

2016-06-13 Thread Basile B. via Digitalmars-d-learn
On Monday, 13 June 2016 at 14:30:13 UTC, Basile B. wrote: On Monday, 13 June 2016 at 11:27:31 UTC, Jacob Carlborg wrote: On 2016-06-13 09:54, Pierre wrote: Thank you i will try it. You don't need to involve the constructor. You can use .tupleof, as I mentioned [1] [2]. [1]

Re: Easier way to add libraries to visual d?

2016-05-28 Thread Basile B. via Digitalmars-d-learn
On Saturday, 28 May 2016 at 15:31:18 UTC, TheDGuy wrote: On Saturday, 28 May 2016 at 15:29:36 UTC, TheDGuy wrote: Thanks a lot for the fast hot fix, now everything works fine! :) Great IDE! Do you mind implementing an option to reset the layout to default? Because i think i messed up and

Re: Keeping a mutable reference to a struct with immutable members

2016-05-29 Thread Basile B. via Digitalmars-d-learn
On Sunday, 29 May 2016 at 19:09:13 UTC, pineapple wrote: On Sunday, 29 May 2016 at 18:52:36 UTC, pineapple wrote: What's the best way to handle something like this? Well I did get something to work but it's ugly and I refuse to believe there isn't a better way to handle this. Where `Range`

Re: Easier way to add libraries to visual d?

2016-05-28 Thread Basile B. via Digitalmars-d-learn
On Friday, 27 May 2016 at 19:30:10 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 22:15:17 UTC, Basile B. wrote: gfm doesn't yield a .lib because of this: https://github.com/d-gamedev-team/gfm/blob/master/dub.json#L22 it should be "library" or staticLibrary or "sourceLibrary" thus it can't

Re: Getting the parameters and other attributes belonging to the function overload with the greatest number of arguments

2016-05-31 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 31 May 2016 at 20:06:47 UTC, pineapple wrote: I'd like to find the overload of some function with the most parameters and (in this specific case) to get their identifiers using e.g. ParameterIdentifierTuple. There have also been cases where I'd have liked to iterate over the result

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 15:11:05 UTC, TheDGuy wrote: Hi, i use Visual D as a plugin for visual studio to create D applications. But what bothers me a bit is that i have to tell visual D the exact link to the .lib file for every lib i want to use in the project (!). So these are the steps

Re: Why do some T.init evaluate to true while others to false?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 15:14:21 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 15:11:50 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 14:03:16 UTC, ArturG wrote: [...] [...] - integral(*): if (i) <=> if (i > 0) I obviously meant: - integral(*): if (i) <=> if (i <> 0) and

Re: Why do some T.init evaluate to true while others to false?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 15:48:18 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 15:34:50 UTC, ArturG wrote: On Thursday, 26 May 2016 at 15:29:52 UTC, Basile B. wrote: float.init is not equal to 0.0f. In D FP points values are initialized to nan (not a number). By the way for

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 15:41:45 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 15:21:40 UTC, Basile B. wrote: Use Coedit: the widget "library manager" allow to register libraries in a single click and then they are usable on the fly, in the projects or in a runnable modules, without

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 16:21:30 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 16:01:22 UTC, Basile B. wrote: To register a DUB package, you can either fetch (DUB icon) or clone the repo, open the DUB JSON project, compile the right config, then in the libman there's a icon with a gray

Re: Why do some T.init evaluate to true while others to false?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 15:34:50 UTC, ArturG wrote: On Thursday, 26 May 2016 at 15:29:52 UTC, Basile B. wrote: float.init is not equal to 0.0f. In D FP points values are initialized to nan (not a number). By the way for strings it works, it's like the array case I described in the

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 16:53:42 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 16:21:30 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 16:01:22 UTC, Basile B. wrote: To register a DUB package, you can either fetch (DUB icon) or clone the repo, open the DUB JSON project, compile the

Re: Why do some T.init evaluate to true while others to false?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 15:25:03 UTC, arturg wrote: On Thursday, 26 May 2016 at 15:15:57 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 15:14:21 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 15:11:50 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 14:03:16 UTC, ArturG wrote:

Re: Why do some T.init evaluate to true while others to false?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 15:34:50 UTC, ArturG wrote: On Thursday, 26 May 2016 at 15:29:52 UTC, Basile B. wrote: float.init is not equal to 0.0f. In D FP points values are initialized to nan (not a number). By the way for strings it works, it's like the array case I described in the

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 17:09:03 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 17:06:03 UTC, Basile B. wrote: colorize works. You meant "serial-port" ? Well, i get the same message for both packages...Even though it creates a new folder with all the files in

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 17:02:06 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 16:53:42 UTC, Basile B. wrote: [...] Thanks, now i found it. If i try to add for example 'colorize' as a package i get: Fetching serial-port ~master... Placing serial-port ~master to

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 17:09:03 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 17:06:03 UTC, Basile B. wrote: colorize works. You meant "serial-port" ? Well, i get the same message for both packages...Even though it creates a new folder with all the files in

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 17:06:03 UTC, Basile B. wrote: On Thursday, 26 May 2016 at 17:02:06 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 16:53:42 UTC, Basile B. wrote: [...] Thanks, now i found it. If i try to add for example 'colorize' as a package i get: Fetching serial-port

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 17:09:03 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 17:06:03 UTC, Basile B. wrote: colorize works. You meant "serial-port" ? Well, i get the same message for both packages...Even though it creates a new folder with all the files in

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 19:07:42 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 17:25:25 UTC, Basile B. wrote: I'm on Windows now. I'm sorry but both packages were setup successfully. What you can do is the other way: - clone the git repos. - open the DUB json as project. - choose the

Re: Easier way to add libraries to visual d?

2016-05-26 Thread Basile B. via Digitalmars-d-learn
On Thursday, 26 May 2016 at 20:46:31 UTC, TheDGuy wrote: On Thursday, 26 May 2016 at 20:25:43 UTC, Basile B. wrote: [...] I tried this with the gfm-package. I opened the dub.json file as a project and clicked 'Compilation'-> 'Compile Project' then it did its things: [...] gfm doesn't

Re: TypeInfo_Interface from runtime string?

2016-06-22 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 22 June 2016 at 15:15:51 UTC, Thalamus wrote: Hi everyone, My project includes lots of .Net interop via C linkage. One of the things I need to do is refer in C# to an interface declared in the D code, and then to actually work with the interface concretely in the D layer. So, I

Re: GTKD - Application crashes - or not? [Coedit]

2016-06-16 Thread Basile B. via Digitalmars-d-learn
On Thursday, 16 June 2016 at 07:51:14 UTC, TheDGuy wrote: On Thursday, 16 June 2016 at 07:50:13 UTC, TheDGuy wrote: I get 'Failed to execute: 267'. Probably because a symbolic string is used in the run options? https://picload.org/upload,8e3f683557a8cd3401f002304f387932.html That is the

Re: GTKD - Application crashes - or not? [Coedit]

2016-06-16 Thread Basile B. via Digitalmars-d-learn
On Thursday, 16 June 2016 at 10:02:01 UTC, TheDGuy wrote: On Thursday, 16 June 2016 at 09:27:38 UTC, Basile B. wrote: FOrget any previous comment and in your program use the first argument of the command line to detect your resources, this will solve your problem. For the execution click

Re: GTKD - Application crashes - or not? [Coedit]

2016-06-16 Thread Basile B. via Digitalmars-d-learn
On Thursday, 16 June 2016 at 09:18:54 UTC, TheDGuy wrote: On Thursday, 16 June 2016 at 08:20:00 UTC, Basile B. wrote: Yes it's "WorkingDirectory" (and not current...). But otherwise you can use args[0]. Actually using the cwd in a program is often an error because there is no guarantee that

Re: Passing anonymous templated functions as template parameters

2016-06-15 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 23:52:56 UTC, Basile B. wrote: On Wednesday, 15 June 2016 at 22:27:38 UTC, pineapple wrote: Here's a simple code example to illustrate what I expected to work and didn't - is this a mistake in my syntax or a limitation of the language? template

Re: GTKD - Application crashes - or not? [Coedit]

2016-06-16 Thread Basile B. via Digitalmars-d-learn
On Thursday, 16 June 2016 at 15:57:36 UTC, TheDGuy wrote: On Thursday, 16 June 2016 at 10:14:47 UTC, Basile B. wrote: from args[0] you can get the base bath and since your css is relative to the base path: string cssPath = "test.css"; CssProvider provider = new CssProvider();

Re: GTKD - Application crashes - or not? [Coedit]

2016-06-15 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 23:41:51 UTC, Basile B. wrote: On Wednesday, 15 June 2016 at 17:35:32 UTC, TheDGuy wrote: I'm gonna check on Windows today but in the meantime you can try I've checked on windows and here is what I can say about the problem. - Symbolic strings won't work on

Re: Passing anonymous templated functions as template parameters

2016-06-15 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 22:27:38 UTC, pineapple wrote: Here's a simple code example to illustrate what I expected to work and didn't - is this a mistake in my syntax or a limitation of the language? template SomeTemplate(alias func){ auto templatefunc(T)(int x){

Re: GTKD - Application crashes - or not? [Coedit]

2016-06-15 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 17:35:32 UTC, TheDGuy wrote: On Wednesday, 15 June 2016 at 13:15:56 UTC, Rene Zwanenburg wrote: I'm not familiar with Coedit, but the run options seem to contain a field for setting it: https://github.com/BBasile/Coedit/wiki#run-options You may be able to use the

Re: Variable below zero but if statement doesn't grab?

2016-01-15 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 5 January 2016 at 23:52:05 UTC, Basile B. wrote: On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote: On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote: On Monday, 28 December 2015 at 15:07:08 UTC, jkpl wrote: On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote:

Fuck the brits

2016-01-15 Thread Basile B. via Digitalmars-d-learn
On Friday, 15 January 2016 at 22:16:09 UTC, Basile B. wrote: On Tuesday, 5 January 2016 at 23:52:05 UTC, Basile B. wrote: On Monday, 28 December 2015 at 18:02:53 UTC, jkpl wrote: On Monday, 28 December 2015 at 15:50:06 UTC, Basile B. wrote: On Monday, 28 December 2015 at 15:07:08 UTC, jkpl

Re: GTKD - Application crashes - or not? [Coedit]

2016-06-17 Thread Basile B. via Digitalmars-d-learn
On Thursday, 16 June 2016 at 09:18:54 UTC, TheDGuy wrote: On Thursday, 16 June 2016 at 08:20:00 UTC, Basile B. wrote: Yes it's "WorkingDirectory" (and not current...). But otherwise you can use args[0]. Actually using the cwd in a program is often an error because there is no guarantee that

Re: How to warn of unused imports?

2016-02-09 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 9 February 2016 at 17:54:30 UTC, Basile B. wrote: On Tuesday, 9 February 2016 at 15:21:59 UTC, Basile B. wrote: On Monday, 8 February 2016 at 20:48:29 UTC, cy wrote: On Monday, 8 February 2016 at 18:57:52 UTC, Basile B. wrote: Otherwise, it sounds like a decent enhancement request

Re: How do you reference variables in an AA of Variants?

2016-02-08 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 9 February 2016 at 03:49:11 UTC, Enjoys Math wrote: This: double b = 1.0; Variant[string] aa = ["b": ]; writeln(aa["b"]); fails with: Error: cannot implicitly convert expression(["b":]) of type double*[string] to VariantN!20u[string] Helps please!

Re: How to warn of unused imports?

2016-02-09 Thread Basile B. via Digitalmars-d-learn
On Monday, 8 February 2016 at 20:48:29 UTC, cy wrote: On Monday, 8 February 2016 at 18:57:52 UTC, Basile B. wrote: Otherwise, it sounds like a decent enhancement request for DMD. I know other compilers who do this warning. It definitely does sound like a decent enhancement request. I didn't

Re: Can D interface with Free Pascal?

2016-02-08 Thread Basile B. via Digitalmars-d-learn
On Thursday, 28 January 2016 at 04:26:26 UTC, Taylor Hillegeist wrote: Just curious... I had a thought that perhaps since Objective C was a replacement for Pascal on the mac. that they might have the same interface. but I'm not savvy enough with fpc to figure out how to try it. As said in

Re: How to warn of unused imports?

2016-02-08 Thread Basile B. via Digitalmars-d-learn
On Monday, 8 February 2016 at 08:50:17 UTC, Daniel Kozak wrote: V Mon, 08 Feb 2016 08:25:09 + cy via Digitalmars-d-learn napsáno: When I factor out code from my modules, it really, really often leaves import statements that just sit there doing

Re: How to warn of unused imports?

2016-02-09 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 9 February 2016 at 15:21:59 UTC, Basile B. wrote: On Monday, 8 February 2016 at 20:48:29 UTC, cy wrote: On Monday, 8 February 2016 at 18:57:52 UTC, Basile B. wrote: Otherwise, it sounds like a decent enhancement request for DMD. I know other compilers who do this warning. It

Re: is(some template instantiation) is true, but the actual instantiation fails

2016-01-29 Thread Basile B. via Digitalmars-d-learn
On Friday, 29 January 2016 at 15:28:29 UTC, Adrian Matoga wrote: How can I reliably test if CallsFoo can be instantiated? You can use a constraint to prevent invalid instantiation: struct HasFoo { void foo() {} } struct NoFoo {} struct CallsFoo(T) if (__traits(hasMember, T, "foo")) {

Re: how to allocate class without gc?

2016-01-28 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 27 January 2016 at 22:39:54 UTC, Igor wrote: But doesn't this ultimately defeat the purpose of having manual memory management if one has to add it to the GC to be scanned? You can make the LOC related to the GC optional with an additional bool template parameter and a static

Re: how to allocate class without gc?

2016-01-26 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 26 January 2016 at 01:09:50 UTC, Igor wrote: Is there any examples that shows how to properly allocate an object of a class type with the new allocators and then release it when desired? This is more or less the same answer as you've get previously except that I don't use emplace

Re: is(some template instantiation) is true, but the actual instantiation fails

2016-01-29 Thread Basile B. via Digitalmars-d-learn
On Friday, 29 January 2016 at 17:01:46 UTC, Adrian Matoga wrote: On Friday, 29 January 2016 at 16:36:01 UTC, Steven Schveighoffer wrote: On 1/29/16 10:28 AM, Adrian Matoga wrote: [...] is(T) is supposed to be false if T is not a valid type. I would agree with you that the static assert

Re: opApply @safety

2016-01-29 Thread Basile B. via Digitalmars-d-learn
On Friday, 29 January 2016 at 17:44:34 UTC, Chris Wright wrote: I want to create an opApply for a type. I've marked my code @safe, because everything I wrote was @safe. The body of opApply is @safe, but it calls a delegate that may or may not be @safe. How do I make it so I can iterate

  1   2   3   4   5   6   7   >