On Mon, 11 Aug 2014 05:18:59 +
Jeremy DeHaan via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
why do you need that info? D types has well-defined sizes (i.e uint is
always 32 bits, and so on).
you still can check pointer size -- (void *).sizeof. but i'm pretty
sure that you
On 11/08/14 07:18, Jeremy DeHaan wrote:
I am looking at these versions as described here:
http://dlang.org/version.html
There are X86 and X86_64 version identifiers, but these specifically
mention that they are versions for the processor type. Can they also be
used to determine if the OS is
On Monday, 11 August 2014 at 05:19:01 UTC, Jeremy DeHaan wrote:
I am looking at these versions as described here:
http://dlang.org/version.html
There are X86 and X86_64 version identifiers, but these
specifically mention that they are versions for the processor
type. Can they also be used to
On Monday, 11 August 2014 at 07:58:15 UTC, Freddy wrote:
If you want to check if
the target OS(not your code) is running 32 vs 64 bit you have
to do system call for your target OS.
Not the OS, but a special CPU instruction: isX86_64() in
core.cpuid?
can someone talk me through the reasoning behind this:
import std.typetuple;
void foo(T)(T v){}
void foo(){}
version(ThisCompiles)
{
alias Parent = TypeTuple!(__traits(parent, foo))[0];
pragma(msg, __traits(getOverloads, Parent, foo));
// tuple()
}
else
{
alias Parent =
Is there a way to separately stringify/print the mantissa and
exponent of a floating point?
I want this in my pretty-printing module to produce something like
1.2 \cdot 10^3
instead of
1.2e3
I could of course always split on the e but that is kind of
non-elegant, I believe.
On Wednesday, 25 April 2012 at 21:43:11 UTC, Dmitry Olshansky
wrote:
On 25.04.2012 23:08, H. S. Teoh wrote:
Does std.regex support input ranges to match()? Or do I need
to convert
to string first?
For now, yes you have to convert them. Any random access range
of code units should do the
Here's my current try:
string toMathML(T)(T x) @trusted /** pure */ if
(isFloatingPoint!T)
{
import std.conv: to;
import std.algorithm: findSplit; //
immutable parts = to!string(x).findSplit(e);
if (parts[2].length == 0)
return parts[0];
else
return parts[0]
On Mon, 11 Aug 2014 13:47:13 +, Nordlöw wrote:
Is there a way to separately stringify/print the mantissa and exponent
of a floating point?
I want this in my pretty-printing module to produce something like
1.2 \cdot 10^3
instead of
1.2e3
I could of course always split on the
On Monday, 11 August 2014 at 14:15:05 UTC, Nordlöw wrote:
Here's my current try:
string toMathML(T)(T x) @trusted /** pure */ if
(isFloatingPoint!T)
{
import std.conv: to;
import std.algorithm: findSplit; //
immutable parts = to!string(x).findSplit(e);
if (parts[2].length ==
On Mon, 11 Aug 2014 12:51:40 +
via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Not the OS, but a special CPU instruction: isX86_64() in
core.cpuid?
but there is ARM64 coming. and gdc, for example, will has no problems
to support it out of the box due to using gcc cogegen.
Just for a bit a fun i've implemented a simple doubly linked list
and trying out some range based stuff. Whilst doing so i have
some questions which you guys might be able to answer.
1. In your opinion when accessing the elements of a linked list
should they yield the data stored within the
On Mon, Aug 11, 2014 at 05:51:11PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
Just for a bit a fun i've implemented a simple doubly linked list and
trying out some range based stuff. Whilst doing so i have some
questions which you guys might be able to answer.
1. In your opinion
Hi, I try to get why the last way of generating an interface
implementation fails. I've put assumptions: is it right ?
---
module itfgen;
import std.stdio;
interface itf{
void a_int(int p);
void a_uint(uint p);
}
template genimpl(T){
char[] genimpl(){
On Monday, 11 August 2014 at 18:20:51 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
If you make your linked list container the same thing as a
range over it, then iterating over the range will empty the
container as
well, which generally isn't what you want.
Yes but only if it's been
I mean when writing a D lexer, you necessarly reach the moment
when you think:
Oh no! is this feature just here to suck ?
On Mon, Aug 11, 2014 at 07:35:04PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
On Monday, 11 August 2014 at 18:20:51 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
If you make your linked list container the same thing as a range over
it, then iterating over the range will empty the
On Mon, Aug 11, 2014 at 07:47:44PM +, Klaus via Digitalmars-d-learn wrote:
I mean when writing a D lexer, you necessarly reach the moment when
you think:
Oh no! is this feature just here to suck ?
I use heredocs every now and then when I need to embed long strings in
my program. It's one
On Monday, 11 August 2014 at 20:02:38 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Mon, Aug 11, 2014 at 07:35:04PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
On Monday, 11 August 2014 at 18:20:51 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
If you make your linked list
On Mon, Aug 11, 2014 at 08:22:11PM +, Gary Willoughby via
Digitalmars-d-learn wrote:
[...]
That..is..awesome! and much more simpler than i thought. I get it now,
thanks. Is this pattern repeated in phobos?
This is essentially what byKey and byValue of the built-in associative
arrays do.
On Mon, Aug 11, 2014 at 10:09 PM, H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Mon, Aug 11, 2014 at 07:47:44PM +, Klaus via Digitalmars-d-learn wrote:
I mean when writing a D lexer, you necessarly reach the moment when
you think:
Oh no! is this feature
On Mon, Aug 11, 2014 at 10:50:34PM +0200, Philippe Sigaud via
Digitalmars-d-learn wrote:
On Mon, Aug 11, 2014 at 10:09 PM, H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Mon, Aug 11, 2014 at 07:47:44PM +, Klaus via Digitalmars-d-learn
wrote:
I mean
On Monday, 11 August 2014 at 20:10:47 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Mon, Aug 11, 2014 at 07:47:44PM +, Klaus via
Digitalmars-d-learn wrote:
I mean when writing a D lexer, you necessarly reach the moment
when
you think:
Oh no! is this feature just here to suck ?
I use
On Mon, Aug 11, 2014 at 10:58 PM, H. S. Teoh via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
In Flex, one way you can implement heredocs is to have a separate mode
where the lexer is scanning for the ending string. So basically you
have a sub-lexer that treats the heredoc as
On Monday, 11 August 2014 at 15:37:29 UTC, Dominikus Dittes
Scherkl wrote:
Should be patrs[1], he?
No, parts[1] contains a slice to the e separating the mantissa
from the exponent.
On Monday, 11 August 2014 at 15:30:30 UTC, Justin Whear wrote:
1. http://dlang.org/phobos/std_bitmanip.html#.FloatRep
Great! Thx.
On Monday, 11 August 2014 at 15:30:30 UTC, Justin Whear wrote:
1. http://dlang.org/phobos/std_bitmanip.html#.FloatRep
I'm lacking a use case. See
http://dlang.org/library/std/bitmanip/FloatRep.html
Is unsafe
*(cast(FloatRep*)float_instance)
the only way to use this?
I use
auto pipes = pipeProcess( cmd, Redirect.stdout |
Redirect.stderr );
to redirect stdout of the newly created subprocess via pipes to a
file. The redirect itself happens in a newly created thread
(because I need to wait for the subprocess to finish to take the
exact elapsed
On Monday, 11 August 2014 at 19:47:46 UTC, Klaus wrote:
I mean when writing a D lexer, you necessarly reach the moment
when you think:
Oh no! is this feature just here to suck ?
They are and they do.
On Monday, 11 August 2014 at 22:20:54 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 19:47:46 UTC, Klaus wrote:
I mean when writing a D lexer, you necessarly reach the moment
when you think:
Oh no! is this feature just here to suck ?
They are and they do.
Also, use this:
On Monday, 11 August 2014 at 22:24:28 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 22:20:54 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 19:47:46 UTC, Klaus wrote:
I mean when writing a D lexer, you necessarly reach the
moment when you think:
Oh no! is this feature just
On Monday, 11 August 2014 at 22:56:27 UTC, Klaus wrote:
On Monday, 11 August 2014 at 22:24:28 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 22:20:54 UTC, Brian Schott wrote:
On Monday, 11 August 2014 at 19:47:46 UTC, Klaus wrote:
I mean when writing a D lexer, you necessarly reach the
On Monday, 11 August 2014 at 13:00:27 UTC, John Colvin wrote:
alias Parent = TypeTuple!(__traits(parent, foo!float))[0];
Say hello to optional parens - you are trying to call foo!float()
here and apply result to trait.
33 matches
Mail list logo