On Sunday, 4 October 2020 at 17:43:13 UTC, Michael wrote:
On Sunday, 4 October 2020 at 17:37:52 UTC, Mathias LANG wrote:
On Sunday, 4 October 2020 at 17:05:33 UTC, Michael wrote:
On Sunday, 4 October 2020 at 17:01:44 UTC, Paul Backus wrote:
On Sunday, 4 October 2020 at 16:48:24 UTC, Michael
On Sunday, 4 October 2020 at 17:37:52 UTC, Mathias LANG wrote:
On Sunday, 4 October 2020 at 17:05:33 UTC, Michael wrote:
On Sunday, 4 October 2020 at 17:01:44 UTC, Paul Backus wrote:
On Sunday, 4 October 2020 at 16:48:24 UTC, Michael wrote:
Dear all,
Sorry for the potentially stupid
On Sunday, 4 October 2020 at 17:05:33 UTC, Michael wrote:
On Sunday, 4 October 2020 at 17:01:44 UTC, Paul Backus wrote:
On Sunday, 4 October 2020 at 16:48:24 UTC, Michael wrote:
Dear all,
Sorry for the potentially stupid question, but I'm a complete
newbie to D. Why does compiling the
On Sunday, 4 October 2020 at 17:01:44 UTC, Paul Backus wrote:
On Sunday, 4 October 2020 at 16:48:24 UTC, Michael wrote:
Dear all,
Sorry for the potentially stupid question, but I'm a complete
newbie to D. Why does compiling the following trivial code
fail?
import std.stdio;
void main()
{
Dear all,
Sorry for the potentially stupid question, but I'm a complete
newbie to D. Why does compiling the following trivial code fail?
import std.stdio;
void main()
{
writeln(3.14);
}
Error message:
/Library/D/dmd/src/phobos/std/format.d(1601): Error: pure
function
Is there a way to detect unused imports?
It happened to me that I used imports which I did not need in the
end. So, I'd like to remove them easily.
On Thursday, 30 January 2020 at 13:23:17 UTC, Adam D. Ruppe wrote:
On Thursday, 30 January 2020 at 06:12:32 UTC, Michael wrote:
I did exactly just what you proposed.
yeah i often just leave my random filenames in there, in this
case rl was one of them. (if you don't put `.d` at the end of a
auto is surely a nice feature. Nonetheless I'd prefer to use
explicit types. So when reading a code and I see the auto keyword
I also have to find out what kind of type is meant.
I have a line of code that looks like this:
auto elements = buf.to!string.strip.split(" ").filter!(a => a !=
"");
On Thursday, 30 January 2020 at 08:13:16 UTC, Mike Parker wrote:
That means any arguments you pass on the command line after the
source file name will be passed to your program. Compiler
options need to go before the source file name.
rdmd -L-lreadline mysource.d
That works, thanks Mike
On Thursday, 30 January 2020 at 06:15:54 UTC, Mike Parker wrote:
Is your source file named rl.d? And are you running dmd in the
source file's directory?
No, I did not. Changed it now and it works with dmd. Great!
Tried the same with rdmd I'm getting a linker error.
On Wednesday, 29 January 2020 at 21:15:08 UTC, Adam D. Ruppe
wrote:
On Wednesday, 29 January 2020 at 20:01:32 UTC, Michael wrote:
I am new to D.
I would like to use the Gnu readline function in D. Is there a
module that i can use?
just define it yourself
---
// this line right here is all
I am new to D.
I would like to use the Gnu readline function in D. Is there a
module that i can use?
On Friday, 18 January 2019 at 13:29:29 UTC, Adam D. Ruppe wrote:
On Friday, 18 January 2019 at 12:27:17 UTC, Michael wrote:
This, to be, looks like quite the explicit conversion, no?
Yeah, I agree. But the language is silly. I just leave the type
out of foreach and explicitly cast it inside
Hello all,
I am getting this deprecation warning when compiling using DMD64
D Compiler v2.084.0 on Linux. I'm a little unsure what the
problem is, however, because the code producing these warnings
tends to be of the form:
foreach (int i, ref prop; props)
This, to be, looks like quite
On Tuesday, 14 August 2018 at 11:25:06 UTC, Jonathan M Davis
wrote:
On Tuesday, August 14, 2018 4:03:11 AM MDT Michael via
Digitalmars-d-learn wrote:
[...]
CTFE is triggered when a value must be known at compile-time.
So, if you have something like
[...]
That is much clearer now, thanks
On Tuesday, 14 August 2018 at 09:17:41 UTC, ixid wrote:
On Tuesday, 14 August 2018 at 09:12:30 UTC, ixid wrote:
This will not compile as it says n is not known at compile
time...
This does work if 'value' is changed to immutable and fun to
accept it. So it still seems like a missed
On Friday, 13 July 2018 at 11:17:32 UTC, Radu wrote:
On Friday, 13 July 2018 at 11:12:47 UTC, Michael wrote:
On Friday, 13 July 2018 at 10:52:54 UTC, Radu wrote:
On Friday, 13 July 2018 at 10:21:54 UTC, Michael wrote:
[...]
Do you try to call member functions? UFCS only works with
free
On Friday, 13 July 2018 at 10:52:54 UTC, Radu wrote:
On Friday, 13 July 2018 at 10:21:54 UTC, Michael wrote:
Hello,
I am nesting some function calls, and I'm pretty used to
making use of D's Uniform Function Call Syntax, but I'm
getting an error if I try to convert this line:
Hello,
I am nesting some function calls, and I'm pretty used to making
use of D's Uniform Function Call Syntax, but I'm getting an error
if I try to convert this line:
createSet(createVector(langSize, index)).length;
which works, into this line:
createVector(langSize,
On Friday, 6 July 2018 at 16:24:03 UTC, Timoses wrote:
On Friday, 6 July 2018 at 15:51:34 UTC, Michael wrote:
[...]
While writing I realized that the following is even the case
without the 'ref' parameter:
The caller of the setter will still be able to change the
content of your private data
On Friday, 6 July 2018 at 15:57:27 UTC, Timoses wrote:
On Friday, 6 July 2018 at 15:33:18 UTC, Michael wrote:
This is definitely to do with my use of the setter syntax,
which maybe I am misunderstanding? Because if I change it to a
normal function call like so:
On Friday, 6 July 2018 at 15:37:25 UTC, Timoses wrote:
On Friday, 6 July 2018 at 15:14:01 UTC, Michael wrote:
class Agent
{
private
{
double[int] mDict;
}
// Setter: copy
void beliefs(ref double[int] dict)
{
import std.stdio : writeln;
On Friday, 6 July 2018 at 15:14:01 UTC, Michael wrote:
On Friday, 6 July 2018 at 14:50:39 UTC, Ali Çehreli wrote:
[...]
I'm just trying to do that now.
Here is what I have in terms of code:
[...]
This is definitely to do with my use of the setter syntax, which
maybe I am
On Friday, 6 July 2018 at 14:50:39 UTC, Ali Çehreli wrote:
On 07/06/2018 07:36 AM, Michael wrote:
> but not in
> my case, if this is a weird edge-case with setter member
functions?
This is all very interesting but I'm dying to see the code. :)
Can you change Timoses's code to demonstrate your
On Friday, 6 July 2018 at 14:11:42 UTC, Timoses wrote:
This works for me:
auto create()
{
string[int] dict;
dict[2] = "hello";
return dict;
}
void modifyNoRef(string[int] m)
{
writeln("Address not ref: ", );
m[0] = "modified";
On Friday, 6 July 2018 at 14:11:42 UTC, Timoses wrote:
On Friday, 6 July 2018 at 13:13:43 UTC, Michael wrote:
static auto ref consensus( ... )
`auto ref` infers the return type from the return statement
[1]. So it's not necessarily returning a ref type.
However, I don't think this matters
Hello,
I'm a little confused about what is actually happening when I try
to pass a reference, returned by a method that produces the
object (associative array), to a setter method which expects a
reference. What seems to be happening is that it simply does
nothing, as if the setter method is
On Sunday, 22 April 2018 at 02:08:40 UTC, fevasu wrote:
what flags to use so that the intermediate .o files are
discared by ldc and only a.out is written to disk
You can also use rdmd with ldc, if that makes things easier.
On Sunday, 18 March 2018 at 15:42:18 UTC, Andrey Kabylin wrote:
On Sunday, 18 March 2018 at 15:32:47 UTC, Michael wrote:
On Sunday, 18 March 2018 at 14:58:52 UTC, Andrey Kabylin wrote:
In DList we have method remove, but I can't understand how
this method works, I want write somethink like
On Sunday, 18 March 2018 at 14:58:52 UTC, Andrey Kabylin wrote:
In DList we have method remove, but I can't understand how this
method works, I want write somethink like this:
void unsubscribe(EventsSubscriber subscriber) {
subscribers.remove(subscriber);
}
The remove function seems to
On Sunday, 18 March 2018 at 14:58:52 UTC, Andrey Kabylin wrote:
In DList we have method remove, but I can't understand how this
method works, I want write somethink like this:
void unsubscribe(EventsSubscriber subscriber) {
subscribers.remove(subscriber);
}
So I guess you would want
On Friday, 5 January 2018 at 12:19:11 UTC, thedeemon wrote:
On Friday, 5 January 2018 at 07:40:14 UTC, Brian wrote:
I think code style like:
db.select(User).where(email.like("*@hotmail.com")).limit(10);
You need to read about templates in D, here's a good guide:
On Tuesday, 19 December 2017 at 02:12:29 UTC, Mike Franklin wrote:
On Tuesday, 19 December 2017 at 02:04:34 UTC, codephantom wrote:
writeln(S.j);
// Error: Instance symbols cannot be used through types.
I don't understand why you would say that is a bug.
I meant that the example is
On Tuesday, 19 December 2017 at 01:29:04 UTC, Meta wrote:
On Monday, 18 December 2017 at 23:44:46 UTC, Michael wrote:
[...]
I think the reason that this works is because i is static,
meaning that you don't need the `this` reference of S to access
it and thus it can be aliased. Declaring a
Hello,
I have been looking at the following example found right at the
end of the section here:
https://dlang.org/spec/declaration.html#alias
struct S { static int i; }
S s;
alias a = s.i; // illegal, s.i is an expression
alias b = S.i; // ok
b = 4; // sets S.i to 4
and it runs
On Friday, 15 December 2017 at 21:29:10 UTC, Jonathan M Davis
wrote:
On Friday, December 15, 2017 20:40:10 Ecstatic Coder via
Digitalmars-d-learn wrote:
It's taken me some time to find an implicit cast bug ("if
(my_sometimes_negative_index >= this_array.length)"), while a
simple C++-like
On Wednesday, 29 November 2017 at 17:03:42 UTC, Steven
Schveighoffer wrote:
On 11/29/17 11:13 AM, Wanderer wrote:
I'm trying to simulate a race condition in D with the
following code:
(https://run.dlang.io/is/RfOX0I)
One word of caution, I think the running of your code on
run.dlang.io is
On Wednesday, 29 November 2017 at 16:33:50 UTC, Steven
Schveighoffer wrote:
On 11/29/17 11:13 AM, Wanderer wrote:
[...]
[snip]
[...]
Using the compiler switch -vcg-ast, I see no synchronization of
these methods.
[...]
Any idea what has changed in DMD-nightly to retain the correct
On Wednesday, 29 November 2017 at 16:19:05 UTC, Michael wrote:
On Wednesday, 29 November 2017 at 16:13:13 UTC, Wanderer wrote:
[...]
I unfortunately cannot answer your question but I am noticing
that running the code with DMD gives you an unordered sequence
of IDs, but running with
On Wednesday, 29 November 2017 at 16:13:13 UTC, Wanderer wrote:
I'm trying to simulate a race condition in D with the following
code:
(https://run.dlang.io/is/RfOX0I)
```
import std.stdio;
import core.thread;
import std.concurrency;
shared struct IdGen(T)
{
T id;
this(T start)
{
On Thursday, 23 November 2017 at 14:16:25 UTC, Andrea Fontana
wrote:
On Thursday, 23 November 2017 at 13:47:37 UTC, Adam D. Ruppe
wrote:
On Thursday, 23 November 2017 at 05:19:27 UTC, Andrey wrote:
for instance in kotlin it can be replace with this:
when {
c1 -> foo(),
c2 -> bar(),
On Saturday, 12 August 2017 at 20:22:44 UTC, Adam D. Ruppe wrote:
On Saturday, 12 August 2017 at 19:53:22 UTC, Faux Amis wrote:
[...]
My dom.d and http2.d combine to make this easy:
https://github.com/adamdruppe/arsd/blob/master/dom.d
https://github.com/adamdruppe/arsd/blob/master/http2.d
On Thursday, 10 August 2017 at 19:10:05 UTC, Jiyan wrote:
Hey,
wanted to the following simple thing with vectorflow:
[...]
I'm worried there might not be many on the forums who can help
too much with vectorflow given how new it is. Maybe some in the
community are more familiar with neural
On Thursday, 3 August 2017 at 15:29:29 UTC, Adam D. Ruppe wrote:
On Thursday, 3 August 2017 at 15:18:17 UTC, Michael wrote:
I've not seen that either, though I'm not a C++ programmer.
Does using free() on its own not assume access of a global
namespace?
Consider the following:
class Foo {
On Thursday, 3 August 2017 at 14:15:40 UTC, Temtaime wrote:
On Thursday, 3 August 2017 at 14:03:56 UTC, Michael wrote:
So this might be a bit of a stupid question, but looking at
the DMD source code (dmodule.d in particular) I see the
following code:
[...]
and I was just wondering why
So this might be a bit of a stupid question, but looking at the
DMD source code (dmodule.d in particular) I see the following
code:
if (srcfile._ref == 0)
.free(srcfile.buffer);
srcfile.buffer = null;
srcfile.len = 0;
and I was just wondering why certain functions seem to be called
On Friday, 17 March 2017 at 11:30:48 UTC, Jonathan M Davis wrote:
On Friday, March 17, 2017 01:55:19 Hussien via
Digitalmars-d-learn wrote:
I tend to agree with this. If the foreach is static, and
continue and break are just going to be ignored, then they
should just be illegal. Allowing
On Wednesday, 31 August 2016 at 11:43:12 UTC, Nick wrote:
On Tuesday, 30 August 2016 at 14:24:22 UTC, eugene wrote:
On Tuesday, 30 August 2016 at 13:33:44 UTC, Nick wrote:
Is it possible to compile from D to C++?
Explanation:
I do some competition programming and would like to write it
in D
On Thursday, 19 May 2016 at 15:49:17 UTC, ag0aep6g wrote:
On 05/19/2016 05:09 PM, Michael wrote:
Any idea what causes this to occur when optimising? I wanted
to try and
speed up a simulation I'm running but it just produces too many
unexpected consequences.
I suspect that you're seeing issue
Could it be that the code is optimised to the same as that in the
original issue and so the current compiler still produces the
incorrect result? Obviously the original issue has since been
fixed but I won't be able to test this until the next version of
DMD is released.
I'm not entirely sure what optimisations are made when supplying
the -O flag to rdmd, but this may be related to an earlier issue
I found for similar code here:
https://issues.dlang.org/show_bug.cgi?id=16027
The code is:
void main()
{
auto seed = 128;
auto rand = Random(seed);
On Sunday, 15 May 2016 at 14:12:47 UTC, Marc Schütz wrote:
On Sunday, 15 May 2016 at 13:01:45 UTC, Michael wrote:
It may be that I'm doing something wrong here, but after
updating DMD to the latest version, my simulations started
producing some very odd results and I think I've pinpointed it
On Sunday, 15 May 2016 at 13:12:44 UTC, Saurabh Das wrote:
On Sunday, 15 May 2016 at 13:01:45 UTC, Michael wrote:
It may be that I'm doing something wrong here, but after
updating DMD to the latest version, my simulations started
producing some very odd results and I think I've pinpointed it
It may be that I'm doing something wrong here, but after updating
DMD to the latest version, my simulations started producing some
very odd results and I think I've pinpointed it to a sign
inversion that I was making. Here is some code from dpaste to
demonstrate the behaviour I get vs. the
On Monday, 18 April 2016 at 09:38:48 UTC, Justice wrote:
On Saturday, 16 April 2016 at 04:04:24 UTC, Justice wrote:
Is it difficult to create a D business like app and connect it
to android through java for the interface?
I'd rather create all the complex stuff in D and either use it
On Thursday, 11 December 2014 at 20:40:40 UTC, Suliman wrote:
string dbname = config.getKey(dbname1);
scope(failure) writeln(look like dbname is missing);
I am using dini and trying to throw exception if value can't be
extract from config. If I am wrap it's in try-сефср block it's
work or.
Hello Anyone:
i am trying make a ftp client with socket,i have tried std.net.curl,but i
cont stand with so many try-catch structure in my code,i am not familiar with
socket,i write a pecie of code but it cont give me the welcome message which i
want,and then i use wireshark to trace the
On Monday, 8 December 2014 at 01:17:16 UTC, Ellery Newcomer wrote:
On 12/07/2014 03:12 PM, Michael wrote:
On Saturday, 6 December 2014 at 00:40:49 UTC, Ellery Newcomer
wrote:
On 12/04/2014 10:55 PM, Ellery Newcomer wrote:
I guess tomorrow I can try messing around with
thread_attachThis, as
On Saturday, 6 December 2014 at 00:40:49 UTC, Ellery Newcomer
wrote:
On 12/04/2014 10:55 PM, Ellery Newcomer wrote:
I guess tomorrow I can try messing around with
thread_attachThis, as the
fullcollect happening in #2 might be screwing with python
data. But you
aren't really passing anything
On Thursday, 4 December 2014 at 03:22:05 UTC, Ellery Newcomer
wrote:
dustmite?
Not sure what went wrong with dustmite, but every time I tried it
it just started deleting all the files in the directory and
setup.py would give errors. I manually deleted a reasonable chunk
of the code and I'm
On Wednesday, 3 December 2014 at 06:11:56 UTC, Ellery Newcomer
wrote:
are you looking at this pyd:
https://bitbucket.org/ariovistus/pyd
I'm looking at this one, which is what came up when googling
python to D
http://pyd.dsource.org/
On Wednesday, 3 December 2014 at 06:30:07 UTC, Russel Winder via
Digitalmars-d-learn wrote:
As far as I can tell PyD is still active, but in a non-funded
FOSS way,
i.e. work happens as and when volunteers put time and effort
in. I
haven't tried PyD recently but it worked fine last time I did.
On Wednesday, 3 December 2014 at 21:35:48 UTC, ketmar via
Digitalmars-d-learn wrote:
ah, dsource strikes back! that vile site keep biting us again
and
again. let's hope that new admins will kill it for good.
Yeah. I've got the new PyD and it compiles and does everything I
want much nicer,
On Thursday, 4 December 2014 at 02:31:51 UTC, Ellery Newcomer
wrote:
okay. that's not too surprising.
If you can get me a minimal example, I'd be happy to have a
look since pyd should probably support this case.
Cool. Unfortunately most of the times I've attempted to reduce
this down it
Hi. I'm new here and this is my first post. I'm not sure this is
the right subforum for it, but wasn't sure where else to put it
either.
I've written a library to talk to some external hardware using a
socket. It uses the std.concurrency threads to send messages
between the main D-object for
Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
I'm fairly sure I have tackled both of these issues, but it
still seems like Python threads and D threads don't mix well.
When running the same functions from D, I am able to get no
errors, but when run from Python/C it causes segfaults
On Wednesday, 3 December 2014 at 02:41:11 UTC, ketmar via
Digitalmars-d-learn wrote:
On Wed, 03 Dec 2014 02:21:45 +
Michael via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
wrote:
Thanks for this. Its definitely a step in the right direction.
Would you mind explaining a bit more
Hello All:
when i am using std.net.curl to download a file that dosent exist on ftp
sever,my code
will get an execption like this
std.net.curl.CurlException@std\net\curl.d(3605): Remote file not found on
handle
1A8E038
0x0042EC05
0x004027F6
and then it exits,however what i
68 matches
Mail list logo