Re: Setting GTK_BASEPATH for gtkd

2023-10-16 Thread dan via Digitalmars-d-learn
On Monday, 16 October 2023 at 18:57:45 UTC, bachmeier wrote: On Monday, 16 October 2023 at 18:28:52 UTC, dan wrote: (Now, i still think that when module initialization order is not forced, it should be something a programmer or systems integrator can choose, but i don't want to be too greedy

Re: Forcing my module to be initialized first

2023-10-16 Thread dan via Digitalmars-d-learn
(Now, i still think that when module initialization order is not forced, it should be something a programmer or systems integrator can choose, but i don't want to be too greedy.) Thanks again for your help!! dan

Re: Forcing my module to be initialized first

2023-10-15 Thread dan via Digitalmars-d-learn
On Monday, 16 October 2023 at 04:26:32 UTC, Paul Backus wrote: On Monday, 16 October 2023 at 03:31:13 UTC, dan wrote: I have some code that i would like executed before anything else is. The code is to set an environment variable which is used by a library. I'm trying to find some way

Re: Forcing my module to be initialized first

2023-10-15 Thread dan via Digitalmars-d-learn
On Monday, 16 October 2023 at 03:33:55 UTC, Richard (Rikki) Andrew Cattermole wrote: On 16/10/2023 4:31 PM, dan wrote: I suppose if i could figure out a way to make all other modules depend on my module this would happen, but the module which uses the variable i want to set is in some already

Forcing my module to be initialized first

2023-10-15 Thread dan via Digitalmars-d-learn
?) Although i would prefer to code in d, it would be ok to do it in c. This is on MacOS (Catalina) in case that makes a difference, and i'm using dmd v2.104.0. Thanks in advance for any clues. dan

Re: Want a function that determines a double or float given its 80-bit IEEE 754 SANE (big endian) representation

2023-08-23 Thread dan via Digitalmars-d-learn
On Wednesday, 23 August 2023 at 03:24:49 UTC, z wrote: On Tuesday, 22 August 2023 at 22:38:23 UTC, dan wrote: Hi, I'm parsing some files, each containing (among other things) 10 bytes said to represent an IEEE 754 extended floating point number, in SANE (Standard Apple Numerical Environment

Want a function that determines a double or float given its 80-bit IEEE 754 SANE (big endian) representation

2023-08-22 Thread dan via Digitalmars-d-learn
the remaining 8 bytes to a fractional part, perhaps ignoring the last 2 or 3 as not being significant. But --- it seems like this kind of task may be something that d already does, maybe with some constructor of a double or something. Thanks in advance for any suggestions. dan

Re: Function which returns a sorted array without duplicates

2023-01-22 Thread dan via Digitalmars-d-learn
On Sunday, 22 January 2023 at 07:33:01 UTC, evilrat wrote: On Sunday, 22 January 2023 at 04:42:09 UTC, dan wrote: I would like to write a function which takes an array as input, and returns a sorted array without duplicates. ```d private S[] _sort_array( S )( S[] x ) { import

Function which returns a sorted array without duplicates

2023-01-21 Thread dan via Digitalmars-d-learn
). Here's the usage: ```d void main( ) { uint[] nums = [1, 3, 2, 5, 1, 4, 2, 8]; auto sorted = _sort_array( nums ); import std.stdio; writeln( "Input: ", nums ); writeln( "Output: ", sorted ); } ``` Thanks in advance for any info! dan

Re: running a d compiler on the Mac Mini with an M1 chip

2021-03-26 Thread dan via Digitalmars-d-learn
On Friday, 26 March 2021 at 21:54:20 UTC, rikki cattermole wrote: On 27/03/2021 10:51 AM, dan wrote: Are there any d compilers that run natively on the Mac Mini with an M1 chip? If so, does anybody here have any experience with them that can be shared? If not, and your machine is a mac

running a d compiler on the Mac Mini with an M1 chip

2021-03-26 Thread dan via Digitalmars-d-learn
Are there any d compilers that run natively on the Mac Mini with an M1 chip? If so, does anybody here have any experience with them that can be shared? If not, and your machine is a mac mini, how would you go about programming in d on it? TIA for any info!

which free operating systems have a gtkd package?

2021-01-22 Thread dan via Digitalmars-d-learn
.) Thanks in advance for any info! dan

Re: Compile code for PowerNex OS

2020-09-06 Thread Dan Printzell via Digitalmars-d-learn
On Saturday, 5 September 2020 at 12:45:06 UTC, Quantium wrote: I have a code that I need to compile for PowerNex OS, which compiler should I use and how to compile code for PowerNex? Short version: You can't (right now). Long version: PowerNex is currently in broken development state so even

Re: a function like writeln that returns a string rather than writes to a file

2020-05-02 Thread dan via Digitalmars-d-learn
On Saturday, 2 May 2020 at 10:36:47 UTC, Ali Çehreli wrote: On 5/1/20 7:40 PM, dan wrote:> On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: >> On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn >> wrote: >>> I'm looking for a function somethi

Re: a function like writeln that returns a string rather than writes to a file

2020-05-01 Thread dan via Digitalmars-d-learn
On Saturday, 2 May 2020 at 02:49:04 UTC, Steven Schveighoffer wrote: On 5/1/20 10:40 PM, dan wrote: On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn wrote: [...] [...] import std.format : format; string

Re: a function like writeln that returns a string rather than writes to a file

2020-05-01 Thread dan via Digitalmars-d-learn
On Saturday, 2 May 2020 at 02:29:43 UTC, H. S. Teoh wrote: On Sat, May 02, 2020 at 02:22:42AM +, dan via Digitalmars-d-learn wrote: I'm looking for a function something like writeln or write, but instead of writing to stdout, it writes to a string and returns the string

a function like writeln that returns a string rather than writes to a file

2020-05-01 Thread dan via Digitalmars-d-learn
apparatus? My only real requirement is that it be something really easy to do. Thanks in advance for any pointers. dan

Re: There is Dlang Telegram Bot based on the official Telegram Bot API?

2020-04-05 Thread Dan Cirnat via Digitalmars-d-learn
On Friday, 3 April 2020 at 16:10:55 UTC, Baby Beaker wrote: I create Bots for Telegram using Python or PHP. But I love Dlang and would like to create my Bots in Dlang. Is there any support for Dlang to create Telegram Bots? Hi, A quick search yielded this dub package:

Re: Output predefined versions

2020-03-25 Thread Dan Cirnat via Digitalmars-d-learn
On Wednesday, 25 March 2020 at 17:35:07 UTC, kinke wrote: Yes, just dummy-compile something with `-v` and check the line starting with `predefs`. Exactly what I need, thank you!

Output predefined versions

2020-03-25 Thread Dan Cirnat via Digitalmars-d-learn
Hi, I'm debugging issues with conditionally compiled code and I'd like to know exactly which versions are predefined by my compiler (Linux LDC Aarch64) Is there a quick way to check which ones are predefined? [0] https://dlang.org/spec/version.html#predefined-versions

Re: formatting a float or double in a string with all significant digits kept

2019-10-10 Thread dan via Digitalmars-d-learn
On Thursday, 10 October 2019 at 22:44:05 UTC, H. S. Teoh wrote: On Thu, Oct 10, 2019 at 09:13:05PM +, Jon Degenhardt via Digitalmars-d-learn wrote: On Thursday, 10 October 2019 at 17:12:25 UTC, dan wrote: > Thanks also berni44 for the information about the dig > attribut

Re: formatting a float or double in a string with all significant digits kept

2019-10-10 Thread dan via Digitalmars-d-learn
On Wednesday, 9 October 2019 at 10:54:49 UTC, David Briant wrote: On Tuesday, 8 October 2019 at 20:37:03 UTC, dan wrote: I have a double precision number that i would like to print all significant digits of, but no more than what are actually present in the number. Or more exactly, i want

formatting a float or double in a string with all significant digits kept

2019-10-08 Thread dan via Digitalmars-d-learn
i would like to be able to do this without knowing the expansion of pi, or writing too much code, especially if there's some d function like writeAllDigits or something similar. Thanks in advance for any pointers! dan

Re: Small program producing binary with large filesize

2018-08-01 Thread Dan Barbarito via Digitalmars-d-learn
Thank you for all of the great answers, everyone!

Small program producing binary with large filesize

2018-07-31 Thread Dan Barbarito via Digitalmars-d-learn
Hi all, I am starting to write a command line tool. So far it is a small (feature-wise) program but the file size is scaring me. It's already 13 megabytes, but I would expect it to be much smaller. Is it because I'm using 3 libraries so far? The libraries are: mir, vibe.d, and d2sqlite3.

GC in D and synadard library.

2017-12-21 Thread Dan Partelly via Digitalmars-d-learn
I started to look into D very recently. I would like to know the following, if you guys are so nice to help me: 1. What is the performance of D's GC, what trade-offs where done in design , and if a in-deep primer on efficient usage and gotchas of the current implementation exists. 2. GC

Re: How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread dan via Digitalmars-d-learn
On Tuesday, 7 November 2017 at 21:32:26 UTC, Adam D. Ruppe wrote: On Tuesday, 7 November 2017 at 21:25:00 UTC, dan wrote: I looked in my distribution's object.d (debian stretch, gdc, in Did you import std.stdio in the file? If so, it is calling the std.stdio.write on the object

How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread dan via Digitalmars-d-learn
for any clues, or a pointer to page 1 of the manual if it's there and i'm just being dense. dan

Re: using assignment statement as conditional in a where

2016-12-03 Thread dan via Digitalmars-d-learn
On Saturday, 3 December 2016 at 09:03:25 UTC, rikki cattermole wrote: On 03/12/2016 9:55 PM, dan wrote: [...] If you can use another compiler do so, gdc is on an old frontend/Phobos now. I recommend ldc or you know the reference compiler dmd if performance/platform isn't an issue

using assignment statement as conditional in a where

2016-12-03 Thread dan via Digitalmars-d-learn
hen break if the assignment returns zero. But i really, really would like to use the idiom of assigning a value from inside a while condition. Is it possible to do this? Perhaps with extra braces or something, like while ( {something here} ) { } ? TIA for any pointers or advice. dan

Re: dependency analysis for makefile construction

2016-09-05 Thread dan via Digitalmars-d-learn
On Monday, 5 September 2016 at 18:49:25 UTC, Basile B. wrote: On Monday, 5 September 2016 at 18:22:08 UTC, ag0aep6g wrote: On 09/04/2016 12:07 AM, dan wrote: Are there any FOSS tools for doing dependency analysis of [...] [...] I'm not aware of a standalone tool that does something like

dependency analysis for makefile construction

2016-09-03 Thread dan via Digitalmars-d-learn
my_string = import("my_file");'). My guess is there must be, because one of the big deals about d is the more regular syntax it offers to make compiler building more reliable. (I'm using gdc, and building with gnumake.) TIA for any info! dan

Re: Is there a d analog of strncmp?

2016-08-21 Thread dan via Digitalmars-d-learn
On Monday, 22 August 2016 at 01:45:02 UTC, Jonathan M Davis wrote: On Monday, August 22, 2016 00:14:31 Adam D. Ruppe via Digitalmars-d-learn wrote: int strncmp(string a, string b, int n) { if(a.length > n) a = a[0 .. n]; if(b.length > n) b = b[0 .. n]; import

Is there a d analog of strncmp?

2016-08-21 Thread dan via Digitalmars-d-learn
In c, there's this very nice function strncmp(s1,s2,count) which compares two c strings, using at most count characters. count can be less than, more than, or equal to either or both of the lengths of the two strings. It can be used to see if two c-strings have the same prefix of some

Re: persistence, serialization, history (run-to-run) in small self-contained program

2016-07-14 Thread dan via Digitalmars-d-learn
On Thursday, 14 July 2016 at 08:28:56 UTC, Jacob Carlborg wrote: On 2016-07-14 07:18, dan wrote: I'm writing a small program (compiled with gdc on xubuntu 16.04). I would like it to remember a little data (a few kilobytes maybe). . My main concern is minimizing program complexity

persistence, serialization, history (run-to-run) in small self-contained program

2016-07-13 Thread dan via Digitalmars-d-learn
entirely? (In each case, i would store the data in some file, and on second and subsequent runs of the program attempt to recover the data from that file if possible.) My main concern is minimizing program complexity. TIA for any advice. dan

Re: standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
On Sunday, 29 May 2016 at 02:44:33 UTC, jhps wrote: On Sunday, 29 May 2016 at 00:48:20 UTC, dan wrote: Especially in a declaration like static typeof(this) make_instance( ) but also in the 'new typeof(this)'. In both cases, 'this' doesn't even exist. https://dlang.org/spec

Re: standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
On Sunday, 29 May 2016 at 00:28:13 UTC, Mithun Hunsur wrote: On Sunday, 29 May 2016 at 00:14:17 UTC, dan wrote: Is there a standard alias for a class name inside class code? Something like 'this' referring to a class instance, but referring instead to the class itself? [...] typeof

standard alias for a class name inside the class code?

2016-05-28 Thread dan via Digitalmars-d-learn
ant to provide this feature. (But the php interpreter, whatever else is good or bad about it, does let you write 'new self(...)' and does the right thing with it.) TIA for any clues. dan

Re: Is there a way to make a class variable visible but constant to outsiders, but changeable (mutable) to the class itself?

2016-05-23 Thread dan via Digitalmars-d-learn
On Monday, 23 May 2016 at 07:03:08 UTC, chmike wrote: On Saturday, 21 May 2016 at 17:32:47 UTC, dan wrote: (This effect could be simulated by making my_var into a function, but i don't want to do that.) May I ask why you don't want to do that ? In D you can call a function without args

Re: Is there a way to make a class variable visible but constant to outsiders, but changeable (mutable) to the class itself?

2016-05-21 Thread dan via Digitalmars-d-learn
Thanks Vit, Meta, and Yuxuan for your speedy help! So 3 pieces to put together, function, const, and @property (and i guess final for protection against subclasses).

Is there a way to make a class variable visible but constant to outsiders, but changeable (mutable) to the class itself?

2016-05-21 Thread dan via Digitalmars-d-learn
;no" (the only relevant type qualifiers are private, package, protected, public, and export, and none seem appropriate). (This effect could be simulated by making my_var into a function, but i don't want to do that.) TIA for any info! dan

Re: Using D in Android App

2016-04-18 Thread Dan Olson via Digitalmars-d-learn
ne yet and Apple's requirement to include embedded bitcode is missing currently. -- Dan

Re: GC configuration docs

2016-01-05 Thread Dan Olson via Digitalmars-d-learn
Rainer Schuetze <r.sagita...@gmx.de> writes: > On 05.01.2016 01:39, Dan Olson wrote: >> I haven't played with any of the new GC configuration options introduced >> in 2.067, but now need to. An application on watchOS currently has >> about 30 MB of RAM. Is there

Re: Looking for a language to hang my hat on.

2015-11-17 Thread Dan via Digitalmars-d-learn
Thanks everyone for taking the time to respond! @Lobo, Start using D now. It's not all or nothing so you don't have to give up on C++. I have several projects that contain both C++ and D intermixed. Using both does seem like a good way to transition. I could combine the strengths of D

Looking for a language to hang my hat on.

2015-11-16 Thread Dan via Digitalmars-d-learn
ition. Can anyone here who has already made that transition tell me how smoothly it went? Any major unexpected problems? Advice? thanks! Dan

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
thank you John it worked :) do I always need do the same for all windows API?

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
thank you so much John :)

Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
hi I'm using those imports: import core.runtime; import core.sys.windows.windows; when I call GetWindowTextW DMD compiler complains! (error:undefined identifier) any solution?

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
GetWindowTextW(hWindow, buffer, sizeof(title)); -- Problem here please Ignore the sizeof(title) parameter, I copied that from c++ equivalent code :D

Re: Can't call GetWindowTextW - Error:undefined identifier

2015-06-17 Thread Dan via Digitalmars-d-learn
I'm new to Dlang and I have no Idea whats wrong with this code! wchar[260] buffer; HWND hWindow = GetForegroundWindow(); GetWindowTextW(hWindow, buffer, sizeof(title)); -- Problem here

overloading evaluation (treating objects as functions)

2015-05-18 Thread dan via Digitalmars-d-learn
this, because i can't find it on the internet or in Alexandrescu's book. But it is also possible that everybody considers it so obvious that they just don't elaborate on it. I'd be delighted if there were the case, at least if somebody would elaborate on it if so. TIA for any info! dan

Re: overloading evaluation (treating objects as functions)

2015-05-18 Thread dan via Digitalmars-d-learn
Awesome!! Thanks Gary and namespace (and obviously i gotta improve my google-fu). dan On Sunday, 17 May 2015 at 19:40:10 UTC, Gary Willoughby wrote: On Sunday, 17 May 2015 at 18:58:32 UTC, Namespace wrote: http://dlang.org/operatoroverloading.html#function-call Like this: module main

Re: Is this expected? default to public members in private class

2015-05-04 Thread Dan Olson via Digitalmars-d-learn
ketmar ket...@ketmar.no-ip.org writes: On Sun, 03 May 2015 18:07:20 -0700, Dan Olson wrote: It seems a private class or struct defaults to public members. Just curious if this is intended. I would have expected private all the way down unless overriden. i bet it is intended. protection

Is this expected? default to public members in private class

2015-05-03 Thread Dan Olson via Digitalmars-d-learn
() {} public void pub() {} } --- xyzzy.d module xyzzy; import plugh; void main() { auto f = makeFoo(); f.maybepriv(); // is accessible after all //f.priv(); // err expected, member private f.pub(); } -- Dan Olson

Re: Weird OSX issue

2015-04-25 Thread Dan Olson via Digitalmars-d-learn
Jacob Carlborg d...@me.com writes: 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,

Re: std.json questions

2015-04-25 Thread Dan Olson via Digitalmars-d-learn
tired_eyes pastuho...@gmail.com writes: First issue: what is the proper (idiomatic) way to conver JSONValue to the proper types? Second: what is the proper way of handling boolean values in JSON (how to convert JSON_TYPE.TRUE and JSON_TYPE.FALSE to bool)? Righ now I'm doing is something

Re: extern(C++) linker errors

2015-04-22 Thread Dan Olson via Digitalmars-d-learn
/tree/merge-2.067 and check it out. There are still a few tests to reolve, but it works pretty well for me. -- Dan

Re: Unittest in a windows app

2014-12-20 Thread Dan Nestor via Digitalmars-d-learn
I managed to isolate the problem to the following. Program 1 below works (displays unit test failure when run), while program 2 does not. * Program 1 * import std.stdio; unittest { assert(false); } void main() { writeln(Hello D-World!); } * Program 2 * module

Unittest in a windows app

2014-12-19 Thread Dan Nestor via Digitalmars-d-learn
for helping! Dan

Re: Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-14 Thread Dan Olson via Digitalmars-d-learn
Marc Schütz\ schue...@gmx.net writes: On Saturday, 13 December 2014 at 21:20:43 UTC, Andrey Derzhavin wrote: import std.stdio; class ObjectAType { bool ok; this() {ok = true;} } void main() { auto a = new ObjectAType; assert(a.ok); destroy(a); assert(!a.ok); // a

Re: mixin template had error by calling shared function

2014-12-11 Thread Dan Olson via Digitalmars-d-learn
Here is a way that will work. Vlasov Roman vlasovroman...@yandex.ru writes: I have this code mixin template Template(void function() func1, void function() func2) mixin template Template(alias func1, alias func2) class SomeClass { mixin Template!(func, func23); mixin

Re: std.parallelism: How to wait all tasks finished?

2014-02-03 Thread Dan Killebrew
It seems to me that worker threads will continue as long as the queue isn't empty. So if a task adds another task to the pool, some worker will process the newly enqueued task. No. After taskPool.finish() no way to add new tasks to the queue. taskPool.put will not add new tasks. Then

Re: std.parallelism: How to wait all tasks finished?

2014-02-02 Thread Dan Killebrew
// Next line will block execution until all tasks already in queue finished. // Almost all what I need, but new tasks will not be started. taskPool.finish(true); } Are you sure TaskPool.finish isn't what you're looking for? Signals worker threads to terminate when the queue becomes

Re: mixin template

2014-01-30 Thread Dan Killebrew
mixin template Foo(alias a){ alias Foo=a; } pragma(msg, Foo!2); // error template Bar(alias a){ alias Bar=a; } pragma(msg, Bar!2); // ok Perhaps I was unclear. What I meant: What does 'mixin template' do that 'template' does not? Where would I use 'mixin template'? As far as I can tell,

Re: mixin template

2014-01-30 Thread Dan Killebrew
On Friday, 31 January 2014 at 06:24:27 UTC, Dan Killebrew wrote: mixin template Foo(alias a){ alias Foo=a; } pragma(msg, Foo!2); // error template Bar(alias a){ alias Bar=a; } pragma(msg, Bar!2); // ok As far as I can tell, 'mixin template' does nothing new; (besides fail to compile

Re: std.json tree navigation help

2014-01-27 Thread Dan Killebrew
Check out the json module in vibe.d. Maybe copy it into your own application (since it can't be used as a library, yet). http://vibed.org/api/vibe.data.json/ https://github.com/rejectedsoftware/vibe.d

Re: mixin template

2014-01-27 Thread Dan Killebrew
Found this: http://forum.dlang.org/thread/ntuysfcivhbphnhnn...@forum.dlang.org#post-mailman.1409.1339356130.24740.digitalmars-d-learn:40puremagic.com If what Jonathan says is true, then http://dlang.org/template-mixin.html should be updated: s/mixin template/template/

Re: Idiomatic way to share mutable data?

2013-12-23 Thread Dan Killebrew
On Sunday, 22 December 2013 at 21:07:11 UTC, Charles McAnany wrote: Friends, I'm writing a little molecular simulator. Without boring you with the details, here's the gist of it: struct Atom{ double x, vx; double interaction(Atom a2){ return (a2.x-this.x)^^2; //more

sending an Exception and print it

2013-12-21 Thread Dan Killebrew
I'm sending an exception from a worker thread to the owner thread to be logged/printed. Using DMD64 D Compiler v2.064 http://dpaste.dzfl.pl/7c8b68bd Using std.concurrency prevents me from passing a naked Exception. So the owner receives either a shared or immutable Exception. I can't format a

Re: sending an Exception and print it

2013-12-21 Thread Dan Killebrew
I just wanted to add that the can't format immutable Exception also prevents me from doing this: auto exception = receiveOnly!(immutable Exception)(); because receiveOnly creates a tuple which implements a toString that uses indirectly uses formatObject. So I'm forced to use the slightly

Re: Tricky code with exceptions

2013-05-09 Thread Dan Olson
evilrat evilrat...@gmail.com writes: On Thursday, 9 May 2013 at 20:33:17 UTC, bearophile wrote: Brad Anderson: a 64-bit Windows dmd build did not crash and here is the output. Thank you for the data point. So maybe the problem is only on 32 bit Windows. Bye, bearophile win8 dmd 2.062

Re: debugging on Mac OSX

2013-04-29 Thread Dan
On Monday, 29 April 2013 at 16:48:27 UTC, Jacob Carlborg wrote: On 2013-04-29 14:45, Daniel Davidson wrote: Ho do you debug D executables on mac os x in which debug symbols are available (preferably a setup that works in emacs with gdb or gud-gdb)? This thread seems to bring up the issue I

Re: Orange lib help

2013-03-27 Thread Dan
On Tuesday, 26 March 2013 at 19:35:51 UTC, Jacob Carlborg wrote: I'll take a look. Which compiler and version are you using? DMD64 D Compiler v2.062 ubuntu 64 bit thanks!

Orange lib help

2013-03-26 Thread Dan
.__aggr2839 inout variables can only be declared inside inout functions I can't seem to find any answers in the documentation. Anybody could help me out? thanks dan

static functions associated with enums

2013-03-21 Thread Dan
)) ) Thanks Dan --- static void fromJson(ref AssetCategory assetType, Json src) { string value = cast(string)src; writeln(value is ,value); final switch(value) { case Investment: { assetType = AssetCategory.Investment; break; } case PrimaryResidence: { assetType

Re: recursive equal, and firstDifference functions

2013-03-20 Thread Dan
. Semantically deep equality is comfortable to me, but I would imagine by now there is a fair amount of code that might rely on a false result from opEquals if the members (slices, associative arrays) are not bitwise the same. Thanks Dan

looking for V[string] workarounds

2013-03-20 Thread Dan
by the asset name. Thanks, Dan import std.stdio; struct Series { // REQUIRED - need to have no aliasing this(this) { data = data.dup; } private double[] data; } struct Assets { this(this) { itemToSeries.dup; } // REQUIRED - want ctor to dup arg to ensure no aliasing this(const(Series

Re: looking for V[string] workarounds

2013-03-20 Thread Dan
to be passed in, due to const transitivity. So that requirement would ripple a change to all already const correct instances to now need to flip to non-const. I'm looking for a const correct solution. It should be doable ... I just have had no luck with it. Thanks Dan

initializing const maps with value types having aliasing

2013-03-20 Thread Dan
The following works and is the only way I have found to initialize m. Unfortunately it requires the cast. Is this safe to do? Is there a better way? Is this a bug or are future features coming to clean it up? Thanks Dan -- import std.stdio; struct S

Re: initializing const maps with value types having aliasing

2013-03-20 Thread Dan
{ this(this) { x = x.dup; } char[] x; } immutable S[string] aa; static this() { // now what } Thakns Dan

Re: looking for V[string] workarounds

2013-03-20 Thread Dan
On Wednesday, 20 March 2013 at 17:44:16 UTC, Ali Çehreli wrote: In that case, brute force to the rescue (nc stands for non-const): :) this(const(Series[string]) source) { auto nc_source = cast(Series[string])source; itemToSeries = nc_source.dup; } Wow - that worked. Thanks! I

initializing const(Date)

2013-03-19 Thread Dan
: /opt/compilers/dmd2/include/std/datetime.d(13542): Error: Internal Compiler Error: CTFE literal cast(short)1 dmd: ctfeexpr.c:353: Expression* copyLiteral(Expression*): Assertion `0' failed. Thanks Dan

Re: recursive equal, and firstDifference functions

2013-03-19 Thread Dan
/patefacio/d-help/blob/master/d-help/opmix/mix.d Thanks Dan

Re: recursive equal, and firstDifference functions

2013-03-19 Thread Dan
On Tuesday, 19 March 2013 at 20:28:09 UTC, Jonathan M Davis wrote: Those are what opEquals, opCmp, and toHash are for. It might make sense to define mixins which implement them for you (dealing with whatever recursive semantics are necessary), but using external functions for those just

Re: recursive equal, and firstDifference functions

2013-03-19 Thread Dan
and toHash. The above works with the built-in AAs. Please offer an example. Thanks Dan

Re: recursive equal, and firstDifference functions

2013-03-19 Thread Dan
On Tuesday, 19 March 2013 at 23:13:19 UTC, Jonathan M Davis wrote: On Tuesday, March 19, 2013 22:43:10 Dan wrote: The above works with the built-in AAs. Please offer an example. It works because the outer type defines toHash. Without toHash, the built-in AAs won't work. If you're dealing

Re: recursive equal, and firstDifference functions

2013-03-19 Thread Dan
On Wednesday, 20 March 2013 at 02:03:31 UTC, Jonathan M Davis wrote: We already get this. That's what == does by default. It's just that it uses == on each member, so if == doesn't work for a particular member variable and the semantics you want for == on the type it's in, you need to override

Re: recursive equal, and firstDifference functions

2013-03-19 Thread Dan
On Wednesday, 20 March 2013 at 02:54:23 UTC, Jonathan M Davis wrote: On Wednesday, March 20, 2013 03:48:38 Dan wrote: On Wednesday, 20 March 2013 at 02:03:31 UTC, Jonathan M Davis wrote: We already get this. That's what == does by default. It's just that it uses == on each member, so

Re: Can D still compile html files? Seems not.

2013-02-26 Thread Dan Olson
Maybe you want Knuth's Literate Programming. http://en.wikipedia.org/wiki/Literate_programming Long ago it was only for pascal and C (web and cweb), but now I see there is noweb that works with any programming language. -- Dan

Re: std.container.RedBlackTree versus C++ std::set

2013-02-16 Thread Dan
of the copy constructor is to do a deep copy. This could easily be provided by the compiler or phobos. Further, consider standardizing on the .dup and .idup conventions for this purpose. Thanks Dan

rdmd hung?

2013-02-15 Thread Dan
this? - on linux is there a way, once in this state to provide any information that would be helpful. strace during on a complete run could help - but it is too late for that. Thanks Dan

Re: std.container.RedBlackTree versus C++ std::set

2013-02-15 Thread Dan
. For structs we could use compile time reflection to provide automatic efficient opCmp behavior. Section 3.1 here outlines a way: https://github.com/patefacio/d-help/blob/master/doc/canonical.pdf Any comments appreciated. Thanks Dan HOWEVER, when you get to the point of executing a == b, it's

Re: std.container.RedBlackTree versus C++ std::set

2013-02-15 Thread Dan
Dan

Re: std.container.RedBlackTree versus C++ std::set

2013-02-15 Thread Dan
not know the cost of postblit - or copy construction if that were a future solution for structs. Granted the no rvalue passing is a pain - but is it a big deal in library/generic code? Thanks, Dan

Re: std.container.RedBlackTree versus C++ std::set

2013-02-15 Thread Dan
if not. Thanks Dan

Re: best idiom for insert if not present; else use value in assoc array

2013-02-09 Thread Dan
On Saturday, 9 February 2013 at 00:54:58 UTC, Andrej Mitrovic wrote: Feel free to file an enhancement request. http://d.puremagic.com/issues/show_bug.cgi?id=9491 Hopefully that is clear.

what is special about unittest constants

2013-02-08 Thread Dan
is the reason for the difference between unittest constants and module constants? Thanks, Dan

best idiom for insert if not present; else use value in assoc array

2013-02-07 Thread Dan
welcome. Also, an FYI to dpaste maintainer that the compiler service has been unavailable for a while. Thanks Dan

Re: best idiom for insert if not present; else use value in assoc array

2013-02-07 Thread Dan
for a given key the hash is computed just once. I believe this would have to be done at the level of AssociativeArray and can not be done as a helper function, since this set helper is still doing 3 hashes/lookups. Thanks Dan

  1   2   3   >