On Monday, 3 October 2016 at 12:08:54 UTC, Chalix wrote:
Hi All!
The documentation of D
(https://dlang.org/overview.html#compatibility) says:
"Direct Access to C API's
Not only does D have data types that correspond to C types, it
provides direct access to C functions. There is no need to
On 04/10/2016 1:56 AM, Chalix wrote:
On Monday, 3 October 2016 at 12:15:10 UTC, rikki cattermole wrote:
To use any kind of function you must declare it, plain and simple.
Any c or c++ function/class is the very much same way.
Now C++ types such as classes are highly limited in D since it
I suppose that's https://issues.dlang.org/show_bug.cgi?id=8006
On Monday, 3 October 2016 at 12:47:48 UTC, Chalix wrote:
Also, I used the Qt library a lot with C++. But although it is
a library, I have access to all the classes, like " QWidget w =
new QWidget();". There is no factory method used. (This
confuses me now a bit...)
Qt bindings is a major
On Monday, 3 October 2016 at 13:12:55 UTC, Chalix wrote:
But I don't get, why I have a gtkd-3 lib. Why can't I just link
against the gtk-3 lib then? I have now the headers to use the
nice D stuff, but the linking should be done against the
C-compiled library.
If you don't use D-specific
On Monday, 3 October 2016 at 12:08:54 UTC, Chalix wrote:
Furthermore, if there is an not very popular C library, where
no wrapper function exists, would it possible to include it
into a D project? Probably I have to transform all the .h to .d
files, so i can "import" them instead of "include"
On Monday, 3 October 2016 at 12:54:03 UTC, Adam D. Ruppe wrote:
It is possible, you just need to match compilers with the
library in C++, whereas C libraries don't need such an exact
match.
With your Qt library, you get a build of it that is compatible
with the compiler you use to build your
On Monday, October 03, 2016 17:19:47 Chalix via Digitalmars-d-learn wrote:
> But there still is one thing, which I don't get:
>
> If I "import foo;" in my project, it will be compiled alongside.
> So there is no need for an extra library. Same should be for
> wrapfoo.d. If I "import wrapfoo;", I
On 10/03/2016 05:47 AM, Chalix wrote:
> what do you mean
> by "turn C functions into classes"?
Many C APIs are object-oriented in that, they pass the most interesting
object as the first parameter:
// C struct
struct Foo {
// ...
};
// Factory method (or, "constructor")
Foo*
On Monday, 3 October 2016 at 17:56:46 UTC, ag0aep6g wrote:
When you do precompile to a library, you can skip the
compilation later. That can save time.
True, linking with this library instead of compiling it every
time I changed my code will save me a lot of time :)
On Monday, October 03, 2016 18:05:47 Chalix via Digitalmars-d-learn wrote:
> Ah great, now I understand it :)
> I thought, import and include would work the same way (taking all
> the code in the .h or .d file and pasting it into the other file).
> But if import extracts only the definitions, it
On Monday, 3 October 2016 at 17:19:47 UTC, Chalix wrote:
If I "import foo;" in my project, it will be compiled
alongside. So there is no need for an extra library. Same
should be for wrapfoo.d. If I "import wrapfoo;", I should just
need the C-library "foo", and no D-library "food" right?
On 10/03/2016 07:19 PM, Chalix wrote:
If I "import foo;" in my project, it will be compiled alongside.
Not necessarily. dmd won't compile foo unless you tell it to by putting
foo.d on the command line. If foo is only imported, dmd parses the file
but it doesn't compile it.
So
there is no
On 10/03/2016 01:50 PM, Chalix wrote:
On Sunday, 18 September 2016 at 21:41:45 UTC, Mike Wey wrote:
The demo still uses the old GtkGLExt binding, which usually isn't
available in de distributions repositories.
The newer GLArea is easier to use since it's part of GTK.
As for the linker errors,
On Monday, 3 October 2016 at 17:45:55 UTC, Jonathan M Davis wrote:
The import statement just tells the D compiler to pull in
declarations for the symbols that it needs from those modules.
It doesn't actually compile those modules. You still have to
give them to the compiler (either all
On 10/03/2016 07:19 PM, Chalix wrote:
On Monday, 3 October 2016 at 13:51:28 UTC, Mike Parker wrote:
// wrapfoo.d
import foo; // import the foo module from above
void myFunc(string s)
{
import std.string : toStringz;
my_func(s.toStringz());
}
Thank you for the example, Mike!
And
On Monday, 3 October 2016 at 13:51:28 UTC, Mike Parker wrote:
// wrapfoo.d
import foo; // import the foo module from above
void myFunc(string s)
{
import std.string : toStringz;
my_func(s.toStringz());
}
Thank you for the example, Mike!
And thanks to all others who support me with
On Saturday, 1 October 2016 at 18:33:02 UTC, TheFlyingFiddle
wrote:
On Saturday, 1 October 2016 at 16:45:11 UTC, Uranuz wrote:
[...]
There are two reasons why this does not compile. The first has
to do with how retro() (and indeed most function in std.range)
work with utf-8 strings (eg the
On Saturday, 1 October 2016 at 18:55:54 UTC, pineapple wrote:
On Saturday, 1 October 2016 at 17:55:08 UTC, Uranuz wrote:
On Saturday, 1 October 2016 at 17:32:59 UTC, Uranuz wrote:
On Saturday, 1 October 2016 at 17:23:16 UTC, Uranuz wrote:
[...]
But these example fails. Oops. Looks like a
On Monday, 3 October 2016 at 19:25:59 UTC, Uranuz wrote:
When I pass empty string to splitter in most of languages I
expect to get list with 1 item (empty string) as a result, but
I get error instead. And I see inconsistency in that .front
behaves normally, but .back is not. Usually I access
On Monday, 3 October 2016 at 18:00:53 UTC, Mike Wey wrote:
The signal functions can be found in the gobject.Signals module.
But you should use the GLArea.addOnCreateContext / addOnRender
/ addOnResize functions to attach a D delegate to the signal.
You will still need to link with the OpenGL
On Sunday, 2 October 2016 at 17:22:57 UTC, Basile B. wrote:
On Sunday, 2 October 2016 at 15:54:38 UTC, Satoshi wrote:
Hello,
why
pure @safe nothrow @nogc struct Point {
}
isn't same as
struct Point {
pure: @safe: nothrow: @nogc:
}
??
This is not specified but attributes aren't applied to
On 2016-09-27 22:21, Jacob Carlborg wrote:
I'm working on a Ddoc theme and I have trouble figuring out when the
DDOC_KEYWORD and DDOC_TEMPLATE_PARAM macros are used. Are the compiler
outputting them or should the developer be using those directly? If the
compiler is outputting them, then when is
On Saturday, 1 October 2016 at 00:06:05 UTC, Matthias Klumpp
wrote:
I do none of those things in my code though...
`grep "~this" *.d` gives nothing? It can be a struct with
destructor stored in a class. Can you observe the error? Try to
set a breakpoint at onInvalidMemoryOperationError
On Sunday, 2 October 2016 at 21:05:25 UTC, A D dev wrote:
One last point:
If that was always the behavior (in all versions from 2010 - or
earlier), i.e. -o- generates neither .OBJ nor .EXE, then what
is the purpose of the option? does it act as just a syntax
check?
Purpose is to skip code
On Sunday, 25 September 2016 at 16:23:11 UTC, Matthias Klumpp
wrote:
For Ubuntu, some modifications on the code were needed, and
apparently for them the code is currently crashing in the GC
collection thread: http://paste.debian.net/840490/
Oh, wait, what do you mean by crashing?
If it's heap corruption, GC has debugging option -debug=SENTINEL
- for buffer overrun checks. Also that particular stack trace
shows that object being destroyed is allocated in bin 512, i.e.
its size is between 256 and 512 bytes.
On Sunday, October 02, 2016 18:31:11 Mike Bierlee via Digitalmars-d-learn
wrote:
> Consider the following code:
>
> enum StringTypeEnumOne : string {
> bla = "bla"
> }
>
> enum StringTypeEnumTwo : string {
> bleh = "bleh"
> }
>
> enum IntTypeEnumOne : int {
> bla = 1
> }
>
> enum
Is this the preferred logging module for vibe.d:
http://vibed.org/api/vibe.core.log/
There is also:
http://vibed.org/api/vibe.http.log/
which is there for backwards compatibility?
Unexpected auto-concatenation of string elements:
string[] arr = ["a", "b" "c"];// ["a", "bc"], length==2
int[] arr2 = [[1], [2] [3]];// Error: array index 3 is out
of bounds [2][0 .. 1]
// Error: array index 3 is out
of bounds [0..1]
dmd
On 10/03/2016 01:40 PM, deed wrote:
Unexpected auto-concatenation of string elements:
string[] arr = ["a", "b" "c"];// ["a", "bc"], length==2
int[] arr2 = [[1], [2] [3]];// Error: array index 3 is out of
bounds [2][0 .. 1]
// Error: array index 3 is
Hi All!
The documentation of D
(https://dlang.org/overview.html#compatibility) says:
"Direct Access to C API's
Not only does D have data types that correspond to C types, it
provides direct access to C functions. There is no need to write
wrapper functions, parameter swizzlers, nor code to
On Monday, 3 October 2016 at 12:08:54 UTC, Chalix wrote:
So, if there is no need for wrapper functions, why are there a
lot of them?
A lot of people like the wrappers as being prettier to use since
you can turn C functions into classes and such. gtkd is an
example of that.
Furthermore, if
On 2016-10-03 12:36, Chris wrote:
Is this the preferred logging module for vibe.d:
http://vibed.org/api/vibe.core.log/
There is also:
http://vibed.org/api/vibe.http.log/
which is there for backwards compatibility?
The second one is specific for HTTP. The first one is generic.
--
/Jacob
On Sunday, 18 September 2016 at 21:41:45 UTC, Mike Wey wrote:
The demo still uses the old GtkGLExt binding, which usually
isn't available in de distributions repositories.
The newer GLArea is easier to use since it's part of GTK.
As for the linker errors, you'll need to link with the OpenGL
On 04/10/2016 1:08 AM, Chalix wrote:
Hi All!
The documentation of D (https://dlang.org/overview.html#compatibility)
says:
"Direct Access to C API's
Not only does D have data types that correspond to C types, it provides
direct access to C functions. There is no need to write wrapper
On Monday, 3 October 2016 at 12:08:54 UTC, Chalix wrote:
Hi All!
The documentation of D
(https://dlang.org/overview.html#compatibility) says:
"Direct Access to C API's
Not only does D have data types that correspond to C types, it
provides direct access to C functions. There is no need to
On Monday, 3 October 2016 at 12:12:44 UTC, Adam D. Ruppe wrote:
A lot of people like the wrappers as being prettier to use
since you can turn C functions into classes and such. gtkd is
an example of that.
Thanks for your fast answers :)
Hm, I thing I am missing some fundamentals...
I read a
On Monday, 3 October 2016 at 12:47:48 UTC, Chalix wrote:
I read a bit about creating libraries in C++, and I found out,
this is not possible, because there is no definition of the API.
It is possible, you just need to match compilers with the library
in C++, whereas C libraries don't need
On Monday, 3 October 2016 at 12:15:10 UTC, rikki cattermole wrote:
To use any kind of function you must declare it, plain and
simple.
Any c or c++ function/class is the very much same way.
Now C++ types such as classes are highly limited in D since it
doesn't ugh cross over all that well (it
40 matches
Mail list logo