On Sunday, 26 June 2016 at 04:25:07 UTC, "Smoke" Adams wrote:
Languages:
C#: https://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx
Java:
https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.17.3
C11:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/C99RationaleV5.10.pdf (See
What deadalnix (how did you choose a nickname that is more difficult to
write than your given name anyway?) said was that the definition of %
only makes sense if, for every n and every m:
(n/m)+(n%m)=n
What this means is that, if n/m is rounded up for negative numbers, n%m
must be negative.
On Sunday, 26 June 2016 at 03:54:28 UTC, deadalnix wrote:
On Sunday, 26 June 2016 at 02:05:53 UTC, "Smoke" Adams wrote:
On Sunday, 26 June 2016 at 00:31:29 UTC, deadalnix wrote:
On Saturday, 25 June 2016 at 23:01:00 UTC, "Smoke" Adams
wrote:
This proves nothing.
This isn't a proof, this is
On Friday, 24 June 2016 at 17:26:19 UTC, Craig Dillabaugh wrote:
Just wanted to congratulate our 4 Google Summer of Code
students who have now officially all passed their mid-term
evaluations.
So congrats to Lodovico, Wojciech, Jeremy, and Sebastian for
making it this far, and thanks to the
On Sunday, 26 June 2016 at 02:05:53 UTC, "Smoke" Adams wrote:
On Sunday, 26 June 2016 at 00:31:29 UTC, deadalnix wrote:
On Saturday, 25 June 2016 at 23:01:00 UTC, "Smoke" Adams wrote:
This proves nothing.
This isn't a proof, this is a definition. This is the
definition that is used by all
On Saturday, 25 June 2016 at 12:34:04 UTC, ZombineDev wrote:
On Friday, 24 June 2016 at 21:36:27 UTC, Wild wrote:
On Friday, 24 June 2016 at 14:11:43 UTC, Mike Parker wrote:
On Friday, 24 June 2016 at 14:09:12 UTC, Mike Parker wrote:
[...]
And the reddit thread is here:
On Sunday, 26 June 2016 at 00:31:29 UTC, deadalnix wrote:
On Saturday, 25 June 2016 at 23:01:00 UTC, "Smoke" Adams wrote:
This proves nothing.
This isn't a proof, this is a definition. This is the
definition that is used by all programming languages out there
and all CPUs. It isn't going
On 26.06.2016 02:54, Guillaume Boucher wrote:
On Friday, 24 June 2016 at 20:43:38 UTC, deadalnix wrote:
Most reasonable is
numerator = quotient * divisor + remainder
Which means it can be negative.
Depends on the definition.
If division truncates towards negative infinity, the remainder
On 17.06.2016 21:59, kinke wrote:
Most interesting IMO though is the question when the slicee's pointer is
to be loaded. This is only relevant if the base is an lvalue and may
therefore be modified when evaluating the bound expressions. Should the
returned slice be based on the slicee's buffer
On Friday, 24 June 2016 at 20:43:38 UTC, deadalnix wrote:
Most reasonable is
numerator = quotient * divisor + remainder
Which means it can be negative.
Depends on the definition.
If division truncates towards negative infinity, the remainder
will always be nonegative (in case of a positive
On 6/25/16 7:50 PM, Meta wrote:
On Saturday, 25 June 2016 at 21:46:23 UTC, deadalnix wrote:
On Saturday, 25 June 2016 at 14:38:43 UTC, Robert burner Schadek wrote:
I think there is a major problem with the proposed design.
when Checked!(int, void) is to behave as an int, why do we need it in
On Saturday, 25 June 2016 at 23:01:00 UTC, "Smoke" Adams wrote:
This proves nothing.
This isn't a proof, this is a definition. This is the definition
that is used by all programming languages out there and all CPUs.
It isn't going to change because someone on the internet think he
has a
On Saturday, 25 June 2016 at 21:46:23 UTC, deadalnix wrote:
On Saturday, 25 June 2016 at 14:38:43 UTC, Robert burner
Schadek wrote:
I think there is a major problem with the proposed design.
when Checked!(int, void) is to behave as an int, why do we
need it in the first place. I mean we have
On Friday, 24 June 2016 at 20:43:38 UTC, deadalnix wrote:
On Friday, 24 June 2016 at 20:33:45 UTC, Andrei Alexandrescu
wrote:
In a checked environment, division may "overflow", e.g. -6 /
2u must be typed as uint but is not representable properly one.
How about remainder? I suppose one can
https://issues.dlang.org/show_bug.cgi?id=12357
Walter Bright changed:
What|Removed |Added
Keywords||pull
On 6/25/2016 3:44 PM, Walter Bright wrote:
4. Add @safe to the unittest
A unittest that is deliberately unsafe should be annotated with @system. Meaning
that any un-annotated unittest needs corrective action one way or the other.
Debugging tip:
Templates should almost never be marked @safe or @trusted, as the safety should
be inferred. However, to isolate down where the unsafe code actually is, add
@safe temporarily to the template declaration. Then, the compiler will tell you
which line in the template is unsafe.
Andrei identified a key blocker for D adoption is the incomplete implementation
of @safe. I'm working on the compiler end. But Phobos has a lot of code that is
pointlessly not @safe, making it frustrating to write @safe code that calls
Phobos. Some are listed in Bugzilla, most are not.
So
Ping. Let's clearly define these hairy evaluation order details
and add corresponding tests; that'd be another advantage over C++.
https://issues.dlang.org/show_bug.cgi?id=6278
--- Comment #16 from Walter Bright ---
(In reply to hsteoh from comment #15)
> Shouldn't it be ContractError?
That was my thought, too. The problem with Error (and ContractError is derived
from Error) is that it is not
On Saturday, 25 June 2016 at 21:57:35 UTC, TheDGuy wrote:
But i want to flash (e.g. change the CSS class) the buttons one
by one and not all at the sime time? How am i going to do that?
Okay, i tried it with a new private int-variable which contains
the current index of the for-loop, like
On Saturday, 25 June 2016 at 01:49:22 UTC, Andrei Alexandrescu
wrote:
On 06/24/2016 09:42 PM, Andrei Alexandrescu wrote:
long x = -1;
auto y = array.length + x;
I would be hard pressed to acknowledge that as an overflow
that needs to
be dynamically signaled. And the beauty of two's complement
On Saturday, 25 June 2016 at 20:39:53 UTC, Mike Wey wrote:
The constructor accepts an delegate, witch can access it's
context so it has access to some of the data.
The functions from GTK are also available like Timeout.add from
the linked tutorial:
On Saturday, 25 June 2016 at 14:38:43 UTC, Robert burner Schadek
wrote:
I think there is a major problem with the proposed design.
when Checked!(int, void) is to behave as an int, why do we need
it in the first place. I mean we have int as a basic type.
Can't we do:
alias Int = int;
alias
On 6/25/16 10:38 AM, Robert burner Schadek wrote:
On Friday, 24 June 2016 at 21:31:14 UTC, Andrei Alexandrescu wrote:
By default, if Hook has no state and implements none of these methods,
e.g. is void, then Checked!(int, void) is a user-defined type that
mimics the behavior of int to the
On 06/25/2016 05:26 PM, TheDGuy wrote:
On Saturday, 25 June 2016 at 13:01:09 UTC, TheDGuy wrote:
Thanks for your answer.
I have to pass the Button object to my timeout function to change the
CSS class. But how do i do that within the Timeout constructor?
I mean:
I have to pass my function
On Saturday, 25 June 2016 at 20:32:33 UTC, Walter Bright wrote:
Thank you for your hard work on this important project.
Please ensure that it has a range interface - a range is used
as input.
You mean that the document source may be a range?
In that case, I already implemented a lexer that
On Saturday, 25 June 2016 at 20:16:09 UTC, Steven Schveighoffer
wrote:
When I had the gumption to try and make an XML parser range,
the idea I had was to have the current element's tag and
attributes, all parent elements' tags and attributes, and the
currently parsed entity inside the element.
On 6/23/2016 1:04 PM, Lodovico Giaretta wrote:
One month after the official GSoC start, I want to share with you what's in
std.experimental.xml and what will hopefully be there
Thank you for your hard work on this important project.
Please ensure that it has a range interface - a range is
On 6/25/16 12:26 PM, Lodovico Giaretta wrote:
On Saturday, 25 June 2016 at 15:59:40 UTC, Jacob Carlborg wrote:
Any range API, or plan for?
Hi,
I'm definitely going to provide a wrapper around the Cursor API, that
will provide InputRange access to all the children of the current node
(this
https://issues.dlang.org/show_bug.cgi?id=16202
Steven Schveighoffer changed:
What|Removed |Added
CC|
On Saturday, 25 June 2016 at 11:27:01 UTC, cym13 wrote:
We are talking about early returns (checking for something and
returning as soon as possible) which are a well-known and
efficient
way to reduce indentation levels and increase modularity. You
can't
come and say "What? You want it to
https://issues.dlang.org/show_bug.cgi?id=6278
--- Comment #15 from hst...@quickfur.ath.cx ---
Shouldn't it be ContractError?
--
On Friday, 24 June 2016 at 15:09:41 UTC, Satoshi wrote:
On Friday, 24 June 2016 at 14:09:12 UTC, Mike Parker wrote:
Not that long ago, Dan Printzell announced his D OS Kernel,
PowerNex [1], in this forum. It is now the subject of the
first project highlight on the D Blog [2].
[1]
On Saturday, 25 June 2016 at 17:26:03 UTC, Andre Pany wrote:
On Saturday, 25 June 2016 at 16:05:30 UTC, Vladimir Panteleev
wrote:
On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote:
Does D/Phobos has any support for thunks?
Made this a while ago:
On Saturday, 25 June 2016 at 16:05:30 UTC, Vladimir Panteleev
wrote:
On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote:
Does D/Phobos has any support for thunks?
Made this a while ago:
http://stackoverflow.com/a/8656294/21501
Thanks, I had a look. Unfortunately it doesn't compile
On Saturday, 25 June 2016 at 15:59:40 UTC, Jacob Carlborg wrote:
Any range API, or plan for?
Hi,
I'm definitely going to provide a wrapper around the Cursor API,
that will provide InputRange access to all the children of the
current node (this way the tree structure is maintained). I plan
On Friday, 24 June 2016 at 07:35:51 UTC, Ruslan Mullakhmetov
wrote:
Hi all!
I saw pure jpeg decoder was announced recently and I decided to
publish pure D mpeg2 decoder that I wrote just for myself, with
study aims.
I didn't test it exhaustively, so don't judge me for bugs)
Currently it
On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote:
Does D/Phobos has any support for thunks?
Made this a while ago:
http://stackoverflow.com/a/8656294/21501
On Friday, 17 June 2016 at 16:51:04 UTC, Jack Stouffer wrote:
On Wednesday, 8 June 2016 at 22:19:47 UTC, Bauss wrote:
D definitely needs some optimizations, I mean look at its
benchmarks compared to other languages:
https://github.com/kostya/benchmarks
Welp, I tried making it faster and I
On Friday, 24 June 2016 at 07:35:51 UTC, Ruslan Mullakhmetov
wrote:
Hi all!
I saw pure jpeg decoder was announced recently and I decided to
publish pure D mpeg2 decoder that I wrote just for myself, with
study aims.
I didn't test it exhaustively, so don't judge me for bugs)
Currently it
On 23/06/16 22:04, Lodovico Giaretta wrote:
What is working?
- Four lexers are provided to abstract different kinds of input from the
other layers, providing different speed characteristics;
- The parser splits the document into nodes, doing most of the hard work;
- A cursor sits on top of the
On Saturday, 25 June 2016 at 15:26:00 UTC, TheDGuy wrote: }
But i get the error:
Error: none of the overloads of '__ctor' are callable using
argument types (bool delegate(void* userData), int, bool),
candidates are:
This is the correct error message:
Error: none of the overloads of '__ctor'
On Saturday, 25 June 2016 at 13:01:09 UTC, TheDGuy wrote:
Thanks for your answer.
I have to pass the Button object to my timeout function to
change the CSS class. But how do i do that within the Timeout
constructor?
I mean:
I have to pass my function and delay time to the constructor, but
On Friday, 24 June 2016 at 21:31:14 UTC, Andrei Alexandrescu
wrote:
By default, if Hook has no state and implements none of these
methods, e.g. is void, then Checked!(int, void) is a
user-defined type that mimics the behavior of int to the
maximum extent possible.
I think there is a major
On Saturday, 25 June 2016 at 12:35:39 UTC, Lodovico Giaretta
wrote:
On Saturday, 25 June 2016 at 12:30:22 UTC, Lodovico Giaretta
wrote:
If you want this to work, you need your lambdas to take the
casted value as a parameter:
Thanks.
On Saturday, 25 June 2016 at 10:19:47 UTC, Claude wrote:
On Friday, 24 June 2016 at 15:24:48 UTC, Andrei Alexandrescu
wrote:
Does anyone else find this annoying?
https://issues.dlang.org/show_bug.cgi?id=16201 -- Andrei
My 2 cents. I don't find that annoying at all. It's perfectly
normal
On Saturday, 25 June 2016 at 14:06:51 UTC, John wrote:
On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote:
[...]
This will only work on X86:
version(X86)
struct FunctionPtr(TDelegate) if (is(TDelegate == delegate)) {
[...]
Thanks a lot John, that's fantastic.
Kind regards
André
On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote:
Hi everyone,
I have some issue with win32 function SetWindowsHookEx. For
this specific funtion there is no possibility to pass extra
data (pointer to a class instance to be called) to the callback
function.
The general solution
On Saturday, 25 June 2016 at 13:44:48 UTC, Andre Pany wrote:
Does D/Phobos has any support for thunks?
It isn't included in the stdlib, but you can use the same C++
they describe in the link in D.
Hi everyone,
I have some issue with win32 function SetWindowsHookEx. For this
specific funtion there is no possibility to pass extra data
(pointer to a class instance to be called) to the callback
function.
The general solution seems to use thunks. I found s.th. for c++:
On Saturday, 25 June 2016 at 11:45:40 UTC, Mike Wey wrote:
You should change the css class in the timeout_delay function.
It's called by the GTK main loop every time the amount of
seconds passed to the constructor has passed. And return true
if you want to continue to flash the button, and
On Saturday, 25 June 2016 at 12:30:22 UTC, Lodovico Giaretta
wrote:
If you want this to work, you need your lambdas to take the
casted value as a parameter:
void test(T)(T value) {
int i;
string s;
match!(value,
int, (val) => i = val,
string, (val) => s = val
On Saturday, 25 June 2016 at 10:49:43 UTC, qznc wrote:
Since fibers are bound to a thread, a thread-local GC would
help as well. The hard part is how to make it safe.
Yes, but a thread is usually long-lived, so you don't get the
free-all-no-collection-needed speedup.
I don't think it is so
On Saturday, 25 June 2016 at 10:39:09 UTC, John wrote:
Thanks for the help, both. This appeared to work, until I
realised the lambda isn't static:
void match(T, cases...)() {
static if (cases.length == 1) cases[0]();
else static if (cases.length > 2) {
static if
On Friday, 24 June 2016 at 21:36:27 UTC, Wild wrote:
On Friday, 24 June 2016 at 14:11:43 UTC, Mike Parker wrote:
On Friday, 24 June 2016 at 14:09:12 UTC, Mike Parker wrote:
Not that long ago, Dan Printzell announced his D OS Kernel,
PowerNex [1], in this forum. It is now the subject of the
On Saturday, 25 June 2016 at 12:01:25 UTC, rikki cattermole wrote:
2. You can hand out borrowed fiber-references to the fiber
heap when
calling non-fiber functions, but fiber-references can never be
turned
into non-fiber references.
This worries me.
1. This adds ref counting or some other
On 25/06/2016 11:55 PM, Ola Fosheim Grøstad wrote:
On Saturday, 25 June 2016 at 11:37:44 UTC, rikki cattermole wrote:
I've thought about this further, the only hook function we don't
currently have is related to global + TLS assignment for memory.
We can get away with e.g. new overriding and ~
On Saturday, 25 June 2016 at 11:37:44 UTC, rikki cattermole wrote:
I've thought about this further, the only hook function we
don't currently have is related to global + TLS assignment for
memory.
We can get away with e.g. new overriding and ~ via the GC proxy
(actually a fairly decent way to
On 06/24/2016 10:03 PM, TheDGuy wrote:
On Friday, 24 June 2016 at 16:44:59 UTC, Gerald wrote:
Other then the obvious multi-threaded, using glib.Timeout to trigger
the reversion of the color change could be an option.
http://api.gtkd.org/src/glib/Timeout.html
Thanks! I tried this so far:
On 25/06/2016 11:00 PM, rikki cattermole wrote:
... snip ...
What we want is to be able to explicitly say what the context is for a
functions code and declare no globals.
@noglobals
struct MyContext {
@disable
this(this);
void func() {
}
}
Function calls outside of the
On Saturday, 25 June 2016 at 10:19:47 UTC, Claude wrote:
And if some code have too many indentation levels, than it
probably means it should be better modularized, hence I'd
suggest to split it in several sub-functions, it will be more
readable/maintainable.
We are talking about early
On 25/06/2016 10:33 PM, Ola Fosheim Grøstad wrote:
Pony has a fiber local GC, which means collection can happen when the
fiber is inactive or even altogether skip collection if the fiber is
short-lived.
Go is currently exploring a Transaction Oriented GC addition to the
concurrent GC it
On 6/25/2016 12:52 AM, Gary Willoughby wrote:
Done.
Good!
On Saturday, 25 June 2016 at 10:33:00 UTC, Ola Fosheim Grøstad
wrote:
Pony has a fiber local GC, which means collection can happen
when the fiber is inactive or even altogether skip collection
if the fiber is short-lived.
Go is currently exploring a Transaction Oriented GC addition to
the
On 25/06/2016 10:25 PM, Dlangofile wrote:
On Saturday, 25 June 2016 at 09:39:21 UTC, rikki cattermole wrote:
On 25/06/2016 9:03 PM, Dlangofile wrote:
On Saturday, 25 June 2016 at 03:29:02 UTC, rikki cattermole wrote:
On 25/06/2016 5:57 AM, Dlangofile wrote:
Hi all,
I'm building a Docker
On Saturday, 25 June 2016 at 09:12:12 UTC, Lodovico Giaretta
wrote:
On Saturday, 25 June 2016 at 09:07:19 UTC, Lodovico Giaretta
wrote:
Instead of passing functions to match!, pass pairs of
arguments, like this:
match!(T,
int, writeln("Matched int"),
is(T : SomeObject),
Pony has a fiber local GC, which means collection can happen when
the fiber is inactive or even altogether skip collection if the
fiber is short-lived.
Go is currently exploring a Transaction Oriented GC addition to
the concurrent GC it already has:
On Saturday, 25 June 2016 at 09:39:21 UTC, rikki cattermole wrote:
On 25/06/2016 9:03 PM, Dlangofile wrote:
On Saturday, 25 June 2016 at 03:29:02 UTC, rikki cattermole
wrote:
On 25/06/2016 5:57 AM, Dlangofile wrote:
Hi all,
I'm building a Docker Alpine linux image with wine, for
being able
On Friday, 24 June 2016 at 15:24:48 UTC, Andrei Alexandrescu
wrote:
Does anyone else find this annoying?
https://issues.dlang.org/show_bug.cgi?id=16201 -- Andrei
My 2 cents. I don't find that annoying at all. It's perfectly
normal IMHO.
It may introduce an additional indentation level for
On 25/06/2016 9:03 PM, Dlangofile wrote:
On Saturday, 25 June 2016 at 03:29:02 UTC, rikki cattermole wrote:
On 25/06/2016 5:57 AM, Dlangofile wrote:
Hi all,
I'm building a Docker Alpine linux image with wine, for being able to
forge Windows executable from my laptop, without having to dual
On Saturday, 25 June 2016 at 09:07:19 UTC, Lodovico Giaretta
wrote:
Instead of passing functions to match!, pass pairs of
arguments, like this:
match!(T,
int, writeln("Matched int"),
is(T : SomeObject), writeln("Derives from SomeObject");
);
Now, in the
also, there is a subtle bug in matcher. sorry. ;-)
On Saturday, 25 June 2016 at 08:46:05 UTC, John wrote:
Anyone able to improve on it?
q hack:
template tyma(T, Cases...) {
import std.traits;
template GetFunc(size_t idx) {
static if (idx >= Cases.length) {
static assert(0, "no delegate for match");
} else static if
On Saturday, 25 June 2016 at 08:46:05 UTC, John wrote:
Writing a long series of "static if ... else" statements can be
tedious and I'm prone to leaving out the crucial "static" after
"else", so I was wondered if it was possible to write a
template that would resemble the switch statement, but
On Saturday, 25 June 2016 at 03:29:02 UTC, rikki cattermole wrote:
On 25/06/2016 5:57 AM, Dlangofile wrote:
Hi all,
I'm building a Docker Alpine linux image with wine, for being
able to
forge Windows executable from my laptop, without having to
dual boot.
With my disappointment, I'm not
Writing a long series of "static if ... else" statements can be
tedious and I'm prone to leaving out the crucial "static" after
"else", so I was wondered if it was possible to write a template
that would resemble the switch statement, but for types.
Closest I came up to was this:
void
On Friday, 24 June 2016 at 22:24:09 UTC, Walter Bright wrote:
Please post bug reports to bugzilla. They'll get lost in the
n.g.
Done. https://issues.dlang.org/show_bug.cgi?id=16204
https://issues.dlang.org/show_bug.cgi?id=16204
Issue ID: 16204
Summary: When using the -profile flag phobos unit tests fail
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
On Friday, 24 June 2016 at 15:24:48 UTC, Andrei Alexandrescu
wrote:
Does anyone else find this annoying?
https://issues.dlang.org/show_bug.cgi?id=16201 -- Andrei
What I think about enchancement of static if is that it could be
interesting to have `elif` keyword like in Python, so instead of
On Friday, 24 June 2016 at 20:34:38 UTC, deadalnix wrote:
On Friday, 24 June 2016 at 10:33:43 UTC, Patrick Schluter wrote:
On Friday, 24 June 2016 at 10:11:11 UTC, deadalnix wrote:
On Friday, 24 June 2016 at 08:40:26 UTC, Patrick Schluter
wrote:
On Thursday, 23 June 2016 at 20:01:26 UTC,
Btw, one might take the view that "pown(real x,int y)" is
describing monomials:
https://en.wikipedia.org/wiki/Monomial
Whereas "powr(real x,real y)" is a shorthand for "exp(y *
log(x))".
82 matches
Mail list logo