On Thursday, 9 February 2017 at 05:40:01 UTC, Jonathan M Davis
wrote:
with(import std.datetime)
auto foo(SysTime st1, SysTime st2, Duration d);
There is of course the middle way: with(from!q{std.datetime})
I would love to be able to use `with` and have the language
accept it in a wider range
On Thursday, 9 February 2017 at 05:40:01 UTC, Jonathan M Davis
wrote:
On Friday, February 03, 2017 14:43:01 Dominikus Dittes Scherkl
via Digitalmars-d wrote:
Any thoughts?
This is really cool, but I have a couple of concerns about this
and how it seems deficient in comparison to DIP 1005. I
On Thursday, 9 February 2017 at 05:40:01 UTC, Jonathan M Davis
wrote:
auto func(alias pred, R)(R range)
if(from!"std.range.primitives".isInputRange!R &&
is(typeof(pred(range.front)) == bool))
{...}
but you can't import std.range.primitives.front to make dynamic
arrays work, whereas w
On Friday, 10 February 2017 at 13:28:43 UTC, Dominikus Dittes
Scherkl wrote:
Sorry, accidentally hit some key-combination that immediately
send the message that was not yet complete.
With my original proposal you would write
auto foo(foo.SysTime st1,
foo.SysTime st2,
foo.Dur
On Thursday, 9 February 2017 at 05:40:01 UTC, Jonathan M Davis
wrote:
On Friday, February 03, 2017 14:43:01 Dominikus Dittes Scherkl
via Digitalmars-d wrote:
Any thoughts?
This is really cool, but I have a couple of concerns about this
and how it seems deficient in comparison to DIP 1005.
Of
On Thursday, 9 February 2017 at 05:40:01 UTC, Jonathan M Davis
wrote:
The import is only listed once, whereas with this technique,
you have to list it for each symbol. e.g.
auto foo(from!"std.datetime".SysTime st1,
from!"std.datetime".SysTime st2,
from!"std.datetime".Duration
On Friday, February 03, 2017 14:43:01 Dominikus Dittes Scherkl via
Digitalmars-d wrote:
> Any thoughts?
This is really cool, but I have a couple of concerns about this and how it
seems deficient in comparison to DIP 1005. I mentioned it in Andrei's PR for
this, but no one has responded to my comm
On 2/7/2017 7:00 AM, Andrea Fontana wrote:
I don't understand why we can't use a template like:
auto fun_time(SysTime)(SysTime tm)
{
import std.datetime;
static assert (is(SysTime == std.datetime.SysTime));
return tm;
}
void main()
{
import std.stdio;
import std.datetime;
fun
On Tue, 07 Feb 2017 15:00:17 +, Andrea Fontana wrote:
> I don't understand why we can't use a template like:
You can. However, that makes things awkward when you want to pass that as
a delegate. It makes it awkward to read. You don't get to specify the
return type unless it happens to be the
On Tuesday, 7 February 2017 at 15:00:17 UTC, Andrea Fontana wrote:
...
I think I misunderstood your comment. Please forgive the noise.
I need more coffee
On Tuesday, 7 February 2017 at 15:00:17 UTC, Andrea Fontana wrote:
I don't understand why we can't use a template like:
auto fun_time(SysTime)(SysTime tm)
{
import std.datetime;
static assert (is(SysTime == std.datetime.SysTime));
return tm;
}
void main()
{
import std.stdio;
imp
On Friday, 3 February 2017 at 15:41:56 UTC, Daniel N wrote:
On Friday, 3 February 2017 at 14:43:01 UTC, Dominikus Dittes
Scherkl wrote:
DIP 1005 provides new syntax to make it possible to avoid
global imports.
Any thoughts?
I like it!
template imp(string mod)
{
mixin("import imp = " ~ mod
On Saturday, 4 February 2017 at 11:56:52 UTC, Stefan Koch wrote:
please refrain from insulting string-mixins.
they are by far the most understandable of meta-programming
facilities.
Most understandable don't mean "good to use". We can do many
things with it but it's really hack and easy way t
On Saturday, 4 February 2017 at 11:50:50 UTC, crimaniak wrote:
On Friday, 3 February 2017 at 21:23:22 UTC, Daniel Nielsen
wrote:
I just had to try one more thing. It never ceases to amaze me
what is possible in D today.
Yes, all except of good IDE and tooling.
template imp(string mod) { m
On Friday, 3 February 2017 at 21:23:22 UTC, Daniel Nielsen wrote:
I just had to try one more thing. It never ceases to amaze me
what is possible in D today.
Yes, all except of good IDE and tooling.
template imp(string mod) { mixin("import imp = " ~ mod ~ ";"); }
... because of string mixin
On Friday, 3 February 2017 at 20:04:22 UTC, Daniel Nielsen wrote:
On Friday, 3 February 2017 at 19:14:16 UTC, Andrei Alexandrescu
wrote:
Wow. This is... brilliant. Thanks for the great idea. I ran a
few tests and it seems to be doing out of the box most of what
we want with DIP1005 with no la
On Friday, 3 February 2017 at 19:14:16 UTC, Andrei Alexandrescu
wrote:
Wow. This is... brilliant. Thanks for the great idea. I ran a
few tests and it seems to be doing out of the box most of what
we want with DIP1005 with no language change at all.
Congratulations!
Andrei
Thank you very
On 2/3/17 2:14 PM, Andrei Alexandrescu wrote:
On 2/3/17 10:41 AM, Daniel N wrote:
On Friday, 3 February 2017 at 14:43:01 UTC, Dominikus Dittes Scherkl
wrote:
DIP 1005 provides new syntax to make it possible to avoid global
imports.
Any thoughts?
I like it!
template imp(string mod)
{
mixin(
On 2/3/17 10:41 AM, Daniel N wrote:
On Friday, 3 February 2017 at 14:43:01 UTC, Dominikus Dittes Scherkl wrote:
DIP 1005 provides new syntax to make it possible to avoid global imports.
Any thoughts?
I like it!
template imp(string mod)
{
mixin("import imp = " ~ mod ~ ";");
}
auto fun_time(
On Fri, 03 Feb 2017 14:43:01 +, Dominikus Dittes Scherkl wrote:
> fun.ST fun()
> {
> import someModule.SomeType;
> alias ST = SomeType;
> ...
> }
What compiler version is this? I'm getting segfaults with both 2.072.2 and
2.073.0.
Reported as https://issues.dlang.org/show_bug.cgi?
On Friday, 3 February 2017 at 14:59:09 UTC, rikki cattermole
wrote:
On 04/02/2017 3:43 AM, Dominikus Dittes Scherkl wrote:
DIP 1005 provides new syntax to make it possible to avoid
global imports.
But this can already be worked around with some nice trick:
Any thoughts?
Needless syntax sugar:
On Friday, 3 February 2017 at 14:43:01 UTC, Dominikus Dittes
Scherkl wrote:
DIP 1005 provides new syntax to make it possible to avoid
global imports.
Any thoughts?
I like it!
template imp(string mod)
{
mixin("import imp = " ~ mod ~ ";");
}
auto fun_time(imp!"std.datetime".SysTime tm)
{
r
On 04/02/2017 3:43 AM, Dominikus Dittes Scherkl wrote:
DIP 1005 provides new syntax to make it possible to avoid global imports.
Till now global imports are necessary if a function uses types declared
in some imported module within it's declaration or definition (otherwise
a local import will do)
DIP 1005 provides new syntax to make it possible to avoid global
imports.
Till now global imports are necessary if a function uses types
declared in some imported module within it's declaration or
definition (otherwise a local import will do).
But this can already be worked around with some ni
24 matches
Mail list logo