Re: Properties don't work as expected

2016-07-05 Thread Leandro Motta Barros via Digitalmars-d-learn
D is being used productively by some companies, so I guess we can call it production-ready. This doesn't meant there are not rough corners. The language is being actively developed, and I see that some work is being done on those rough corners. However, keep in mind that: 1) Maybe what you

Re: blog.dlang.org

2016-06-21 Thread Leandro Motta Barros via Digitalmars-d-learn
Try http://dlang.org/blog/ But, indeed, I would expect blog.dlang.org to work... Cheers, LMB On Tue, Jun 21, 2016 at 6:47 PM, Christian Köstlin < digitalmars-d-learn@puremagic.com> wrote: > I just wanted to have a look at the new blog post about ldc, and entered > blog.dlang.org without

Re: OpenGL Setup?

2016-06-17 Thread Leandro Motta Barros via Digitalmars-d-learn
I have been using Textadept ( http://foicica.com/textadept/ ) with Textadept-d ( https://github.com/Hackerpilot/textadept-d ). I use mostly on Linux for development, but I've recently spent two or three days on Windows and things worked well enough for me. (Coming for someone who has used Emacs

Re: Coverage

2016-02-16 Thread Leandro Motta Barros via Digitalmars-d-learn
dependency. LMB On Tue, Feb 16, 2016 at 4:58 PM, Sebastiaan Koppe via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Tuesday, 16 February 2016 at 12:35:38 UTC, Leandro Motta Barros wrote: > >> You probably already though of it, but: can't you create a unit

Re: Coverage

2016-02-16 Thread Leandro Motta Barros via Digitalmars-d-learn
You probably already though of it, but: can't you create a unittest that calls your code as many times as desired, passing different input each time? LMB On Tue, Feb 16, 2016 at 10:16 AM, Sebastiaan Koppe via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > I currently run

Module-level attributes and unit tests

2014-08-23 Thread Leandro Motta Barros via Digitalmars-d-learn
Hello, I have a module which is completelly @nogc, and as such I'd like to just say @nogc: at the top of the file and be happy. However, my unit tests for this same module do some GC allocation, so the module fails to compile. Is there a way to disable @nogc for the unit tests only? Would

Re: Module-level attributes and unit tests

2014-08-23 Thread Leandro Motta Barros via Digitalmars-d-learn
Thanks, this was helpful! LMB On Sat, Aug 23, 2014 at 1:22 PM, monarch_dodra via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Saturday, 23 August 2014 at 15:26:02 UTC, Leandro Motta Barros via Digitalmars-d-learn wrote: Hello, I have a module which is completelly

Re: pointer array?

2014-07-30 Thread Leandro Motta Barros via Digitalmars-d-learn
Justin's answers seems correct to me, and I don't know anything about your specific use case, but I cannot resist to add: Think twice before doing this kind of things. I know that sometimes this is necessary or handy, but one of the great things about D is that it provides so many higher-level

Re: pointer array?

2014-07-30 Thread Leandro Motta Barros via Digitalmars-d-learn
Can't you call it directly? extern(C) { int add (int a, int b)'; } // ... auto ret = add(123, 456); LMB On Wed, Jul 30, 2014 at 2:55 PM, seany via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Can you post the signatures of some of the C functions you're trying to

Re: Any GPL video games in D2

2014-06-25 Thread Leandro Motta Barros via Digitalmars-d-learn
Hi, Some time ago I wrote this Tetris-like game: https://bitbucket.org/lmb/anytris (also on GitHub: https://github.com/lmbarros/Anytris) Nothing fancy. I am sure there are better examples out there. And maybe this is not the best code to show to students ;-) Also, license is ZLib -- I assume it

Re: package.d imports

2014-01-19 Thread Leandro Motta Barros
Hi! I made similar questions here a month ago, but also couldn't get definitive answers. I just sent a message about this to the main D forum. Let's see if we have better luck there :-) Cheers, LMB On Fri, Jan 17, 2014 at 5:39 PM, Lemonfiend le...@fie.nd wrote: I think this is what you are

Re: package.d

2013-12-18 Thread Leandro Motta Barros
: mylib.util.Foo is used as a type Fishy, isn't it? Maybe I should report this as a bug? Cheers, LMB On Wed, Dec 18, 2013 at 6:09 AM, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On 12/17/13, Leandro Motta Barros l...@stackedboxes.org wrote: Is there any documentation describing the expected

Re: package.d

2013-12-18 Thread Leandro Motta Barros
On Wed, Dec 18, 2013 at 6:56 AM, Joseph Rushton Wakeling joseph.wakel...@webdrake.net wrote: On 17/12/13 01:51, Leandro Motta Barros wrote: I have some code using the old all.d idiom, which I am changing to use the new package.d feature. Related question -- it seems like rdmd doesn't

package.d

2013-12-16 Thread Leandro Motta Barros
Hello, I have some code using the old all.d idiom, which I am changing to use the new package.d feature. Originally, I had something like this: // mylib/util.d: module mylib.util; class Foo { } // mylib/all.d: module mylib.all; public import mylib.util; // main.d: import mylib.all; void

TypeInfo.compare is not implemented

2013-11-30 Thread Leandro Motta Barros
Hello, I my FewDee game prototyping library (https://bitbucket.org/lmb/fewdee) I ignored most of the usual reccomendations like be careful with the GC, it's slow and associative arrays are buggy in D, so avoid them. I just used whatever I found convenient to have my stuff running with minimal

Re: TypeInfo.compare is not implemented

2013-11-30 Thread Leandro Motta Barros
, Leandro Motta Barros said: Hello, I my FewDee game prototyping library (https://bitbucket.org/lmb/fewdee) I ignored most of the usual reccomendations like be careful with the GC, it's slow and associative arrays are buggy in D, so avoid them. I just used whatever I found convenient to have

InExpression with custom type?

2013-08-23 Thread Leandro Motta Barros
Hello! Is it possible to make an InExpression work with a used-defined type? struct MyCollection { ... } MyCollection mc; auto p = 123 in mc; if (p) { ... } Thanks! LMB

Re: InExpression with custom type?

2013-08-23 Thread Leandro Motta Barros
Thanks! LMB On Fri, Aug 23, 2013 at 4:59 PM, Namespace rswhi...@googlemail.com wrote: On Friday, 23 August 2013 at 19:57:42 UTC, Leandro Motta Barros wrote: Hello! Is it possible to make an InExpression work with a used-defined type? struct MyCollection { ... } MyCollection mc; auto

Re: How to disable the DOS window at the start of my program on D

2013-07-24 Thread Leandro Motta Barros
For Win32/OPTLINK, I passed the following flag to dmd in a lil' project of mine: -L/SUBSYSTEM:WINDOWS:4.0 Worked for me. LMB On Wed, Jul 24, 2013 at 5:24 AM, Rikki Cattermole alphaglosi...@gmail.com wrote: On Wednesday, 24 July 2013 at 08:16:39 UTC, MGW wrote: On Wednesday, 24 July

Re: Reference to D class instance with a C library

2013-07-14 Thread Leandro Motta Barros
On Sun, Jul 14, 2013 at 6:29 AM, Jacob Carlborg d...@me.com wrote: On 2013-07-13 20:53, Leandro Motta Barros wrote: Hey, thanks! This makes sense :-) Am I now wondering... how safe, portable and future proof would this be? If some future version of D implements a garbage collector capable

Re: Reference to D class instance with a C library

2013-07-13 Thread Leandro Motta Barros
destructiona...@gmail.com wrote: On Saturday, 13 July 2013 at 18:30:24 UTC, Leandro Motta Barros wrote: So, is there some way to store a reference to a D class instance in that 'user_data' field? Should be ok to cast the reference itself to that type - don't take the address of it, since

Re: Reference to D class instance with a C library

2013-07-13 Thread Leandro Motta Barros
Good. Thanks again! LMB On Sat, Jul 13, 2013 at 4:01 PM, Adam D. Ruppe destructiona...@gmail.com wrote: On Saturday, 13 July 2013 at 18:54:18 UTC, Leandro Motta Barros wrote: If some future version of D implements a garbage collector capable of moving objects around the heap, I could get

Re: Reference to D class instance with a C library

2013-07-13 Thread Leandro Motta Barros
Also note that if the pointer in C land is the only reference to the class, the garbage collector will destroy the instance when it gets around to it. Yup, I am aware of this. I mentioned that I can guarantee that my object will outlive the C struct... There's a function GC.addRoot[1] in

Re: Finalizing GC

2013-04-01 Thread Leandro Motta Barros
On Mon, Apr 1, 2013 at 1:45 PM, H. S. Teoh hst...@quickfur.ath.cx wrote: On Mon, Apr 01, 2013 at 01:07:56AM -0700, Jonathan M Davis wrote: On Sunday, March 31, 2013 20:51:52 H. S. Teoh wrote: On Sun, Mar 31, 2013 at 06:29:21PM -0700, Jonathan M Davis wrote: [...] Seems to me like dtors

Re: Passing revision tag to the compiler

2013-03-31 Thread Leandro Motta Barros
On Sun, Mar 31, 2013 at 10:09 AM, Tobias Pankrath tob...@pankrath.net wrote: On Sunday, 31 March 2013 at 02:00:46 UTC, Leandro Motta Barros wrote: Hello, I'd like to include the version control revision tag in a program. In the C/C++ world I'd make my build system call the compiler like

Passing revision tag to the compiler

2013-03-30 Thread Leandro Motta Barros
Hello, I'd like to include the version control revision tag in a program. In the C/C++ world I'd make my build system call the compiler like this: g++ -DMY_REVISION_HERE . so that the revision is available as a preprocessor symbol. Is there an easy way to achieve the same in D? I can

Re: Why is null lowercase?

2013-01-24 Thread Leandro Motta Barros
Hi, In C, NULL is a #define, and #defines are typically all-caps. In D, null is real keyword recognized by the compiler, and those are typically lowercase. I am just guessing here, but I'd say the choice for 'null' instead of 'NULL' is just to be coherent with this. Personally, I kinda like

Re: Global variables read at compile time?

2012-08-15 Thread Leandro Motta Barros
Another option is to use module constructors, as shown below. (But somehow this all looks a bit fishy for me...) LMB import std.stdio; string a = a; string b; static this() { b = a; } void main() { writeln(b); } On Wed, Aug 15, 2012 at 11:03 AM, d_follower