Allocator Part of Type

2018-03-15 Thread jmh530 via Digitalmars-d-learn
I recall some talk Andrei did where he said it was a bad idea to make the allocator part of the type. However, the container library in dlang-community(says it is backed with std.experimental.allocator) contains allocator as part of the type. Automem does too. Honestly, I would think you would

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 6 March 2018 at 18:41:15 UTC, H. S. Teoh wrote: The fix itself may be straightforward, but how to do it without breaking tons of existing code and provoking user backlash is the tricky part. [snip] Ah, I see what you're saying. People may be depending on the extra accuracy for

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 6 March 2018 at 17:51:54 UTC, H. S. Teoh wrote: [snip] I'm not advocating for getting *rid* of 80-bit float support, but only to make it *optional* rather than the default, as currently done in std.math. T Aren't there two issues: 1) std.math functions that cast to real to pe

Re: Speed of math function atan: comparison D and C++

2018-03-05 Thread jmh530 via Digitalmars-d-learn
On Monday, 5 March 2018 at 21:05:19 UTC, bachmeier wrote: I wonder if Ilya has worked on any of this for Mir. Mir has sin and cos, but that's it. It looks like they use llvm intrinsics on LDC and then fall back to phobos' implementation.

Re: Making mir.random.ndvariable.multivariateNormalVar create bigger data sets than 2

2018-02-27 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 27 February 2018 at 21:54:34 UTC, Nathan S. wrote: Cross-posting from the github issue (https://github.com/libmir/mir-random/issues/77) with a workaround (execute it at https://run.dlang.io/is/Swr1xU): [snip] Step in the right direction at least.

Re: Making mir.random.ndvariable.multivariateNormalVar create bigger data sets than 2

2018-02-27 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 27 February 2018 at 17:24:22 UTC, Nathan S. wrote: On Tuesday, 27 February 2018 at 16:42:00 UTC, Nathan S. wrote: On Tuesday, 27 February 2018 at 15:08:42 UTC, jmh530 wrote: Nevertheless, it probably can't hurt to file an issue if you can't get something like the first one to work.

Re: Making mir.random.ndvariable.multivariateNormalVar create bigger data sets than 2

2018-02-27 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 27 February 2018 at 09:23:49 UTC, kerdemdemir wrote: I need a classifier in my project. Since it is I believe most easy to implement I am trying to implement logistic regression. I am trying to do the same as the python example: https://beckernick.github.io/logistic-regression-fr

Re: Help using lubeck on Windows

2018-02-26 Thread jmh530 via Digitalmars-d-learn
On Monday, 26 February 2018 at 19:02:36 UTC, Arredondo wrote: This worked. Thank you jmh530! I feel like at this moment, lubeck should be clearly marked "not Windows ready", as not everybody will have the inclination/patience to deal with incompatible object file formats or the Windows subsy

Re: Help using lubeck on Windows

2018-02-26 Thread jmh530 via Digitalmars-d-learn
On Monday, 26 February 2018 at 17:12:51 UTC, Arredondo wrote: Okay, so I just finished configuring WSL. The way I want to use my app is having it read from stdin, do some calculations, and write to stdout, in an infinite cycle. I wanted to feed this to some higher level algorithms in Wolfram

Re: Help using lubeck on Windows

2018-02-25 Thread jmh530 via Digitalmars-d-learn
On Sunday, 25 February 2018 at 14:25:04 UTC, Arredondo wrote: On Friday, 23 February 2018 at 16:56:13 UTC, jmh530 wrote: I had given up and used WSL at this point rather than compile it myself with CMAKE. Less of a headache. I don’t understand. Wouldn’t WSL produce Linux binaries? I need my p

Re: Help using lubeck on Windows

2018-02-23 Thread jmh530 via Digitalmars-d-learn
On Friday, 23 February 2018 at 12:13:11 UTC, Arredondo wrote: Help using lubeck on Windows I'd like to experiment with linear algebra in D, and it looks like lubeck is the way to do it right now. However, I'm having a hard time dealing with the CBLAS and LAPACK dependencies. I downloaded the

Re: Performance of default and enum parameters

2018-02-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 February 2018 at 23:18:53 UTC, H. S. Teoh wrote: [snip] Appreciate the detailed reply. I had tried to look at the assembly with that tool recently discussed in the announce thread, but there was so much extra stuff reported that I threw up my hands.

Performance of default and enum parameters

2018-02-07 Thread jmh530 via Digitalmars-d-learn
I'm a little curious on the impact of default and enum parameters on performance. In the simple example below, I have foo and bar that return different results depending on a bool. Foo is a template with check as a template parameter and bar is a normal function. foo creates two different ver

Re: How to test a DUB-based library during development?

2018-01-11 Thread jmh530 via Digitalmars-d-learn
On Thursday, 11 January 2018 at 14:59:18 UTC, DanielG wrote: Ah, thank you! I replaced: "libs-windows-x86-dmd" with: "sourceFiles-windows-x86-dmd" (and added a .lib suffix) and now everything works as expected. I see now that I was using "libs" improperly. It seems more for system-

DIP1000 & Owning Containers

2018-01-08 Thread jmh530 via Digitalmars-d-learn
DIP1000 has a section on owning containers where it shows that you can have a reference to a member of a struct that will not outlive the struct itself. This seems to work through the function opAssign being scope ref. Why wouldn't you normally be allowed to make a scoped pointer to a member

Re: Consequences of casting away immutable from pointers

2018-01-05 Thread jmh530 via Digitalmars-d-learn
On Friday, 5 January 2018 at 04:10:54 UTC, Steven Schveighoffer wrote: Yes, this is undefined behavior. https://dlang.org/spec/const3.html#removing_with_cast The compiler assumes x is going to be 5 forever, so instead of loading the value at that address, it just loads 5 into a register (or

Re: Consequences of casting away immutable from pointers

2018-01-05 Thread jmh530 via Digitalmars-d-learn
On Friday, 5 January 2018 at 04:10:54 UTC, Steven Schveighoffer wrote: Yes, this is undefined behavior. https://dlang.org/spec/const3.html#removing_with_cast The compiler assumes x is going to be 5 forever, so instead of loading the value at that address, it just loads 5 into a register (or

Consequences of casting away immutable from pointers

2018-01-04 Thread jmh530 via Digitalmars-d-learn
I'm trying to understand the consequences of casting away immutable from a pointer. The code below has some weird things going on like the pointers still point to the correct address but when you dereference them they don't point to the correct value anymore. Should I just assume this is unde

Re: Any free stock market data API?

2018-01-04 Thread jmh530 via Digitalmars-d-learn
On Friday, 5 January 2018 at 01:45:46 UTC, Laeeth Isharc wrote: On Thursday, 4 January 2018 at 23:04:44 UTC, Amorphorious wrote: Most are in other languages: https://www.alphavantage.co/ https://iextrading.com/ are two free ones. I'm just hoping for a more D'ish solution. I wrote a simple

Re: How to use the -I command line switch?

2018-01-03 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 3 January 2018 at 22:52:10 UTC, Seb wrote: Which documentation are you referring to? If it's the specification, just click "edit". I know how to edit it. I just don't know how to word it so that it isn't so confusing.

Re: How to use the -I command line switch?

2018-01-03 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 3 January 2018 at 18:35:21 UTC, Ali Çehreli wrote: -I is for import directives only. imports are needed to compile the importing module. All other modules still need to be compiled themselves and added to the program either as individual .o files or as libraries (e.g. .a, .lib,

Re: How to use the -I command line switch?

2018-01-03 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 3 January 2018 at 17:10:22 UTC, tipdbmp wrote: dmd main.d C:\libs\my_module.d That does not use the -I switch. It compiles if I specify the full path to my_module.d: dmd -IC:\libs main.d C:\libs\my_module.d I don't understand the error message though. I tried a few other op

Re: How to use the -I command line switch?

2018-01-03 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 3 January 2018 at 12:21:28 UTC, tipdbmp wrote: // C:\libs\my_module.d module my_module; void foo() {} // main.d module main; import my_module; void main() { foo(); } Running dmd with: dmd -IC:\libs main.d my_module.d I get: Error: module my_module is in file 'my_modu

Re: git workflow for D

2017-12-04 Thread jmh530 via Digitalmars-d-learn
On Sunday, 3 December 2017 at 20:05:47 UTC, bitwise wrote: I've finally started learning git, due to our team expanding beyond one person - awesome, right? Anyways, I've got things more or less figured out, which is nice, because being clueless about git is a big blocker for me trying to do any

Re: dub: Use Alternate Dependency

2017-11-21 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 21 November 2017 at 07:36:25 UTC, drug wrote: Probably author needs the following: dependency "package" version="*" path="../relative/path/to/other/custom/package" instead of dependency "package" version="~>1.2.3" this allows using custom package not registered on dub and after d

dub: Use Alternate Dependency

2017-11-20 Thread jmh530 via Digitalmars-d-learn
I'm working on two related dub projects on code.dlang.org. One has a dependency on the other. However, I've made changes to both and to run the tests properly requires me to use both versions in my working directory, rather than the versions (specifically for the dependency) that is registered

Re: std.format and floating point issue

2017-11-01 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 1 November 2017 at 19:06:42 UTC, Ali Çehreli wrote: On 10/29/2017 03:13 AM, codephantom wrote: Can anyone help me to understand why the format in the second writeln below, does not format the output with commas? void main() {     import std.stdi

Re: writeln double precision

2017-10-24 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 24 October 2017 at 16:18:03 UTC, H. S. Teoh wrote: I have never seen a programming language in which dividing two integers yields a float or double. Either numbers default to a floating point type, in which case you begin with floats in the first place, or division is integer div

Re: Splitting a sequence using a binary predicate on adjacent elements

2017-10-17 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 17 October 2017 at 13:25:01 UTC, Nordlöw wrote: On Tuesday, 17 October 2017 at 13:09:18 UTC, Nordlöw wrote: Is there one? If not, what should we call it?...yet another overload of `splitter()` with a binary predicate and only a single parameter `Range input`? Would probably nee

Re: Need importing dcompute.lib into my project

2017-10-13 Thread jmh530 via Digitalmars-d-learn
On Sunday, 8 October 2017 at 07:51:12 UTC, Nicholas Wilson wrote: You are using an old DCompute: that message was changed in https://github.com/libmir/dcompute/commit/cf1420d5377c48f9132f1a9a0f8f06ebb46a6433#diff-b0637c2cde07f2ec8f77f9e3d379fff7 I'm not quite sure how the dub version specs wo

Re: initializing a static array

2017-10-10 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 10 October 2017 at 13:48:16 UTC, Andrea Fontana wrote: Maybe: double[n] bar = 0.repeat(n).array; Alt: double[n] bar; bar[] = 0;

Re: @nogc formattedWrite

2017-10-07 Thread jmh530 via Digitalmars-d-learn
On Saturday, 7 October 2017 at 18:14:00 UTC, Nordlöw wrote: It would be nice to be able to formatted output in -betterC... Agreed. If you know the size of the buffer, you can use sformat, which might be @nogc, but I don't know if it's compatible with betterC. Also, you might check out Ocean,

Re: For fun: Expressive C++ 17 Coding Challenge in D

2017-10-04 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 4 October 2017 at 15:30:08 UTC, Ali Çehreli wrote: On 10/04/2017 02:26 AM, Atila Neves wrote: > in D so trivial it'd probably make me sleep out of boredom. I spent more time on this obviously trivial program than necessary. :( In addition to facing known template resolution issu

Re: [OT] Converting booleans to numbers

2017-09-20 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 19:25:58 UTC, Timon Gehr wrote: On 19.09.2017 23:17, nkm1 wrote: ... OTOH, booleans converting to numbers is a very questionable feature. > I certainly have never seen any good use for it. ... Actually, it is useful enough to have a Wikipedia page: https://e

Re: wstring hex literals

2017-09-20 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 16:26:46 UTC, Neia Neutuladh wrote: On Wednesday, 20 September 2017 at 15:04:08 UTC, jmh530 wrote: testing_utf16.d(5): Error: Truncated UTF-8 sequence testing_utf16.d(6):while evaluating: static assert((_error_) == (wstring )) Failed: ["dmd", "-unitte

wstring hex literals

2017-09-20 Thread jmh530 via Digitalmars-d-learn
I don't seem to be having any issues making strings or dstrings from hex, but I run into some issues with wstrings. Of course, my knowledge of UTF-16 is limited, but I don't see any issues with the code below and I get some errors on the hex string literal. unittest { wchar data = 0x03C0;

Re: What the hell is wrong with D?

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 20 September 2017 at 02:36:50 UTC, Jonathan M Davis wrote: Please try to be civil. It's fine if you're unhappy about some aspect of how D works and want to discuss it, but we do not condone personal attacks here. - Jonathan M Davis He seemed to be threatening the guy's life o

Re: What the hell is wrong with D?

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 20:00:40 UTC, Brad Anderson wrote: If you want to help, I suggest trying to come up with a DIP that addresses it while being conscious of how to avoid breaking an enormous amount of code. I suspect it's a hard and maybe impossible problem but if you are up for

Re: What the hell is wrong with D?

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 19:16:05 UTC, EntangledQuanta wrote: ()?: is not ambiguous! The D community preaches all this safety shit but when it comes down to it they don't seem to really care(look at the other responses like like "Hey, C does it" or "Hey, look up the operator preceden

Re: What the hell is wrong with D?

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: Thanks for wasting some of my life... Just curious about who will justify the behavior and what excuses they will give. Pretty sure it would be exactly the same thing in C...

Re: Basic LDC Linux Install Question

2017-09-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 12:37:12 UTC, Daniel Kozak wrote: Yes you need to add ldc2 to your PATH. So if your ldc2 binary is in /user/something/something/folder_where_is_ldc2/ldc2 you havto add /user/something/something/folder_where_is_ldc2 to your PATH. You can test this by pasting thi

Basic LDC Linux Install Question

2017-09-19 Thread jmh530 via Digitalmars-d-learn
I'm more of a Windows user than a Linux user. I have the latest DMD on my Linux install (linux mint 17.3), but I wanted to test LDC. I get a message that ldc2 is not found when I type ldc2 --version or sudo ldc2 --version (I'm not on root and the existing user does not have root privileges, s

Re: Looking for instructions on how to make a Derelict library

2017-09-18 Thread jmh530 via Digitalmars-d-learn
On Monday, 18 September 2017 at 00:33:25 UTC, Matt Jones wrote: I've been reading the DerelictSDL2 source code. I think I have a handle on it. I'll have to look more at the wiki too. Thanks. Might be interesting to write up your experience with doing it as either blog post or part of the

Re: extern(C) enum

2017-09-15 Thread jmh530 via Digitalmars-d-learn
On Friday, 15 September 2017 at 18:20:06 UTC, Jonathan M Davis wrote: It is my understanding that for both C and C++, an enum is always an int (unless you're talking about enum classes in C++). The size of an int can change based on your architecture, but AFAIK, all of the architectures suppo

Re: Dub project with .lib/.dlls for static binding

2017-09-13 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 13 September 2017 at 22:50:54 UTC, Seb wrote: No you are not, it's just currently a bit painful to do manually due to e.g. missing support for git submodules. However, some projects already do this: Windows: https://github.com/ariovistus/pyd/blob/master/dub.json I was not awar

Dub project with .lib/.dlls for static binding

2017-09-13 Thread jmh530 via Digitalmars-d-learn
I'm not sure this makes much sense, but it's something that's been rolling around in my head the past 2-3 days. One of the great things about Python's Anaconda is that you just download one file, install and it just works. In D, dub offers comparable functionality as conda, which is very helpf

Re: Override with function overloads

2017-09-11 Thread jmh530 via Digitalmars-d-learn
On Monday, 11 September 2017 at 20:40:30 UTC, nkm1 wrote: I don't know, maybe don't use alias this :) IMO, it's a really dubious feature... I don't think it's an issue of alias this, per se. I think it's just something to be aware of and use your approach of aliasing as necessary. It's basi

Re: Override with function overloads

2017-09-11 Thread jmh530 via Digitalmars-d-learn
On Monday, 11 September 2017 at 17:59:25 UTC, nkm1 wrote: On Monday, 11 September 2017 at 15:13:25 UTC, jmh530 wrote: I suppose my issue is that final should prevent function hijacking because I shouldn't be allowed to override string bar(double d) anyway. It shouldn't be a worry. It has noth

Re: Override with function overloads

2017-09-11 Thread jmh530 via Digitalmars-d-learn
On Monday, 11 September 2017 at 04:29:39 UTC, Ali Çehreli wrote: Here, the feature called "name hiding" is in effect. Foo2.bar hides all bars from Foo. This is to avoid "function hijacking"[1]. Ali [1] https://dlang.org/hijack.html I suppose my issue is that final should prevent function

Override with function overloads

2017-09-10 Thread jmh530 via Digitalmars-d-learn
In the code below, the second to the last line fails to compile. As far as I can tell it is because the override also overrides all overloads. I could imagine why it would occur with a virtual member function, but I would think it wouldn't be necessary with a final one. @system unittest {

Re: Protection attribute in another module

2017-08-30 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 21:15:56 UTC, Kagamin wrote: Something like mixin("__traits(getProtection, A."~member~")") The following compiles without error. It would be nice if something like this got added to std.traits. template getProtection(string from, string member) { mixin("st

Re: Protection attribute in another module

2017-08-29 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 15:48:05 UTC, Kagamin wrote: You iterate over string literals: https://dlang.org/spec/traits.html#allMembers I had known that, but I couldn't figure out how to get the identifiers. It turns out that I can loop over getOverloads and it produces the desired result

Re: testing for deprecation

2017-08-28 Thread jmh530 via Digitalmars-d-learn
On Monday, 28 August 2017 at 21:29:31 UTC, Jonathan M Davis wrote: I think that it's pretty clear that a new traits for __traits would be required. Per the documentation, getFunctionAttributes does not include anything about deprecation, and even if it did, it wouldn't be sufficient anyway, b

Protection attribute in another module

2017-08-28 Thread jmh530 via Digitalmars-d-learn
How do I get the protection status of function in another module? Basically I have some code that loops through all the members of another module and I want to be able to skip the ones that are private. The code below prints public for foo. module A; private void foo(); ---

Re: testing for deprecation

2017-08-28 Thread jmh530 via Digitalmars-d-learn
On Saturday, 26 August 2017 at 07:17:49 UTC, user1234 wrote: getAttributes is made for UDAs only. Okay, well if you change it to deprecated { void foo(); } void main() { pragma(msg, __traits(getFunctionAttributes, foo)); } then you just get tuple(@system) so the issue still stands

Re: testing for deprecation

2017-08-25 Thread jmh530 via Digitalmars-d-learn
On Thursday, 1 September 2016 at 11:13:42 UTC, rikki cattermole wrote: That is a first that somebody wanted it. Bug report please! I just ran across this with deprecated { void foo(); } void main() { pragma(msg, __traits(getAttributes, foo)); } producing just tuple(). I came across t

Re: Type Inference in @safe unittests

2017-08-22 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 22 August 2017 at 18:25:31 UTC, Steven Schveighoffer wrote: @safe void main() { struct Foo { int foo(int i, string s) @safe { return 0; } double foo2(string s) @safe { return 0; } } printMemberTypes!(Foo); } The surprising part to me is that non-@sa

Re: Type Inference in @safe unittests

2017-08-22 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 22 August 2017 at 16:27:05 UTC, Jonathan M Davis wrote: Well, templates aren't the only case where we have attribute inference anymore (e.g. auto return functions have it), and I'm pretty sure that there have been several requests for fixing issues regards to local declarations so

Type Inference in @safe unittests

2017-08-22 Thread jmh530 via Digitalmars-d-learn
I'm not sure if this is a bug or not. I was playing around with printing out some member types with unittests and I was noticing some strange results when they were in @safe unittests rather than normal unittests. The first one prints out what I would expect, but the @safe unittest puts @safe

Re: std.format expand "%s"

2017-08-22 Thread jmh530 via Digitalmars-d-learn
On Monday, 21 August 2017 at 15:39:04 UTC, Steven Schveighoffer wrote: What I mean is that %s goes to %d for isIntegral!(typeof(x)), and %s goes to %g for isFloatingPoint!(typeof(x)), and stays as %s for everything else. Given this, you could probably write the function you were looking for

Re: std.format expand "%s"

2017-08-21 Thread jmh530 via Digitalmars-d-learn
On Monday, 21 August 2017 at 13:57:01 UTC, Steven Schveighoffer wrote: Well, for most things, %s does not do the same thing as another specifier. It's only integers, which format the same as %d, and floating points, which format the same as %g. For all others, the format is specified as %s.

std.format expand "%s"

2017-08-20 Thread jmh530 via Digitalmars-d-learn
I'm playing around with std.format and I'm trying to figure out if there is any way to identify what "%s" should expand to. So for instance: int x = 1; auto result = x.format!"%s"; I would know that result="1". I could run "1" through unformatValue and get back 1. I'm looking to see if there i

Re: Issue with template constraints in numeric types

2017-08-04 Thread jmh530 via Digitalmars-d-learn
On Thursday, 3 August 2017 at 12:49:48 UTC, data pulverizer wrote: Hmm ... it looks as the specialization `:` operator is working like the constraint `:` operator and doing convertible at least for the floating point case. Is that right? They're both doing the same thing as far as I know.

Re: Template mixins and selective imports

2017-08-03 Thread jmh530 via Digitalmars-d-learn
On Thursday, 3 August 2017 at 19:05:47 UTC, Meta wrote: On Thursday, 3 August 2017 at 19:03:55 UTC, Meta wrote: `mixin vectorize!sin vsin; alias sin = vsin;` and see if it Should be `alias sin = vsin.sin;` Thanks, this pointed me in the right direction. I got the line below working. m

Template mixins and selective imports

2017-08-03 Thread jmh530 via Digitalmars-d-learn
I am trying to create a vectorize function that mixes in a new version of function with the same name that applies the function (to an ndslice). The code below compiles without error and has the behavior I would expect. However, when I change the function import to a selective import (e.g.

Re: using DCompute

2017-07-27 Thread jmh530 via Digitalmars-d-learn
On Friday, 28 July 2017 at 01:30:58 UTC, Nicholas Wilson wrote: Yes, although I'll have to add an attribute shim layer for the dcompute druntime symbols to be accessible for DMD. When you compile LDC will produce .ptx and .spv files in the object file directory which will be able to be used i

Re: dub seems to have forgotten my versions

2017-06-29 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 21:25:18 UTC, jmh530 wrote: On Wednesday, 28 June 2017 at 20:18:20 UTC, jmh530 wrote: On Wednesday, 28 June 2017 at 19:54:01 UTC, jmh530 wrote: [snip] Does not seem to be a problem for another project using dub with dmd and similar dependencies... After spendi

Re: dub seems to have forgotten my versions

2017-06-28 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 20:18:20 UTC, jmh530 wrote: On Wednesday, 28 June 2017 at 19:54:01 UTC, jmh530 wrote: [snip] Does not seem to be a problem for another project using dub with dmd and similar dependencies... After spending some time looking through the dub issues, I found that

Re: dub seems to have forgotten my versions

2017-06-28 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 19:54:01 UTC, jmh530 wrote: [snip] Does not seem to be a problem for another project using dub with dmd and similar dependencies...

dub seems to have forgotten my versions

2017-06-28 Thread jmh530 via Digitalmars-d-learn
I am behind a corporate firewall at work so I have to manually install dub packages. This requires setting the version manually, otherwise master is inferred. This was working great until I had ended a dub run command early. Now dub seems to have forgotten that the versions are in there. It's w

Re: Relative lflag paths in dub on Windows

2017-06-28 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 00:22:56 UTC, Mike Parker wrote: On Wednesday, 28 June 2017 at 00:16:23 UTC, Mike Parker wrote: On Tuesday, 27 June 2017 at 19:07:49 UTC, You have to specify the appropriate linker option, e.g. -L-option. For gcc, that happens to -L, so you get -L-L. For optlink

Relative lflag paths in dub on Windows

2017-06-27 Thread jmh530 via Digitalmars-d-learn
Is it possible to set relative -L paths on dub for Windows? Absolute paths work fine, just can't get relative paths working. I was looking at the thread here https://forum.dlang.org/post/dkwqrwzwqbrnaamlv...@forum.dlang.org and came up with something like { ... "lflags": ["-L-L..\\libs\\

Re: BetterC and TypeInfo Question

2017-06-22 Thread jmh530 via Digitalmars-d-learn
On Thursday, 22 June 2017 at 14:50:45 UTC, Adam D. Ruppe wrote: [snip] I appreciate the reply.

BetterC and TypeInfo Question

2017-06-22 Thread jmh530 via Digitalmars-d-learn
I should preface this by saying I don't really have a good sense of how either BetterC or the D runtime work. The recent BetterC thread made me wonder about TypeInfo in the D runtime. My (surface level) understanding is that this is what makes typeid work at run time. I was looking through t

Re: Static Initialization of Struct as UDA

2017-06-13 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 13 June 2017 at 22:16:37 UTC, ag0aep6g wrote: No bug. `static` has no effect on module-level variables. `z` is a normal mutable variable, not at all guaranteed to be constant. Make it an `enum` or `immutable`. Note that immutable doesn't guarantee compile-time constancy, either.

Static Initialization of Struct as UDA

2017-06-13 Thread jmh530 via Digitalmars-d-learn
The code below doesn't compile because "static variable z cannot be read at compile time". However, z is a static variable, so I don't see why it wouldn't be available at compile-time. Bug or am I missing something? struct Bar { int x = 2; int y; } static Bar z = {y:1}; void main() {

Re: Mutiple AliasSeq as input to template

2017-06-08 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 June 2017 at 19:03:39 UTC, David Sanders wrote: You can use nested templates to process multiple AliasSeqs like so: [snip] Interesting approach also.

Re: D scripting in D

2017-06-02 Thread jmh530 via Digitalmars-d-learn
On Friday, 2 June 2017 at 02:06:27 UTC, Mike B Johnson wrote: I wonder if it is possible to somehow turn D in to a scripting language that can be run inside D? The point? To have the same uniform syntax for quickly developing scripts that can then be easily transferred, if desired, in to a co

Re: Changing Template Static Ifs to Recursion

2017-06-01 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 21:02:07 UTC, jmh530 wrote: On Wednesday, 31 May 2017 at 19:22:18 UTC, Stefan Koch wrote: You could also use string mixins. Which will be more efficient then recursion. I try to avoid string mixins unless I can't help it. Nevertheless, I made an effort to try to

Re: Changing Template Static Ifs to Recursion

2017-05-31 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 19:22:18 UTC, Stefan Koch wrote: You could also use string mixins. Which will be more efficient then recursion. I try to avoid string mixins unless I can't help it. Nevertheless, I made an effort to try to get it to work and below seems to be working. I still hav

Re: Changing Template Static Ifs to Recursion

2017-05-31 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 19:25:22 UTC, ag0aep6g wrote: On 05/31/2017 08:50 PM, jmh530 wrote: Note: I left out the function foo, but think of foo is to Foo as tuple is to Tuple. You should have included foo, in my opinion. I'm having trouble figuring out what your code does. `process` inst

Changing Template Static Ifs to Recursion

2017-05-31 Thread jmh530 via Digitalmars-d-learn
I have a struct that I am using like a Tuple, but I want to be able to opIndex in a different way than Tuple's opIndex. I want to be able to opIndex whatever is underlying the Tuple. The code below works, but is kind of annoying because to extend you have to keep adding static ifs. I want to c

Re: Mutiple AliasSeq as input to template

2017-05-25 Thread jmh530 via Digitalmars-d-learn
On Thursday, 25 May 2017 at 16:36:45 UTC, jmh530 wrote: [snip] I haven't played around with it fully, but it seems like the following resolves my issue in a sort of manual way: template Process1(A, B) { static if (!isIndex!B) alias Process1 = A; else

Mutiple AliasSeq as input to template

2017-05-25 Thread jmh530 via Digitalmars-d-learn
I'm trying to process one AliasSeq based on the types in another. I've tried to sketch it out below. However, it doesn't work because when you combine together two AliasSeq's in the template, then it creates one AliasSeq. The only other thing I considered was a staticMap with isIndex, but I w

Re: Getting familiar with std.process

2017-02-09 Thread jmh530 via Digitalmars-d-learn
On Thursday, 9 February 2017 at 21:36:46 UTC, Ali Çehreli wrote: On 02/09/2017 12:44 PM, jmh530 wrote: > I think the issue is that create_file doesn't write to stdout, it writes > to file. Correct. Pipe works by piping the standard input/output streams. > Other than reading the file and then d

Getting familiar with std.process

2017-02-09 Thread jmh530 via Digitalmars-d-learn
I haven't used std.process before and am trying to play around with it. In the code below, the first file writes some text to an output file. My goal is to be able to read what is written to that file without creating the file itself. I'm not sure it's possible, but the second file is my atte

Re: Templates problem

2016-09-09 Thread jmh530 via Digitalmars-d-learn
On Friday, 9 September 2016 at 13:24:18 UTC, Russel Winder wrote: For computational work I'd say Chapel was just as productive as any other language, probably better. This is though likely an issue on which there is only opinion and no facts. GPGPU support is not in Chapel as yet I believe,

Re: Templates problem

2016-09-08 Thread jmh530 via Digitalmars-d-learn
On Thursday, 8 September 2016 at 10:18:36 UTC, Russel Winder wrote: I am certainly hoping that Chapel will be the language to displace NumPy for serious computation in the Python-sphere. Given it's foundation in the PGAS model, it has all the parallelism needs, both cluster and local, built i

Re: Templates problem

2016-09-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 21:41:20 UTC, data pulverizer wrote: Yes, but from a usability point of view this would be very poor - forcing the user to create a new variable each time they modified a table. I am aware that databases do this but it is hidden away. To be fair, you can

Re: Templates problem

2016-09-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 21:33:25 UTC, pineapple wrote: Fuck it, I took an hour to document the most significant modules. https://github.com/pineapplemachine/mach.d/tree/master/mach/range Looks like a step in the right direction!

Re: Templates problem

2016-09-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 20:49:42 UTC, data pulverizer wrote: You're quite right that D doesn't need to change at all to implement something like pandas or dataframes in R, but I am thinking of how to got further. Very often in data science applications types will turn up that are re

Re: Templates problem

2016-09-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 21:01:59 UTC, deXtoRious wrote: That's just typical press nonsense, and even they quote Bezanson saying how Julia isn't at all suited to a whole host of applications. Julia certainly has (justifiable, imho, though only time will tell) aspirations of being use

Re: Templates problem

2016-09-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 19:19:23 UTC, data pulverizer wrote: For some time I have been considering a problem to do with creating tables with unbounded types, one of the failed attempts is here: https://forum.dlang.org/thread/gdjaoxypicsxlfvzw...@forum.dlang.org?page=1 I then exchang

Re: Templates problem

2016-09-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 18:55:41 UTC, pineapple wrote: So the first difference you're likely to notice is that it's not as well documented. (Sorry. I'm a busy woman. I'll get around to it.) I try to make up for it with copious unit tests, which should provide a good example for how

Re: Templates problem

2016-09-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 18:10:45 UTC, pineapple wrote: You might want to check out the ranges package of the library I'm working on. https://github.com/pineapplemachine/mach.d/tree/master/mach/range There's a lot of stuff there. Do you mind giving a TL;DR version of what your ra

Re: Templates problem

2016-09-07 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 11:37:44 UTC, Russel Winder wrote: I really don't see what's not working in this. Trying to get new D users from Python users is the main problem. I came to D from Python/R/Matlab. The biggest issue for me wasn't error messages so much as the lack of good

Re: pow exponent type issue

2016-08-24 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 24 August 2016 at 19:41:35 UTC, ag0aep6g wrote: -y1 is -1. But -y2 is uint.max, i.e. a pretty large positive number. The 'u' in "uint" stands for "unsigned". That is, it doesn't know negative numbers. Dont' use uint when you need negative numbers. Ahh, doh.

pow exponent type issue

2016-08-24 Thread jmh530 via Digitalmars-d-learn
I'm a little confused on why pow behaves so differently when switching from an int to a uint for the exponent. import std.math : pow; import std.stdio : writeln; void main() { float x = 2; int y1 = 1; uint y2 = 1; writeln(pow(x, -y1)); //prints 0.5 wri

Re: Passing a single tuple or multiple values

2016-07-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 July 2016 at 15:40:20 UTC, Lodovico Giaretta wrote: You can find this out from the error, which says that you can't expand an object of type `(Tuple!(int, int))`. Note the surrounding parenthesis: they tell you that what you have is not a Tuple, but an AliasSeq whose only membe

Re: Passing a single tuple or multiple values

2016-07-19 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 19 July 2016 at 07:23:52 UTC, John wrote: auto bar(T...)(T x) { static if (T.length == 1 && isTuple!(T[0])) return foo(x.expand); else return foo(x); } Hmm, this actually doesn't seem to be resolving my issue. I'm still getting the error about not being able to expand

<    1   2   3   4   5   >