I wonder if there's a way to add UDA to functions at compile-time
(so I can read later from other parts of application).
Andrea
On Wednesday, 26 August 2015 at 14:01:00 UTC, Alex Parrill wrote:
On Wednesday, 26 August 2015 at 08:19:04 UTC, Andrea Fontana
wrote:
I wonder if there's a way to add UDA to functions at
compile-time (so I can read later from other parts of
application).
Andrea
What do you mean? UDAs are
On Friday, 7 August 2015 at 08:18:04 UTC, Nordlöw wrote:
On Friday, 7 August 2015 at 05:21:32 UTC, Tofu Ninja wrote:
HAHAH wow, this is hilarious, I just checked, nothing in
std.algo takes advantage of sorted ranges, sort doesn't even
take advantage of it! You pass a sorted range into sort and
Check this code:
http://dpaste.dzfl.pl/a76db2cde13d
When __FUNCTION__ is called inside a foreach body, it appears to
be:
f212.myFunction.__foreachbody1
Rather than:
f212.myFunction.
Is it correct?
How can I get the function name?
On Tuesday, 28 July 2015 at 15:13:28 UTC, Steven Schveighoffer
wrote:
How can I get the function name?
Be outside foreach. The way foreach works in many cases
(including foreach over an associative array), is that the
compiler constructs an internal function delegate, then passes
it to a
It seems that PATCH http method is missing from std.net.curl http
methods.
No way to use it?
On Monday, 20 July 2015 at 13:16:43 UTC, Lemonfiend wrote:
I was still using 2.066.1.
When I try to build using 2.067.0 or 2.067.1 I get:
Linking...
checkpoint(256)
--- errorlevel 1
with an Unexpected OPTLINK Termination popup which lists a
bunch of registers.
I'm not sure how to proceed..
On Tuesday, 14 July 2015 at 10:09:56 UTC, aki wrote:
I like to create immutable object
which is identified by name as it's key.
And also need get() to look up named object
which is already created.
class Foo {
static immutable(Foo)[string] map;
string name;
// and other
On Friday, 10 July 2015 at 08:42:06 UTC, Per Nordlöw wrote:
On Friday, 10 July 2015 at 03:18:23 UTC, Mike Parker wrote:
[1]http://dlang.org/interfaceToC.html
Is there any tool out there that automatically creates D
wrappers from C headers`?
https://github.com/jacob-carlborg/dstep ?
On Tuesday, 7 July 2015 at 12:26:33 UTC, Per Nordlöw wrote:
I'm currently developing a high-level wrapper for FFMPEG at
https://github.com/nordlow/justd/blob/master/tests/t_ffmpeg.d
My question now becomes how to most easily wrap the iteration
over streams at
What's the problem with ctor taking typeof(null)?
I've just used it, maybe I missed something?
On Thursday, 28 May 2015 at 11:19:39 UTC, Vladimir Panteleev
wrote:
I'm trying to write a type which (to some extent) emulates
built-in AAs.
One thing I'm having trouble with is null function
void fun(typeof(null)) { }
?
On Thursday, 28 May 2015 at 13:06:27 UTC, Vladimir Panteleev
wrote:
On Thursday, 28 May 2015 at 12:37:52 UTC, Andrea Fontana wrote:
What's the problem with ctor taking typeof(null)?
I've just used it, maybe I missed something?
It doesn't work:
//
Check this example:
http://dpaste.dzfl.pl/53f85bae4382
Calling with null, both c-tor match.
Is there a way to solve this?
Something like:
this(in ubyte* data) if( ??? )
{
}
Andrea
The first answer is the one I was looking for. Very useful.
You should add to next this week in d tips.
On Wednesday, 27 May 2015 at 14:09:48 UTC, Adam D. Ruppe wrote:
Two options:
1) add an overload that takes typeof(null)
this(typeof(null)) { /* handles the null literal specially */ }
2)
https://github.com/CyberShadow/DustMite/wiki
On Thursday, 21 May 2015 at 08:28:30 UTC, Saurabh Das wrote:
Hello,
We have been working on a genetic programming project, and
occasionally the compiler fails and gives an internal error.
I've captured and reduced one of these down to a single
On Thursday, 7 May 2015 at 21:53:24 UTC, Per Nordlöw wrote:
On Thursday, 7 May 2015 at 13:38:23 UTC, Andrea Fontana wrote:
Because it is a more generic operation and you can work on a
lazy range.
Anyway, to sort and to do uniq it isn't the fastest way.
Or maybe I just didn't understand what
On Friday, 8 May 2015 at 09:23:42 UTC, Per Nordlöw wrote:
On Friday, 8 May 2015 at 08:27:19 UTC, Andrea Fontana wrote:
Name could be misleading. This is a sortedrange: [4,3,2,1,0].
In your case minElement is 4, maxElement is 0 :) On ranges
with more complex elements sort order can be even less
On Thursday, 7 May 2015 at 06:53:39 UTC, Per Nordlöw wrote:
On Wednesday, 6 May 2015 at 16:05:15 UTC, Andrea Fontana wrote:
Maybe a way like this could be useful:
http://dpaste.dzfl.pl/7b4b37b490a7
If r is a SortedRange this is very unneccesary wasteful because
of the use AA.
In that case
On Thursday, 7 May 2015 at 09:21:58 UTC, Per Nordlöw wrote:
On Thursday, 7 May 2015 at 08:03:41 UTC, Andrea Fontana wrote:
It's not that difficult to implement.
You just need to implement a merge() range that returns the
min of all ranges' front(). Then you can define distinct() for
On Wednesday, 6 May 2015 at 14:28:26 UTC, Adam D. Ruppe wrote:
On Wednesday, 6 May 2015 at 14:23:27 UTC, Chris wrote:
Especially this: http://vibed.org/templates/diet#embedded-code
I think that's a misfeature... if I used vibe.d, I'd want to
avoid the diet too.
I agree
On Friday, 1 May 2015 at 19:08:51 UTC, Per Nordlöw wrote:
What's the fastest Phobos-way of doing either
x ~= y; // append
x = x.uniq; // remove duplicates
or
x = (x ~ y).uniq; // append and remove duplicates in one go
provided that
T[] x, y;
?
Maybe a way like this could
On Tuesday, 28 April 2015 at 13:59:48 UTC, Ivan Kazmenko wrote:
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby
wrote:
After reading the following thread:
http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org
I wondered if it was possible to write a classic fizzbuzz[1]
My 2 cents. If I remember correctly, @ prefix in @safe,
@trusted, @system, etc was added just to avoid keywords
pollution, right?
Now UDA uses the same prefix: if some new
keywords/properties/attributes will be added to D, the same
problem will come back again... Is it a crazy idea to
Yes it is.
takeNone() take a char from a string.
So you are going to append a char (with code 5) on the next line.
If you replace that line with:
s ~= 65;
it will print A. (65 is ascii code for letter 'A')
On Tuesday, 7 April 2015 at 02:24:00 UTC, Dennis Ritchie wrote:
Hi,
Is it OK?
-
On Monday, 27 October 2014 at 22:53:57 UTC, Nordlöw wrote:
Why bidirectional range only?
popBack() only for
I mean: you should write a different version for
non-bidirectional ranges too :)
On Monday, 27 October 2014 at 16:59:19 UTC, Nordlöw wrote:
On Monday, 27 October 2014 at 12:10:59 UTC, Marc Schütz wrote:
You could add an early `return false;` if the range has length
and it is less than minLength.
See update :)
Thanks!
And you can return true if length = 1
Why
Is there any counter-indication with this:
immutable ubyte[5] stub = xb8 01 4c cd 21.representation;
?
Is it a compile time value?
On Monday, 14 July 2014 at 12:18:20 UTC, bearophile wrote:
Alexandre:
Look at line 114 of my code: http://dpaste.com/3B5WYGV
The indentations are messed up.
On Thursday, 19 June 2014 at 05:48:24 UTC, Vlad Levenfeld wrote:
I'm instantiating a couple of template structs that conflict
with each other. I'd like them to be unique types,
automatically. So I tried this:
template Foo (string unique_id = __FILE__~__LINE__.to!string)
{...}
but it didn't
On Thursday, 19 June 2014 at 07:26:12 UTC, Andrea Fontana wrote:
On Thursday, 19 June 2014 at 05:48:24 UTC, Vlad Levenfeld wrote:
I'm instantiating a couple of template structs that conflict
with each other. I'd like them to be unique types,
automatically. So I tried this:
template Foo
201 - 229 of 229 matches
Mail list logo