Re: Where is COFFIMPLIB

2015-04-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-18 20:20, Darrell Gallion wrote: Thought there were other complications on Windows for 64bit? I don't know, I never used it. -- /Jacob Carlborg

Re: Building website from git master, why does it checkout DMD v2.066.1 and die?

2015-04-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-19 10:56, Jacob Carlborg wrote: The makefile isn't updated, see [1]. Trying adding "STABLE_DMD_VER=2.067.0" to the command you're running. Pull request: https://github.com/D-Programming-Language/dlang.org/pull/968 -- /Jacob Carlborg

Re: Building website from git master, why does it checkout DMD v2.066.1 and die?

2015-04-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-19 10:56, Jacob Carlborg wrote: The makefile isn't updated, see [1]. Trying adding "STABLE_DMD_VER=2.067.0" to the command you're running. That won't work because someone thought it was a good idea to split the download site per year :( . Try overriding "STABLE_DMD_URL" [1] instead

Re: Building website from git master, why does it checkout DMD v2.066.1 and die?

2015-04-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-18 20:52, Gary Willoughby wrote: I'm trying to build the website from git master and i'm getting some errors. Here is the last part of the output: Any ideas what the issue is here? The makefile isn't updated, see [1]. Trying adding "STABLE_DMD_VER=2.067.0" to the command you're run

Re: About @ and UDA

2015-04-18 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-17 21:35, Jacob Carlborg wrote: UDA's were available when these attributes/keywords were created. Reasons why they're still not UDA's are probably a mix of avoiding code breakage and someone that needs to make the change. Were _not_ available ... -- /Jacob Carlborg

Re: About @ and UDA

2015-04-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-17 16:34, Sönke Ludwig wrote: +1 for body I still haven't got the reason though, why "safe" and friends cannot simply be UDAs defined in object.d that the compiler recognizes. UDA's were available when these attributes/keywords were created. Reasons why they're still not UDA's are

Re: Where is COFFIMPLIB

2015-04-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-17 16:20, Darrell Gallion wrote: Attempting to link to snappy.lib on windows. Getting the infamous Error 43: Not a Valid Library File The conversion from COFF Format to OMF Format seems like the issue. The fix isn't so clear. There's an ftp site that needs a password. ftp://digitalma

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-17 10:16, Dicebot wrote: Does DMD also use GCC conventions on Linux when compiling extern(C++) code? I didn't know that. Not exactly sure that you mean by "conventions" but "extern(C++)" and "extern(C)" follows the ABI of the system compiler. On Linux that is GCC, on OS X it's Cla

Re: Linking C++ standard library works with GDC... but not DMD. (Linux)

2015-04-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-16 11:56, Dicebot wrote: Simple issue but unpleasant fix. You always must use C++ library that matches base C++ compiler. For GDC it is GCC (which is used by default). For DMD it is DMC (Digital Mars C compiler). For LDC it is whatever Clang standard library is called. All those are i

Re: About @ and UDA

2015-04-15 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-15 10:53, Andrea Fontana wrote: My 2 cents. If I remember correctly, "@" prefix in @safe, @trusted, @system, etc was added just to avoid keywords pollution, right? Now UDA uses the same prefix: if some new keywords/properties/attributes will be added to D, the same problem will come b

Re: Trouble in converting C code to D

2015-04-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-12 11:57, Suliman wrote: Oh in gdal.d there is comment: /* * The enum CPLErr is defined in the header file cpl_error.h. I have not * for the time being included a binding to that header, but have just * imported this single symbol from it. * * Similarly, GDALProgressF

Re: Trouble in converting C code to D

2015-04-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-12 11:53, Suliman wrote: But could you explain why if binding have next string: enum CPLErr { CE_None = 0, CE_Debug = 1, CE_Warning = 2, CE_Failure = 3, CE_Fatal = 4 } I can't use: if( GDALGetGeoTransform( hDataset, adfGeoTransform.ptr ) == CE_None ) In D

Re: Trouble in converting C code to D

2015-04-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-12 11:19, Suliman wrote: So I got GDAL binding work. And now I need to understand how to translate C code to D. Here is simple tutorial: http://www.gdal.org/gdal_tutorial.html If I right understand it's easier to take C, than C++ code example. Now I am trying to get very simple examp

Re: D + .NET

2015-03-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-03-11 14:30, Sativa wrote: Can you point out where it says anything about wpf or .NET? I'm having trouble finding it. I even searched for .net and wpf but still no luck ;/ Maybe you posted the wrong link by accident? You did mention win32 ;) For OS X Cocoa is the GUI framework. To acc

Re: DMD Zip for Mac OS X

2015-02-28 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-02-28 07:45, Mike Parker wrote: I'm not a Mac user and I'm fairly clueless about it. The DMD zip for OS X contains one executable. I assume it's a 64-bit binary. Is that true? Yes. Since DMD on OS X got support for 64bit DMD has only been shipped as 64bit. There's basically no Mac comp

Re: Will D have a standard cross platform GUI toolkit?

2015-02-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-02-26 19:20, Rinzler wrote: Hello, I was wondering if D will have a standard cross platform GUI toolkit. I think that any modern language should provide a cross-platform GUI toolkit. I know that there are some GUI toolkits, but are there cross-platform? Are there serious works? That is,

Re: Deprecation process documented?

2015-02-25 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-02-24 18:55, Jonathan M Davis via Digitalmars-d-learn wrote: Normally, the symbol is deprecated right away, because using a deprecated symbol just results in a message being printing, but if a new symbol is being introduced to replace the deprecated one at the same time that the old symb

Re: Deprecation process documented?

2015-02-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-02-24 10:20, Jonathan M Davis via Digitalmars-d-learn wrote: No, it's not documented. I really should put it up on the wiki. The current process is that if the replacement for the symbol is being introduced at the same time, the old symbol will be marked as deprecated for a release (so t

Deprecation process documented?

2015-02-23 Thread Jacob Carlborg via Digitalmars-d-learn
Is the deprecation process used for Phobos and druntime code documented somewhere? I.e. how long after a deprecation is a symbols removed and so on. -- /Jacob Carlborg

Re: Conditional Compilation for Specific Windows

2015-01-07 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-01-07 20:48, Jonathan Marler wrote: I've looked up the windows version helper functions (http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx). The problem is that these functions are not defined in DMD's user32.lib. I could use the operating system's user32.

Re: Conditional Compilation for Specific Windows

2015-01-07 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-01-07 19:27, Jonathan Marler wrote: I'm looking at the Windows multicast API. It has different socket options depending on if you are on Windows XP or Windows Vista (and later). Is there a way to tell at runtime which version of windows you are on? Note: I'm specifically talking about r

Re: vibe.d + dub dynamic library

2015-01-03 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-01-02 19:44, Benjamin Thaut wrote: Is it possible to get dub to build vibe.d into a dynamic library? Or is it at least possible to make dub link against the shared version of phobos? I found this blog post about dynamic linktimes, unfortunately it does not describe how to actually make du

Re: dub dustmite

2014-12-11 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-12-12 05:25, Vlad Levenfeld wrote: I get Executing dustmite... None => No object.Exception@dustmite.d(243): Initial test fails It seems like a pretty simple case, I'm not sure what's going on. I get the same error as well every time I use dustmite. At lease via Dub. -- /Jac

Re: How to ensure a thread cannot be blocked by the GC?

2014-12-04 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-12-03 23:53, ponce wrote: I have a DLL written in D that gets called by two different threads, created by a non-D host program (audio plugin). I did not create those threads, but my understanding is that they get "attached" to the D runtime. No, the runtime in D doesn't know anything ab

Re: Tagged enums why reserved words are not permitted ?

2014-10-28 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-10-28 01:51, Jonathan M Davis via Digitalmars-d-learn wrote: And I've never seen a language where it did (though one may exist out there somewhere) Ruby: class Foo end Foo == Foo.new.class # perfectly legal You always need to have a receiver when calling the "class" method. This i

Re: Base class with member parameterized on type of extending class

2014-10-20 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-10-20 12:27, rcor wrote: I would, as I need to keep track of the current scene in a variable somewhere: Scene _currentScene; // problematic if Scene is a template If the state machine doesn't need to be exposed you can create base class for Scene which is not templated: abstract

Re: Base class with member parameterized on type of extending class

2014-10-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-10-19 13:19, rcor wrote: I'm trying to make a game, and would like to set up the following hierarchy: At any time, the game is in one Scene. Each scene has a state machine that manages States of type T, where T is the type of the scene (e.g. Overworld, Menu). abstract class State!T {

Re: Recommended GUI library?

2014-10-18 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-10-17 18:34, K.K. wrote: I'm looking for suggestions for a GUI library, to create a somewhat light GUI that can also be created without too much fuss, and support for Windows & Linux. Have a look at DWT [1]. It's basically the only D GUI framework that doesn't have any dependencies exc

Re: object hijacked ?

2014-10-09 Thread Jacob Carlborg via Digitalmars-d-learn
On 09/10/14 22:06, Dicebot wrote: I think this is an issue with the import resolution, not module system. The way it is implemented right now DMD stops searching for object.d / object.di once it has found one. So while your module name is not interpreted as "object" _original_ object.di does not

object hijacked ?

2014-10-09 Thread Jacob Carlborg via Digitalmars-d-learn
I have a file named "Object.d", in a directory called "foo". The module name of this file is "foo.Object". As it happens, I'm using OS X which uses a case insensitive file system. I also have another file, say "Bar.d" in "foo", with the module name "foo.Bar". When I try to compile/run Bar.d wit

Re: How to detect start of Unicode symbol and count amount of graphemes

2014-10-06 Thread Jacob Carlborg via Digitalmars-d-learn
On 06/10/14 19:48, H. S. Teoh via Digitalmars-d-learn wrote: This looks wrong to me. Are you sure this finds *all* possible graphemes? No, the data I gave was to detect a complete code unit. Graphemes are something else, I think Uranuz is mixing up the Unicode terms. -- /Jacob Carlborg

Re: How to detect start of Unicode symbol and count amount of graphemes

2014-10-05 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-10-05 14:09, Uranuz wrote: Maybe there is some idea how to just detect first code unit of grapheme without overhead for using Grapheme struct? I just tried to check if ch < 128 (for UTF-8). But this dont work. How to check if byte is continuation of code for single code point or if new s

Re: Hunting down rogue memory allocations?

2014-10-03 Thread Jacob Carlborg via Digitalmars-d-learn
On 02/10/14 22:31, Kiith-Sa wrote: If *time* spent by allocations is a problem, profile with `perf top` (assuming you have Linux): Look for 'gc', 'malloc', 'calloc', etc. (Plain perf record will also work, but not be as quick/interactive. CodeXL works too.) If you have OS X, you can use Instru

Re: find all public properties at compile time

2014-09-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-09-30 22:19, anonymous wrote: import std.typetuple: staticMap; enum stringOf(alias thing) = thing.stringof; It's better to use __traits(identifier) instead of .stringof. -- /Jacob Carlborg

Re: Dynamically loading a D dynamic library from a c++ program

2014-09-27 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-09-26 21:52, John Colvin wrote: Yes, but it depends on the complexity of the headers. C++ templates aren't supported for example. Templates are supported, if they're already instantiated. -- /Jacob Carlborg

Re: Object.factory from shared libraries

2014-09-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-09-26 16:24, krzaq wrote: That would be satisfactory to me, except for the linux-only part. In that case, I think I'll simply try to call filename() as the factory function in each library - that should work everywhere, right? Dynamic libraries only work properly on Linux. This has no

Re: Object.factory from shared libraries

2014-09-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 26/09/14 14:37, krzaq wrote: I'd like to extend my program's functionality from plugins, that'd be loaded by name (or not) as requested by the config file. Is it possible to throw in a few dlls/sos implementing those new modules into a directory and hope that they will be all loaded and availa

Re: Interop with C++ library - what toolchain do you use?

2014-09-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 18/09/14 00:28, Cliff wrote: So I am trying to use a C++ library with D. My toolchain is currently Visual Studio 2013 with Visual D, using the DMD compiler. When trying to link, I obviously ran into the OMF vs. COFF issue DMD has always produce COFF for Windows 64bit. Recently it also got

Re: How do I properly exit from a D program (outside main)?

2014-09-15 Thread Jacob Carlborg via Digitalmars-d-learn
On 16/09/14 02:06, AsmMan wrote: Neither assert or return will help. Check out this code example: void main() { f(); } void f() { if(!foo) exit(1); do_something(); } If you want to exit the application with exit code 1 then it sounds like something has gone wrong. In that case,

Re: Downloading Files in D

2014-09-11 Thread Jacob Carlborg via Digitalmars-d-learn
On 11/09/14 00:05, "Nordlöw" wrote: I'm asking because I've read somewhere that there have been complaints about the curl wrapper. If you don't want to worry about dependencies on libcurl you can use Tango [1] [2]. You can see how I use Tango to download files in DVM [3] [1] https://github.

Re: How to get nogc to work with manual memory allocation

2014-09-04 Thread Jacob Carlborg via Digitalmars-d-learn
On 04/09/14 22:30, Kagamin wrote: emplace calls constructor, and constructor can't be realistically required to be nogc. It depends on the constructor. Similar for destroy. But if the constructor is @nogc or if there's a default constructor. -- /Jacob Carlborg

Re: D1: Error: duplicate union initialization for size

2014-08-31 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-08-31 04:53, Ali Çehreli wrote: On 08/30/2014 06:05 PM, jicman wrote: > Really is or how one can fix it? This is the only time that I have > found myself without answers with D. Strange. Maybe folks are not that > into D1, but D1 was before D2. Any thoughts would be greatly > app

Re: D1: Error: duplicate union initialization for size

2014-08-27 Thread Jacob Carlborg via Digitalmars-d-learn
On 27/08/14 23:48, jicman wrote: On Wednesday, 27 August 2014 at 06:20:24 UTC, Jacob Carlborg wrote: On 23/08/14 19:50, jicman wrote: This is line 7634: const Size DEFAULT_SCALE = { 5, 13 }; What does the error say and how can I fix it? Thanks. Does the following make any difference? con

Re: D1: Error: duplicate union initialization for size

2014-08-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 27/08/14 04:38, jicman wrote: I wish I knew. :-( Above, in this same post I pasted all lines that had Size and right below it all lines that had size. These are all the places where Size is found. If you can tell me which one you think it is, I can grab that piece of the code. I found it

Re: D1: Error: duplicate union initialization for size

2014-08-26 Thread Jacob Carlborg via Digitalmars-d-learn
On 23/08/14 19:50, jicman wrote: This is line 7634: const Size DEFAULT_SCALE = { 5, 13 }; What does the error say and how can I fix it? Thanks. Does the following make any difference? const Size DEFAULT_SCAL = Size(5, 13) -- /Jacob Carlborg

Re: D1: Error: duplicate union initialization for size

2014-08-25 Thread Jacob Carlborg via Digitalmars-d-learn
On 26/08/14 00:57, jicman wrote: Ok, let's try something simpler... Where can I find the D1 v1.076 compiler error meaning of, Error: duplicate union initialization for size for this line, const Size DEFAULT_SCALE = { 5, 13 }; How does the code for Size look like? -- /Jacob Carlborg

Re: How to get nogc to work with manual memory allocation

2014-08-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-08-24 14:18, Kagamin wrote: Shouldn't emplace and destroy infer their attributes instead of strictly annotating them as nogc. If they are templates, I guess they should. I don't know how good the compiler is at inferring attributes. I also haven't looked at the source code for these

Re: How to get nogc to work with manual memory allocation

2014-08-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-08-24 10:03, Bienlein wrote: I have omitted the code for the TestClass class to save space. Problem is that the compiler outputs this: Error: @nogc function 'main.nogcNew!(TestClass, ).nogcNew' cannot call non-@nogc function 'core.exception.onOutOfMemoryError' Error: @nogc function 'mai

Re: Identifying 32 vs 64 bit OS?

2014-08-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 11/08/14 07:18, Jeremy DeHaan wrote: I am looking at these versions as described here: http://dlang.org/version.html There are X86 and X86_64 version identifiers, but these specifically mention that they are versions for the processor type. Can they also be used to determine if the OS is runn

Re: Passing Command Line Arguments to a new Thread

2014-08-07 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-08-07 20:23, "Nordlöw" wrote: What is the best way to forward a string[] as argument to a function called through std.concurrency.spawn(). What about just accessing core.runtime.Runtime.args from the new thread? -- /Jacob Carlborg

Re: Using enum constant from different modules

2014-07-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 10/07/14 23:48, "Marc Schütz" " wrote: Try other immutable variables (int arrays, structs), and non-immutable ones. They will probably behave differently. String literals are put directly in the executable and therefore should be the same. Array literals are dynamically allocated. -- /Ja

Re: Using enum constant from different modules

2014-07-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 10/07/14 22:48, anonymous wrote: I don't think this is a bug. Remember that enums have copy-paste semantics. So, this is the same as comparing literals from different modules. Apparently, in the same module, a duplicate string literal is optimized out. But that's not done across the module b

Re: Using enum constant from different modules

2014-07-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 10/07/14 22:47, "Marc Schütz" " wrote: No, this is equivalent to: void bar (string a) { assert(a is "GET"); } void asd() { bar("GET"); } Enums behave as if their values are copy-n-pasted everywhere they are used (you probably know that). Yes, I was thinking that. Then I was thi

Using enum constant from different modules

2014-07-10 Thread Jacob Carlborg via Digitalmars-d-learn
Here's a code example: module main; import foo; enum Get = "GET"; void bar (string a) { assert(a is Get); } void main () { asd(); } module foo; import main; void asd() { bar(Get); } Running the above code will cause an assert error in the function "bar". But if I move the fun

Re: Bizarre compile error in GtkD

2014-06-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-06-29 22:28, Evan Davis wrote: I have no idea how this error exists. Can anyone help me fix it? Perhaps some mismatch between mutable/const/immutable? -- /Jacob Carlborg

Re: Why is the Win32 boilerplate the way it is?

2014-06-29 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-06-29 17:06, Jeremy Sorensen wrote: The only question I have is what happens when you use SUBSYSTEM:WINDOWS:4.0 (Which I understand means XP or higher) and the program runs on something older? Will you get an error message or just silent failure? Actually, I don't know. You could try s

Re: Why is the Win32 boilerplate the way it is?

2014-06-29 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-06-29 06:47, Jeremy Sorensen wrote: I found an example of boilerplate code for Win32 programming in D here: http://wiki.dlang.org/D_for_Win32 I have some questions. 1. It appears that the call to myWinMain from WinMain is to ensure that any exception or error is caught. At first glance i

Re: Is their a way for a Child process to modify its Parent's environment?

2014-06-25 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-06-25 03:53, WhatMeWorry wrote: I open a command line window, and run the following 6 line program void main() { string envPath = environment["PATH"]; writeln("PATH is: ", envPath); envPath ~= r";F:\dmd2\windows\bin"; environment["PATH"] = envPath; envPath = envir

Re: Another rambling musing by a Dynamic Programmer - map!

2014-06-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-06-24 04:34, John Carter wrote: So in Ruby and R and Scheme and... I have happily used map / collect for years and years. Lovely thing. So I did the dumb obvious of string[] stringList = map!...; And D barfed, wrong type, some evil voldemort thing again. So.. auto stringList

Re: D1: UTF8 char[] casting to wchar[] array cast misalignment ERROR

2014-06-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 17/06/14 04:27, jicman wrote: Greetings! I have a bunch of files plain ASCII, UTF8 and UTF16 with and without BOM (Byte Order Mark). I had, "I thought", a nice way of figuring out what type of encoding the file was (ASCII, UTF8 or UTF16) when the BOM was missing, by reading the content and

Re: Version() for unittest OR debug?

2014-06-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 10/06/14 16:06, bearophile wrote: You can define a enum boolean value in the version unittest block, and another inside the debug {} else {}. And then you can use "if (b1 || b2) { ... }". "static if" is probably what's needed. -- /Jacob Carlborg

Re: Fighting compiler - experienced programmer but D novice

2014-06-02 Thread Jacob Carlborg via Digitalmars-d-learn
On 03/06/14 05:57, Charles Parker wrote: Chris, that was it I needed to do both things. It then complained about trying to allocate the in_edges and out_edges arrays in the constructor which is how I thought dynamic arrays are allocated on the heap. I removed the 2 new statements, and both compi

Re: How to detect a lambda expression get it is signature

2014-06-01 Thread Jacob Carlborg via Digitalmars-d-learn
On 02/06/14 01:00, bioinfornatics wrote: Hi i am looking how to perform this action with traits. Below some code to show what it fail Regards CODE import std.traits : isDelegate, isSomeFunction, MemberFunctionsTuple, ParameterIdentifierTuple; struct section( alias start, alias en

Re: D Newbie Trying to Use D with Major C Libraries

2014-05-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 16/05/14 11:19, John Colvin wrote: Any plans to get any preprocessor stuff working? Presumably libclang can make this feasible. Yes, eventually. Although, currently libclang doesn't really provide an API for the preprocessor, so that needs to be added. -- /Jacob Carlborg

Re: Objects(from classes) at Compile time? no gc

2014-05-15 Thread Jacob Carlborg via Digitalmars-d-learn
On 16/05/14 06:59, Taylor Hillegeist wrote: The subject says it all really. i have this example: import core.memory; class fruit{ int value=5; public int getvalue(){ return value; } } int main(string[] args) { GC.disable; static fruit myfruit; return myfruit.getval

Re: D Newbie Trying to Use D with Major C Libraries

2014-05-15 Thread Jacob Carlborg via Digitalmars-d-learn
On 15/05/14 23:27, Tom Browder via Digitalmars-d-learn wrote: I am a volunteer developer with the well-known 3D CAD FOSS project BRL-CAD: http://brlcad.org I have wanted to use D for a long time but I hadn't taken the plunge. Yesterday I advertised to the BRL-CAD community my new project to

Re: DFL is the best UIcontrols for D, compare it to dwt, tkd, dtk, dlangui, anchovy......

2014-05-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-05-13 12:14, FrankLike wrote: Look at the Button class in DWT. In Linux ,button class need 844 lines,but in win32 ,button class need >1300 lines. Look at the setText Method in button class. There is a great difference between in Linux and in Win32. public void setText (String strin

Re: DFL is the best UIcontrols for D, compare it to dwt, tkd, dtk, dlangui, anchovy......

2014-05-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 13/05/14 08:44, FrankLike wrote: Thank you. DWT AND DFL ,their Memory Usage is the least . but DWT is more complicated than DFL. Look at the base control :Button at DFL :only 270 lines , but at DWT: need >1400 lines. Thank you again. The question is what the buttons in each library is cap

Re: naming a variable at runtime

2014-05-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 13/05/14 06:32, InfinityPlusB wrote: yup, that will work. If I wasn't hell bent on naming variables, I probably would have figured this out. :P Perhaps you could use an associative array. Then you get sort of named variables. -- /Jacob Carlborg

Re: DFL is the best UIcontrols for D, compare it to dwt, tkd, dtk, dlangui, anchovy......

2014-05-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 13/05/14 02:10, FrankLike wrote: 1.DFL's Memory Usage is the least than other. winsamp.exe is 2.1M,DFL's example's exe is 2.7M. 2.The size of DFL's example's exe files is the least than other, and only a single file. 3.DFL's source code is the most easy to understand. Although DFL not use on

Re: Templating everything? One module per function/struct/class/etc, grouped by package?

2014-05-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 12/05/14 20:58, Francesco Cattoglio wrote: Error messages! If your code is not compiled, you can't know whether it is valid or not. I must say that since we have unittests, this is somewhat less relevant, but still... One nice thing would be stripping the executable of unneeded code. One tri

Re: Inspecting lambda parameters

2014-05-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-05-10 18:56, Meta wrote: Wasn't there recently a pull request to add TemplateArgsOf, or something like that. There's this pull request [1] that adds a couple of new traits that might help. Also, if you know what type the lambda is going to be instantiated with, you can turn it into

Inspecting lambda parameters

2014-05-10 Thread Jacob Carlborg via Digitalmars-d-learn
I know that there are templates to inspect function parameters, like ParameterIdentifierTuple and ParameterTypeTuple. But these don't work for templated/untyped lambdas, they're apparently not callables. I don't expect ParameterTypeTuple to work, but it would be nice if ParameterIdentifierTuple

Re: Recommendation on option parsing

2014-05-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-05-10 01:09, Chris Piker wrote: Phobos' std.getopt is a bit spare for my taste, as there is no builtin general help facility with word-wrapping. Does anyone have a recommendation on which of the existing command line option parsing libraries floating around in the wild to use? If it doe

<    2   3   4   5   6   7