On Friday, 26 July 2013 at 09:12:27 UTC, Land wrote:
I'm confused when it comes to modules.
I've read somewhere that modules are basically 'singleton
classes' and that anything that doesn't need its own state
should
not needlessly be put inside a class.
But what if I want to create a simple O
On Friday, 26 July 2013 at 20:33:29 UTC, Marek Janukowicz wrote:
I have a repetitive piece of code that I'm now generating using
string mixin. I humbly ask someone more skilled with D to
review the code and help me transforming it into regular
template mixin (as I would gladly avoid string mixi
Hello
I have a repetitive piece of code that I'm now generating using
string mixin. I humbly ask someone more skilled with D to review
the code and help me transforming it into regular template mixin
(as I would gladly avoid string mixin if possible).
string flaggedAttr(string type, string n
On Friday, July 26, 2013 21:51:39 Gary Willoughby wrote:
> I'm writing a program that deals a lot with dates in unix
> timestamp format. I need to 'normalise' this timestamp to only
> give me the date and not the time. To do this i thought of using
> only midnight on that day.
>
> Here is the firs
I'm writing a program that deals a lot with dates in unix
timestamp format. I need to 'normalise' this timestamp to only
give me the date and not the time. To do this i thought of using
only midnight on that day.
Here is the first attempt to normalise these dates:
protected uint trimU
On Friday, 26 July 2013 at 17:58:21 UTC, Dmitry Olshansky wrote:
You are spot on. In case you want to further dig into Unicode
characters and properties, there is this nice tool:
http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AN%3A%5D&g=
(e.g. this link shows all of 'N' = Number char
26-Jul-2013 09:54, Meta пишет:
On Friday, 26 July 2013 at 05:06:45 UTC, Jonathan M Davis wrote:
[snip]
That makes sense. I know that the first 127 unicode characters are
equivalent to the 7-bit ASCII charset, but it confused me that the
module is named std.ascii when it actually operates on un
25-Jul-2013 22:15, Gary Willoughby пишет:
I've just read the article over at Dr Dobbs by Walter
http://www.drdobbs.com/cpp/increasing-compiler-speed-by-over-75/240158941
and this line caught my eye:
Even if you know your code well, you're likely wrong about where
the performance bottlenecks a
On Thursday, 25 July 2013 at 17:59:23 UTC, Elie Morisse wrote:
On Wednesday, 30 May 2012 at 08:13:34 UTC, Sputnik wrote:
There is a build and/or package managment system for D2 that is
working?
I googled, and I only can find things like dsss or cmaked that
don't get updated from a long time ago.
On 07/26/2013 08:33 AM, Land wrote:
> What about inheritance and interfaces,
> though? Am I supposed to put all the interface/inherited methods into
> the object
At least technically, yes. There is no other way for interfaces and
function overriding.
> and all the other, utility methods, as f
On Friday, 26 July 2013 at 15:31:06 UTC, bearophile wrote:
Dicebot:
Not possible, front is 'dchar' for char arrays:
So do I have to use foreach loops to fill a char[] lazily? :-)
Bye,
bearophile
You could also use appender. Appender supports it:
//
import std.array, std.algorithm, std
Thanks for all the replies. What about inheritance and
interfaces, though? Am I supposed to put all the
interface/inherited methods into the object and all the other,
utility methods, as free functions? Do I understand that
correctly?
Dicebot:
Not possible, front is 'dchar' for char arrays:
So do I have to use foreach loops to fill a char[] lazily? :-)
Bye,
bearophile
On Friday, 26 July 2013 at 14:46:23 UTC, bearophile wrote:
import std.range, std.algorithm;
void main() {
char[5] arr;
auto r = 5.iota.map!(i => cast(char)(i + 'a'));
static assert(is(typeof(r.front) == char)); // OK
r.copy(arr[]); // error
}
Not possible, front is 'dchar' for c
On 07/26/2013 05:13 AM, Dicebot wrote:
> On Friday, 26 July 2013 at 09:12:27 UTC, Land wrote:
>> struct Shader
>> {
>> // Field
>> // Field
>> // Field
>> }
>>
>> // Method
>> // Method
>> // Method
>> // Method
>
> I personally favor this approach whenever possible, it fits nicely
On Friday, 26 July 2013 at 14:46:23 UTC, bearophile wrote:
monarch_dodra:
I reacted to your bug entry.
Thank you very much for your comments. I am wrong all the
time... I have written a small answer.
However, copy could be improved with the knowledge that a
dchar can be streamed into a s
monarch_dodra:
I reacted to your bug entry.
Thank you very much for your comments. I am wrong all the time...
I have written a small answer.
However, copy could be improved with the knowledge that a dchar
can be streamed into a series of chars (EG, the way an
appender!(char[]) can handle
On Fri, Jul 26, 2013 at 02:48:05PM +0200, monarch_dodra wrote:
> On Friday, 26 July 2013 at 12:16:02 UTC, bearophile wrote:
> >Ali Çehreli:
> >
> >>I agree. I would expect copy to maintain the same type.
> >
> >http://d.puremagic.com/issues/show_bug.cgi?id=10718
> >
> >Bye,
> >bearophile
>
> I rea
On Friday, 26 July 2013 at 13:11:33 UTC, JS wrote:
But what about protection semantics? Access to this?
Properties? Virtual functions?
Non-public methods should not be free functions. Same goes for
virtual ones. Access to this is no different from access to first
parameter of function.
That
On Friday, 26 July 2013 at 13:11:33 UTC, JS wrote:
On Friday, 26 July 2013 at 11:58:13 UTC, John Colvin wrote:
On Friday, 26 July 2013 at 11:42:25 UTC, JS wrote:
On Friday, 26 July 2013 at 09:12:27 UTC, Land wrote:
I'm confused when it comes to modules.
I've read somewhere that modules are ba
On Friday, 26 July 2013 at 11:58:13 UTC, John Colvin wrote:
On Friday, 26 July 2013 at 11:42:25 UTC, JS wrote:
On Friday, 26 July 2013 at 09:12:27 UTC, Land wrote:
I'm confused when it comes to modules.
I've read somewhere that modules are basically 'singleton
classes' and that anything that d
On Friday, 26 July 2013 at 12:16:02 UTC, bearophile wrote:
Ali Çehreli:
I agree. I would expect copy to maintain the same type.
http://d.puremagic.com/issues/show_bug.cgi?id=10718
Bye,
bearophile
I reacted to your bug entry. I don't think copy's behavior should
be *changed*. That would vi
Ali Çehreli:
I agree. I would expect copy to maintain the same type.
http://d.puremagic.com/issues/show_bug.cgi?id=10718
Bye,
bearophile
Jonathan M Davis:
Which function you use depends on what you're trying to do.
Right. I have just added this:
http://d.puremagic.com/issues/show_bug.cgi?id=10717
Bye,
bearophile
On Friday, 26 July 2013 at 09:12:27 UTC, Land wrote:
struct Shader
{
// Field
// Field
// Field
}
// Method
// Method
// Method
// Method
I personally favor this approach whenever possible, it fits
nicely with UFCS and allows to keep data type signature clean
from unrelated st
On Friday, 26 July 2013 at 11:42:25 UTC, JS wrote:
On Friday, 26 July 2013 at 09:12:27 UTC, Land wrote:
I'm confused when it comes to modules.
I've read somewhere that modules are basically 'singleton
classes' and that anything that doesn't need its own state
should
not needlessly be put insi
On Friday, 26 July 2013 at 09:12:27 UTC, Land wrote:
I'm confused when it comes to modules.
I've read somewhere that modules are basically 'singleton
classes' and that anything that doesn't need its own state
should
not needlessly be put inside a class.
But what if I want to create a simple O
On Wednesday, 30 May 2012 at 08:13:34 UTC, Sputnik wrote:
There is a build and/or package managment system for D2 that is
working?
I googled, and I only can find things like dsss or cmaked that
don't get updated from a long time ago.
I really need to manage to get a project to compile in Windows
On 2013-07-26 11:12, Land wrote:
I'm confused when it comes to modules.
I've read somewhere that modules are basically 'singleton
classes' and that anything that doesn't need its own state should
not needlessly be put inside a class.
Modules are not singleton classes. They haven't much to do w
I'm confused when it comes to modules.
I've read somewhere that modules are basically 'singleton
classes' and that anything that doesn't need its own state should
not needlessly be put inside a class.
But what if I want to create a simple OpenGL shader object. Do I
create a class like this:
cla
On Friday, July 26, 2013 07:54:42 Meta wrote:
> Am I right in thinking that std.uni.isNumber
> will match things outside of the basic 0..9?
Yes. Expect all of the isX functions in std.uni to return true for characters
outside of ASCII.
- Jonathan M Davis
31 matches
Mail list logo