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

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

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

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

2014-05-13 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

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 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: naming a variable at runtime

2014-05-13 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-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

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

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

2014-05-16 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: Objects(from classes) at Compile time? no gc

2014-05-16 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

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: How to detect a lambda expression get it is signature

2014-06-02 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

Re: Fighting compiler - experienced programmer but D novice

2014-06-03 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

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: D1: UTF8 char[] casting to wchar[] array cast misalignment ERROR

2014-06-17 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: 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

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 =

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

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

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

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

Re: Using enum constant from different modules

2014-07-11 Thread Jacob Carlborg via Digitalmars-d-learn
On 10/07/14 22:47, Marc Schütz schue...@gmx.net 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

Re: Using enum constant from different modules

2014-07-11 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

Re: Using enum constant from different modules

2014-07-11 Thread Jacob Carlborg via Digitalmars-d-learn
On 10/07/14 23:48, Marc Schütz schue...@gmx.net 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

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: Identifying 32 vs 64 bit OS?

2014-08-11 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

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

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: D1: Error: duplicate union initialization for size

2014-08-26 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: D1: Error: duplicate union initialization for size

2014-08-27 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-27 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

Re: D1: Error: duplicate union initialization for size

2014-08-28 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?

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

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

2014-09-05 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: 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]

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

2014-09-16 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: Interop with C++ library - what toolchain do you use?

2014-09-18 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: 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

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

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: 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: 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

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

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

2014-10-07 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

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 with rdmd as

Re: object hijacked ?

2014-10-10 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

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

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

2014-10-20 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: 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:

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 is

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

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. --

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

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

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

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

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

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

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: 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

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

Re: Converting Java code to D

2015-04-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-20 20:05, Steven Schveighoffer wrote: enum LineStyle : string { NONE = None, SOLID = Solid, ... // etc } Used like this: funcThatTakesString(LineStyle.NONE); LineStyle ls = LineStyle.SOLID; funcThatTakesLineStyle(ls); I'm not a Java programmer, and my time with Java

Re: Structural exhaustive matching

2015-04-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-21 17:36, Jadbox wrote: What's the best equivalent to Rust's structural enum/pattern (match)ing? Is it also possible to enforce exhaustive matches? Basically, I'm curious on what the best way to do ADTs in D. There's something call castSwitch [1], perhaps not what you're looking

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

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-20 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-20 12:42, Gary Willoughby wrote: Great thanks that cured the linking problem but there are still more errors during the build. I'm giving up for now as i only need the html but it's disappointing that it's so broken. Are your clones of DMD, druntime and Phobos up to date and clean?

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 18:20, Gary Willoughby wrote: Here are the errors: ... touch ../dub-0.9.23/.cloned mkdir -p /tmp/.stable_dmd-2.067.0 TMPFILE=$(mktemp deleteme.) curl -fsSL http://downloads.dlang.org/releases/2.x/2.067.0/dmd.2.067.0.linux.zip ${TMPFILE}.zip \ unzip -qd

Re: Weird OSX issue

2015-04-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-24 20:37, Steven Schveighoffer wrote: So am I going crazy? Or is dmd doing things differently depending on where its environment is? Any compiler gurus out there understand why the symbol is different? I don't want to file a bug with this, because it seems dependent on installation

Re: [dvm] Can't install compilers on Mac

2015-04-29 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-28 19:46, Chris wrote: I keep getting this message. Why? Fetching: http://ftp.digitalmars.com/dmd.2.067.0.zip [] 56256/54884 KB Installing: dmd-2.067.0 An unknown error occurred:

Re: [dvm] Can't install compilers on Mac

2015-04-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-04-29 23:24, Chris wrote: Yes. Doesn't work. What happens when you run ./dvm install dvm? What is the output? If the installation of DVM itself fails you will not be able to install compilers. You can verify the installation of DVM by opening a new shell session (a new tab or

Re: Linking to Dynamic Library on Mac OS X

2015-05-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-05-15 21:49, John Colvin wrote: Note that you may also find you need to help OS X find the dylib when running the program, either by moving it to one of the system locations or using DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH That should not be necessary. -- /Jacob Carlborg

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

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

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

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,

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: 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.

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: 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-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

Re: Initialising global associative array

2015-06-06 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-06-06 20:18, Paul wrote: I need a globally accessible AA of type string[string] and find that it won't compile unless I use the static this(){} method as described in this thread:

Re: Exec function D from C++

2015-06-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 21/06/15 16:09, Sean Campbell wrote: extern(C++) void d_initialize() { Runtime.initialize(); } extern(C++) void d_terminate() { Runtime.terminate(); } These two functions are not necessary. There are already functions in druntime which are supposed to be called from C/C++:

Re: What is D's minimum requirements on Mac?

2015-06-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-06-11 13:34, Kagamin wrote: You can try to register as a developer: https://developer.apple.com/programs/ and get beta versions of OSX and install them on virtual box. Not sure how much it costs. OS X is free, you just need a Mac to download it :) -- /Jacob Carlborg

Re: What is D's minimum requirements on Mac?

2015-06-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-06-10 20:55, Adam D. Ruppe wrote: I'm still tempted to grab a used Mac so I can port my display stuff to Cocoa and test it, but Macs are outrageously expensive and I hate them, so want to spend as little as possible. What does dmd minimally require on a mac? If I got like a 10.5 would

Re: What is D's minimum requirements on Mac?

2015-06-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-06-10 20:55, Adam D. Ruppe wrote: i'm considering something like http://www.amazon.com/Apple-MB138LL-Intel-Drive-Combo/dp/B0006HU49Y/ref=sr_1_5?ie=UTF8qid=1433962021sr=8-5keywords=used+mac+mini You can look up the requirements for OS X and see which is the latest version you can run

Re: proper way to calculate toHash() for string

2015-06-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 30/06/15 16:19, aki wrote: Please suggest me if anyone have an idea. You can use TypeInfo.getHash [1] to get the hash of a given value. Something like: string a = foo; typeid(a).getHash(a) [1] http://dlang.org/phobos/object.html#.TypeInfo.getHash -- /Jacob Carlborg

Re: deserialization: creating a class instance without calling constructor

2015-05-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-05-21 11:06, Timothee Cour via Digitalmars-d-learn wrote: Can I create an instance of A without calling a constructor? (see below) Use case: for generic deserialiaztion, when the deserialization library encounters a class without default constructor for example (it knows what the fields

Re: Empty struct, any runtime cost?

2015-08-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-19 16:05, Nicholas Wilson wrote: I'd be surprised if it didn't, but you can always check the disassembly. If for some reason either the compiler doesn't remove it (it never removes classes btw but not sure about structs) or the linker doesn't discard it you can try -gcsections ( or

Re: automatically verifying code samples in phobos docs

2015-08-20 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-20 01:41, Laeeth Isharc wrote: Should this be done? How? Just use a documented unit tests block: /// unittest { // code goes here } It will be run as part of the unit tests and it will be included when generating the documentation. Although I don't have a good solution for

Re: automatically verifying code samples in phobos docs

2015-08-20 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-20 10:49, wobbles wrote: Will AutoProtocol().idup not make this work? Make an immutable copy of whatever AutoProtocol() returns, which should be then immutable char[] (i.e. string) Yes, that should work. -- /Jacob Carlborg

Re: A better way than foreach with this?

2015-08-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-24 07:58, Joel wrote: auto names = Alef Bet Gimel Dalet He Vav Zayen Het Tet Yod Final_Kaf Kaf Lamed Final_Mem Mem Final_Nun Nun Samekh Ayin Final_Pe Pe Final_Tsadi Tsadi Qof Resh Shin Tav.split; foreach (ref name; names)

Re: (De)Serializing interfaces

2015-08-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-22 21:14, nims wrote: Using Orange all I got was a lot of compiler errors. Seems I completely overlooked interfaces. I'll see if I can add support for them. -- /Jacob Carlborg

Re: extern(C) with function returning user type

2015-07-30 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-29 20:42, Kyoji Klyden wrote: Thanks for the replies, This issue really highlights one of D's weak points I think. I've atleast got a round about solution almost working. :P You might want to check out Calypso [1] as well. [1]

Re: How does __traits and std.traits differ?

2015-07-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-24 09:16, WhatMeWorry wrote: Looking at the online documentation, it says: __traits are extensions to the language to enable programs, at compile time, to get at information internal to the compiler. std.traits are Templates which extract information about types and symbols at

Re: C bindings: typedef struct conflicts with method

2015-07-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-21 14:24, yawniek wrote: done, https://github.com/jacob-carlborg/dstep/issues/40 i was under the impression that there is already a ticked as https://github.com/jacob-carlborg/dstep/issues/8 looks very similar (but was closed). Yeah, looks very similar. Issue 8 i still open and has

Re: C bindings: typedef struct conflicts with method

2015-07-23 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-23 03:57, Mike Parker wrote: In your case, rd_kafka_metadata is the name of the struct, but in C instances would need to be declared like so: struct rd_kafka_metadata instance; Since the struct is declared directly in the typedef, is the struct name actually available? --

Re: Getting this to work similar to self in Python

2015-07-23 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-23 00:22, nurfz wrote: I think you got overly complicated answers. I guess I'm confused as to why the D code isn't acting similar to the Python code in the sense that you would expect this to reference the speed property of the current instance and not statically reference the

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-17 09:33, Anonymous wrote: So for a software named 'SuperDownloader2015' it would be $HOME/Library/Application Support/SuperDownloader2015 right ? so it's not user-specific and it's writable for the current user ? sorry but it looks a bit strange, anyone can confirm ? Yes,

  1   2   3   4   5   6   7   >