On 2013-10-02 04:10, Nick Sabalausky wrote:
I thought variable.init was different from T.init and gave the value of
the explicit initializer if one was used. Was I mistaken?:
Yes.
--
/Jacob Carlborg
On Wednesday, October 02, 2013 12:32:24 Alexandr Druzhinin wrote:
> Is it safe to replace code:
>
> uint index;
> // do something
> index++;
> if(index == index.max)
> index = index.init;
>
> by the following code
> uint index;
> // do something
> index++; /// I use unsigned int so uint.max chang
Is it safe to replace code:
uint index;
// do something
index++;
if(index == index.max)
index = index.init;
by the following code
uint index;
// do something
index++; /// I use unsigned int so uint.max changed to 0 automagically
Thanks in advance
On Tuesday, October 01, 2013 21:32:05 qznc wrote:
> On Sunday, 29 September 2013 at 07:49:21 UTC, Jonathan M Davis
>
> wrote:
> > I confess that I don't understand why so many people are
> > fixated on having a
> > standard style, particularly when it's very, very clear that
> > most everyone
> >
On Wednesday, October 02, 2013 03:19:19 Jesse Phillips wrote:
> On Tuesday, 1 October 2013 at 19:32:08 UTC, qznc wrote:
> > On Sunday, 29 September 2013 at 07:49:21 UTC, Jonathan M Davis
> >
> > wrote:
> >> I confess that I don't understand why so many people are
> >> fixated on having a
> >> stan
I thought variable.init was different from T.init and gave the value of
the explicit initializer if one was used. Was I mistaken?:
import std.stdio;
void main()
{
int a = 5;
writeln(a.init); // Outputs 0, not 5
}
On Sun, 29 Sep 2013 16:31:14 +0200
"linkrope" wrote:
> I want to pretty-print the representation of a value of a generic
> type T.
> In Ruby, I would use 'pp':
>
> value = 'hello'
> pp value # prints "hello" - with quotes!
> value = 42
> pp value # prints 42
>
> Now, valu
On Tuesday, 1 October 2013 at 03:01:32 UTC, evilrat wrote:
AFAIK people rarely use interface files this days, one reason
is templates which needs instantiated in ur code but it won't
be able to put them in interface files.
(though i may be wrong on it)
The interface file needs the entire temp
On Tuesday, 1 October 2013 at 19:32:08 UTC, qznc wrote:
On Sunday, 29 September 2013 at 07:49:21 UTC, Jonathan M Davis
wrote:
I confess that I don't understand why so many people are
fixated on having a
standard style, particularly when it's very, very clear that
most everyone
disagrees on what
monarch_dodra:
%r is already taken: It means "raw". It's used as a way to use
formatting, even when writing in a binary file. You can even
use "%+r" and "%-r" to specify the endian-ness you want to
write in. It's fun. Makes writing file headers *real* easy.
I didn't know that -.-
Bye,
bearo
On Tuesday, 1 October 2013 at 19:47:16 UTC, linkrope wrote:
On Tuesday, 1 October 2013 at 07:30:06 UTC, Jacob Carlborg
wrote:
On 2013-09-30 23:56, bearophile wrote:
Surely Phobos should add a prettyPrinting() function, like
the function
of Python standard library.
I would rather have functi
On Tuesday, 1 October 2013 at 07:30:06 UTC, Jacob Carlborg wrote:
On 2013-09-30 23:56, bearophile wrote:
Surely Phobos should add a prettyPrinting() function, like the
function
of Python standard library.
I would rather have function that generates a pretty
representation of a given value.
On Monday, 30 September 2013 at 23:27:48 UTC, bearophile wrote:
Inspired by a talk by Eden in the StrangeLoop 2013 conference,
I'd like to create a new small Rosettacode Task. Perhaps
someone here is able to review this task description a little,
or even to implement the D solution:
- - - -
On Sunday, 29 September 2013 at 07:49:21 UTC, Jonathan M Davis
wrote:
I confess that I don't understand why so many people are
fixated on having a
standard style, particularly when it's very, very clear that
most everyone
disagrees on what counts as good style. What little we have in
terms of o
On 10/01/13 19:56, Dicebot wrote:
> Definition of common type is pretty simple - it is a type both types can be
> implicitly converted to.
It's a bit more complicated, even for the simple cases - for example two types
that implicitly convert to a narrower type can (and usually should) have a
diff
On Tuesday, 1 October 2013 at 17:58:58 UTC, Jacob Carlborg wrote:
On 2013-10-01 18:03, Gary Willoughby wrote:
Are there any plans to allow rdmd to emit object files?
I ask because i have a debugger id like to use that uses
object files
and my project is of sufficient complexity that rdmd is ne
On Tuesday, 1 October 2013 at 17:56:17 UTC, Dicebot wrote:
Definition of common type is pretty simple - it is a type both
types can be implicitly converted to. For `int` and `BigInt`
common type should be `BigInt` if it was possible to define
that implicit conversion. AFAIK it is not possible a
On Tuesday, 1 October 2013 at 09:21:44 UTC, John Colvin wrote:
On Monday, 30 September 2013 at 21:24:28 UTC, linkrope wrote:
But putting quotes around a string value is obviously not
enough.
What if the string contains a quote? "hell\"o" would become
`"hell"o"`!
Would would you want it be bec
On 2013-10-01 18:03, Gary Willoughby wrote:
Are there any plans to allow rdmd to emit object files?
I ask because i have a debugger id like to use that uses object files
and my project is of sufficient complexity that rdmd is needed to
correctly compile the dependencies.
What happens if you pa
Definition of common type is pretty simple - it is a type both
types can be implicitly converted to. For `int` and `BigInt`
common type should be `BigInt` if it was possible to define that
implicit conversion. AFAIK it is not possible and thus they can't
have common type.
On 09/28/13 17:34, Eberhard wrote:
> I came across this unexpected error in the first example, so I tested similar
> scenarios, but couldn't make any sense of it.
The symbols are looked up in parent scope first, the implicit
conversion happens later.
I'm not sure what the right order /should/ be;
On 10/01/13 12:50, Joseph Rushton Wakeling wrote:
> (4) Is there a good reason why there _shouldn't_ be a CommonType of (say) int
> and BigInt?
Define "CommonType". Ie it's a question of definition, and the language
does not have sufficient means to easily enough express that concept
("interface
Are there any plans to allow rdmd to emit object files?
I ask because i have a debugger id like to use that uses object
files and my project is of sufficient complexity that rdmd is
needed to correctly compile the dependencies.
On Saturday, 31 August 2013 at 12:01:48 UTC, Dicebot wrote:
On Friday, 30 August 2013 at 13:32:25 UTC, eles wrote:
On Friday, 30 August 2013 at 11:34:59 UTC, Jacob Carlborg
wrote:
On 2013-08-30 09:39, eles wrote:
This is an ancient dmd misfeature - it treats `dmd test` as
`dmd test.d`, adding
On Thursday, 26 September 2013 at 23:08:15 UTC, David Nadlinger
wrote:
On Wednesday, 25 September 2013 at 15:32:08 UTC, Lemonfiend
wrote:
The docs only mention
http://assimp.sourceforge.net/lib_html/config_8h.html#afc0a4c00fb90c345eb38fe3f7d7c8637
which is less than helpful..
I'm not sure wha
P.S. adding implicit conversion other way around is possible via
`alias this` but I don't think it is a valid behavior. (as common
type of (`long`, `int`, `short`) is `long`)
On Tuesday, 1 October 2013 at 10:50:39 UTC, Joseph Rushton
Wakeling wrote:
Hello all,
In the course of examining std.rational I've had to take a look
inside std.traits.CommonType, and I'm hoping people can help me
to understand some fine details which I'm currently unsure of.
The essence of
On Tuesday, 1 October 2013 at 10:50:39 UTC, Joseph Rushton
Wakeling wrote:
(1) Can someone please explain to me _in detail_ the mechanics
of the code which identifies whether the first 2 template
arguments have a common type?
I understand what it does, but not why/how it does it, if you
get m
On Tuesday, 1 October 2013 at 10:50:39 UTC, Joseph Rushton
Wakeling wrote:
(1) Can someone please explain to me _in detail_ the mechanics
of the code which identifies whether the first 2 template
arguments have a common type?
I understand what it does, but not why/how it does it, if you
get m
Hello all,
In the course of examining std.rational I've had to take a look inside
std.traits.CommonType, and I'm hoping people can help me to understand some fine
details which I'm currently unsure of.
The essence of the CommonType template is simple:
* If it is passed no arguments, the
On Tuesday, 1 October 2013 at 09:21:44 UTC, John Colvin wrote:
On Monday, 30 September 2013 at 21:24:28 UTC, linkrope wrote:
But putting quotes around a string value is obviously not
enough.
What if the string contains a quote? "hell\"o" would become
`"hell"o"`!
Would would you want it be bec
On Monday, 30 September 2013 at 21:24:28 UTC, linkrope wrote:
But putting quotes around a string value is obviously not
enough.
What if the string contains a quote? "hell\"o" would become
`"hell"o"`!
Would would you want it be become?
Jacob Carlborg:
I would rather have function that generates a pretty
representation of a given value. Then it either can be used to
print the representation or something else.
That's the point of the Python pprint() (pretty print) function
:-)
Bye,
bearophile
On 2013-09-30 23:56, bearophile wrote:
Surely Phobos should add a prettyPrinting() function, like the function
of Python standard library.
I would rather have function that generates a pretty representation of a
given value. Then it either can be used to print the representation or
something
34 matches
Mail list logo