On Thursday, 28 June 2012 at 07:43:58 UTC, Jonathan M Davis wrote:
On Thursday, June 28, 2012 09:29:14 Alex Rønne Petersen wrote:
On 27-06-2012 23:31, Jonathan M Davis wrote:
> On Wednesday, June 27, 2012 23:00:58 nazriel wrote:
>> On Wednesday, 27 June 2012 at 08:53:14 UTC, Andrea Fontana
>> w
On Sunday, 27 May 2012 at 14:04:48 UTC, Dmitry Olshansky wrote:
IMHO if you use annotations for *this* then your language is as
good as dead.
There are far better things to aim annotations at.
I couldn't say it better. @switch might have some utility in rare
cases in a language with pattern
On Saturday, June 30, 2012 19:00:29 Walter Bright wrote:
> On 6/30/2012 6:05 PM, bearophile wrote:
> > Walter Bright:
> >> It's not a bug. It's deliberate, and is there to support mechanical
> >> translation of Java code.
> >
> > Is this stuff written somewhere in a D design rationales page?
> >
On 6/30/2012 6:05 PM, bearophile wrote:
Walter Bright:
It's not a bug. It's deliberate, and is there to support mechanical
translation of Java code.
Is this stuff written somewhere in a D design rationales page?
Now that D is several years old, how much Java code was ported to D? (Despite
th
Walter Bright:
It's not a bug. It's deliberate, and is there to support
mechanical translation of Java code.
Is this stuff written somewhere in a D design rationales page?
Now that D is several years old, how much Java code was ported to
D? (Despite there is no mechanical Java->D translator
On 5/27/2012 6:13 AM, bearophile wrote:
Currently this D2 code compiles:
void main() {
int x = 2;
int y = 2;
switch(x) {
case 1: break;
case y: break;
default:
}
}
I think that accepting that "case y" is a compiler bug, because y is a run-time
valu
On 6/30/12 11:15 AM, Monarch Dodra wrote:
On Saturday, 30 June 2012 at 14:22:06 UTC, Andrei Alexandrescu wrote:
2) The new range is defined as a fixed length from the beginning of the
range, as opposed to start and finish points. If I were to insert new
items into my Slist, the new range would j
2012/7/1 d coder :
> Thanks Kenji, I will use xformat. BTW, why is it named "x"format? Would not
> "s"format be a better name? Where "s" could stand for string.
eXtended format.
> Also I feel, std.string.format should work for BitArray and BigInt too. Both
> these types are defined as part of pho
Thanks Kenji, I will use xformat. BTW, why is it named "x"format? Would not
"s"format be a better name? Where "s" could stand for string.
Also I feel, std.string.format should work for BitArray and BigInt too.
Both these types are defined as part of phobos.
Regards
- Puneet
std.string.format uses std.format.doFormat, and it is based on RTTI.
On the other hand, writeln/writefln uses std.format.formattedWrite and
formatValue, they are based on Compile Time Reflection.
So the results are different.
In 2.060head, std.string.xformat is added, and it works as like writefln
I have files a phobos bug report.
http://d.puremagic.com/issues/show_bug.cgi?id=8326
Regards
- Puneet
Greetings
std.string.format throws runtime exception for BigInt and for BitArray
types even though writefln works fine. The run-time error says
std.format.FormatException@std/format.d(4744): Can't convert
std.bigint.BigInt to string: "string toString()" not defined
Here is a small test case.
Reg
On wiki? Other projects have that list on homepage!!
On Thursday, 28 June 2012 at 16:15:35 UTC, Graham Fawcett wrote:
On Thursday, 28 June 2012 at 16:02:43 UTC, Jakob Bornecrantz
wrote:
On Thursday, 28 June 2012 at 07:38:19 UTC, Andrea Fontana
wrote:
In production it's just a way to say "comple
On Saturday, 30 June 2012 at 14:22:06 UTC, Andrei Alexandrescu
wrote:
2) The new range is defined as a fixed length from the
beginning of the
range, as opposed to start and finish points. If I were to
insert new
items into my Slist, the new range would just bump the top
items out of
its range.
On 6/30/12 9:15 AM, Dmitry Olshansky wrote:
On 30-Jun-12 15:35, Tobias Pankrath wrote:
Say I have a forward range (for example, an SList[]). I would like to
create a new range containing only the first 5 elements of that old
range. How can I do that?
std.algorithm.take.
But I would generally
On 6/30/12 8:24 AM, monarch_dodra wrote:
On Saturday, 30 June 2012 at 11:35:07 UTC, Tobias Pankrath wrote:
std.algorithm.take.
But I would generally avoid SList.
Thanks, but isn't that kind of a crutch solution?
I mean:
1) It creates a new type, so any attempt to use it to modify an existin
On 6/30/12 7:31 AM, monarch_dodra wrote:
I've been enjoying my time with D's ranges, but something is nagging at
me: If the range is not random access, then how does one create a
sub-view of that range?
Use take or takeExactly.
Say I have a forward range (for example, an SList[]). I would lik
On Saturday, 30 June 2012 at 14:01:08 UTC, Andrei Alexandrescu
wrote:
On 6/30/12 7:21 AM, monarch_dodra wrote:
The "isTerminator" version of std.algorithm.splitter, eg:
auto splitter(alias isTerminator, Range)(Range input)
Returns an object that is "only" ForwardRange. This is
especially weird
On 6/30/12 7:21 AM, monarch_dodra wrote:
The "isTerminator" version of std.algorithm.splitter, eg:
auto splitter(alias isTerminator, Range)(Range input)
Returns an object that is "only" ForwardRange. This is especially weird,
since the normal "separator" version is bidirectional. Comparing using
"bearophile" wrote in message
news:dkpmzrcoppslcjqvd...@forum.dlang.org...
>
> Currently this D2 code compiles:
>
> void main() {
> int x = 2;
> int y = 2;
> switch(x) {
> case 1: break;
> case y: break;
> default:
> }
> }
>
> I think that accepting that "c
On 30-Jun-12 15:35, Tobias Pankrath wrote:
Say I have a forward range (for example, an SList[]). I would like to
create a new range containing only the first 5 elements of that old
range. How can I do that?
std.algorithm.take.
But I would generally avoid SList.
Indeed. I'd be hard pressed t
On Saturday, 30 June 2012 at 12:27:38 UTC, bearophile wrote:
Tobias Pankrath:
But I would generally avoid SList.
It's not good.
And in general linked lists are quite overrated.
...
Bye,
bearophile
I appreciate the input, which I (mostly) agree with (I still love
list's splice ability, whi
Tobias Pankrath:
But I would generally avoid SList.
It's not good.
And in general linked lists are quite overrated. On modern CPUs
it's not easy to find situations where a linked list is better
than a dynamic array or a chunked array (that is a dynamic array
of pointers to arrays. It's oft
On Saturday, 30 June 2012 at 11:35:07 UTC, Tobias Pankrath wrote:
std.algorithm.take.
But I would generally avoid SList.
Thanks, but isn't that kind of a crutch solution?
I mean:
1) It creates a new type, so any attempt to use it to modify an
existing range becomes impossible:
void main()
Am 30.06.2012 13:52, schrieb bearophile:
I don't know if that bug fix (in dmd 2.060alpha) has fixed your
problem too.
I have compiled this code from your issue 7271 with the latest beta:
struct MemoryBlockInfo {
size_t size;
long[10] backtrace;
int backtraceSize;
this(siz
Benjamin Thaut:
I created a bug ticket for this 6 months ago, but it has been
ignored so far:
http://d.puremagic.com/issues/show_bug.cgi?id=7271
A similar bug was fixed very recently. D used to allocate a
dynamic array of length 1 when you write "new T" where T is a
struct. I don't know if
I don't know if that bug fix (in dmd 2.060alpha) has fixed your
problem too.
I have compiled this code from your issue 7271 with the latest
beta:
struct MemoryBlockInfo {
size_t size;
long[10] backtrace;
int backtraceSize;
this(size_t size) {
this.size = size;
}
Say I have a forward range (for example, an SList[]). I would
like to create a new range containing only the first 5 elements
of that old range. How can I do that?
std.algorithm.take.
But I would generally avoid SList.
I've been enjoying my time with D's ranges, but something is
nagging at me: If the range is not random access, then how does
one create a sub-view of that range?
Say I have a forward range (for example, an SList[]). I would
like to create a new range containing only the first 5 elements
of th
The "isTerminator" version of std.algorithm.splitter, eg:
auto splitter(alias isTerminator, Range)(Range input)
Returns an object that is "only" ForwardRange. This is especially
weird, since the normal "separator" version is bidirectional.
Comparing using a function rather than with a value sho
On 2012-06-30 01:25, Martin Nowak wrote:
class Foo
{
auto foo ()
{
return "Foo";
}
}
class Bar : Foo
{
auto foo ()
{
return "Bar";
}
}
Ouch, what a terrible idea to base a class hierachy on inference.
But nonetheless covariance checking should be performed after inference.
I actually found t
If T is a struct both of the following statements will lead to a call of
the _d_arrayliteral function which will allocate a array of the size of
the struct just to initialize it!!
void T[] data = ...;
data[0] = T.init;
data[0] = T();
This has proven to be the biggest performance bottleneck in
32 matches
Mail list logo