Re: What's up with GDC?

2016-06-10 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 11 June 2016 at 04:20:38 UTC, Joerg Joergonson wrote: On Saturday, 11 June 2016 at 01:43:21 UTC, Adam D. Ruppe wrote: What's the exact message and what did you do? The opengl32.lib I have on my github is for dmd 32 bit, ldc uses the Microsoft one I think so you shouldn't need

Re: What's up with GDC?

2016-06-10 Thread Joerg Joergonson via Digitalmars-d-learn
On Saturday, 11 June 2016 at 01:43:21 UTC, Adam D. Ruppe wrote: On Friday, 10 June 2016 at 22:01:15 UTC, Joerg Joergonson wrote: The problem I'm getting with ldc, using your simpledisplay, is that the libs aren't loading due to the wrong format. What's the exact message and what did you do?

Re: Asio Bindings?

2016-06-10 Thread Joerg Joergonson via Digitalmars-d-learn
On Friday, 10 June 2016 at 20:52:46 UTC, Andrej Mitrovic wrote: On 6/9/16, Joerg Joergonson via Digitalmars-d-learn wrote: [...] Just to show that I'm not full of shit, here's the e-mail chain: On 6/3/11, Andrej Mitrovic wrote:

Re: Why can't I assign a mixin to an alias?

2016-06-10 Thread Alex Parrill via Digitalmars-d-learn
On Saturday, 11 June 2016 at 02:46:00 UTC, Adam D. Ruppe wrote: On Saturday, 11 June 2016 at 02:33:46 UTC, Alex Parrill wrote: Mixins are statements. No, they're not. Well, yes they are [1], but there are also mixin expressions [2]. Not to be confused with the TemplateMixin[3], which is

Re: Why can't I assign a mixin to an alias?

2016-06-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 11 June 2016 at 02:33:46 UTC, Alex Parrill wrote: Mixins are statements. No, they're not. Well, yes they are [1], but there are also mixin expressions [2]. Not to be confused with the TemplateMixin[3], which is indeed always a statement. 1:

Re: Why can't I assign a mixin to an alias?

2016-06-10 Thread Alex Parrill via Digitalmars-d-learn
On Friday, 10 June 2016 at 22:38:29 UTC, Dechcaudron wrote: I have the following code: private string getVariableSignalWrappersName(VarType)() { return VarType.stringof ~ "SignalWrappers"; } void addVariableListener(VarType)(int variableIndex, void delegate(int, VarType)) { alias

Re: Why can't I assign a mixin to an alias?

2016-06-10 Thread David Nadlinger via Digitalmars-d-learn
On Friday, 10 June 2016 at 22:38:29 UTC, Dechcaudron wrote: Error: basic type expected, not mixin Why should it be like that? I believe the compiler should not impose restrictions on what mixins can or cannot do :/ This might be a gratuitous grammar restriction. There are a few of those

Re: What's up with GDC?

2016-06-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 10 June 2016 at 22:01:15 UTC, Joerg Joergonson wrote: The problem I'm getting with ldc, using your simpledisplay, is that the libs aren't loading due to the wrong format. What's the exact message and what did you do? The opengl32.lib I have on my github is for dmd 32 bit, ldc uses

Re: What's up with GDC?

2016-06-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 11 June 2016 at 01:04:28 UTC, David Nadlinger wrote: Knowing Adam, though, simpledisplay probably only depends on the Win32 API, so I'm not sure where the issue would be in the first place. It also uses opengl32.lib that could be a problem. I offer the .omf file on my github for

Re: What's up with GDC?

2016-06-10 Thread David Nadlinger via Digitalmars-d-learn
On Friday, 10 June 2016 at 22:01:15 UTC, Joerg Joergonson wrote: The problem I'm getting with ldc, using your simpledisplay, is that the libs aren't loading due to the wrong format. It's the omf vs coff thing or whatever, I guess... How do you mean that? LDC/MSVC uses COFF, and there should

Re: Why can't I assign a mixin to an alias?

2016-06-10 Thread Mihail-K via Digitalmars-d-learn
On Friday, 10 June 2016 at 22:38:29 UTC, Dechcaudron wrote: I have the following code: private string getVariableSignalWrappersName(VarType)() { return VarType.stringof ~ "SignalWrappers"; } void addVariableListener(VarType)(int variableIndex, void delegate(int, VarType)) { alias

Why can't I assign a mixin to an alias?

2016-06-10 Thread Dechcaudron via Digitalmars-d-learn
I have the following code: private string getVariableSignalWrappersName(VarType)() { return VarType.stringof ~ "SignalWrappers"; } void addVariableListener(VarType)(int variableIndex, void delegate(int, VarType)) { alias typeSignalWrappers =

Re: Parse File at compile time, but not embedded

2016-06-10 Thread Adrian Matoga via Digitalmars-d-learn
On Tuesday, 7 June 2016 at 22:09:58 UTC, Alex Parrill wrote: Not necessarily, You chased that rabbit quite far! The data your reading could contain sensitive information only used at compile time and not meant to embed. For example, the file could contain login and password to an SQL database

Re: What's up with GDC?

2016-06-10 Thread Joerg Joergonson via Digitalmars-d-learn
On Friday, 10 June 2016 at 21:33:58 UTC, Adam D. Ruppe wrote: On Friday, 10 June 2016 at 20:30:36 UTC, Joerg Joergonson wrote: Why isn't there a proper binaries for ldc and gdc that work out of the box like dmd? There used to be. What's up with all this arm-linux-genuabi crap? Those are

Re: What's up with GDC?

2016-06-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 10 June 2016 at 20:30:36 UTC, Joerg Joergonson wrote: Why isn't there a proper binaries for ldc and gdc that work out of the box like dmd? There used to be. What's up with all this arm-linux-genuabi crap? Those are proper binaries that work out of the box on different platforms.

Re: What's up with GDC?

2016-06-10 Thread David Nadlinger via Digitalmars-d-learn
On Friday, 10 June 2016 at 20:30:36 UTC, Joerg Joergonson wrote: Well, the post was a bit incoherent because getting all this stuff working is. I was searching for ldc and ran across some web site that had only the sources(same for gdc). […] Why isn't there a proper binaries for ldc and gdc

Re: What's up with GDC?

2016-06-10 Thread Seb via Digitalmars-d-learn
On Friday, 10 June 2016 at 20:30:36 UTC, Joerg Joergonson wrote: On Friday, 10 June 2016 at 19:51:19 UTC, Johan Engelen wrote: [...] Well, the post was a bit incoherent because getting all this stuff working is. I was searching for ldc and ran across some web site that had only the

Re: Asio Bindings?

2016-06-10 Thread Andrej Mitrovic via Digitalmars-d-learn
On 6/9/16, Joerg Joergonson via Digitalmars-d-learn wrote: > Why would bindings have any issues with licensing? Just to show that I'm not full of shit, here's the e-mail chain: On 6/3/11, Andrej Mitrovic wrote: > Hello, > > I'm

Re: What's up with GDC?

2016-06-10 Thread Joerg Joergonson via Digitalmars-d-learn
On Friday, 10 June 2016 at 19:51:19 UTC, Johan Engelen wrote: On Friday, 10 June 2016 at 19:37:13 UTC, Joerg Joergonson wrote: arm-linux-genuabi? arm-linux-gnueableihfqueridsofeyfh? aifh-fkeif-f-fdsskjhfkjfafaa? Rofl! and ldc requires building from sources(actually I didn't

Re: What's up with GDC?

2016-06-10 Thread Johan Engelen via Digitalmars-d-learn
On Friday, 10 June 2016 at 19:37:13 UTC, Joerg Joergonson wrote: arm-linux-genuabi? arm-linux-gnueableihfqueridsofeyfh? aifh-fkeif-f-fdsskjhfkjfafaa? Rofl! and ldc requires building from sources(actually I didn't have too much trouble with installing it but it doesn't work

What's up with GDC?

2016-06-10 Thread Joerg Joergonson via Digitalmars-d-learn
version 2.062? 2.066.1? arm-linux-gnueabi arm-linux-gnueabihf ? I remember a year ago when I tried D for the first time I downloaded both gdc and ldc and everything just worked and each install was just like dmd! Now it seems like a step backwards and I'm not sure what is going on.

Re: Parse File at compile time, but not embedded

2016-06-10 Thread Joerg Joergonson via Digitalmars-d-learn
On Friday, 10 June 2016 at 12:48:43 UTC, Alex Parrill wrote: On Thursday, 9 June 2016 at 22:02:44 UTC, Joerg Joergonson wrote: On Tuesday, 7 June 2016 at 22:09:58 UTC, Alex Parrill wrote: Accessing a SQL server at compile time seems like a huge abuse of CTFE (and I'm pretty sure it's

Re: Cannot find module during separate compilation

2016-06-10 Thread Mike Parker via Digitalmars-d-learn
On Friday, 10 June 2016 at 15:20:21 UTC, Satoshi wrote: Hello, I have 2 files: source/test.d: module foo.test; and source/bar.d module foo.bar; import foo.test; When I am compiling this 2 files together there is no problem. But when I compile it with -c flag (LDC) compiler thrown an error

isCallable and templates

2016-06-10 Thread Steven Schveighoffer via Digitalmars-d-learn
Consider: import std.traits; class Foo { void bar() {} void baz()() {} } This works: static assert(isCallable!(Foo.bar)); This does not: static assert(isCallable!(Foo.baz)); However, clearly I can call baz due to IFTI (with the equivalent syntax, someFoo.baz() or someFoo.baz). Is

Cannot find module during separate compilation

2016-06-10 Thread Satoshi via Digitalmars-d-learn
Hello, I have 2 files: source/test.d: module foo.test; and source/bar.d module foo.bar; import foo.test; When I am compiling this 2 files together there is no problem. But when I compile it with -c flag (LDC) compiler thrown an error (cannot find foo/test.d) Why isn't import path

Re: How to cast ASCII value to char?

2016-06-10 Thread TheDGuy via Digitalmars-d-learn
On Friday, 10 June 2016 at 14:27:41 UTC, Seb wrote: On Friday, 10 June 2016 at 14:20:16 UTC, TheDGuy wrote: Is it possible to cast an ascii value to char? Sure! char A = cast(char) 65; // A char a = cast(char) 97; // a and back again: ubyte b = cast(ubyte) a; // 65 In general there's also

Re: How to cast ASCII value to char?

2016-06-10 Thread Seb via Digitalmars-d-learn
On Friday, 10 June 2016 at 14:20:16 UTC, TheDGuy wrote: Is it possible to cast an ascii value to char? Sure! char A = cast(char) 65; // A char a = cast(char) 97; // a and back again: ubyte b = cast(ubyte) a; // 65 In general there's also an entire module

Re: How to cast ASCII value to char?

2016-06-10 Thread TheDGuy via Digitalmars-d-learn
On Friday, 10 June 2016 at 14:20:16 UTC, TheDGuy wrote: Is it possible to cast an ascii value to char? Yea, basically just like that: cast(char) *sorry*

How to cast ASCII value to char?

2016-06-10 Thread TheDGuy via Digitalmars-d-learn
Is it possible to cast an ascii value to char?

Re: Where are the solutions for the exercises of the dlang tour???

2016-06-10 Thread Seb via Digitalmars-d-learn
On Friday, 10 June 2016 at 05:31:18 UTC, Richter wrote: I've been trying to solve the exercise of the caesar encryption for practicing with arrays with no luck. I'm new to D Thanks for your help. :D 1) First of all - sorry that you couldn't find the solution. The tour is still heavily

Re: Mono-D for the new Xamarin Studio

2016-06-10 Thread Alex Bothe via Digitalmars-d-learn
On Friday, 10 June 2016 at 12:51:34 UTC, Saurabh Das wrote: I have foolishly updated my Xamarin Studio and now the D Language Binding no longer works. Is there an update to fix this? Or should I downgrade? Thanks, Saurabh Hi there, please uninstall XS and reinstall the older release

Re: Mono-D for the new Xamarin Studio

2016-06-10 Thread Saurabh Das via Digitalmars-d-learn
On Friday, 10 June 2016 at 13:36:43 UTC, Alex Bothe wrote: On Friday, 10 June 2016 at 12:51:34 UTC, Saurabh Das wrote: I have foolishly updated my Xamarin Studio and now the D Language Binding no longer works. Is there an update to fix this? Or should I downgrade? Thanks, Saurabh Hi there,

Re: Linker error

2016-06-10 Thread Chris via Digitalmars-d-learn
On Friday, 10 June 2016 at 13:17:32 UTC, Steven Schveighoffer wrote: On 6/10/16 8:04 AM, Chris wrote: I get the error below with code like this: auto res = ['1', '2'].map!(a => a.to!string); dmd 2.071.0 What's wrong here? I import std.algorithm, std.range, std.array, std.conv in the

Re: Linker error

2016-06-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/10/16 8:04 AM, Chris wrote: I get the error below with code like this: auto res = ['1', '2'].map!(a => a.to!string); dmd 2.071.0 What's wrong here? I import std.algorithm, std.range, std.array, std.conv in the module.

Re: Linker error

2016-06-10 Thread ketmar via Digitalmars-d-learn
On Friday, 10 June 2016 at 13:04:32 UTC, Chris wrote: It doesn't compile with `dmd file1.d file2.d` either. I'll have to look into this. Weird. looks like a clear sign of dmd versions conflict. most of the time things like that caused by some leftover from previous dmd — like old

Re: Linker error

2016-06-10 Thread ketmar via Digitalmars-d-learn
On Friday, 10 June 2016 at 12:52:05 UTC, Chris wrote: I use dub and `dvm use 2.071.0`. hm. sorry, i can't help you with this. straight "dmd test.d" is ok, so it's probably something with dub/dvm interaction...

Re: Linker error

2016-06-10 Thread Chris via Digitalmars-d-learn
On Friday, 10 June 2016 at 12:12:17 UTC, ketmar wrote: On Friday, 10 June 2016 at 12:04:50 UTC, Chris wrote: I get the error below with code like this: auto res = ['1', '2'].map!(a => a.to!string); dmd 2.071.0 What's wrong here? I import std.algorithm, std.range, std.array, std.conv in the

Mono-D for the new Xamarin Studio

2016-06-10 Thread Saurabh Das via Digitalmars-d-learn
I have foolishly updated my Xamarin Studio and now the D Language Binding no longer works. Is there an update to fix this? Or should I downgrade? Thanks, Saurabh

Re: Parse File at compile time, but not embedded

2016-06-10 Thread Alex Parrill via Digitalmars-d-learn
On Thursday, 9 June 2016 at 22:02:44 UTC, Joerg Joergonson wrote: On Tuesday, 7 June 2016 at 22:09:58 UTC, Alex Parrill wrote: Accessing a SQL server at compile time seems like a huge abuse of CTFE (and I'm pretty sure it's impossible at the moment). Why do I need to install and set up a MySQL

Re: Linker error

2016-06-10 Thread ketmar via Digitalmars-d-learn
On Friday, 10 June 2016 at 12:04:50 UTC, Chris wrote: I get the error below with code like this: auto res = ['1', '2'].map!(a => a.to!string); dmd 2.071.0 What's wrong here? I import std.algorithm, std.range, std.array, std.conv in the module.

Re: shared Mutex?

2016-06-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/9/16 9:19 PM, cy wrote: On Thursday, 9 June 2016 at 20:53:38 UTC, tcak wrote: (cast()mx).lock(); I was told casting away shared when there are still references to it is a bad idea. Like, the Mutex object might get corrupted if the garbage collector tries to move it while another

Linker error

2016-06-10 Thread Chris via Digitalmars-d-learn
I get the error below with code like this: auto res = ['1', '2'].map!(a => a.to!string); dmd 2.071.0 What's wrong here? I import std.algorithm, std.range, std.array, std.conv in the module. (.data._D65TypeInfo_xC3std5range10interfaces18__T10InputRangeTiZ10InputRange6__initZ+0x10):

Re: operator overload for enum

2016-06-10 Thread Timon Gehr via Digitalmars-d-learn
On 10.06.2016 13:02, Satoshi wrote: Hello, why operator overloading is not working as a static methods through the UFCS? ... It's an arbitrary limitation. https://issues.dlang.org/show_bug.cgi?id=8062 (The specification has been updated in the meantime, it now documents the limitation

operator overload for enum

2016-06-10 Thread Satoshi via Digitalmars-d-learn
Hello, why operator overloading is not working as a static methods through the UFCS? I need overload a << operator in this way: enum PlatformID { None, Trinix, Unix, MacOS, Windows } PlatformID toPlatformID(string platform) { switch

Re: Pointer problems, changing for no reasons

2016-06-10 Thread ketmar via Digitalmars-d-learn
ooops. that solution is provided in Ali's book. sorry for the noise.

Re: Pointer problems, changing for no reasons

2016-06-10 Thread ketmar via Digitalmars-d-learn
On Friday, 10 June 2016 at 08:32:40 UTC, Begah wrote: In the constructor, i copied the textures to the model's inner texture array, and for some reason this caused the problem. So i needed to change to something like : this.textures.length = textures.length; foreach(i; 0..textures.length) {

Re: Pointer problems, changing for no reasons

2016-06-10 Thread Ali Çehreli via Digitalmars-d-learn
On 06/10/2016 01:32 AM, Begah wrote: > I have found the problem and i still don't understand why i was a problem : > struct Model > { > TextureType[] textures; > > this(TextureType[] textures...) { > this.textures = textures[]; > } > } Yeah, that's a bug because the

Re: Pointer problems, changing for no reasons

2016-06-10 Thread Begah via Digitalmars-d-learn
On Friday, 10 June 2016 at 07:28:44 UTC, Begah wrote: On Thursday, 9 June 2016 at 19:00:42 UTC, cy wrote: I can't help but notice that loadModel is not a static member function, yet you don't seem to call it with a Model object in your "get" function. Also have a look at

Re: Pointer problems, changing for no reasons

2016-06-10 Thread Begah via Digitalmars-d-learn
On Thursday, 9 June 2016 at 19:00:42 UTC, cy wrote: I can't help but notice that loadModel is not a static member function, yet you don't seem to call it with a Model object in your "get" function. Also have a look at std.typecons.RefCounted if you want reference counted data.. loadModel

Re: Parse File at compile time, but not embedded

2016-06-10 Thread ketmar via Digitalmars-d-learn
On Thursday, 9 June 2016 at 22:02:44 UTC, Joerg Joergonson wrote: Lol, who says you have access to my software? You know, the problem with assumptions is that they generally make no sense when you actually think about them. oh, yeah. it suddenly reminds me about some obscure thing. other