On 04/18/2017 02:48 AM, Jethro wrote:
I generally need this for regex stuff and it's quite annoying it doesn't
work.
if (!match(s, "\s*(?P.),").empty())
{
// Need the result of match to do things!
}
but this doesn't work:
if (!(auto r = match(s, "\s*(?P.),")).empty())
{
}
Stanislav Blinov
On Thursday, 13 April 2017 at 21:06:52 UTC, Jesse Phillips wrote:
I realize that this is likely really pushing the compile time
generation but a recent change to the switch statement[1] is
surfacing because of this usage.
uninitswitch2.d(13): Deprecation: 'switch' skips declaration of
variabl
On Monday, 17 April 2017 at 08:48:06 UTC, Jacob Carlborg wrote:
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
nee
Would be prettier as a language feature, but still:
template test(alias pred)
{
import std.functional : unaryFun;
alias P = unaryFun!pred;
auto test(R)(R r)
{
struct Test
{
R v;
string toString()
{
import std.co
On Monday, 17 April 2017 at 19:15:06 UTC, Nordlöw wrote:
What's the plan for the recent adding __equal overloads at
https://github.com/dlang/druntime/pull/1808/files
Is it only meant for runtime and phobos to be updated? Or does
user-libraries, such as container libraries, need to be updated
How to combine the need to localize a result for an if statement
and have to call a method to get proper comparison:
if (((auto x = X.value()).empty())
{
}
instead of having to do the long and winded way
auto x = X.value();
if (x.empty())
{
}
Many times I need the result of a function insid
On Monday, 17 April 2017 at 19:15:06 UTC, Nordlöw wrote:
What's the plan for the recent adding __equal overloads at
https://github.com/dlang/druntime/pull/1808/files
Is it only meant for runtime and phobos to be updated? Or does
user-libraries, such as container libraries, need to be updated
On Sunday, 16 April 2017 at 08:20:21 UTC, Russel Winder wrote:
There are points when you need to ask someone for help…
I am trying to get Dub to build integration tests from
test-source as a separate thing from building unit tests from
source. The latter is easy and works, as does building the
On 04/17/2017 09:29 PM, Jesse Phillips wrote:
On Thursday, 13 April 2017 at 21:33:28 UTC, ag0aep6g wrote:
[...]
By the way, in my opinion, `case li[0]:` shouldn't compile with the
static immutable `list`. `list` and `li[0]` are dynamic values. The
compiler only attempts (and succeeds) to evalua
On 04/17/2017 12:33 PM, H. S. Teoh via Digitalmars-d-learn wrote:
On Mon, Apr 17, 2017 at 12:05:19PM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
[...]
auto byNode(const(Tree) tree) {
alias RangeType = typeof(byNode(tree.root));
Could this possibly be simplified to:
alias Ra
On Monday, April 17, 2017 19:39:25 Stanislav Blinov via Digitalmars-d-learn
wrote:
> On Monday, 17 April 2017 at 19:00:44 UTC, Jonathan M Davis wrote:
> > Because otherwise, it's not acting like a reference to the
> > original range, which is the whole point of RefRange. The
> > correct solution w
On Mon, Apr 17, 2017 at 12:05:19PM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
[...]
> auto byNode(const(Tree) tree) {
> alias RangeType = typeof(byNode(tree.root));
Could this possibly be simplified to:
alias RangeType = typeof(return);
?
Or does that cause a circular depend
On Monday, 17 April 2017 at 19:00:44 UTC, Jonathan M Davis wrote:
Because otherwise, it's not acting like a reference to the
original range, which is the whole point of RefRange. The
correct solution would probably be to @disable opAssign in the
case where the original range can't be overwritt
On Thursday, 13 April 2017 at 21:33:28 UTC, ag0aep6g wrote:
That's not a static foreach. It's a normal run-time foreach.
The switch jumps into the loop body without the loop head ever
executing. The compiler is correct when it says that
initialization of li is being skipped.
Good good. I did
What's the plan for the recent adding __equal overloads at
https://github.com/dlang/druntime/pull/1808/files
Is it only meant for runtime and phobos to be updated? Or does
user-libraries, such as container libraries, need to be updated
aswell?
On 04/17/2017 11:30 AM, Russel Winder via Digitalmars-d-learn wrote:
I find myself in need of constructing an empty Result object. I tried
takeNone!Result, but obviously the type Result doesn't appear to exist.
Anyone any ideas?
(Not a complete solution; just sharing your pain.)
I had the sam
On Monday, April 17, 2017 18:45:46 Jerry via Digitalmars-d-learn wrote:
> On Monday, 17 April 2017 at 18:07:36 UTC, Jonathan M Davis wrote:
> > In this particular case, it looks like the main problem is
> > RefRange's opAssign. For it to work, the type needs to be
> > copyable. It might be reasonab
On Monday, 17 April 2017 at 18:07:36 UTC, Jonathan M Davis wrote:
In this particular case, it looks like the main problem is
RefRange's opAssign. For it to work, the type needs to be
copyable. It might be reasonable for RefRange to be enhanced so
that it doesn't compile in opAssign if the range
On Monday, 17 April 2017 at 18:07:36 UTC, Jonathan M Davis wrote:
Non-copyable types tend to wreak havoc with things
- Jonathan M Davis
Basicly what I use this for is to combine RAII with ranges.
Which I find quite useful when doing DB queries and the data is
lazily fetched
since this allows m
I find myself in need of constructing an empty Result object. I tried
takeNone!Result, but obviously the type Result doesn't appear to exist.
Anyone any ideas?
--
Russel.
=
Dr Russel Winder t: +44 20 7585 2200 voip
On Monday, April 17, 2017 17:23:32 Jerry via Digitalmars-d-learn wrote:
> Hello guys, so I wanted to have a noncopyable range on the stack.
> So my thoughts was to make it non copyable and use refRange
> whenever I want to use it with map and others.
>
> But I got a compiler warning when doing so l
On Mon, 2017-04-17 at 11:03 +0200, Jacob Carlborg via Digitalmars-d-
learn wrote:
Thanks for the pointers to the example, I shall peruse.
I now have the SCons build working fine (OK so there are bugs in the
application code highlighted by the integration test bugs), so the D
code is not wrong. Th
Hello guys, so I wanted to have a noncopyable range on the stack.
So my thoughts was to make it non copyable and use refRange
whenever I want to use it with map and others.
But I got a compiler warning when doing so like this:
import std.range;
void main() {
NonCopyable v;
On Monday, 17 April 2017 at 14:23:50 UTC, Jonathan M Davis wrote:
So, if you're okay with explicitly instantiating your variadic
function template instead of having the types inferred, then it
Yes, it's my case. That's a game engine, so some kilobytes isn't
a problem.
Moreover, possible that fu
On Monday, April 17, 2017 13:45:18 Dmitry via Digitalmars-d-learn wrote:
> On Monday, 17 April 2017 at 10:55:30 UTC, Jonathan M Davis wrote:
> > They works, but it results in a new template being instantiated
> > for every call, so you really shouldn't use __FILE__ or
> > __LINE__ as template argum
On Monday, 17 April 2017 at 10:02:22 UTC, Suliman wrote:
New question. Can I put result of filtering in itself without
creation of new variables like x:
auto x =
MySQLTablesRange.array.filter!(a=>a[0].coerce!string.canFind("_"));
No. filter is simply a wrapper around the source range, it doe
On Monday, 17 April 2017 at 10:55:30 UTC, Jonathan M Davis wrote:
They works, but it results in a new template being instantiated
for every call, so you really shouldn't use __FILE__ or
__LINE__ as template arguments if you can avoid it.
Does it matter if I anyway use template (S...) ?
And what
thank you all! i will try
On Monday, 17 April 2017 at 11:51:45 UTC, dennis wrote:
Hi,
try to build a little programm, but need to know
how to check the input.
For example: input only numbers: 0 - 9 but 1.5 for example is
ok.
thanks
I will point you to Ali's book (free), it goes through the basics
of input and out
On Monday, 17 April 2017 at 11:51:45 UTC, dennis wrote:
Hi,
try to build a little programm, but need to know
how to check the input.
For example: input only numbers: 0 - 9 but 1.5 for example is
ok.
thanks
How I would do it:
Run a loop, checking if the characters in input are within the
Hi,
try to build a little programm, but need to know
how to check the input.
For example: input only numbers: 0 - 9 but 1.5 for example is ok.
thanks
On Friday, 14 April 2017 at 15:53:18 UTC, Rene Zwanenburg wrote:
On Friday, 14 April 2017 at 15:42:33 UTC, Suliman wrote:
On Friday, 14 April 2017 at 15:40:18 UTC, Rene Zwanenburg
wrote:
On Friday, 14 April 2017 at 15:31:21 UTC, Suliman wrote:
On Friday, 14 April 2017 at 15:22:49 UTC, Rene Zwan
On Monday, April 17, 2017 10:58:36 Basile B. via Digitalmars-d-learn wrote:
> On Monday, 17 April 2017 at 10:55:30 UTC, Jonathan M Davis wrote:
> > On Monday, April 17, 2017 10:30:35 Basile B. via
> >
> > Digitalmars-d-learn wrote:
> >> On Monday, 17 April 2017 at 10:22:47 UTC, Dmitry wrote:
> > vo
On Monday, 17 April 2017 at 10:55:30 UTC, Jonathan M Davis wrote:
On Monday, April 17, 2017 10:30:35 Basile B. via
Digitalmars-d-learn wrote:
On Monday, 17 April 2017 at 10:22:47 UTC, Dmitry wrote:
void error(string msg, string file = __FILE__, size_t line =
__LINE__)
{
...
}
That's what
On Monday, April 17, 2017 10:30:35 Basile B. via Digitalmars-d-learn wrote:
> On Monday, 17 April 2017 at 10:22:47 UTC, Dmitry wrote:
> > Hi there.
> >
> > Currently for messages about errors I use code like this:
> > void add(string name, ref Scene scene)
> > {
> >
> > if (name in
On Monday, 17 April 2017 at 10:30:35 UTC, Basile B. wrote:
when used as template value parameter, __FILE__ and
__LINE__evaluate to the file and line of the call site. So help
yourself ans use something like this:
void error(string f = __FILE__, int l = __LINE__)(string msg){}
Thank you, Basi
On Monday, 17 April 2017 at 10:22:47 UTC, Dmitry wrote:
Hi there.
Currently for messages about errors I use code like this:
void add(string name, ref Scene scene)
{
if (name in listOfScenes)
{
EError(__FILE__, __LINE__, "scene already
exists".L, quoted(name)
Hi there.
Currently for messages about errors I use code like this:
void add(string name, ref Scene scene)
{
if (name in listOfScenes)
{
EError(__FILE__, __LINE__, "scene already exists".L,
quoted(name));
}
...
}
Is there way for avoid using
New question. Can I put result of filtering in itself without
creation of new variables like x:
auto x =
MySQLTablesRange.array.filter!(a=>a[0].coerce!string.canFind("_"));
I am writing lambda function. I need filter data at first step
and than do dome operation on them (for start simply print on the
screen. I wrote next code:
MySQLTablesRange.filter!(a=>a[0].coerce!string.canFind("_")).each!(a =>
to!int(a[0].coerce!string.split("_")[1]).writeln);
But it's seem
On 2017-04-16 10:20, Russel Winder via Digitalmars-d-learn wrote:
There are points when you need to ask someone for help…
I am trying to get Dub to build integration tests from test-source as a
separate thing from building unit tests from source. The latter is easy
and works, as does building th
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 Carlbo
The report below was about using ldc2 on Fedora Rawhide. I get the same
problem using dmd on Debian Sid. So I guess we are looking at Dub (and
likely my use it it and dub.sdl file) as the problem.
On Sun, 2017-04-16 at 09:20 +0100, Russel Winder wrote:
> There are points when you need to ask someo
On Sun, 2017-04-16 at 12:04 +0300, drug via Digitalmars-d-learn wrote:
>
[…]
> Try to add version for `integrationtest` to exclude `main` from
> building
> like you did with unittests version. In dub.sdl add versions
> "integrationtests" for correspondence configuration and in
> `source\main.d`
44 matches
Mail list logo