https://issues.dlang.org/show_bug.cgi?id=16438
--- Comment #2 from greensunn...@gmail.com ---
sorry wrong Github PR - see
https://github.com/dlang/phobos/pull/3955
https://github.com/dlang/phobos/commit/096480ecc35fbe427b08eeb1441a9ae44ea44f98
--
https://issues.dlang.org/show_bug.cgi?id=16438
greensunn...@gmail.com changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
https://issues.dlang.org/show_bug.cgi?id=16438
Issue ID: 16438
Summary: std.typelist still exists!
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
#2541 from quickfur/issue7797
Deprecated obsolete module std.typelist.
--
https://issues.dlang.org/show_bug.cgi?id=7797
hst...@quickfur.ath.cx changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
#3 from hst...@quickfur.ath.cx ---
Hmm. std.typelist isn't on dlang.org anymore, and hasn't been as far as I can
remember. Is it safe to outright delete it, or should we deprecate it first?
--
https://issues.dlang.org/show_bug.cgi?id=7797
hst...@quickfur.ath.cx changed:
What|Removed |Added
Keywords||pull
--- Comment #4 from
https://issues.dlang.org/show_bug.cgi?id=7797
--- Comment #5 from hst...@quickfur.ath.cx ---
Just for reference / posterity:
std.typelist was originally added in Sep 2009
(04216e8d29a4ff4674c9dd332b68962539c368a6). It was first referenced from
another Phobos module in May 2010
On Mon, Feb 11, 2013 at 1:05 PM, bearophile bearophileh...@lycos.comwrote:
And isn't it better for the Rational constructor to simplify the arguments
(calling an optimized GCD)? See this implementation (that doesn't use an
optimized GCD):
Arlen:
I ran some benchmarks, and I don't see how the rosetta version
is more optimized:
My message says See this implementation (that doesn't use an
optimized GCD):. I have never said that code is more optimized.
What I have said is that your version probably should simplify
its
On Wed, Feb 13, 2013 at 3:48 PM, bearophile bearophileh...@lycos.comwrote:
Arlen:
I ran some benchmarks, and I don't see how the rosetta version is more
optimized:
My message says See this implementation (that doesn't use an optimized
GCD):. I have never said that code is more
Arlen:
but my version _does_ simplify its arguments inside the
constructor.
Right, sorry.
As for an optimized GCD, are you talking about binary GCD?
Right, but as we have seen a naive implementation of binary GCD
gives no improvements:
On 2013-02-12 04:03, bearophile wrote:
But I have not yet understood why D isn't using GMP as Haskell does.
Especially that when you get dynamic libraries working it would create good
common ground for interoperability.
In theory Open Source is meant to give a huge help to code reuse, in
FG:
Not sure though whether what's possible in Mono's GC can be
ported to D.
With developed in conjunction I meant written with then, not
just ported (that means copied and then adapted). Go, C#, Rust
and D need GCs with different characteristics, but not totally
different characteristics.
Andrej Mitrovic:
Good luck compiling that with DMC on win32. And fixing bugs
upstream. :)
For the first problem maybe using LLVM is a solution. For the
second problem, do you know how do Haskell devs solve it?
Bye,
bearophile
On 2/12/13, bearophile bearophileh...@lycos.com wrote:
Good luck compiling that with DMC on win32. And fixing bugs
upstream. :)
For the first problem maybe using LLVM is a solution.
That doesn't help if we want to use DMD. As for the second part I
meant it's likely easier to fix bugs in
Just a quick update:
I have made Rational nothrow, fixed toString, and some other minor
changes. For the past several months I've used Rational extensively in
units (see my other thread), and it works great.
source: https://github.com/Arlen/phobos/blob/std_rational/std/rational.d
docs:
Arlen:
https://github.com/Arlen/phobos/blob/std_rational/std/rational.d
docs: http://arlen.github.com/phobos/std_rational.html
I'd like a good Rational in Phobos.
From your code:
private template isSignedIntegral(T)
{
enum isSignedIntegral = isIntegral!T isSigned!T;
}
...
struct
On Mon, Feb 11, 2013 at 1:05 PM, bearophile bearophileh...@lycos.comwrote:
A Rational should accept T as BigInt too.
Bye,
bearophile
Rational doesn't support BigInt because the necessary math functions do not
support BigInt. And if you are going to have Rational support BigInt, you
are
Arlen:
Rational doesn't support BigInt because the necessary math
functions do not
support BigInt. And if you are going to have Rational support
BigInt, you
are most likely going to need BigFloat, which is something we
don't have.
I have used Rationals with BigInts several times, and so
Summary|std.typelist missing from |std.typelist should be
|documentation |deprecated
--- Comment #2 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-02-06
20:27:31 PST ---
Changing to a Phobos bug. std.typelist should be nuked, I don't see anything
http://d.puremagic.com/issues/show_bug.cgi?id=7797
Andrej Mitrovic andrej.mitrov...@gmail.com changed:
What|Removed |Added
CC|
On Mon, 08 Oct 2012 23:01:42 +0200, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
Wasn't Paul D. Anderson working on a BigFloat?
Thanks for the hint. I found his project on github:
https://github.com/andersonpd/decimal
Seems fairly complete and usable. Hope he's going to continue to
On Monday, 8 October 2012 at 15:14:35 UTC, Aziz K. wrote:
Incidentally, I would very much need a BigFloat class/struct,
written in D and independent of any C library.
I'm trying to write one myself, but it seems to be rather
tricky. Could this be implemented in a short amount of time by
On 2012-44-08 06:10, Arlen arlen...@gmx.com wrote:
On Sat, Oct 6, 2012 at 1:32 PM, Dmitry Olshansky dmitry.o...@gmail.com
wrote:
Cool, does it work with BigInt?
No it doesn't work with BigInt, but I did look into it today briefly.
There are issues with BigInt that I'm not sure what to do
On Mon, Oct 08, 2012 at 09:08:57AM +0200, Simen Kjaeraas wrote:
On 2012-44-08 06:10, Arlen arlen...@gmx.com wrote:
On Sat, Oct 6, 2012 at 1:32 PM, Dmitry Olshansky
dmitry.o...@gmail.com wrote:
Cool, does it work with BigInt?
No it doesn't work with BigInt, but I did look into it today
On Sun, Oct 07, 2012 at 01:15:50PM +0400, Dmitry Olshansky wrote:
[...]
Just define method with this signature:
void toString(scope void delegate(const(char)[]) sink)
And bingo! It's used in all of formatting stuff like write(f)(ln),
format, formattedWrite etc.
e.g. before posting I
On Mon, 08 Oct 2012 09:28:37 +0200, H. S. Teoh hst...@quickfur.ath.cx
wrote:
I'd like to chime in to state that I'd love to have Rational support
BigInt. If necessary, use an arbitrary-width floating point format for
floating point conversions (BigFloat?).
Incidentally, I would very much
On Mon, Oct 8, 2012 at 2:08 AM, Simen Kjaeraas simen.kja...@gmail.com wrote:
On 2012-44-08 06:10, Arlen arlen...@gmx.com wrote:
1. To convert a BigInt to floating-point one needs to convert it to
the built-in integer types first. If you go beyond the limits of the
built-in types (long),
On 10/08/2012 07:56 AM, Aziz K. wrote:
Incidentally, I would very much need a BigFloat class/struct, written in
D and independent of any C library.
I'm trying to write one myself, but it seems to be rather tricky. Could
this be implemented in a short amount of time by someone with more
Arlen:
Yes, std.math.abs and std.numeric.gcd are very easy to
implement for BigInt,
Don doesn't agree regarding the gcd. To compute the gcd
efficiently on large numbers you need not easy algorithms.
See:
http://d.puremagic.com/issues/show_bug.cgi?id=7102
Bye,
bearophile
On Mon, Oct 8, 2012 at 4:37 PM, bearophile bearophileh...@lycos.com wrote:
Arlen:
Yes, std.math.abs and std.numeric.gcd are very easy to implement for
BigInt,
Don doesn't agree regarding the gcd. To compute the gcd efficiently on large
numbers you need not easy algorithms.
See:
On Sat, Oct 6, 2012 at 8:01 PM, Arlen arlen...@gmx.com wrote:
I'm not sure if TypeTuples work well when doing things like dimensional
analysis. For example, if you have two TypeTuples, A and B, what would the
signature of the metafunction to merge the two look like?
template Merge(A, B) {
On Sat, Oct 6, 2012 at 8:32 PM, Dmitry Olshansky dmitry.o...@gmail.com wrote:
Your current code may have some bad impact on performance:
return ( ~ to!string(res.numerator) ~ / ~ to!string(res.denominator) ~
);
Allocates 4 times. ~ operator is convenient shortcut to get job done but
it's
On Sat, Oct 6, 2012 at 11:52 PM, Arlen arlen...@gmx.com wrote:
#1
template Foldl(alias Fun, Z, alias TL) { }
This is called when dealing with 1-dimensional typelists. For example:
alias Foldl!(MyFun, char, TL) R1; // where TL is, e.g.,
TypeList!(int, char, double)
#2
template
On Sunday, 7 October 2012 at 07:36:08 UTC, Philippe Sigaud wrote:
On Sat, Oct 6, 2012 at 8:32 PM, Dmitry Olshansky
dmitry.o...@gmail.com wrote:
Your current code may have some bad impact on performance:
return ( ~ to!string(res.numerator) ~ / ~
to!string(res.denominator) ~
);
Allocates 4
On 07-Oct-12 12:10, Jakob Ovrum wrote:
On Sunday, 7 October 2012 at 07:36:08 UTC, Philippe Sigaud wrote:
On Sat, Oct 6, 2012 at 8:32 PM, Dmitry Olshansky
dmitry.o...@gmail.com wrote:
Your current code may have some bad impact on performance:
return ( ~ to!string(res.numerator) ~ / ~
On 07-Oct-12 11:23, Philippe Sigaud wrote:
On Sat, Oct 6, 2012 at 8:01 PM, Arlen arlen...@gmx.com wrote:
I'm not sure if TypeTuples work well when doing things like dimensional
analysis. For example, if you have two TypeTuples, A and B, what would the
signature of the metafunction to merge
On Sunday, 7 October 2012 at 09:27:54 UTC, Dmitry Olshansky wrote:
Ehem.. I've been pushing for DIP9 a lot of time. But then I
find out that it is already here (and been for some time).
Like I said use a special overload of toString that is exactly
writeTo.
Just define method with this
On Sunday, October 07, 2012 11:37:30 Jakob Ovrum wrote:
To implement it fully we would still want to change toString for
classes, and probably do something like providing a UFCS function
in object.toString or some other relevant location for
convenience and backwards compatibility.
Well,
On Sunday, 7 October 2012 at 09:58:54 UTC, Jonathan M Davis wrote:
Well, considering that we're looking at removing toString,
toHash, opCmp, and
opEquals from Object entirely, that probably won't be
necessary. But that
particular plan hasn't gotten past the initial discussions
AFAIK, so who
On Sun, Oct 7, 2012 at 11:15 AM, Dmitry Olshansky dmitry.o...@gmail.com wrote:
import std.stdio, std.format;
struct A{
int k;
void toString(scope void delegate(const(char)[]) sink)
{
formattedWrite(sink, [%d], k);
}
}
I see, thanks. And if
On Sunday, 7 October 2012 at 15:36:52 UTC, Philippe Sigaud wrote:
I see, thanks. And if the string in formattedWrite is a complex
beast,
created through lots of if's and while's, I use Appender in its
place?
Ideally, you just write to the sink directly, piece by piece –
but if for some
On 10/07/12 17:24, Philippe Sigaud wrote:
On Sun, Oct 7, 2012 at 11:15 AM, Dmitry Olshansky dmitry.o...@gmail.com
wrote:
import std.stdio, std.format;
struct A{
int k;
void toString(scope void delegate(const(char)[]) sink)
{
formattedWrite(sink,
On Sun, Oct 7, 2012 at 2:23 AM, Philippe Sigaud
philippe.sig...@gmail.com wrote:
Double-stage templates (which reminds me of rocket science :) )
template Merge(A...)
{
template With(B...)
{ }
}
Usage:
Merge!(int,double,string).With!(double,byte)
I can live with that, but, as
On Sunday, October 07, 2012 22:57:33 Arlen wrote:
I can live with that, but, as I explained before, TypeTuples cause
code duplication in certain cases because they force 'alias' to be
used in the signature of the metafunctions.
And how would you return a multi-dimensional TypeTuple? The
On Sat, Oct 6, 2012 at 1:32 PM, Dmitry Olshansky dmitry.o...@gmail.com wrote:
Cool, does it work with BigInt?
No it doesn't work with BigInt, but I did look into it today briefly.
There are issues with BigInt that I'm not sure what to do about:
1. To convert a BigInt to floating-point one
On Sun, Oct 7, 2012 at 11:16 PM, Jonathan M Davis jmdavisp...@gmx.com wrote:
While this sort of function might be useful from time to time, how often is it
actually, realistically needed? Certainly, I'd argue that it's rare enough
that having a slightly more complicated solution specifically
On Monday, October 08, 2012 00:14:04 Arlen wrote:
So, we're not adding TypeList.
Oh, I was aware that a decision had already been made. I thought it
was an open issue.
It was decided the last time that std.typelist was brought up. Basically,
TypeList doesn't provide enough over TypeTuple
std.typelist, which provides the TypeList type and several metafunctions. The
metafunctions are pretty much stolen from Haskell.
Source: https://github.com/Arlen/phobos/blob/units/std/typelist2.d
Docs: http://arlen.github.com/phobos/std_typelist2.html
I wasn't aware that we already had std.typelist
On Saturday, October 06, 2012 19:03:39 Arlen wrote:
I wasn't aware that we already had std.typelist module in Phobos until I was
ready to submit my work. I suppose the work was abandoned or it was never
finalized? There are differences in typelist2.d and typelist.d, though.
It needs
/phobos/blob/units/std/rational.d
Docs: http://arlen.github.com/phobos/std_rational.html
I'd like a Rational in Phobos. Have you tested it (in unittests)
widely with Bigints?
std.typelist, which provides the TypeList type and several
metafunctions. The metafunctions are pretty much stolen from
like it in
Phobos. It is pretty much finished, but needs a bit of polish
here and there (many compiler improvements have been made since I
wrote it). Unfortunately, I'm currently swamped in other work,
though…
std.typelist, which provides the TypeList type and several
metafunctions
) { }
and you certainly can't do something like
template Merge(AB...) { }
Arlen
- Original Message -
From: Jonathan M Davis
Sent: 10/06/12 12:52 PM
To: digitalmars.D
Subject: Re: Preliminary submission - std.rational and std.typelist
On Saturday, October 06, 2012 19:03:39
On Saturday, 6 October 2012 at 18:13:19 UTC, Arlen wrote:
For example, if you have two TypeTuples, A and B, what would
the signature of the metafunction to merge the two look like?
In my experience, these cases occur a lot less frequently than
one might think when first encountering the
.
std.typelist, which provides the TypeList type and several metafunctions. The
metafunctions are pretty much stolen from Haskell.
Source: https://github.com/Arlen/phobos/blob/units/std/typelist2.d
Docs: http://arlen.github.com/phobos/std_typelist2.html
I concur with the general idea that it needs
: Preliminary submission - std.rational and std.typelist
I'd like a Rational in Phobos. Have you tested it (in unittests)
widely with Bigints?
Bye,
bearophile
- Original Message -
From: David Nadlinger
Sent: 10/06/12 12:58 PM
To: digitalmars-d@puremagic.com
Subject: Re: Preliminary submission - std.rational and std.typelist
I wrote a units library in D last year:
http://klickverbot.at/code/units/. Before setting out, I
extensively
- Original Message -
From: David Nadlinger
Sent: 10/06/12 01:08 PM
To: digitalmars-d@puremagic.com
Subject: Re: Preliminary submission - std.rational and std.typelist
In my experience, these cases occur a lot less frequently than
one might think when first encountering
On 10/06/2012 07:54 PM, bearophile wrote:
I'd like a Rational in Phobos. Have you tested it (in unittests) widely with
Bigints?
Seconded, this would be very nice to see.
On Saturday, 6 October 2012 at 20:00:47 UTC, Arlen wrote:
You need both of these if you want, for example, fold to work
with n-dimensional typelists:
template Foldl(alias Fun, Z, alias TL) { }
template Foldl(alias Fun, alias Z, alias TL) { } // when Z is a
TypeList
I'm not quite sure what
On Saturday, 6 October 2012 at 19:40:10 UTC, Arlen wrote:
Besides, the math behind it is sound and and many years of hard
work has gone into it.
Also, it is extremely complicated by the fact that it somehow has
to work withing the boundaries of C++ and boost::mpl and friends.
I do want to
Testing...
On Sat, Oct 6, 2012 at 3:53 PM, David Nadlinger s...@klickverbot.at wrote:
On Saturday, 6 October 2012 at 20:00:47 UTC, Arlen wrote:
You need both of these if you want, for example, fold to work with
n-dimensional typelists:
template Foldl(alias Fun, Z, alias TL) { }
template Foldl(alias
On Sat, Oct 06, 2012 at 10:54:31PM +0200, Joseph Rushton Wakeling wrote:
On 10/06/2012 07:54 PM, bearophile wrote:
I'd like a Rational in Phobos. Have you tested it (in unittests) widely with
Bigints?
Seconded, this would be very nice to see.
+1.
T
--
Computers are like a jungle: they
On 6/22/12 5:00 PM, Jonathan M Davis wrote:
I tend to agree with all of this. I think that std.typelist looks very cool,
but we need to make sure that it fits in well with what we want to do.
Agreed. FWIW I'm not all that enthused about std.typelist. D's tuples
support random access and much
hand, type tuples are deeply anchored in the
language (variadics, ...), and better match the general
array/range theme of D, thus probably reducing »mental
overhead« for people not used to functional programming.
This is not to say that I don't find the std.typelist concept
interesting. We
As was recently pointed out on the Phobos list (
http://forum.dlang.org/post/CAEnAdhZTcuOL50TeRwCCG=E99nCA_Gh=y=ttheugknueac0...@mail.gmail.com
), we technically have std.typelist (which I'd never heard of before that
post), which Bartosz Milewski put together a few years ago. However, it's
On 22-06-2012 20:06, Jonathan M Davis wrote:
As was recently pointed out on the Phobos list (
http://forum.dlang.org/post/CAEnAdhZTcuOL50TeRwCCG=E99nCA_Gh=y=ttheugknueac0...@mail.gmail.com
), we technically have std.typelist (which I'd never heard of before that
post), which Bartosz Milewski put
On Fri, 22 Jun 2012 20:06:10 +0200, Jonathan M Davis jmdavisp...@gmx.com
wrote:
As was recently pointed out on the Phobos list (
http://forum.dlang.org/post/CAEnAdhZTcuOL50TeRwCCG=E99nCA_Gh=y=ttheugknueac0...@mail.gmail.com
), we technically have std.typelist (which I'd never heard of before
, ...), and better match the general
array/range theme of D, thus probably reducing »mental
overhead« for people not used to functional programming.
This is not to say that I don't find the std.typelist concept
interesting. We just should be very clear on how to go forward
with »meta« algorithms
(variadics, ...), and better match the general array/range theme of D,
thus probably reducing »mental overhead« for people not used to
functional programming.
This is not to say that I don't find the std.typelist concept
interesting. We just should be very clear on how to go forward with
»meta
On 06/22/12 21:13, David Nadlinger wrote:
This is not to say that I don't find the std.typelist concept
interesting. We just should be very clear on how to go forward with
»meta« algorithms in Phobos before going forward with this. Developing
std.typelist and std.typetuple side by side
On Friday, 22 June 2012 at 19:52:37 UTC, Guillaume Chatelet wrote:
+1, I'd add std.typecons to this list ( std.typecons.Tuple in
particular ).
The boundaries of each of those modules are kind of blurry and
overlapping.
std.typecons.Tuple lives in the run-time (and CTFE, for that
matter)
74 matches
Mail list logo