On Wednesday, 7 February 2018 at 08:28:23 UTC, Seb wrote:
On Wednesday, 7 February 2018 at 06:05:54 UTC, Paul D Anderson
wrote:
Is there anyone who knows the ins and outs of the makefile
that can shed some light?
Thanks,
Paul
I recommend cloning DMD directly from git if you want to
compile
On Wednesday, 7 February 2018 at 06:18:04 UTC, rikki cattermole
wrote:
On 07/02/2018 6:05 AM, Paul D Anderson wrote:
I don't understand the following line in dmd/src/win32.mak:
extern (C++) __gshared const(char)* ddoc_default = import
("default_ddoc_theme.ddoc");
That is a st
I don't understand the following line in dmd/src/win32.mak:
extern (C++) __gshared const(char)* ddoc_default = import
("default_ddoc_theme.ddoc");
What does the word "import" mean in this context? I can't find
any documentation on the use of import in this way, and the line
fails to compile
On Saturday, 11 March 2017 at 18:02:00 UTC, Stefan Koch wrote:
On Saturday, 11 March 2017 at 02:25:15 UTC, Paul D Anderson
wrote:
On Saturday, 11 March 2017 at 00:34:03 UTC, Paul D Anderson
wrote:
On Friday, 10 March 2017 at 22:04:23 UTC, Paul D Anderson
wrote:
[...]
I see John Colvin has
On Saturday, 11 March 2017 at 00:34:03 UTC, Paul D Anderson wrote:
On Friday, 10 March 2017 at 22:04:23 UTC, Paul D Anderson wrote:
While building DMD -- "make -fwin32.mak release" -- I received
the following error message:
echo "2.073.2" > verstr.h
Error: don
On Friday, 10 March 2017 at 22:04:23 UTC, Paul D Anderson wrote:
While building DMD -- "make -fwin32.mak release" -- I received
the following error message:
echo "2.073.2" > verstr.h
Error: don't know how to make '../res/default_ddoc_theme/ddoc'
--- err
While building DMD -- "make -fwin32.mak release" -- I received
the following error message:
echo "2.073.2" > verstr.h
Error: don't know how to make '../res/default_ddoc_theme/ddoc'
--- error level 1
I'm guessing it might be a build configuration problem on my end,
but what is the problem?
Pa
On Sunday, 5 July 2015 at 20:35:03 UTC, Kai Nacke wrote:
On Friday, 3 July 2015 at 04:08:32 UTC, Paul D Anderson wrote:
On Friday, 3 July 2015 at 03:57:57 UTC, Anon wrote:
On Friday, 3 July 2015 at 02:37:00 UTC, Paul D Anderson wrote:
[...]
Should be plusTwo(in BigInt n) instead.
Yes
On Friday, 3 July 2015 at 02:37:00 UTC, Paul D Anderson wrote:
The following code fails to compile and responds with the given
error message. Varying the "plusTwo" function doesn't work; as
long as there is an arithmetic operation the error occurs.
[...]
https://i
On Friday, 3 July 2015 at 03:57:57 UTC, Anon wrote:
On Friday, 3 July 2015 at 02:37:00 UTC, Paul D Anderson wrote:
enum BigInt test1 = BigInt(123);
enum BigInt test2 = plusTwo(test1);
public static BigInt plusTwo(in bigint n)
Should be plusTwo(in BigInt n) instead.
Yes, I had aliased
The following code fails to compile and responds with the given
error message. Varying the "plusTwo" function doesn't work; as
long as there is an arithmetic operation the error occurs.
It seems to mean that there is no way to modify a BigInt at
compile time. This seriously limits the usabilit
On Thursday, 25 June 2015 at 14:17:13 UTC, Paul D Anderson wrote:
On Thursday, 25 June 2015 at 07:10:57 UTC, tcak wrote:
On Thursday, 25 June 2015 at 04:43:51 UTC, Paul D Anderson
wrote:
I'm trying to pass a function pointer while keeping the
default parameter values intact. Give
On Thursday, 25 June 2015 at 07:10:57 UTC, tcak wrote:
On Thursday, 25 June 2015 at 04:43:51 UTC, Paul D Anderson
wrote:
I'm trying to pass a function pointer while keeping the
default parameter values intact. Given the following:
[...]
I filed a bug about 2-3 months ago about de
I'm trying to pass a function pointer while keeping the default
parameter values intact. Given the following:
import std.traits;
import std.stdio;
int foo(int a, int b = 1)
{
return a;
}
alias FOOP = int function(int, int = 1);
struct ST(POOF)
{
FOOP fctn;
this(POOF fctn)
{
this.
On Thursday, 25 June 2015 at 00:24:23 UTC, Paul D Anderson wrote:
The code snippet below compiles but the linker fails with Error
42: Symbol undefined.
What am I doing wrong?
void main()
{
int foo(int a);
alias FP = int delegate(int);
FP fp = &foo;
}
Paul
Uh, n
The code snippet below compiles but the linker fails with Error
42: Symbol undefined.
What am I doing wrong?
void main()
{
int foo(int a);
alias FP = int delegate(int);
FP fp = &foo;
}
Paul
On Sunday, 12 April 2015 at 04:04:43 UTC, lobo wrote:
On Sunday, 12 April 2015 at 03:51:03 UTC, Paul D Anderson wrote:
I don't understand why the following code compiles and runs
without an error:
import std.stdio;
mixin template ABC(){
int abc() { return 3; }
}
mixin ABC;
in
I don't understand why the following code compiles and runs
without an error:
import std.stdio;
mixin template ABC(){
int abc() { return 3; }
}
mixin ABC;
int abc() { return 4; }
void main()
{
writefln("abc() = %s", abc());
}
Doesn't the mixin ABC create a function with the same signatu
On Saturday, 11 April 2015 at 19:08:50 UTC, Marco Leise wrote:
Am Sat, 11 Apr 2015 18:28:35 +
schrieb "Paul D Anderson" :
Is there a way to return the name of a function (a string)
from a pointer to that function?
Function pointer example from D Reference:
---
int function()
Is there a way to return the name of a function (a string) from a
pointer to that function?
Function pointer example from D Reference:
---
int function() fp;
void test()
{
static int a = 7;
static int foo() { return a + 3; }
fp = &foo;
}
void bar()
{
test();
int i = fp();
On Wednesday, 11 March 2015 at 23:04:15 UTC, Ali Çehreli wrote:
On 03/11/2015 03:44 PM, Paul D Anderson wrote:
This used to work in D2.065:
given
1) public T mul(T)(in T x, in T y,
Context context = T.context) if (isDecimal!T)
// one template parameter for the two input values
and
2
On Wednesday, 11 March 2015 at 22:44:12 UTC, Paul D Anderson
wrote:
This used to work in D2.065:
given
1) public T mul(T)(in T x, in T y,
Context context = T.context) if (isDecimal!T)
// one template parameter for the two input values
and
2) public T mul(T, U)(in T x, U n, Context
This used to work in D2.065:
given
1) public T mul(T)(in T x, in T y,
Context context = T.context) if (isDecimal!T)
// one template parameter for the two input values
and
2) public T mul(T, U)(in T x, U n, Context context = T.context)
if (isDecimal!T && isIntegral!U)
// two dif
On Friday, 22 August 2014 at 01:25:05 UTC, Paul D Anderson wrote:
On Wednesday, 20 August 2014 at 20:46:20 UTC, Paul D Anderson I
don't know if this is expected behavior that just wasn't
enforced before, or if this is something new. Either way I
don't like it. And I'm a
On Wednesday, 20 August 2014 at 20:46:20 UTC, Paul D Anderson
wrote:
Re-compiling existing code with version 2.066 generates a lot
of errors complaining about implicit conversion to const.
Typical is this call (inside a struct with properties 1 & 2):
z.sign = x.sign ^ y.sign;
E
What changed? It ran okay with early beta versions, but not
with the release.
Paul
It compiles in beta-5 but not beta-6. Is the list of changes in
the beta testing wiki complete? None seem pertinent.
monarch_dodra: Thanks for checking. I was trying to avoid tearing
everything down. I was
Re-compiling existing code with version 2.066 generates a lot of
errors complaining about implicit conversion to const. Typical is
this call (inside a struct with properties 1 & 2):
z.sign = x.sign ^ y.sign;
Error: None of the overloads of 'sign' are callable using
argument types bool
On Saturday, 9 August 2014 at 07:07:42 UTC, Rikki Cattermole
wrote:
Cannot reproduce on either 2.065 or git head (according to
dpaste).
You are right. I had the functions in a unittest block that got
executed more than once so the second execution was a
redefinition. Thanks for taking the
When I try to compile these two functions, the second function is
flagged with an already defined error:
bool testRoundTrip(T, U)(T first, U second) if (isIntegral!T &&
isFloatingPoint!U)
{
return false;
}
bool testRoundTrip(U, T)(U first, T second) if (isIntegral!T &&
isFloatingPoint!U)
On Saturday, 21 June 2014 at 11:12:18 UTC, Artur Skawina via
Digitalmars-d-learn wrote:
On 06/21/14 05:32, Paul D Anderson via Digitalmars-d-learn
wrote:
I can't use a template mixin:
mixin template Function(string name)
{
const char[] Function =
"public static in
Does enum have any effect on functions?
Is this:
mixin (Constant!("ln2"));
package enum T ln2(T)(Context context) {
return log(T.TWO, context, false);
}
different from this:
mixin (Constant!("ln2"));
package /*enum*/ T ln2(T)(Context context) {
return log(T.TWO, context, false)
I am misunderstanding something about using mixins for
boilerplate code.
I've got a set of functions all of which do the same thing:
public static int fctn1() { return other.place.fctn1; }
I can't use a string mixin to generate the code:
template Function(string name)
{
const char[] Functio
On Saturday, 31 May 2014 at 22:34:45 UTC, Timon Gehr wrote:
On 06/01/2014 12:25 AM, Ali Çehreli wrote:
dec10 little = cast(dec10(bingo));
You meant cast(dec10)(bingo).
assert(little == dec10("123.45"));
Is this expected behavior?
Paul
That is surprising. I've discovered that if the tem
On Saturday, 31 May 2014 at 20:14:59 UTC, bearophile wrote:
Miles Stoudenmire:
In contrast to those two examples where immutable can be used
at compile
time, what are some other cases where it is necessary to use
enum instead of immutable?
By default use enum if you define a compile-time-kno
I'm working on the decimal number package for D. A decimal is a
struct with precision, max exponent and rounding mode parameters:
"Decimal!(PRECISION, MAX_EXPO, ROUNDING)". I was trying to
overload the opCast operator for this struct and I found that it
does not seem necessary. I can cast decim
Changed compilers from dmd 2.060 to dmd 2.062, running on Windows
7. Got a couple of errors relating to imports that I fixed but
now it crashes with no indication of what went wrong. A Windows
message dialog pops up stating that dmd.exe has stopped working.
The "details" are posted below.
The
On Wednesday, 5 September 2012 at 19:23:11 UTC, Paul D. Anderson
wrote:
No, I don't believe so. AFAIK there is no public access to the
underlying array, but I think it is a good idea.
I meant to say I think that access to the array is a good idea,
not the lack of access. Words are hard!
On Wednesday, 5 September 2012 at 11:50:12 UTC, bearophile wrote:
Don Clugston:
I'd be interested to know if that idea is ever used in real
code. I mean, it's a classic trendy template toy, but does
anyone actually use it?
As usual I don't have usage statistics.
I like dynamic languages, li
On Wednesday, 5 September 2012 at 18:13:40 UTC, Ellery Newcomer
wrote:
Hey.
Investigating the possibility of providing this conversion in
pyd.
Python provides an api for accessing the underlying bytes.
std.bigint seemingly doesn't. Am I missing anything?
No, I don't believe so. AFAIK there
SomeDude: Your outline and especially your emphasis on what a
rank beginner needs to know is very good.
Would you consider writing it up yourself? Not the whole thing,
maybe but the beginner info and the compiler/linker appendices.
You have a commendable prose style.
There are tutorials avai
On Friday, 13 April 2012 at 09:10:37 UTC, James Miller wrote:
So I made the pull request, the documentation you need to read
is here:
https://github.com/Aatch/phobos/commit/cda3c079ee32d98a017f88949c10097840baa075
Hopefully it helps.
--
James Miller
Thanks. That did the trick.
Paul
I'm trying to add formatted output to my decimal arithmetic
module. Decimals should format like floating point, using 'E',
'F' and 'G', etc.
I would expect a format string like "%9.6e" to parse as width =
9, precision = 6, using exponential notation.
In std.format there is a FormatSpec struc
Does anyone know of a prettyprint program for D code?
I use a text editor rather than an IDE and it would be nice if I
could standardize the format of my code. It's not onerous to do
it by hand but it can be tedious.
My text editor (Boxer) does pretty well on syntax highlighting
(other than
ormance tradeoff is.
Again, thanks
Paul
Simen kjaeraas Wrote:
> On Fri, 26 Mar 2010 06:35:29 +0100, Paul D. Anderson
> wrote:
>
> > I want to initialize an immutable struct but I'm encountering two
> > difficulties and I can't find the answer in the documentat
I want to initialize an immutable struct but I'm encountering two difficulties
and I can't find the answer in the documentation. (Wouldn't it be nice if
someone wrote a book?)
The primary difficulty is that I can't use a static initializer but need to use
a constructor instead. But the construc
bearophile Wrote:
> Paul D. Anderson:
>
> > After further review, I now realize that the right way (for me) to do this
> > is to add a .dup property.<
>
> Steven Schveighoffer has given you quite good answers.
> A dup is generally not enough, because what yo
t S s) {
S other = s.dup;
return other;
}
which is ultimately an equivalent operation.
Thanks again, everyone for taking the time to explain what was going on.
Paul
It just looks better to me.
Paul D. Anderson Wrote:
> bearophile Wrote:
>
> > The idea now is to find a way to
bearophile Wrote:
> Paul D. Anderson:
> > My struct has a dynamic array as a member -- that seems to be the problem.
> > This code doesn't compile:
> >
> > struct S {
> > int x;
> > int[] a;
> > }
> >
> > S foo(const S b) {
bearophile Wrote:
> Paul D. Anderson:
> > S x = cast(S) a;
> > S y = cast(S) b;
>
> In Java (especially old Java) casts may be common, but in D they are
> something that has to be used with care, don't cast away things carelessly :-)
>
> Bye,
> b
bearophile Wrote:
> Paul D. Anderson:
>
> > I created a struct, call it "S", and some functions that operate on S. But
> > I'm confused about when const is useful.
> >
> > Being an old Java programmer, I use 'const' the same as I used
I created a struct, call it "S", and some functions that operate on S. But I'm
confused about when const is useful.
Being an old Java programmer, I use 'const' the same as I used 'final' in Java.
So most of my functions look like this:
S for(const S a, const S b) {
S x = a;
S y = b;
bearophile Wrote:
> Paul D. Anderson:
> > Or is this a distinction without a difference?
>
> For POD structs like this one I suggest to implement nothing, and just let
> the compiler copy the struct by itself.
> If the struct is not a POD then I like the dup property
If I'm implementing a struct and want to provide for duplication, is there a
standard way to implement this?
Here's an example:
//---
struct S {
// members of the struct -- three integer values
int a;
int b;
int c;
// here's a copy constructor
Jarrett Billingsley Wrote:
> On Fri, Jun 19, 2009 at 5:05 PM, Paul D.
> Anderson wrote:
> > Okay, where is the max(a,b) function in phobos?
> >
> > I realize it's a dead simple template implementation but I thought it would
> > be implemented somewhere.
>
Okay, where is the max(a,b) function in phobos?
I realize it's a dead simple template implementation but I thought it would be
implemented somewhere.
Paul
Ary Borenszweig Wrote:
> Paul D. Anderson wrote:
> > Paul D. Anderson Wrote:
> >
> >> Is there a way to see the source for a D program after the mixins and
> >> templates, etc., are expanded?
> >>
> >> I get occasional error messages saying
Paul D. Anderson Wrote:
> Is there a way to see the source for a D program after the mixins and
> templates, etc., are expanded?
>
> I get occasional error messages saying I've got incompatible types, for
> example, but the error message only makes sense when I me
Is there a way to see the source for a D program after the mixins and
templates, etc., are expanded?
I get occasional error messages saying I've got incompatible types, for
example, but the error message only makes sense when I mentally instantiate a
template. Is there a way to see this instant
Don Wrote:
> Paul D. Anderson wrote:
> > Looking at Don Clugston's BigInt code I see usage of "*this":
> >
> > BigInt opMulAssign(T: BigInt)(T y) {
> >*this = mulInternal(*this, y);
> > return *this;
> > }
> >
&g
Looking at Don Clugston's BigInt code I see usage of "*this":
BigInt opMulAssign(T: BigInt)(T y) {
*this = mulInternal(*this, y);
return *this;
}
I think I know what it does (passes this by reference) but I can't find any
documentation that explains the usage. Can anyone poi
60 matches
Mail list logo