On Saturday, 11 June 2016 at 15:46:59 UTC, Vladimir Panteleev
wrote:
Taking an address creates a function pointer, which loses the
argument names. (Doesn't it?)
unfortunatly yes, but it works as a struct or class initializer
https://dpaste.dzfl.pl/6aad852aea90
On Saturday, 11 June 2016 at 11:15:43 UTC, ArturG wrote:
On Saturday, 11 June 2016 at 09:07:43 UTC, Andrei Alexandrescu
wrote:
No, both are nice to have. If one name is needed for both,
"args" is indeed a good commonality. "Invoke function f with
these args" and "Construct an object of type T
On Saturday, 11 June 2016 at 09:07:43 UTC, Andrei Alexandrescu
wrote:
No, both are nice to have. If one name is needed for both,
"args" is indeed a good commonality. "Invoke function f with
these args" and "Construct an object of type T with these
args". The problem is it's not very intuitive
On 6/11/16 3:57 AM, Vladimir Panteleev wrote:
On Tuesday, 31 May 2016 at 06:21:03 UTC, Andrei Alexandrescu wrote:
On 5/27/16 10:17 PM, Taylor Hillegeist wrote:
On Friday, 27 May 2016 at 18:10:59 UTC, Vladimir Panteleev wrote:
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I
On Tuesday, 31 May 2016 at 06:21:03 UTC, Andrei Alexandrescu
wrote:
On 5/27/16 10:17 PM, Taylor Hillegeist wrote:
On Friday, 27 May 2016 at 18:10:59 UTC, Vladimir Panteleev
wrote:
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
Yes, though what doe
On Wednesday, 8 June 2016 at 09:19:46 UTC, John wrote:
On Friday, 27 May 2016 at 18:10:59 UTC, Vladimir Panteleev
wrote:
This is by far the most appealing way to implement named
arguments that I've seen so far:
https://github.com/CyberShadow/ae/blob/master/utils/meta/args.d
Another cool thin
On Friday, 27 May 2016 at 18:10:59 UTC, Vladimir Panteleev wrote:
This is by far the most appealing way to implement named
arguments that I've seen so far:
https://github.com/CyberShadow/ae/blob/master/utils/meta/args.d
Another cool thing this enables: object initializers.
T init(T, Args..
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
---
void main() {
import std.stdio;
writeln(obj!(
foo => "bar",
baz => 12
));
}
---
Prints out:
{
foo: bar
baz: 12
}
Pretty sna
On 5/27/16 10:17 PM, Taylor Hillegeist wrote:
On Friday, 27 May 2016 at 18:10:59 UTC, Vladimir Panteleev wrote:
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
Yes, though what does it have to do with this thread? :D
This is by far the most appeali
On Friday, 27 May 2016 at 18:10:59 UTC, Vladimir Panteleev wrote:
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
Yes, though what does it have to do with this thread? :D
This is by far the most appealing way to implement named
arguments that I've
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
Yes, though what does it have to do with this thread? :D
This is by far the most appealing way to implement named
arguments that I've seen so far:
https://github.com/CyberShadow/ae/blob/master/utils/
On 2016-05-25 20:55, Meta wrote:
Is that true? I don't claim to know exactly how the compiler works, but
given a template lambda:
foo => 3
Doesn't it generate something like the following?
template __lambda10293(T)
{
__lambda10293(T foo)
{
return 3;
}
}
In that case,
On Wednesday, 25 May 2016 at 11:22:41 UTC, Jacob Carlborg wrote:
I don't think this is the right approach. I think the correct
approach is to allow introspection of template parameters [1].
That would allow to get the parameter names without having to
instantiate the template.
Is that true? I
On 2016-05-25 13:57, Daniel N wrote:
Issue9608 is good too, but insufficient.
import std.traits;
static assert(__traits(isTemplate, a => 0));
static assert(!__traits(isTemplate, (int a) => 0));
The 2nd case can't be solved by 9608 since it's about introspecting
templates and "(int a) => 0)" is
On Wednesday, 25 May 2016 at 09:24:31 UTC, Daniel N wrote:
From an end-user perspective I find it reasonable to expect
that an API which takes lambda:s works consistently for both
below examples. i.e. if we support one we should support the
other.
[1] fun!( x => y)
[2] fun!((int x) => y)
On Tuesday, 24 May 2016 at 16:00:32 UTC, Andrei Alexandrescu
wrote:
Apparently it can be made to work with non-templates as well,
see https://dpaste.dzfl.pl/c4b7a8b6978b.
Oh, that's the buggy area. The compiler keeps parameter names for
runtime delegates... but it also reuses the structures. T
On Wednesday, 25 May 2016 at 11:22:41 UTC, Jacob Carlborg wrote:
On 2016-05-25 11:24, Daniel N wrote:
ParameterIdentifierTuple can hopefully be updated to take
advantage of this feature when it's available in compiler
without requiring to change the API of ParameterIdentifierTuple.
[1] https
On 2016-05-25 11:24, Daniel N wrote:
From an end-user perspective I find it reasonable to expect that an API
which takes lambda:s works consistently for both below examples. i.e. if
we support one we should support the other.
[1] fun!( x => y)
[2] fun!((int x) => y)
Currently I just copy/
On Tuesday, 24 May 2016 at 01:33:40 UTC, Adam D. Ruppe wrote:
On Monday, 23 May 2016 at 20:08:11 UTC, Daniel N wrote:
This pull request just removes an intentional restriction and
make this feature more easily accessible for meta-programming,
so that not everyone has to reinvent the wheel in th
On 5/23/16 3:00 PM, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
This is very creative, thanks. Definitely make it part of TWID :o).
Apparently it can be made to work with non-templates as well, see
https://dpaste.dzfl.pl/c4b7a8b6978b. Regarding applying a hack/ingenious
label, I'd ca
On 2016-05-23 21:00, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
---
void main() {
import std.stdio;
writeln(obj!(
foo => "bar",
baz => 12
));
}
---
Prints out:
{
foo: bar
baz: 12
}
A few tweaks would mak
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
---
void main() {
import std.stdio;
writeln(obj!(
foo => "bar",
baz => 12
));
}
---
[...]
This is a pretty amazing find!
It's like a better vers
On Tuesday, 24 May 2016 at 01:11:39 UTC, Meta wrote:
Clever and terrible. Now just modify the code to generate a
struct or class and you've invented new anonymous struct/object
syntax.
Indeed.
Also, I think this has revealed a bug (or deficiency) in the
compiler. If you put this inside the f
On Monday, 23 May 2016 at 20:08:11 UTC, Daniel N wrote:
This pull request just removes an intentional restriction and
make this feature more easily accessible for meta-programming,
so that not everyone has to reinvent the wheel in their own
libraries.
S I'm actually not entirely convinced
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
---
void main() {
import std.stdio;
writeln(obj!(
foo => "bar",
baz => 12
));
}
---
Prints out:
{
foo: bar
baz: 12
}
A few twea
On Tuesday, 24 May 2016 at 01:11:39 UTC, Meta wrote:
Clever and terrible. Now just modify the code to generate a
struct or class and you've invented new anonymous struct/object
syntax.
Also, I think this has revealed a bug (or deficiency) in the
compiler. If you put this inside the foreach lo
On Monday, 23 May 2016 at 19:00:40 UTC, Adam D. Ruppe wrote:
Have I gone completely mad?!?!
That makes two of us, I also use similar techniques.
Please help argue in favour of pulling this:
https://github.com/dlang/phobos/pull/3620/files
https://issues.dlang.org/show_bug.cgi?id=13780
This pu
Have I gone completely mad?!?!
---
void main() {
import std.stdio;
writeln(obj!(
foo => "bar",
baz => 12
));
}
---
Prints out:
{
foo: bar
baz: 12
}
A few tweaks would make a whole loose typed hash thing more akin
to Rub
28 matches
Mail list logo