On Friday, 26 February 2016 at 04:03:15 UTC, BBasile wrote:
e.g the DMD equivalent for the two previous example is
DMD "sourceThis.d" "folder/interface.di" "folder/binary.a"
-ofbin/thesoft
You can mix unlinked binaries and text-editor source files on
commandline? Didn't know that when I trie
On Friday, 26 February 2016 at 04:03:15 UTC, BBasile wrote:
The D interface file must be specified to DUB using
"sourceFiles" : ["folder/interface.di"],
either in a config or in the globals.
The binary, so either a .lib | .a or .obj | .o must be
specified to DUB using
"DFlags" : ["folder/
On Friday, 26 February 2016 at 03:19:26 UTC, mahdi wrote:
Great! Thanks.
I was looking for a feature like `jar` files in Java or
`assemblies` in C# where all compiled code and metadata/symbols
are stored together inside a single binary file.
I think same can be implemented for D language an
Would it be a good idea to call "collect" and "minimize" methods
of core.memory.GC when OutOfMemory error is received FOR A LONG
RUNNING PROGRAM? or there won't be any benefit of that?
Example program: A web server that allocates and releases memory
from heap continuously.
On Friday, 26 February 2016 at 04:21:15 UTC, BBasile wrote:
On Friday, 26 February 2016 at 04:19:29 UTC, BBasile wrote:
static if (__traits(isStaticFunction,typeof(m2)))
static if (__traits(isStaticFunction, __traits(getMember,
vulkan_input, m2
Sorry don't copy paste like this there's a
On Friday, 26 February 2016 at 04:19:29 UTC, BBasile wrote:
static if (__traits(isStaticFunction,typeof(m2)))
static if (__traits(isStaticFunction, __traits(getMember,
vulkan_input, m2
Sorry don't copy paste like this there's a superfluous right
paren.
static if (__traits(isStaticFunct
On Friday, 26 February 2016 at 03:57:25 UTC, Nicholas Wilson
wrote:
foreach(m; __traits(allMembers, vulkan_input))
{
static if (m.endsWith("_T"))
{
foreach(m2; __traits(allMembers, vulkan_input))
{
static if
(__traits(isStaticFunction,typeof(m2)))// <- what h
On Thursday, 25 February 2016 at 12:15:42 UTC, mahdi wrote:
Hi,
Suppose I have a package `mypack` in `~/mypack`. I run `dub`
command on this package and have the compiled `mypack` file (OS
is Linux).
Now I am working on my project. I know how to use the
source-code of `mypack` package in th
foreach(m; __traits(allMembers, vulkan_input))
{
static if (m.endsWith("_T"))
{
foreach(m2; __traits(allMembers, vulkan_input))
{
static if (__traits(isStaticFunction,typeof(m2)))//
<- what here?
{
enum fn = __traits(getMember,vu
On Friday, 26 February 2016 at 02:32:44 UTC, Nicholas Wilson
wrote:
struct A
{
const (void *) p;
}
struct B
{
Aa;
this(void * _p)
{
a.p = _p;
}
}
I cannot change the definition of A
how do I initialise b.a.p?
Use a constructor for A instead of trying to write
On Friday, 26 February 2016 at 02:49:20 UTC, Mike Parker wrote:
On Thursday, 25 February 2016 at 21:06:59 UTC, mahdi wrote:
On Thursday, 25 February 2016 at 16:45:46 UTC, Chris Wright
Thanks. Is there a way to use a D library without having
access to it's source code? I tried `dmd -lib abcd.d
On Friday, 26 February 2016 at 02:48:35 UTC, cym13 wrote:
On Friday, 26 February 2016 at 02:32:44 UTC, Nicholas Wilson
wrote:
struct A
{
const (void *) p;
}
struct B
{
Aa;
this(void * _p)
{
a.p = _p;
}
}
I cannot change the definition of A
how do I initialise b
On Friday, 26 February 2016 at 02:49:20 UTC, Mike Parker wrote:
The compiler needs to know about S and its types, and it needs
S and its *members*
On Thursday, 25 February 2016 at 21:06:59 UTC, mahdi wrote:
On Thursday, 25 February 2016 at 16:45:46 UTC, Chris Wright
Thanks. Is there a way to use a D library without having access
to it's source code? I tried `dmd -lib abcd.d` which creates a
static library. But still I need to specify pa
On Friday, 26 February 2016 at 02:32:44 UTC, Nicholas Wilson
wrote:
struct A
{
const (void *) p;
}
struct B
{
Aa;
this(void * _p)
{
a.p = _p;
}
}
I cannot change the definition of A
how do I initialise b.a.p?
As you did:
void main() {
int i = 42;
struct A
{
const (void *) p;
}
struct B
{
Aa;
this(void * _p)
{
a.p = _p;
}
}
I cannot change the definition of A
how do I initialise b.a.p?
On 2/25/16 4:39 PM, asdf wrote:
if(line != "" && line != history[0]) {
string[] x = [line];
foreach(string i; history[0..99]) x ~= i;
history = x;
}
ugh!
history = line ~ history[0 .. $ - 1];
What you may want to consider is making his
On 02/25/2016 12:53 PM, Voitech wrote:
template TupleToString(TList...){
string a;
foreach(T;TList){ // Error: declaration expected, not 'foreach'
a~=T.stringof;
}
enum string TupleToString=a;
}
Of course i can use template function, but wanted to know if can omit
On Thursday, 25 February 2016 at 20:53:12 UTC, Voitech wrote:
On Thursday, 25 February 2016 at 14:29:30 UTC, Nicholas Wilson
wrote:
On Thursday, 25 February 2016 at 13:16:43 UTC, Voitech wrote:
[...]
You can (see std.meta/(std.traits?) , with recursive
templates), but there is nothing stoppi
On Thursday, 25 February 2016 at 21:46:40 UTC, asdf wrote:
Hi, me again. I'm having trouble making a demonstration and not
sure if is obsolete or not anyways. :/
Anyways take a look here.
http://www.tutorialspoint.com/python/python_further_extensions.htm http://dlang.org/spec/interfaceToC
On Thursday, 25 February 2016 at 21:46:40 UTC, asdf wrote:
I haven't tried this myself but D is supposed to have excellent
interface to C code. Perhaps you can go that route.
http://stackoverflow.com/questions/145270/calling-c-c-from-python
That question is the reverse, calling C from python
On Thursday, 25 February 2016 at 11:06:09 UTC, Jacob Carlborg
wrote:
On 2016-02-24 23:11, Joel wrote:
Error: Error writing file
'../../../.dub/packages/dsfml-2.1.0/libdsfml_system.a'
Joels-MacBook-Pro:DGuy joelcnz$
Is the full path of ../../../.dub/packages/dsfml-2.1.0 writable?
It is path:
On Thursday, 25 February 2016 at 21:40:45 UTC, Wyatt wrote:
I have a project I started in Python before I realised I really
don't enjoy Python. It's been on the back-burner for a few
years and I'd like to start again in D, but there's a
particular python module (Mutagen) that I outright refuse
I have a project I started in Python before I realised I really
don't enjoy Python. It's been on the back-burner for a few years
and I'd like to start again in D, but there's a particular python
module (Mutagen) that I outright refuse to reimplement. What's
the state of the art in calling Pyt
On Thursday, 25 February 2016 at 19:21:31 UTC, Steven
Schveighoffer wrote:
On 2/25/16 2:12 PM, Steven Schveighoffer wrote:
I believe you could use std.algorithm.copy, but probably need
to do it
with retro as well.
Heh, or of course use memmove :)
-Steve
I got the history list working this
On Thursday, 25 February 2016 at 11:06:09 UTC, Jacob Carlborg
wrote:
On 2016-02-24 23:11, Joel wrote:
Error: Error writing file
'../../../.dub/packages/dsfml-2.1.0/libdsfml_system.a'
Joels-MacBook-Pro:DGuy joelcnz$
Is the full path of ../../../.dub/packages/dsfml-2.1.0 writable?
.dub is gra
On Thursday, 25 February 2016 at 20:55:33 UTC, Suliman wrote:
On Thursday, 25 February 2016 at 19:09:59 UTC, Suliman wrote:
Where to store shared classes?
{
"name": "123",
"authors": [
"Suliman"
],
"description": "A minimal D application.",
On Thursday, 25 February 2016 at 16:45:46 UTC, Chris Wright wrote:
On Thu, 25 Feb 2016 12:15:42 +, mahdi wrote:
Hi,
Suppose I have a package `mypack` in `~/mypack`. I run `dub`
command on this package and have the compiled `mypack` file
(OS is Linux).
Now I am working on my project. I
On Thursday, 25 February 2016 at 19:09:59 UTC, Suliman wrote:
Where to store shared classes?
{
"name": "123",
"authors": [
"Suliman"
],
"description": "A minimal D application.",
"copyright": "Copyright © 2016, Suliman",
"license":
On Thursday, 25 February 2016 at 14:29:30 UTC, Nicholas Wilson
wrote:
On Thursday, 25 February 2016 at 13:16:43 UTC, Voitech wrote:
Hi, I have some code processing functions definition in
compile time, I want to override
them in some other class but not explicitly so created this
code:
templa
On 02/25/2016 04:47 AM, sigod wrote:
> void bar(ref int[] arr)
>
> Code wouldn't compile if you try to pass static array as `ref` argument.
To qualify further, static arrays cannot be passed as slice references
because although there is an automatic slicing of static arrays, such
slices a
On 2/25/16 2:12 PM, Steven Schveighoffer wrote:
I believe you could use std.algorithm.copy, but probably need to do it
with retro as well.
Heh, or of course use memmove :)
-Steve
On 2/24/16 9:08 PM, Adam D. Ruppe wrote:
On Thursday, 25 February 2016 at 01:31:17 UTC, Chris Wright wrote:
When you get to GC-allocated stuff, there's no way to tell.
The GC is easy, you can simply ask it:
http://dpldocs.info/experimental-docs/core.memory.GC.addrOf.1.html
"If p references m
On 2/25/16 8:24 AM, asdf wrote:
On Thursday, 25 February 2016 at 13:06:10 UTC, cym13 wrote:
In D the binary operator "~" is used to concatenate both strings
(arrays of characters) and arrays. (also the ~= operator is
equivalent to lhs = lhs ~ rhs
Nic
Just a precision: "lhs ~= rhs" isn't ex
Where to store shared classes?
On Thursday, 25 February 2016 at 18:57:08 UTC, Suliman wrote:
I have got 3 small projects that have shared code base. At
compile time they use few same classes. On runtime they use
same config file. How to better to organize work with dub?
Try with subpacjages like I did :
name "dedcpu"
autho
I have got 3 small projects that have shared code base. At
compile time they use few same classes. On runtime they use same
config file. How to better to organize work with dub?
On Thursday, 25 February 2016 at 16:05:37 UTC, Benjamin Thaut
wrote:
On Thursday, 25 February 2016 at 14:42:14 UTC, Thalamus wrote:
your entry point.
Hi Guillaume,
Thanks for responding so quickly! I had found that wiki page
before and I'd been following the "DLLs with a C Interface"
sectio
On Wednesday, 24 February 2016 at 21:48:14 UTC, mahdi wrote:
Suppose we have a function like this:
void diss(int[] array) ...
How can we detect is `array` is static (fixed size) or dynamic,
inside the function body?
I don't see that anyone has mentioned it but:
https://dlang.org/phobos/std_
On Thu, 25 Feb 2016 12:15:42 +, mahdi wrote:
> Hi,
>
> Suppose I have a package `mypack` in `~/mypack`. I run `dub` command on
> this package and have the compiled `mypack` file (OS is Linux).
>
> Now I am working on my project. I know how to use the source-code of
> `mypack` package in the
On Thu, 25 Feb 2016 02:08:18 +, Adam D. Ruppe wrote:
> On Thursday, 25 February 2016 at 01:31:17 UTC, Chris Wright wrote:
>> When you get to GC-allocated stuff, there's no way to tell.
>
> The GC is easy, you can simply ask it:
>
> http://dpldocs.info/experimental-docs/core.memory.GC.addrOf.
On Thursday, 25 February 2016 at 14:42:14 UTC, Thalamus wrote:
your entry point.
Hi Guillaume,
Thanks for responding so quickly! I had found that wiki page
before and I'd been following the "DLLs with a C Interface"
section closely. I had forgotten to add -shared when building
the DLL, but
On Wednesday, 24 February 2016 at 11:17:27 UTC, Tanel Tagaväli
wrote:
Sorry for the confusing state of the codebase.
Only the saw wave generator is currently functional, the `saw`
and `sine` functions are not used and should be left out of
analysis.
Also, audio output is only to ALSA.
Be c
On Thursday, 25 February 2016 at 14:07:21 UTC, Guillaume Piolat
wrote:
On Thursday, 25 February 2016 at 14:01:30 UTC, Thalamus wrote:
I don't control the EXE itself and the code I write to
interface with it must be either C# or JavaScript, but this
repros with a test C# driver EXE as well. The
On Thursday, 25 February 2016 at 13:16:43 UTC, Voitech wrote:
Hi, I have some code processing functions definition in compile
time, I want to override
them in some other class but not explicitly so created this
code:
template MixinFunction(alias attributes,alias returnType,alias
name,alias pa
On Thursday, 25 February 2016 at 14:01:30 UTC, Thalamus wrote:
I don't control the EXE itself and the code I write to
interface with it must be either C# or JavaScript, but this
repros with a test C# driver EXE as well. The interfacing C#
code can only be aware of the exposed D DLL functions de
Hi everyone,
I looked in the forums and Google in general but I didn't find a
similar question, and I'm stumped. I have a scenario where a set
of classes must be registered with a class mapper and then
instantiated via a factory. The classes themselves are agnostic
of one another, and all int
On Wednesday, 24 February 2016 at 21:48:14 UTC, mahdi wrote:
Suppose we have a function like this:
void diss(int[] array) ...
How can we detect is `array` is static (fixed size) or dynamic,
inside the function body?
I don't understand what I'm doing but got a proof of concept for
you. This
On Thursday, 25 February 2016 at 13:38:56 UTC, ag0aep6g wrote:
On 25.02.2016 14:33, Nicholas Wilson wrote:
Note that D has zero based array indexing
so assuming your array has 100 elements history[1..100]
is going one past the end of the array.
No, that's fine. `history[1..100]` gives you 99 e
On 25.02.2016 14:33, Nicholas Wilson wrote:
Note that D has zero based array indexing
so assuming your array has 100 elements history[1..100]
is going one past the end of the array.
No, that's fine. `history[1..100]` gives you 99 elements starting at
index 1, i.e. all except the first one.
On Thursday, 25 February 2016 at 13:24:09 UTC, asdf wrote:
On Thursday, 25 February 2016 at 13:06:10 UTC, cym13 wrote:
In D the binary operator "~" is used to concatenate both
strings (arrays of characters) and arrays. (also the ~=
operator is equivalent to lhs = lhs ~ rhs
Nic
Just a pre
On Thursday, 25 February 2016 at 13:06:10 UTC, cym13 wrote:
In D the binary operator "~" is used to concatenate both
strings (arrays of characters) and arrays. (also the ~=
operator is equivalent to lhs = lhs ~ rhs
Nic
Just a precision: "lhs ~= rhs" isn't exactly equivalent to
"lhs = lh
Hi, I have some code processing functions definition in compile
time, I want to override
them in some other class but not explicitly so created this code:
template MixinFunction(alias attributes,alias returnType,alias
name,alias parameters,alias bodyy){
enum string MixinFunction = for
On Thursday, 25 February 2016 at 12:58:54 UTC, Nicholas Wilson
wrote:
On Thursday, 25 February 2016 at 12:53:37 UTC, asdf wrote:
I'm trying to make a terminal input preprocessor with
alias/shortcuts and history.
import std.stdio;
void main() {
string line;
string[] history;
line
On Thursday, 25 February 2016 at 12:58:54 UTC, Nicholas Wilson
wrote:
In D the binary operator "~" is used to concatenate both
strings (arrays of characters) and arrays. (also the ~=
operator is equivalent to lhs = lhs ~ rhs
Nic
It worked! A link from someone else's question suggested `ne
On Thursday, 25 February 2016 at 12:53:37 UTC, asdf wrote:
I'm trying to make a terminal input preprocessor with
alias/shortcuts and history.
import std.stdio;
void main() {
string line;
string[] history;
line = readln();
foreach(int i; 0..100) history = history + [""]; // XX
On Thursday, 25 February 2016 at 12:53:37 UTC, asdf wrote:
I'm trying to make a terminal input preprocessor with
alias/shortcuts and history.
import std.stdio;
void main() {
string line;
string[] history;
line = readln();
foreach(int i; 0..100) history = history + [""]; // XX
I'm trying to make a terminal input preprocessor with
alias/shortcuts and history.
import std.stdio;
void main() {
string line;
string[] history;
line = readln();
foreach(int i; 0..100) history = history + [""]; // XXX
while(!stdin.eof) {
writeln(line);
if
On Thursday, 25 February 2016 at 12:18:07 UTC, mahdi wrote:
On Thursday, 25 February 2016 at 11:50:02 UTC, sigod wrote:
On Thursday, 25 February 2016 at 10:03:08 UTC, mahdi wrote:
Thanks.
So when we define the function, we MUST specify the array
size to be able to accept a static array?
Can't
On Thursday, 25 February 2016 at 12:18:07 UTC, mahdi wrote:
On Thursday, 25 February 2016 at 11:50:02 UTC, sigod wrote:
On Thursday, 25 February 2016 at 10:03:08 UTC, mahdi wrote:
Thanks.
So when we define the function, we MUST specify the array
size to be able to accept a static array?
Can't
On Thursday, 25 February 2016 at 11:50:02 UTC, sigod wrote:
On Thursday, 25 February 2016 at 10:03:08 UTC, mahdi wrote:
Thanks.
So when we define the function, we MUST specify the array size
to be able to accept a static array?
Can't we just define a function which can accept any static
array
Hi,
Suppose I have a package `mypack` in `~/mypack`. I run `dub`
command on this package and have the compiled `mypack` file (OS
is Linux).
Now I am working on my project. I know how to use the source-code
of `mypack` package in the project but what if I only have the
compiled binary? How c
On Thursday, 25 February 2016 at 10:03:08 UTC, mahdi wrote:
Thanks.
So when we define the function, we MUST specify the array size
to be able to accept a static array?
Can't we just define a function which can accept any static
array with any size? (e.g. a function to calculate average of a
s
On Thursday, 25 February 2016 at 08:40:00 UTC, nkgu wrote:
On Thursday, 25 February 2016 at 04:55:09 UTC, Nicholas Wilson
wrote:
oops should be
writeln(typeof(__traits(getMember, vulkan_input,
m)).stringof);
that compiles but still prints nothing
try
pragma(msg, typeof(__traits(getMember,
On 2016-02-24 23:11, Joel wrote:
Error: Error writing file
'../../../.dub/packages/dsfml-2.1.0/libdsfml_system.a'
Joels-MacBook-Pro:DGuy joelcnz$
Is the full path of ../../../.dub/packages/dsfml-2.1.0 writable?
--
/Jacob Carlborg
On Thursday, 25 February 2016 at 10:44:49 UTC, Andrea Fontana
wrote:
Check this simple code:
http://dpaste.dzfl.pl/2772c9144f1c
I can't understand how to minimize code duplication for
function like get().
Of course on real case body is much bigger and complex than
that.
The only way I found
On Thursday, 25 February 2016 at 10:48:34 UTC, Namespace wrote:
Try inout:
import std.stdio;
struct Inner
{
int field = 3;
}
struct Test
{
auto get() inout { return inner; }
private Inner inner;
}
void main()
{
{
Try inout:
import std.stdio;
struct Inner
{
int field = 3;
}
struct Test
{
auto get() inout { return inner; }
private Inner inner;
}
void main()
{
{
Test test;
test.get.field = 4;
}
Check this simple code:
http://dpaste.dzfl.pl/2772c9144f1c
I can't understand how to minimize code duplication for function
like get().
Of course on real case body is much bigger and complex than that.
The only way I found is to move the body of function inside a
mixin template:
mixin templ
void diss(int n)(ref int[n] array) { }
But to consume array of any size, just take dynamic array as
parameter.
Thanks.
So when we define the function, we MUST specify the array size to
be able to accept a static array?
Can't we just define a function which can accept any static array
with any size? (e.g. a function to calculate average of a static
int array of any size)?
On Thursday, 25 February 2016 at 04:55:09 UTC, Nicholas Wilson
wrote:
oops should be
writeln(typeof(__traits(getMember, vulkan_input, m)).stringof);
that compiles but still prints nothing
try
pragma(msg, typeof(__traits(getMember, vulkan_input,
m)).stringof);
because at compile time the
72 matches
Mail list logo