10.04.2017 19:20, Russel Winder via Digitalmars-d-learn пишет:
On Fri, 2017-04-07 at 11:40 +0300, drug via Digitalmars-d-learn wrote:
[…]
I do this. I have unittests in the module sources and have a
separate
subpackage intended for more advanced testing only.
Do you have an example project
On Tuesday, 11 April 2017 at 05:15:37 UTC, Russel Winder wrote:
As I understand it, Dub compiles a downloaded dependency into
the local Dub cache. This means you cannot store a debug build
and a release build for multiple architectures and different
compilers, at the same time, and you only get
I only have an alias to the method without a this pointer, is
there any way to get the address?
Something like
struct T{
void foo(){}
}
alias A = Alias!(__traits(getMemeber, T, "foo"));
void* A_addres = ? // Somehow get the address from A
On Mon, 2017-04-10 at 12:17 -0700, H. S. Teoh via Digitalmars-d-learn
wrote:
> […]
>
> There is no BigFloat in phobos, you could try looking at
> code.dlang.org
> to see if there's anything that you could use.
>
[…]
Isn't the way forward here just to wrap GMP:
https://code.dlang.org/packages/gm
As I understand it, Dub compiles a downloaded dependency into the local
Dub cache. This means you cannot store a debug build and a release
build for multiple architectures and different compilers, at the same
time, and you only get a .a file, no .so file.
Cargo downloads source to the cache but co
Go only uses Git, Mercurial, or Bazaar for dependency handling. Rust
(via Cargo) allows for a central repository, and Git (, and Mercurial
?) repositories. Dub appears only to allow for central repository, or
have I missed it's ability to work with DVCS repositories?
If Dub cannot handle DVCS repo
On Tuesday, 11 April 2017 at 01:59:57 UTC, Jonathan M Davis wrote:
On Tuesday, April 11, 2017 01:42:32 Jethro via
Digitalmars-d-learn wrote:
arrays have the ability to reserve but when setting the length
to 0, it removes the reserve!! ;/
char[] buf;
buf.reserve = 1000;
buf.length = 0;
assert(b
On Tuesday, 11 April 2017 at 02:20:37 UTC, Jethro wrote:
I need a drop in replacement(no other changes) that can take
over the duties of string and allow for memory reuse.
There is no memory reuse in CTFE right now, that's why the engine
is being rewritten...
I'd suggest writing a regular ru
ctfe string appending is way to slow, I have tried the suggested
methods and nothing works and slows down by at least an order of
magnitude.
I need a drop in replacement(no other changes) that can take over
the duties of string and allow for memory reuse.
reserve, cpacity, assumeSafeAppend c
On Monday, 10 April 2017 at 21:27:34 UTC, Basile B. wrote:
2) This is about the reduce templates. As I've commented, I
can't use a template lambda with reduce, but I can use a
lambda taking ints as arguments. Why is this? The error
message I get when using the template lambda is:
"template in
On Tuesday, April 11, 2017 01:53:07 Jethro via Digitalmars-d-learn wrote:
> I have a template that that takes no arguments. It takes a while
> to compile, but if I simply create a dummy argument, D compiles
> much quicker.
>
> e.g.,
>
> void foo(string s)(); // slow,
>
> void foo(string s)(int x);
On Tuesday, April 11, 2017 01:42:32 Jethro via Digitalmars-d-learn wrote:
> arrays have the ability to reserve but when setting the length to
> 0, it removes the reserve!! ;/
>
> char[] buf;
> buf.reserve = 1000;
> buf.length = 0;
> assert(buf.capacity == 0);
>
> But I simply want to clear the buff
I have a template that that takes no arguments. It takes a while
to compile, but if I simply create a dummy argument, D compiles
much quicker.
e.g.,
void foo(string s)(); // slow,
void foo(string s)(int x); // fast. (I, of course, pass a dummy
value for x)
This is because the compiler does
arrays have the ability to reserve but when setting the length to
0, it removes the reserve!! ;/
char[] buf;
buf.reserve = 1000;
buf.length = 0;
assert(buf.capacity == 0);
But I simply want to clear the buffer, not change it's
reserve/capacity.
I've tried to hack by setting the length to 0 t
On Monday, 10 April 2017 at 21:04:10 UTC, Johan Fjeldtvedt wrote:
I have a couple of questions related to the following code:
https://gist.github.com/Jaffe-/b027287a884fc2e173a65601ec242676
1) This is a very simplified example, but what I'm trying to do
here is to call `foo` on each object in
On Sunday, 9 April 2017 at 14:47:39 UTC, Jonathan Marler wrote:
My guess is that making Socket a class prevents socket handle
leaks because you can clean up the handle in the destructor
when the memory gets freed if no one closes it. Is this the
reason it is a class and are there any other rea
I have a couple of questions related to the following code:
https://gist.github.com/Jaffe-/b027287a884fc2e173a65601ec242676
1) This is a very simplified example, but what I'm trying to do
here is to call `foo` on each object in `Container.ss` contains
when `foo` is called, and likewise for `ba
On Monday, 10 April 2017 at 18:57:13 UTC, Adam D. Ruppe wrote:
On Monday, 10 April 2017 at 16:18:20 UTC, Jonathan Marler wrote:
An interesting benefit. However, I don't think this is the
ideal way to support such a use case.
If I was doing it myself, I'd probably do an interface / final
class
On Mon, Apr 10, 2017 at 06:54:54PM +, Geroge Little via Digitalmars-d-learn
wrote:
> Is there support for BigFloat in phobos or any other package? I was
> playing around with D and wrote some code that calculates a Fibonacci
> sequence (iterative) with overflow detection that upgrades ulong to
On Monday, 10 April 2017 at 18:56:42 UTC, BBasile wrote:
Hello, I have a trait for this:
https://github.com/BBasile/iz/blob/master/import/iz/types.d#L650
Hi BBasile,
I think your trait is a good starting point for my needs. Thanks.
On Monday, 10 April 2017 at 16:18:20 UTC, Jonathan Marler wrote:
An interesting benefit. However, I don't think this is the
ideal way to support such a use case.
If I was doing it myself, I'd probably do an interface / final
class split too (which also opens up a wee bit of additional easy
op
On Monday, 10 April 2017 at 18:32:05 UTC, Benjamin Thaut wrote:
In particular I want to know if the vtable of the class has the
class info member.
Is there any way to do this at compile time? At runtime?
Kind Regards
Benjamin Thaut
Hello, I have a trait for this:
https://github.com/BBasile/i
Is there support for BigFloat in phobos or any other package? I
was playing around with D and wrote some code that calculates a
Fibonacci sequence (iterative) with overflow detection that
upgrades ulong to BigInt. I also wanted to use Binet's formula
which requires sqrt(5) but it only works up
In particular I want to know if the vtable of the class has the
class info member.
Is there any way to do this at compile time? At runtime?
Kind Regards
Benjamin Thaut
On Monday, 13 July 2015 at 14:29:57 UTC, Steven Schveighoffer
wrote:
On 7/11/15 12:57 PM, flamencofantasy wrote:
On Thursday, 9 July 2015 at 15:14:43 UTC, Binarydepth wrote:
This is my code :
import std.stdio : writeln, readf;
void main(){
int[3] nums;
float prom;
foreach(nem; 0
On Saturday, 11 July 2015 at 16:57:55 UTC, flamencofantasy wrote:
On Thursday, 9 July 2015 at 15:14:43 UTC, Binarydepth wrote:
This is my code :
import std.stdio : writeln, readf;
void main() {
int[3] nums;
float prom;
foreach(nem; 0..2) {
writeln
On Fri, 2017-04-07 at 11:40 +0300, drug via Digitalmars-d-learn wrote:
>
[…]
> I do this. I have unittests in the module sources and have a
> separate
> subpackage intended for more advanced testing only.
Do you have an example project I could take a look at?
--
Russel.
===
On Monday, 10 April 2017 at 04:32:20 UTC, Adam D. Ruppe wrote:
On Sunday, 9 April 2017 at 14:47:39 UTC, Jonathan Marler wrote:
Does anyone know why Socket and Address in phobos were created
as classes instead of structs?
It is probably just the historical evolution, but I find it
pretty handy
On Sunday, 9 April 2017 at 13:31:05 UTC, Michael Coulombe wrote:
This is a bug in the insert method. I created a bug report for
you and submitted a pull request for a fix:
https://issues.dlang.org/show_bug.cgi?id=17314
Ah, so it is. Thanks!!
On Monday, 10 April 2017 at 12:56:49 UTC, Nordlöw wrote:
src/knet/traversal.d(20,8): Error: module factixs from file
src/knet/factixs.d must be imported with 'import factixs;'
What am I doing wrong?
My first guess would be that the module declaration in that file
is incorrect. Are you sure i
On Monday, 10 April 2017 at 12:56:49 UTC, Nordlöw wrote:
I have a project with the tree structure
├── knetquery
Ignore this sub-directory. It's unused.
Further, `dub -v` outputs
Using dub registry url 'http://code.dlang.org/'
Refreshing local packages (refresh existing: true)...
Looking for
I have a project with the tree structure
├── knetquery
└── src
└── knet
├── lectures
├── readers
└── tests
├── linenoise (submodule)
├── linenoise-d (submodule)
│ ...
└── phobos-next (submodule)
...
and a DUB-conversion whoose `dub.json` currently contains
{
Hi, all!
Yes, I know, most simple way to validate URL is regex and it
works for most cases, but I search for a correct solution
(ideally rfc3986-compatible), which will be hard to implement
using regular expressions.
33 matches
Mail list logo