On 04/10/2016 04:00 AM, darat wrote:
Is there a particular reason explaining why mov reg,0 is used and not
xor reg,reg ?
(or even and reg, 0)
for example here:
https://github.com/D-Programming-Language/druntime/blob/master/src/core/atomic.d#L1009
It seems that in Go too mov is used:
On 11.04.2016 00:06, Manuel Maier wrote:
So, is this a bug, or is it intended behavior? In case of the latter,
I'd gladly add it to the documentation.
Looks like a bug to me. And it's already been filed:
https://issues.dlang.org/show_bug.cgi?id=13392
On Sunday, 10 April 2016 at 10:43:48 UTC, wobbles wrote:
This would be cool. I'll have a think about how to go about it!
Looking forward to your updates! :P
On Sunday, April 10, 2016 13:58:17 Jay Norwood via Digitalmars-d-learn wrote:
> Seems like there should be an extra level to the version
> statement, something like version(arch,x86).
>
> I must be missing something about the intended use of the version
> statement.
In most cases that I've seen,
On Monday, 11 April 2016 at 01:15:27 UTC, Ali Çehreli wrote:
As a workaround, you can set version to Linux yourself:
version (linux) {
version = Linux;
}
void main() {
version (Linux) {
import std.stdio;
writeln("Linux worked!");
}
}
That's interesting that will
On Monday, 11 April 2016 at 00:51:19 UTC, Mike Parker wrote:
It's an artifact of history. When this was first introduced,
Walter's intent was to match the casing used in gcc
preprocessor definitions. Since that time, we've standardized
on capitalization for everything, but 'linux' lives on. I
On 04/10/2016 03:03 PM, Zekereth wrote:
So I was just testing some code and couldn't figure out why it wasn't
working. My version block looked like this:
version(Linux)
{
...
}
Looking at the list(unless I'm missing something) Linux is the only OS
that is lowercase. I'm guessing most people
On Sunday, 10 April 2016 at 02:59:41 UTC, Adam D. Ruppe wrote:
On Sunday, 10 April 2016 at 00:47:28 UTC, Puming wrote:
3. when hiting 'vim a.file' on the command, things go messy.
Have you got these interactive commands work in dexpect?
It is surely capturing exactly what vim sends to a
On Sunday, 10 April 2016 at 17:19:14 UTC, Eric wrote:
I am getting this error when I compile:
Error: Internal Compiler Error: unsupported type const(string)
No line number is given. Does anyone know what causes this?
compiler version = v2.071.0
-Eric
An ICE should always be considered a
On Sunday, 10 April 2016 at 22:03:54 UTC, Zekereth wrote:
So I was just testing some code and couldn't figure out why it
wasn't working. My version block looked like this:
version(Linux)
{
...
}
Looking at the list(unless I'm missing something) Linux is the
only OS that is lowercase. I'm
On Sunday, 10 April 2016 at 13:58:17 UTC, Jay Norwood wrote:
Seems like there should be an extra level to the version
statement, something like version(arch,x86).
I must be missing something about the intended use of the
version statement.
What's wrong with version(X86)?
On Sunday, 10 April 2016 at 12:14:54 UTC, Pedro Lopes wrote:
Hello,
Every time I try to run a project with derelict-allegro5
package as a dependency, dub says: "Could not find a valid
dependency tree configuration"
I already cleaned the dub cache, that does not solve it,
allegro package is
On Monday, 11 April 2016 at 00:36:28 UTC, Mike Parker wrote:
You say it happens when you try to "run" a project, but the
error message sounds like it's happening before building even
begins, correct? What platform are you on? What does your dub
configuration look like? What does 'dub build
On Sunday, 10 April 2016 at 19:02:06 UTC, Alex Parrill wrote:
A parameter declared as `lazy T` has the type `T delegate()`,
which, when called, evaluates the expression that was passed
into the function.
So effectively, this:
void foo(lazy int x) { auto i = x(); }
foo(a+b);
Is the same as
I'm not sure whether I've found a bug or if I found some very
strange but intended behavior. If it is indeed intended behavior,
I'd like to know the rationale behind it because this one
surprised me a lot when I found it out after 16+ hours of
debugging...
Have a look at this code snippet:
So I was just testing some code and couldn't figure out why it
wasn't working. My version block looked like this:
version(Linux)
{
...
}
Looking at the list(unless I'm missing something) Linux is the
only OS that is lowercase. I'm guessing most people use Posix
instead and never encounter
On Sunday, 10 April 2016 at 18:00:31 UTC, hilop wrote:
On Sunday, 10 April 2016 at 08:29:22 UTC, Lass Safin wrote:
I have a multi-threaded program, one thread drawing to a
window and handling it, the other handling stdin.
[...]
The external program that writes to the input has to close it
On Sunday, 10 April 2016 at 18:57:45 UTC, Suliman wrote:
I like it. Am i right understand that it prevent creation
unneeded of new instance of logger?
No, you need to pass a valid instance in foo(...), It should have
been created before the call to foo(...).
I prefer the second way
On Wednesday, 6 April 2016 at 13:59:42 UTC, pineapple wrote:
Is there any way in D to define static methods or members
within an enum's scope, as one might do in Java? It can
sometimes help with code organization. For example, this is
something that coming from Java I'd have expected to be
On Sunday, 10 April 2016 at 18:08:58 UTC, Ryan Frame wrote:
Greetings.
The following code works:
void main() {
passfunc();
}
void passfunc(void function(string) f) {
f("Hello");
}
void func(string str) {
import std.stdio : writeln;
writeln(str);
}
Now if I change passfunc's
You could pass an argument of type FileLogger (probably better a
pointer?)
foo ( FileLogger log )
{ }
I like it. Am i right understand that it prevent creation
unneeded of new instance of logger?
And what problems I can get if I will create new instance of
logger in every stand alone
Hello all,
I've been playing around recently with some new ideas for a
reworking of my Dgraph library:
https://github.com/WebDrake/Dgraph
... and particularly, considering how to use D's metaprogramming
techniques to best allow the fundamental graph data structures to
be extended
On Sunday, 10 April 2016 at 18:26:57 UTC, Suliman wrote:
Sorry for wrong posting!
I have got logger instance in App.d
void main()
{
...
FileLogger fLogger = new FileLogger("ErrorLog.txt");
foo();
}
utils.d:
foo()
{
// I need logging here
}
Also I have file utils.d that include stand-alone
On Sunday, 10 April 2016 at 18:36:19 UTC, Jonathan Villa wrote:
On Sunday, 10 April 2016 at 18:26:57 UTC, Suliman wrote:
Other whay is to leave FileLogger instance in a separated
module:
logger.d
public static FileLogger fLogger;
App.d
import logger; //the module
void main()
{
//
Sorry for wrong posting!
I have got logger instance in App.d
void main()
{
...
FileLogger fLogger = new FileLogger("ErrorLog.txt");
foo();
}
utils.d:
foo()
{
// I need logging here
}
Also I have file utils.d that include stand-alone functions that
is not in classes. In one of them I need
I have got logger instance in App.d
void main()
{
FileLogger fLogger = new FileLogger("ErrorLog.txt");
Greetings.
The following code works:
void main() {
passfunc();
}
void passfunc(void function(string) f) {
f("Hello");
}
void func(string str) {
import std.stdio : writeln;
writeln(str);
}
Now if I change passfunc's signature to "void passfunc(lazy void
function(string) f)" I
On Sunday, 10 April 2016 at 08:29:22 UTC, Lass Safin wrote:
I have a multi-threaded program, one thread drawing to a window
and handling it, the other handling stdin.
[...]
The external program that writes to the input has to close it
when it has finished to write.
On Sunday, 10 April 2016 at 16:46:02 UTC, deed wrote:
On Sunday, 10 April 2016 at 16:19:51 UTC, Lucien wrote:
Hello,
Is there the possibility to set the cursor position in a file ?
Example:
void main()
{
File myFile = File("myFile.txt");
showFile(myFile);
// set
I am getting this error when I compile:
Error: Internal Compiler Error: unsupported type const(string)
No line number is given. Does anyone know what causes this?
compiler version = v2.071.0
-Eric
On Sunday, 10 April 2016 at 16:19:51 UTC, Lucien wrote:
Hello,
Is there the possibility to set the cursor position in a file ?
Example:
void main()
{
File myFile = File("myFile.txt");
showFile(myFile);
// set cursor pos to 0
showFile(myFile);
}
void
Hello,
Is there the possibility to set the cursor position in a file ?
Example:
void main()
{
File myFile = File("myFile.txt");
showFile(myFile);
// set cursor pos to 0
showFile(myFile);
}
void showFile(File f)
{
while (!f.eof())
{
write(f.readln());
}
On Sunday, 10 April 2016 at 13:58:17 UTC, Jay Norwood wrote:
Seems like there should be an extra level to the version
statement, something like version(arch,x86).
I must be missing something about the intended use of the
version statement.
This will never be done. The language creator has
Seems like there should be an extra level to the version
statement, something like version(arch,x86).
I must be missing something about the intended use of the version
statement.
Hello,
Every time I try to run a project with derelict-allegro5 package
as a dependency, dub says: "Could not find a valid dependency
tree configuration"
I already cleaned the dub cache, that does not solve it,
allegro package is installed (from alleg.sourceforge.net).
dub works with
Is there a particular reason explaining why mov reg,0 is used and
not xor reg,reg ?
(or even and reg, 0)
for example here:
https://github.com/D-Programming-Language/druntime/blob/master/src/core/atomic.d#L1009
It seems that in Go too mov is used:
On Sunday, 10 April 2016 at 00:47:28 UTC, Puming wrote:
On Saturday, 9 April 2016 at 08:56:17 UTC, wobbles wrote:
On Friday, 8 April 2016 at 23:06:06 UTC, Puming wrote:
On Friday, 8 April 2016 at 18:23:32 UTC, wobbles wrote:
On Friday, 8 April 2016 at 16:07:13 UTC, Adam D. Ruppe wrote:
On
On Sunday, 10 April 2016 at 07:48:51 UTC, klimp wrote:
Is this corrrect ? Each task searches for the same thing so
when once has found the others don't need to run anymore. It
looks a bit strange not to stop those who havent find the thing:
Actually I have to kill the other tasks, in this
I have a multi-threaded program, one thread drawing to a window
and handling it, the other handling stdin.
The thread which handles stdin is something like this:
char[] buf;
while(true) {
readln(buf);
}
The window thread also has to receive close-events from the OS,
such as when the
Is this corrrect ? Each task searches for the same thing so when
once has found the others don't need to run anymore. It looks a
bit strange not to stop those who havent find the thing:
import std.concurrency, core.thread, std.random;
void task()
{
size_t i;
while (true)
{
On Saturday, 9 April 2016 at 21:16:08 UTC, ag0aep6g wrote:
On Saturday, 9 April 2016 at 19:31:31 UTC, Uranuz wrote:
I think that we need to add warning about such case in
documentation section:
https://dlang.org/spec/hash-map.html#construction_and_ref_semantic
in order to prevent this kind of
41 matches
Mail list logo