On Wednesday, 28 March 2018 at 03:07:23 UTC, Jonathan M Davis
wrote:
Run
dub test
The problem is that an executable needs a main, and a library
doesn't have one, whereas when you're testing a library, you
need an executable. So, a main must be inserted - e.g. with the
-main flag to dmd.
On Wednesday, March 28, 2018 02:16:59 Joe via Digitalmars-d-learn wrote:
> I'm trying to build a very simple library. For now it just has a
> single class, constructor, destructor and one method. I added a
> unit test right after the method, declared the targetType to be
> "library" and a
I'm trying to build a very simple library. For now it just has a
single class, constructor, destructor and one method. I added a
unit test right after the method, declared the targetType to be
"library" and a buildType of "unittest" (with options
"unittests", "debugMode", "debugInfo"). When I
On Wednesday, 28 March 2018 at 00:15:34 UTC, Per Nordlöw wrote:
Is there a way to check if a struct `S` can be initialized
using zero bits only, so that we can allocate and initialize an
array of `S` in one go using `calloc`? If not, what should such
a trait look like?
Have a look at:
On 03/27/2018 05:15 PM, Per Nordlöw wrote:
Is there a way to check if a struct `S` can be initialized using zero
bits only, so that we can allocate and initialize an array of `S` in one
go using `calloc`? If not, what should such a trait look like?
The following idea should work. One question
Is there a way to check if a struct `S` can be initialized using
zero bits only, so that we can allocate and initialize an array
of `S` in one go using `calloc`? If not, what should such a trait
look like?
On Tuesday, March 27, 2018 23:29:57 Anonymouse via Digitalmars-d-learn
wrote:
> My IRC bot is suddenly seeing crashes. It reads characters from a
> Socket into an ubyte[] array, then idups parts of that (full
> lines) into strings for parsing. Parsing involves slicing such
> strings into
My IRC bot is suddenly seeing crashes. It reads characters from a
Socket into an ubyte[] array, then idups parts of that (full
lines) into strings for parsing. Parsing involves slicing such
strings into meaningful segments; sender, event type, target
channel/user, message content, etc. I can
On Tuesday, 27 March 2018 at 22:00:42 UTC, Johan Engelen wrote:
Indeed.
Please try to manually link first (without dub) by modifying
the command on which dub errors:
```
ldmd2 -flto=thin
On Tuesday, 27 March 2018 at 13:28:08 UTC, kinke wrote:
On Monday, 26 March 2018 at 23:32:59 UTC, Nordlöw wrote:
forwarded as `-L-flto=thin` but still errors as
Which is wrong, it's not a ld command-line option (i.e., the
`-L` prefix is wrong).
Indeed.
Please try to manually link first
On Tuesday, 27 March 2018 at 19:06:38 UTC, Adam D. Ruppe wrote:
On Tuesday, 27 March 2018 at 18:56:58 UTC, Jeremy DeHaan wrote:
Are these put into the text or data segments?
Yeah, they are in the data segment as static data (just like if
you declared your own static array).
Awesome,
On Tuesday, 27 March 2018 at 18:56:58 UTC, Jeremy DeHaan wrote:
Are these put into the text or data segments?
Yeah, they are in the data segment as static data (just like if
you declared your own static array).
On Tuesday, March 27, 2018 16:16:15 Adam D. Ruppe via Digitalmars-d-learn
wrote:
> On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote:
> > it was deemed too dangerous to have in suddenly really mean
> > both scope and const, because it would potentially break a lot
> > of code.
>
>
I was doing some experiments with the runtime and I didn't notice
the TypeInfo instances being allocated by the GC. Are these put
into the text or data segments? Is there anyway to find out more
about this process?
On Tue, Mar 27, 2018 at 03:27:07AM -0600, Jonathan M Davis via
Digitalmars-d-learn wrote:
>
> Because scope has mostly done nothing (it only affected delegates), in has
> effectively been const without scope for its entire existence in D2 in spite
> of the fact that it was supposed to be the
In recent years, thanks to the rapid and continuous advancements
in the field of technology, more companies are doing businesses
across borders. Hence, language interpretation services have
become extremely crucial in today's world. There are different
types of interpretation services such as
On Tue, Mar 27, 2018 at 04:16:15PM +, Adam D. Ruppe via Digitalmars-d-learn
wrote:
> On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote:
> > it was deemed too dangerous to have in suddenly really mean both
> > scope and const, because it would potentially break a lot of code.
>
On Tuesday, 27 March 2018 at 15:38:48 UTC, Brian wrote:
but you don't understand my means, I want have keys with
multiple indeterminate names.
You can pass an associative array (or better yet, a struct
containing one) as a UDA and then use the regular loop over its
keys and values.
struct
On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote:
it was deemed too dangerous to have in suddenly really mean
both scope and const, because it would potentially break a lot
of code.
To be frank, this pisses me off to a ridiculous extent because if
it "breaks" at all... THAT
On Tuesday, 27 March 2018 at 15:28:40 UTC, jmh530 wrote:
static if (isMutable!T)
bag[0] = rhs;
else
bag = [rhs];
I like this idea. I'd even take it a step futher:
When T is a pointer or class reference, then we can put the
reference on the stack
On Monday, 26 March 2018 at 08:50:31 UTC, Simen Kjærås wrote:
On Monday, 26 March 2018 at 08:29:31 UTC, Brian wrote:
Rust sample code:
#[cfg(name = "users")]
PHP sample code:
/*
@Table(name = "users")
*/
Java sample code:
@Table(name = "users")
How to use dlang get key name?
If I
On Tuesday, 27 March 2018 at 13:51:20 UTC, jmh530 wrote:
How about:
[snip]
I can kind of like this more, but after re-reading your original
post I'm not sure it really resolves your issue:
struct Optional(T) {
import std.traits : isMutable;
T[] bag;
this(T t) inout {
On Monday, 26 March 2018 at 14:17:03 UTC, Jonathan M Davis wrote:
Rebindable does is pretty questionable as far as the type
system goes, but it does what it does by forcing pointer
semantics on a class reference, so the point is arguable.
Yeah, I've always assumed that Rebindable cannot be
On Tuesday, 27 March 2018 at 13:02:50 UTC, aliak wrote:
Hmm, now that I'm explicitly trying to produce it, I feel I
maybe using inout incorrectly?
struct Optional(T) {
T[] bag;
this(T t) {
bag = [t];
}
}
struct S {
Optional!(inout(int)) f() inout
{
return
On Monday, 26 March 2018 at 23:32:59 UTC, Nordlöw wrote:
forwarded as `-L-flto=thin` but still errors as
Which is wrong, it's not a ld command-line option (i.e., the `-L`
prefix is wrong). I don't use dub though, so I don't know how to
fix it.
On Tuesday, 27 March 2018 at 11:57:28 UTC, jmh530 wrote:
On Tuesday, 27 March 2018 at 06:26:57 UTC, aliak wrote:
[snip]
By the by, how come inout has to be stack based and
const/immutable/mutable doesn't? Isn't inout just one of those
depending on context?
Example?
Hmm, now that I'm
On Tuesday, 27 March 2018 at 11:24:01 UTC, Jonathan M Davis wrote:
On Tuesday, March 27, 2018 09:58:11 bauss via
Digitalmars-d-learn wrote:
On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis
wrote:
> [...]
So now "in" is basically just an alias and serves no real
purpose or is there
On Tuesday, 27 March 2018 at 12:17:58 UTC, Ellie Harper wrote:
Sorry if this is a stupid question, but is there something
special required to call Appender.clear? When I attempt even
just a simple use I am getting compile errors relating to
`template object.clear`.
From the documentation
On Tuesday, 27 March 2018 at 12:17:58 UTC, Ellie Harper wrote:
Sorry if this is a stupid question, but is there something
special required to call Appender.clear? When I attempt even
just a simple use I am getting compile errors relating to
`template object.clear`.
When I try:
import
On Tuesday, 27 March 2018 at 12:17:58 UTC, Ellie Harper wrote:
Sorry if this is a stupid question, but is there something
special required to call Appender.clear? When I attempt even
just a simple use I am getting compile errors relating to
`template object.clear`.
When I try:
import
On Tuesday, 27 March 2018 at 11:24:01 UTC, Jonathan M Davis wrote:
On Tuesday, March 27, 2018 09:58:11 bauss via
Digitalmars-d-learn wrote:
On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis
wrote:
> On Tuesday, March 27, 2018 09:15:43 Boris-Barboris via
>
> Digitalmars-d-learn wrote:
Sorry if this is a stupid question, but is there something
special required to call Appender.clear? When I attempt even
just a simple use I am getting compile errors relating to
`template object.clear`.
When I try:
import std.array;
void main(string[] args){
auto foo =
On Tuesday, 27 March 2018 at 06:26:57 UTC, aliak wrote:
[snip]
By the by, how come inout has to be stack based and
const/immutable/mutable doesn't? Isn't inout just one of those
depending on context?
Example?
On Tuesday, March 27, 2018 09:58:11 bauss via Digitalmars-d-learn wrote:
> On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote:
> > On Tuesday, March 27, 2018 09:15:43 Boris-Barboris via
> >
> > Digitalmars-d-learn wrote:
> >> Hello! Can someone point me to the changelong entry or
On Monday, 26 March 2018 at 22:07:49 UTC, Nordlöw wrote:
When I try build my application using LDC and -flto=thin it
fails in the final linking as
According to LDC's Release info:
Known issues:
ThinLTO may not work well with the ld.bfd linker, use ld.gold
instead (-linker=gold).
Maybe
On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote:
On Tuesday, March 27, 2018 09:15:43 Boris-Barboris via
Digitalmars-d-learn wrote:
Hello! Can someone point me to the changelong entry or maybe a
pull request, wich changed the "in" from "scope const" to
"const"? I thought the
On Tuesday, 27 March 2018 at 09:27:07 UTC, Jonathan M Davis wrote:
On Tuesday, March 27, 2018 09:15:43 Boris-Barboris via Now that
DIP 1000 is being implemented, and scope is actually going to
do something for more than just delegates, it was deemed too
dangerous to have in suddenly really
On Tuesday, March 27, 2018 09:15:43 Boris-Barboris via Digitalmars-d-learn
wrote:
> Hello! Can someone point me to the changelong entry or maybe a
> pull request, wich changed the "in" from "scope const" to
> "const"? I thought the previous matter of things was pretty
> natural, and current "in"
Hello! Can someone point me to the changelong entry or maybe a
pull request, wich changed the "in" from "scope const" to
"const"? I thought the previous matter of things was pretty
natural, and current "in" is now redundant. Would be glad to read
up on this design decision.
On Tuesday, 27 March 2018 at 08:41:41 UTC, bauss wrote:
Perhaps
https://dlang.org/phobos/std_datetime_stopwatch.html#benchmark ?
That fulfils neither of my two requirements mentioned in above;
it requires explicit iteration count given by the caller and no
automatic printing of results.
On Tuesday, 27 March 2018 at 08:18:43 UTC, Nordlöw wrote:
Have anybody implemented anything near the expressiveness and
ease of use of Rust's builtin benchmarking features
https://doc.rust-lang.org/1.16.0/book/benchmark-tests.html
I'm mostly interested in completely automatic printing of
Have anybody implemented anything near the expressiveness and
ease of use of Rust's builtin benchmarking features
https://doc.rust-lang.org/1.16.0/book/benchmark-tests.html
I'm mostly interested in completely automatic printing of results
such as
test tests::bench_add_two ... bench:
On Tuesday, 27 March 2018 at 06:34:29 UTC, ANtlord wrote:
Hello! I work using Linux.
Is it possible to use environment variables like $HOME in
option importPaths of Dub project file? I tried it but dub
concatenates the path and current path so I get something like
this
Hello! I work using Linux.
Is it possible to use environment variables like $HOME in option
importPaths of Dub project file? I tried it but dub concatenates
the path and current path so I get something like this
/develop/project/$HOME/.dub/packages/gtk-d/generated/gtkd or
On Monday, 26 March 2018 at 11:19:31 UTC, Seb wrote:
On Monday, 26 March 2018 at 10:13:08 UTC, Simen Kjærås wrote:
On Monday, 26 March 2018 at 09:46:57 UTC, Nicholas Wilson
wrote:
Have a look at Rebindable:
https://dlang.org/phobos/std_typecons.html#rebindable
Allow me to quote from aliak's
On Monday, 26 March 2018 at 21:17:10 UTC, jmh530 wrote:
On Sunday, 25 March 2018 at 21:26:57 UTC, aliak wrote:
Hi, I have this optional type I'm working on and I've run in
to a little snag when it comes to wrapping an immutable.
Basically what I want is for an Optional!(immutable T) to
still
On Monday, 26 March 2018 at 16:14:31 UTC, Jonathan wrote:
Can I send data over an std.socket on multiple threads without
manual mutexing?
If not, can I send data on a separate thread than receive?
The docs for std.socket say nothing of it (which I guess means
I should assume it is not thread
On Sunday, 25 March 2018 at 23:00:11 UTC, Simen Kjærås wrote:
On Sunday, 25 March 2018 at 21:26:57 UTC, aliak wrote:
struct Optional(T) {
Unqual!T value;
opAssign(T t) {
value = cast(Unqual!T)(t);
}
}
Consider this case:
Optional!(immutable int) a = some(3);
immutable int* p =
a =
48 matches
Mail list logo