On Wednesday, 9 August 2017 at 21:54:46 UTC, Q. Schroll wrote:
For a class/interface type `A` and a class `C` inheriting from
`A` one can do
A a = getA();
if (auto c = cast(C) a)
{ .. use c .. }
to get a `C` view on `a` if it happens to be a `C`-instance.
Sometimes one cannot find a
On 8/9/17 9:08 PM, Steven Schveighoffer wrote:
Right, but this is not a limitation of the API, just the implementation.
It could be improved.
https://issues.dlang.org/show_bug.cgi?id=17736
Based on H.S. Teoh's comment in the bug report, this actually is invalid.
That's a tough requirement.
On 8/9/17 5:40 PM, H. S. Teoh via Digitalmars-d-learn wrote:
On Wed, Aug 09, 2017 at 09:34:26PM +, Q. Schroll via Digitalmars-d-learn
wrote:
On Friday, 4 August 2017 at 16:40:08 UTC, Stefan Koch wrote:
[..]
foreach(x;A .. B)
it's lowerd to
auto limit = B;
auto key = A;
for(auto x =
On 8/9/17 6:24 PM, Nordlöw wrote:
On Wednesday, 9 August 2017 at 19:00:54 UTC, Steven Schveighoffer wrote:
If I change the definition of ElementType to use R.init.front instead
of R.init.front.init, it compiles. But I'm pretty sure this will break
other ranges.
If Phobos compiles with the
given somethign like Threads.threadsAddIdle
which takes an extern(C) int (void*)
we can't seem to do
threadsAddIdle((void*) { }, null);
nor
because D complains is not the correct type nor can we do
delegate(void*)
or
extern(C) delegate(void*) {}
and have to resort to verbosity to get
On Wednesday, 9 August 2017 at 19:00:54 UTC, Steven Schveighoffer
wrote:
If I change the definition of ElementType to use R.init.front
instead of R.init.front.init, it compiles. But I'm pretty sure
this will break other ranges.
If Phobos compiles with the change would that change deserve a
On Wednesday, 9 August 2017 at 21:54:46 UTC, Q. Schroll wrote:
For a class/interface type `A` and a class `C` inheriting from
`A` one can do
A a = getA();
if (auto c = cast(C) a)
{ .. use c .. }
to get a `C` view on `a` if it happens to be a `C`-instance.
Sometimes one cannot find a
On Wednesday, 9 August 2017 at 02:11:13 UTC, Johnson Jones wrote:
I like to create code that automates much of the manual labor
that we, as programmers, are generally forced to do. D
generally makes much of this work automatable. For example, I
have created the following code which makes
For a class/interface type `A` and a class `C` inheriting from
`A` one can do
A a = getA();
if (auto c = cast(C) a)
{ .. use c .. }
to get a `C` view on `a` if it happens to be a `C`-instance.
Sometimes one cannot find a good new name for `c` while there is
no advantage of accessing
On Wednesday, 9 August 2017 at 15:10:46 UTC, Mike Wey wrote:
On 09-08-17 01:00, Johnson Jones wrote:
But, finally, this does seem to work:
// Fixup missing taskbar icon
void SetTaskBarIcon(gtk.ApplicationWindow window)
{
version(Windows)
version(X86)
{
On Wed, Aug 09, 2017 at 09:34:26PM +, Q. Schroll via Digitalmars-d-learn
wrote:
> On Friday, 4 August 2017 at 16:40:08 UTC, Stefan Koch wrote:
> > [..]
> >
> > foreach(x;A .. B)
> > it's lowerd to
> > auto limit = B;
> > auto key = A;
> > for(auto x = key;key < limit;++key)
> > {
> > // use
On Friday, 4 August 2017 at 16:40:08 UTC, Stefan Koch wrote:
[..]
foreach(x;A .. B)
it's lowerd to
auto limit = B;
auto key = A;
for(auto x = key;key < limit;++key)
{
// use x
}
That's enough to know that the foreach loop does not reuse the
space for the iteration variable. That was what I
Was buggy due to refactoring.
module DLLImport;
/* Import DLL functions in to type T. The following example shows
methodology
struct DLL_gdk
{
@("DLLImport") public static extern(Windows)
{
@("libgdk-3-0.dll")
{
On 8/9/17 4:10 PM, Temtaime wrote:
Sorry, messed up numbers
Expected:
3.11
3.11
3.1
3.1
Seems g outputs one digit less
I was bugged by this too.
It's not a bug. For the %f specifier, the number represents the number
of digits *after* the decimal.
For the %g specifier, the number
Sorry, messed up numbers
Expected:
3.11
3.11
3.1
3.1
Seems g outputs one digit less
import std.stdio;
void main()
{
writefln(`%.2g`, 3.11);
writefln(`%.2f`, 3.11);
writefln(`%.1g`, 3.11);
writefln(`%.1f`, 3.11);
}
3.1
3.11
3
3.1
But expected
3.1
3.11
3.1
3.11
Also, could there be an easier way to import everything that is
generally required?
I'm using an import script that does the work but I have to
replace it upgrade time I upgrade gtkD(since I have to delete
everything). I find that having a ton of imports is a big ugly.
What I use is, which
On Wednesday, 9 August 2017 at 15:10:46 UTC, Mike Wey wrote:
On 09-08-17 01:00, Johnson Jones wrote:
But, finally, this does seem to work:
// Fixup missing taskbar icon
void SetTaskBarIcon(gtk.ApplicationWindow window)
{
version(Windows)
version(X86)
{
On 09.08.2017 21:00, Steven Schveighoffer wrote:
On 8/9/17 2:25 PM, Nordlöw wrote:
Why doesn't appending to `subs` work with std.array.Appender in
struct T
{
string src;
import std.array : Appender;
Appender!(T[]) subs;
}
T t;
t.subs ~=
On 8/9/17 2:25 PM, Nordlöw wrote:
Why doesn't appending to `subs` work with std.array.Appender in
struct T
{
string src;
import std.array : Appender;
Appender!(T[]) subs;
}
T t;
t.subs ~= T.init; // ERRORS
t.subs.put(T.init); // ERRORS
Why doesn't appending to `subs` work with std.array.Appender in
struct T
{
string src;
import std.array : Appender;
Appender!(T[]) subs;
}
T t;
t.subs ~= T.init; // ERRORS
t.subs.put(T.init); // ERRORS
when it works with builtin arrays as in
On 8/9/17 1:05 PM, Johan wrote:
On Wednesday, 9 August 2017 at 12:47:49 UTC, Steven Schveighoffer wrote:
On 8/8/17 3:59 PM, Johan Engelen wrote:
In C++, it is clear that the _caller_ is doing the dereferencing, and
the dereference is also explicit.
In fact it's not doing any dereferencing.
On Wednesday, 9 August 2017 at 12:47:49 UTC, Steven Schveighoffer
wrote:
On 8/8/17 3:59 PM, Johan Engelen wrote:
In C++, it is clear that the _caller_ is doing the
dereferencing, and the dereference is also explicit.
In fact it's not doing any dereferencing. It's just under the
hood
On 09-08-17 01:00, Johnson Jones wrote:
But, finally, this does seem to work:
// Fixup missing taskbar icon
void SetTaskBarIcon(gtk.ApplicationWindow window)
{
version(Windows)
version(X86)
{
import core.sys.windows.winuser, gdk.Window;
auto
On 8/8/17 3:43 PM, Anonymouse wrote:
On Tuesday, 8 August 2017 at 16:00:17 UTC, Steven Schveighoffer wrote:
I wouldn't use formattedRead, as I think this is going to allocate
temporaries for a and b.
What would you suggest to use in its stead? My use-case is similar to
the OP's in that I
On 8/9/17 5:30 AM, Suliman wrote:
Big thanks! Now I understand. Now i redone dlang.ru in diet templates.
Great!
Am I right understand that include is needed only for small includes
without any nesting levels?
No, includes can be as big as you want, with as many nested levels as
you
On 8/8/17 4:00 PM, Andre Kostur wrote:
On 2017-08-08 12:38 PM, Steven Schveighoffer wrote:
On 8/8/17 2:56 PM, ag0aep6g wrote:
On 08/08/2017 08:34 PM, Johan Engelen wrote:
How would you express the function interface intent that a
reference to a class may not be null?
For a function "void
On 8/8/17 3:59 PM, Johan Engelen wrote:
On Tuesday, 8 August 2017 at 19:38:19 UTC, Steven Schveighoffer wrote:
Note that C++ also can do this, so I'm not sure the & is accomplishing
the correct goal:
void foo(Klass&);
int main()
{
Klass *k = NULL;
foo(*k);
}
In C++, it is clear
On Wednesday, 9 August 2017 at 10:00:14 UTC, kerdemdemir wrote:
As a total beginner I am feeling a bit not comfortable with
basic operations in AA.
First even I am very happy we have pointers but using pointers
in a common operation like this IMHO makes the language a bit
not safe.
Second
I haven't yet dug into formattedRead but thx for letting me
know : )
I was mostly speaking about the pattern with the AA. I guess
the best I can do is a templated function to hide the ugliness.
ref Value GetWithDefault(Value)(ref Value[string] map, const
(char[]) key) {
auto pValue = key
On Tuesday, 8 August 2017 at 15:54:29 UTC, Steven Schveighoffer
wrote:
On 8/8/17 10:52 AM, Suliman wrote:
your examples generate me:
DLANG.ru
(c) DLANG 2017
That's the template without the
Am Tue, 08 Aug 2017 20:48:39 +
schrieb Nordlöw :
> Has anybody written a wrapper around `std.file.readText` (or
> similar) that appends a final zero-byte terminator in order to
> realize sentinel-based search in textual parsers.
What do you mean by similar? There are
kiss-rpc-flatbuffer features:
Lightweight and easy to use. There are two ways to support IDL
and manually write protocols. Analog function call, more in line
with the RPC remote call logic, simple, transparent.
Easy to change, easy to use, existing code can be used directly
The data format
On Wednesday, 9 August 2017 at 01:39:07 UTC, Jason Brady wrote:
Why does the following code error out with:
app.d(12,10): Error: function app.FunctionWithArguments (uint
i) is not callable using argument types ()
Like Olivier said, stringof expects a valid expression. There are
a few other
On Wednesday, 9 August 2017 at 01:39:07 UTC, Jason Brady wrote:
Why does the following code error out with:
app.d(12,10): Error: function app.FunctionWithArguments (uint
i) is not callable using argument types ()
Code:
import std.stdio;
void FunctionWithoutArguments() {
}
void
Am Sun, 14 May 2017 15:05:08 +
schrieb Richard Delorme :
> I recently bought the infamous Raspberry pi 3, which has got a
> cortex-a53 4 cores 1.2 Ghz CPU (Broadcom). After installing on it
> a 64 bit OS (a non official fedora 25), I was wondering if it was
>
36 matches
Mail list logo