not sure how to send the onFiledChange event.
A delegate perhaps?
Or you can look at any of the existing event driven libraries that do this:
http://code.dlang.org/packages/vibe-core
http://code.dlang.org/packages/libasync
--
/Jacob Carlborg
to be give as separate
arguments.
--
/Jacob Carlborg
b
[2] http://code.dlang.org/packages/mysql-native
[3] http://vibed.org/api/vibe.data.serialization
--
/Jacob Carlborg
/archives/digitalmars/D/learn/Static_linking_on_Linux_with_dmd_or_gcc_74954.html
Any hints?
You can use LDC to statically link the binary.
--
/Jacob Carlborg
On 2017-08-06 17:47, Moritz Maxeiner wrote:
If you use this option, do be aware that this feature has been scheduled
for future deprecation [1].
It's likely going to continue working for quite a while (years), though.
It's used all over the place in the DMD code base.
--
/Jacob Carlborg
allocations. Is there any
way to get D to allocate a class on the stack like a local struct?
Prefix the variable declaration with "scope":
scope foo = new Object;
--
/Jacob Carlborg
On 2017-08-01 17:45, ashit wrote:
thank you James
i should try that.
i was always enjoy the pure and efficiency of C. that made me stubborn
to learn java.
Just to be clear, there's no Java code in DWT. Everything is ported to D.
--
/Jacob Carlborg
On 2017-07-28 11:30, Mario Kröplin wrote:
Our programs are intended to run "forever". 24/7 servers.
What's wrong with having a bool that determines if the loop should
continue running?
--
/Jacob Carlborg
As others have mentioned, you should in general avoid calling "exit" in
a D program. There's a C function called "atexit" that allows to
register a callback that is called after calling "exit". You could
perhaps join the threads there. I don't know if that helps
h can used in
combination with a cast.
--
/Jacob Carlborg
are combined into one function per module, which is
what Runtime.moduleUnitTester is running. The separate unit test blocks
are gone at runtime so there's nothing to connect the UDAs to.
--
/Jacob Carlborg
problem. I think it was agreed that everything
should be accessible through introspection.
--
/Jacob Carlborg
1] https://is.gd/segmDD
--
/Jacob Carlborg
sorted it out.
--
/Jacob Carlborg
be easier if you provide a small code example of what
you want to achieve.
--
/Jacob Carlborg
/xlld/wrap.d#L686
And https://dlang.org/spec/traits.html#allMembers to iterate all members
in a module.
--
/Jacob Carlborg
you go with "concatenate".
--
/Jacob Carlborg
}));// fail
}
Wh D? It makes no sense, the compiler knows what is the type of the
first processFoo arg anyway...
https://github.com/dlang/DIPs/pull/71
--
/Jacob Carlborg
, just import and dub
dependency).
You can try creating your own bindings. DStep [1] is a tool that can
help with that. Make sure you build DStep from master.
[1] http://github.com/jacob-carlborg/dstep
--
/Jacob Carlborg
not allocated
via the GC).
It will not collect memory allocated by other means, but that Foo* you
got from D and are using in C++ might point to a Bar soon after the GC
runs.
Yes, that can happen.
--
/Jacob Carlborg
On 2017-07-12 12:18, Joel wrote:
Is there a 2D physics library I can use on macOS, with D?
I already use a multimedia library for graphics, sound and input.
Box2D [1] perhaps. I think I've seen bindings for it, somewhere.
[1] http://box2d.org
--
/Jacob Carlborg
from
happening, either
* reallocate and copy the object using the foreign code's storage
allocator or using the C runtime library's malloc/free." [2].
[1] http://dlang.org/spec/garbage.html#how_gc_works
[2] http://dlang.org/spec/garbage.html#gc_foreign_obj
--
/Jacob Carlborg
n you need
the result of an aysnc function call.
--
/Jacob Carlborg
doesn't work well for UI
applications.
It's that basically the whole idea of async/await? Seems like Microsoft
is pushing quite heavily for that in GUI code.
--
/Jacob Carlborg
l
[3] http://sdlang.org
--
/Jacob Carlborg
On 2017-07-09 23:12, bauss wrote:
I believe OSX (possibly macOS too.) only allows it from the main thread.
Yes, that's correct. But what's the difference between OSX and macOS ;)
--
/Jacob Carlborg
on Windows.
--
/Jacob Carlborg
he different formats in the dlang
blog [1] and here [2].
[1] http://dlang.org/blog/2017/06/26/project-highlight-derelict/
[2] http://derelictorg.github.io/bindings/
--
/Jacob Carlborg
able
to find anything if there is anything.
Mixing C++ and D DLLs should work. If you're statically linking the DLL,
which requires import libraries on Windows, you might have the above issue.
--
/Jacob Carlborg
lly lead to problems.
Sounds like you need a connection pool. The vibe.d [1] framework
contains connection pools.
It's also possible to manually disable the GC for a while and then
enable it again.
[1] http://vibed.org
--
/Jacob Carlborg
class was allocated on the
stack, i.e. with the "scope" keyword.
--
/Jacob Carlborg
this as easy as possible for users.
Perhaps not when targeting Windows but when targeting Linux. Can you
target a specific version of libc or do you need to use static linking?
--
/Jacob Carlborg
is required
for linking with other existing C libraries.
--
/Jacob Carlborg
a fully working
cross-compiler tool chain. You might need some extra libraries as well,
depending on what you need.
[1] https://lld.llvm.org
--
/Jacob Carlborg
l it would be a lot easier to create our own tool chain (and get full
support for static liking). Avoiding the need to download the C tool
chain to be able to use D. I've heard that many times, especially on
macOS: "oh, you need to download Xcode to use D?".
--
/Jacob Carlborg
--
/Jacob Carlborg
constructor or the struct initializer syntax to bypass the generate
methods and set the underlying storage field directly.
[1] https://github.com/jacob-carlborg/dstep/issues/151
--
/Jacob Carlborg
is that that good a
creating abstractions.
[1] http://code.dlang.org/packages/ddb
--
/Jacob Carlborg
as extern(C) we're actually calling C functions using
the D calling conventions, which just happens to work in this case
because the C and D calling conventions are mostly the same.
[1] https://github.com/nordlow/gmp-d/blob/master/src/gmp/z.d#L1164-L1165
--
/Jacob Carlborg
no point in looking
for "-lc" since the C standard library on macOS is placed in
/usr/lib/libSystem.B.dylib.
--
/Jacob Carlborg
the is going on. :-(
#0 0x7fffc770 in ?? ()
If you refer to ??, I'm guessing that's inside libdvbv5.so which might
not have been compiled with debug information enabled.
--
/Jacob Carlborg
to (without using sudo).
I expected the result of buildPath to be
"result/usr/include/libxml2/libxml".
--
/Jacob Carlborg
rdlow/gmp-d/issues/4#issuecomment-305974761
I would recommend adding the --verbose flag to see the exact commands
invoked. That will print how the D compiler was invoked. The copy-paste
the exact command and add the -v flag (for verbose). To the same with
the C compiler and the linker.
--
/Jacob Carlborg
On 2017-06-04 07:44, Jesse Phillips wrote:
What is your expected behavior? Throw an exception? You can't really
append an absolute path to another.
Of course you can. I expect buildPath("/foo", "/bar") to result in
"/foo/bar". That's how Ruby behaves.
--
/Jacob Carlborg
On 2017-06-03 16:22, David Nadlinger wrote:
We could also finally fix the frontend to get around this. At DConf
2015, Walter officially agreed that this is a bug that needs fixing. ;)
That would be nice.
--
/Jacob Carlborg
bsolute),
the preceding segments will be dropped."
I cannot find any excuse for this to be even remotely reasonable.
Unfortunately it's been like this since forever. I mean, I checked the
git history, it's been like this for as long as we have history,
including when it was called "join".
--
/Jacob Carlborg
not match template declaration
foo(alias a)()
Perhaps using the variadic template with a constraint on one element
trick will work. Ugly, but I think that will work.
--
/Jacob Carlborg
On 2017-05-16 09:39, Anonymouse wrote:
Linker --gc-sections
IIRC that only works with LDC. With DMD it's possible that it removes
sections that are used but not directly referenced.
--
/Jacob Carlborg
On 2017-05-10 18:17, Stefan Koch wrote:
It looks like this unitest-test block are treated like a function.
unittest blocks are lowered to functions.
--
/Jacob Carlborg
API across all platforms.
--
/Jacob Carlborg
way around.
--
/Jacob Carlborg
On 2017-05-07 06:01, Mike B Johnson wrote:
how many elements(virtual functions) are in the __vptr?
I guess you can use __traits(allMembers) and __traits(isVirtualMethod) [1].
[1] http://dlang.org/spec/traits.html
--
/Jacob Carlborg
t;
I see.
--
/Jacob Carlborg
nst auto b = 4; // here "auto" is redundant
const c = 5;
In your case you have "final" as the attribute.
--
/Jacob Carlborg
o define this
array using enum. What is key difference between them in this case?
Thanks. Sorry if my English is not clear.
Note that when declared as "enum", all places it's referenced, a new
associative array will be allocated.
--
/Jacob Carlborg
ments and AssignExpression".
--
/Jacob Carlborg
tion order defined but Java does.
[1] http://dsource.org/projects/dwt/wiki/Porting#Evaluationorder
--
/Jacob Carlborg
uot;); to set the mangled name of
a symbol.
--
/Jacob Carlborg
for
"sourceFiles". Perhaps remove "source/main.d"?
[1] https://github.com/jacob-carlborg/kiwi/blob/dev/dub.sdl#L11-L22
--
/Jacob Carlborg
On 2017-04-16 10:11, Joel wrote:
I've got Xcode, do I enter `xcode-select --install` in the terminal?
Yes. That will get you access to Clang, the linker and other tools on
the command line. It will also create /usr/include needed to build C/C++
code from the command line.
--
/Jacob
for a
while now.
I would appreciate any help.
For macOS I highly recommend installing Xcode from the app store and
install the command line developer tools (xcode-select --install).
--
/Jacob Carlborg
the name and the
number of parameters (shouldn't require semantic analyze?) and only do
the check for those functions that match. I would guess that would be
quite few functions that falls within that criteria. Also, only within a
single module.
--
/Jacob Carlborg
function overloading works? Is it
possible to for the compiler to report this error? At least this example
is pretty obvious for a human to see.
--
/Jacob Carlborg
. It's more difficult to know if the function should be
called or if the address of the function should be taken.
--
/Jacob Carlborg
As an ugly workaround, you can defined the "_d_dso_registry" symbol
yourself. To be sure, it should match the signature in the runtime.
--
/Jacob Carlborg
flags that Dub uses when invoking DMD when
"dub test --verbose" is run:
-debug -g -unittest -w
--
/Jacob Carlborg
useless and ought to just be removed
(or at least shortened to just the top few lines).
Thx Adam.
You might want to look at using some unit test framework/library, as
unit-threaded [1], which might give you a better experience.
[1] http://code.dlang.org/packages/unit-threaded
--
/Jacob
.
--
/Jacob Carlborg
.length]);
assert(foo.name == row["name"]);
}
executeQuery - for returning a set of rows
executeRow - for returning a single
executeNonQuery - for executing a query without any result
See the examples for more information [1].
[1] https://github.com/pszturmaj/ddb/blob/master/examples/basic.d
--
/Jacob Carlborg
On 2017-03-14 14:32, Suliman wrote:
Does it work fine on Linux with x64 Postgres?
I've tested it on macOS and Linux 64bit. Works great.
--
/Jacob Carlborg
places. Exceptions seem to only be used in the free_list module. It
also uses compile time features from Phobos.
--
/Jacob Carlborg
be possible:
1.match(
3, e => writeln("value is 3"),
(int e) => writeln("value is an integer"),
() => writeln("fallback")
);
--
/Jacob Carlborg
the same on all platforms, there might be other better suited
alternatives.
--
/Jacob Carlborg
-carlborg/orange
--
/Jacob Carlborg
ue.tupleof[i][0]" instead of "mm[0]"
as well.
--
/Jacob Carlborg
enum b = 2;
static int c = 3;
static int d = 4;
private int e_;
private int f_;
this(int e, int f) {}
static void g();
static void h();
int e() { return e_; }
int f() { return f_; }
void i();
void j();
private:
void k();
void l();
}
--
/Jacob Carlborg
pends. You can create a template mixin containing the
implementation of toString, which need to be mixed in in all structs. Or
you can create a new function that can convert any passed in structs in
a generic way. It depends on what you need the string for.
--
/Jacob Carlborg
would only use to the immutable
variable and never the enum.
enum aa = [1 : 2];
immutable int[int] iaa;
static this()
{
iaa = aa;
}
--
/Jacob Carlborg
uot;, name, mixin("s." ~ name));
The string mixin example works for methods, opDispatch and similar as
well. The tupleof example, the first one, works only for fields.
--
/Jacob Carlborg
On 2017-02-19 13:45, ketmar wrote:
nogc doesn't turn it off, if
says that compiler must ensure that *your* *code* doesn't allocate,
Just to clarify, allocate using the GC. It's perfectly fine to allocate
using malloc in a @nogc function.
--
/Jacob Carlborg
g:
import core.stdc.stdio;
class Node
{
this()
{
printf("%p\n", this);
}
}
void main()
{
new Node;
}
--
/Jacob Carlborg
gt; new FileDesc(t.value, t.index));
}
static this()
{
import std.experimental.allocator;
_fileDesc2 = theAllocator.makeArray!(FileDesc)(makeFileDescs(paths));
}
--
/Jacob Carlborg
makeFileDescs(const string[] paths)
{
return paths.enumerate!uint.map!(t => FileDesc(t.value, t.index));
}
static this()
{
import std.experimental.allocator;
_fileDesc2 = theAllocator.makeArray!FileDesc(makeFileDescs(paths));
}
--
/Jacob Carlborg
of code, e.g. one assert () in a
unittest block, would be considered not worth the time to consider as a PR?
The smaller PR the better :). There's more of an issue if the PR is too
big. But adding one assert to one unit test block in ten different PR's
might not be appropriate.
--
/Jacob Carlborg
On 2017-01-19 19:45, Suliman wrote:
It's seems that there is no any big changes in this deal.
The upcoming 2.073.0 (now in release candidate) has a completely new
default Ddoc theme.
--
/Jacob Carlborg
.
--
/Jacob Carlborg
n.
Or if the user of the library could supply the config file from the
beginning then no version statements are needed. Not sure if that's
possible though.
--
/Jacob Carlborg
or
function parameter I always think that the syntax is the same as the
declaring a regular function, but replacing the function name with
"delegate".
--
/Jacob Carlborg
taking an int, no parameter name
auto b = (Foo) => 3; // error, cannot infer type of template lambda
alias b = (Foo) => 3; // works, since this is an alias, Foo is the
parameter name of an unknown type
--
/Jacob Carlborg
ut I don't think you can disable some of the unittest blocks in a
single module.
There's also unit-threaded [1] which allows you to run specific unit tests.
[1] https://github.com/atilaneves/unit-threaded
--
/Jacob Carlborg
On 2016-12-19 13:11, biocyberman wrote:
I can write a short script to clone the remote git repo and use it as a
submodule. But if it is possible to do with dub, it will be more
convenient.
It's not currently possible.
--
/Jacob Carlborg
On 2016-12-17 21:15, bauss wrote:
I thought Tango was obsolete a long time ago.
It's a third party library like any other library.
--
/Jacob Carlborg
no luck. Is it possible to get around them?
I don't know. Seems like the -Werror flag is passed, somewhere.
--
/Jacob Carlborg
On 2016-12-17 16:51, albert-j wrote:
Since I just do "dub build", I assume it invokes dmd? I have v2.072.0.
Try an older version.
--
/Jacob Carlborg
/Log.d(349,51):
Error: undefined identifier '__va_argsave', did you mean struct
'__va_argsave_t'?
What am I missing?
It might not be compatible with that version of the compiler. Or are you
using something that is not DMD?
--
/Jacob Carlborg
enerateCommands" build setting. You can write
the script in D and invoke it using "dmd -run generate_files.d".
Remember to add -J with the path to the folder to your build script, or
use the "importPaths" build setting if you're using Dub.
--
/Jacob Carlborg
On 2016-12-12 12:15, Nicholas Wilson wrote:
there is the pure function attribute, how ever this still allows you to
use globals *if you pass them as parameters to the function*.
And it can access immutable global data.
--
/Jacob Carlborg
l produce
COFF objects and use the Visual Studio tool chain (linker and runtime).
Compiling for 64bit (-m64) will always produce COFF objects.
--
/Jacob Carlborg
("foo");
}
extern(C++) immutable(char)* getExceptionMessage(void* e)
{
if (e)
{
auto t = cast(Throwable) e;
return t.msg.ptr;
}
return null;
}
I'm compiling the C++ code with clang++ and I need to link with libc++abi.
--
/Jacob Carlborg
On 2016-11-29 07:46, Marduk wrote:
Aha! Interesting. Thanks.
Then you can call a custom method that acts as a constructor when the
instance is created this way, if there's a need for it.
--
/Jacob Carlborg
301 - 400 of 1602 matches
Mail list logo