On Friday, 13 June 2014 at 05:54:02 UTC, TheFlyingFiddle wrote:
On Friday, 13 June 2014 at 04:11:38 UTC, Rutger wrote:
I'm trying to create a minimal tweening library in D based on
the
commonly used easing equations by Robert Penner
(http://www.robertpenner.com/easing/).
One of the goals with
On Thursday, 12 June 2014 at 19:30:06 UTC, Rene Zwanenburg wrote:
I need to go. Please don't mind any typo's and untested code
;). Didn't take a look at writers yet, readers and util need
some more scrutiny, but the main theme is: eliminate
unnecessary temporary GC allocations.
Thank you for
On Thursday, 12 June 2014 at 21:07:47 UTC, Tom Browder via
Digitalmars-d-learn wrote:
What I was really trying to do was D'ify C expressions like
this:
typedef ((struct t*)0) blah;
This doesn't compile for me with GCC, and I don't know what it's
supposed to mean. ((struct t*) 0) is a
On Thursday, 12 June 2014 at 22:54:20 UTC, Ali Çehreli wrote:
On 06/12/2014 03:38 PM, monarch_dodra wrote:
So there's something special about null.
The difference is that null is an expression. It is the same
limitation as not being able to alias a literal.
alias zero = 0;
alias
On Fri, Jun 13, 2014 at 7:59 AM, via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Thursday, 12 June 2014 at 21:07:47 UTC, Tom Browder via
Digitalmars-d-learn wrote:
What I was really trying to do was D'ify C expressions like this:
typedef ((struct t*)0) blah;
This
Thanks for all the answers)
8. I have another more simple question about rdmd utility. It
takes one *.d file and searches for all dependencies. What if I
need to pass independent *.d file or *.ddoc file directly to dmd
compiler? How could I do that using dmd? I have no idea how I
could
On Friday, 13 June 2014 at 15:05:49 UTC, Tom Browder via
Digitalmars-d-learn wrote:
On Fri, Jun 13, 2014 at 7:59 AM, via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Thursday, 12 June 2014 at 21:07:47 UTC, Tom Browder via
Digitalmars-d-learn wrote:
What I was really trying
On Friday, 13 June 2014 at 15:05:49 UTC, Tom Browder via
Digitalmars-d-learn wrote:
So I'm not sure how to translate that into D. I do know my
first
attempt here doesn't work, even with it being surrounded by
extern (C)
{}:
$ cat chdr.d
struct t;
struct t* t_ptr = null;
This seems to work
On Fri, Jun 13, 2014 at 10:15 AM, monarch_dodra via
Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Friday, 13 June 2014 at 15:05:49 UTC, Tom Browder via Digitalmars-d-learn
wrote:
So I'm not sure how to translate that into D. I do know my first
attempt here doesn't work,
Hi,
I have a template class List which should provide generic list
functionality. In my use case, using a class instead a struct
is more comfortable.
Following unittest fails, although the forward range
implements the save method.
unittest
{
auto intList = new List!int(1,2,3);
On Fri, Jun 13, 2014 at 08:14:11PM +0200, Andre via Digitalmars-d-learn wrote:
Hi,
I have a template class List which should provide generic list
functionality. In my use case, using a class instead a struct
is more comfortable.
Following unittest fails, although the forward range
Am 13.06.2014 20:22, schrieb H. S. Teoh via Digitalmars-d-learn:
[...]
Generally, it's a bad idea to conflate a container with a range over its
contents. In this sense, built-in arrays are a very bad example, because
they show precisely this sort of conflation. But they get away with it
because
On Friday, 13 June 2014 at 18:14:10 UTC, Andre wrote:
Hi,
I have a template class List which should provide generic
list functionality. In my use case, using a class instead a
struct
is more comfortable.
Following unittest fails, although the forward range
implements the save method.
I recently posted another thread (regarding crt1.o: could not
read symbols: Bad value - I'm creating a new thread because it's
another problem) and I figured out that the following error:
stack_bottom = 7fc98804ae18 thread_stack 0x4
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x8cea15]
I am making the following comment to have others confirm, as well as
remind others about a potential problem.
On 06/13/2014 11:14 AM, Andre wrote:
unittest
{
auto intList = new List!int(1,2,3);
[...]
class List(T)
{
private T[] items;
this(T[] items...)
{
On Friday, 13 June 2014 at 19:03:12 UTC, Ali Çehreli wrote:
I am making the following comment to have others confirm, as
well as remind others about a potential problem.
On 06/13/2014 11:14 AM, Andre wrote:
unittest
{
auto intList = new List!int(1,2,3);
[...]
class List(T)
{
I've been playing around with D and noticed that:
stdin.byLine.writeln
takes ~20 times as long as:
foreach(line; stdin.byLine) writeln(line);
I asked on IRC and this was suggested:
stdin.byLine(KeepTerminator.yes).copy(stdout.lockingTextWriter)
which is slightly faster than the foreach
On Friday, 13 June 2014 at 20:48:16 UTC, Jyxent wrote:
I've been playing around with D and noticed that:
stdin.byLine.writeln
takes ~20 times as long as:
foreach(line; stdin.byLine) writeln(line);
I asked on IRC and this was suggested:
On 06/12/2014 09:30 PM, Rene Zwanenburg wrote:
I remember a function which does something like only only + canFind on
one go. It would look something like
header.colorMapDepth.among(16, 32);
but I can't find it right now.. Maybe it was only proposed but never added.
On 06/13/2014 02:08 PM, monarch_dodra wrote:
Given this input:
line 1
line2
Yo!
Then stdin.byLine.writeln will produce this string:
[line 1, line\t2, Yo!]
Do you mean writeln() first generates an array and then prints that
array? I've always imagined that it used the range interface
On Friday, 13 June 2014 at 21:08:08 UTC, monarch_dodra wrote:
On Friday, 13 June 2014 at 20:48:16 UTC, Jyxent wrote:
I've been playing around with D and noticed that:
stdin.byLine.writeln
takes ~20 times as long as:
foreach(line; stdin.byLine) writeln(line);
I asked on IRC and this was
On Friday, 13 June 2014 at 21:17:27 UTC, Ali Çehreli wrote:
On 06/13/2014 02:08 PM, monarch_dodra wrote:
Given this input:
line 1
line2
Yo!
Then stdin.byLine.writeln will produce this string:
[line 1, line\t2, Yo!]
Do you mean writeln() first generates an array and then prints
that
On 06/13/2014 03:02 PM, monarch_dodra wrote:
No, it just receives a range, so it does range formating. eg:
[ ~ Element ~ , ~ Element ... ].
It still looks like it could send the formatting characters as well as
the elements separately to the output stream:
[
Element
,
...
]
I am
On Friday, 13 June 2014 at 22:12:01 UTC, Ali Çehreli wrote:
On 06/13/2014 03:02 PM, monarch_dodra wrote:
No, it just receives a range, so it does range formating. eg:
[ ~ Element ~ , ~ Element ... ].
It still looks like it could send the formatting characters as
well as the elements
On Fri, Jun 13, 2014 at 10:02:49PM +, monarch_dodra via Digitalmars-d-learn
wrote:
[...]
That said, you can use one of D's most powerful formating abilities:
Range formating:
writefln(%-(%s\n%), stdin.byLine());
And BOOM. Does what you want. I freaking love range formatting.
More info
On Friday, 13 June 2014 at 22:25:25 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
In C/C++,
you'd have
to manually write nested loops to print out the data, which may
involve
manually calling accessor methods, manually counting them,
perhaps
storing intermediate output fragments in
something similar to boost/units?
In other words, is 'shared __gshared' redundant?
On Saturday, 14 June 2014 at 01:24:05 UTC, Mike Franklin wrote:
In other words, is 'shared __gshared' redundant?
All __gshared does is makes the variable not go into thread-local
storage, nothing more. Shared does this, as well as modify the
type to be shared(T) instead of just T. So yes,
Hi,
I'm new to D and am trying to compile a simple hello world
program.
I get the following error when compiling it:
dmd test.d
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld:
/opt/dmd-2.065/lib64/libphobos2.a(lifetime_488_4cd.o): relocation
R_X86_64_32
This seems to work from quick testing, but it has casts in
get_ref that I want to avoid.
cast(T*) refs[i] is obviously not @safe.
cast(T*) _buffer[read].ptr doesn't seem necessary, since
_buffer[read] is conceivably a T so _buffer[read].ptr should be a
T*. But without it I get Error: cannot
On 06/13/2014 06:56 PM, Anonymous wrote:
@trusted void get_ref(TS strat=TS.cyclic)(size_t n, const(T*)[]
refs) const nothrow
{
[...]
cast(T*) refs[i] = cast(T*) _buffer[read].ptr;
The left-hand side violates a promise: The function takes a slice where
the elemenst
I thought this was possible, but DMD 2.065 doesn't allow it,
saying no constructor for int:
int* p = new int(3);
Is something like this planned for the future? I know we can
already do:
int n = int(3);
Hi Vlad,
you can try David Nadlinger's std.units:
http://klickverbot.at/code/units/std_units.html
See the discussion at
http://forum.dlang.org/thread/io1vgo$1fnc$1...@digitalmars.com
From what I deemly remember of Boost/units, it's a bit less complete,
but far easier to use.
34 matches
Mail list logo