I'll be giving a presentation on The Many Faces of D at the Northwest C++ Users'
Group meeting on Sept. 15.
http://nwcpp.org/
3 copies of The D Programming Language book autographed by Andrei will be given
out as door prizes. Light refreshments, too!
See y'all there.
Iain Buclaw wrote:
When it comes to using goto in D, the behaviour seems to be that you cannot
enter a try block, and neither can you enter or exit from a
finally block.
What about catch blocks? It seems that there is no restrictions imposed on
them, meaning that the following is legal.
bearophile wrote:
Something that seems fit for the D2 standard library, a lossless compressor
meant to speed up some memory-heavy operations (already used in Pytables):
http://blosc.pytables.org/trac
Bye,
bearophile
Which specific standard D2 library module do you propose this fit for?
Philippe Sigaud philippe.sig...@gmail.com wrote:
I guess the D syntax would be
auto x = amb([1,2,3]);
auto y =amb([4,5,6]);
x*y == 8; // forces desambiguation = the ambs explore the possibilities.
assert(x == amb([2]));
assert(y == amb([4]));
There is only one value left, no more ambiguity.
Justin Johansson:
Which specific standard D2 library module do you propose this fit for?
std.memory, that contains some special allocators too :-)
Bye,
bearophile
Regarding the recent small thread about the new statement, this is how the
Dylan language faces the problem (found through Lambda The Ultimate):
http://www.opendylan.org/books/drm/Constructing_and_Initializing_Instances#make
Bye,
bearophile
On Sat, Sep 4, 2010 at 23:55, bearophile bearophileh...@lycos.com wrote:
It computes the result (ghc-6.8.2) in 0.93s using only 8.7 MB of memory.
OK, so that may the difference between GHCi and GHC proper. Less than 1s is
impressive.
I see I have GHC 6.12.3 on my system. I may give this code
On Sun, Sep 5, 2010 at 12:00, Simen kjaeraas simen.kja...@gmail.com wrote:
Philippe Sigaud philippe.sig...@gmail.com wrote:
I guess the D syntax would be
auto x = amb([1,2,3]);
auto y =amb([4,5,6]);
x*y == 8; // forces desambiguation = the ambs explore the possibilities.
assert(x ==
On Sun, 05 Sep 2010 16:59:31 +0400, Philippe Sigaud
philippe.sig...@gmail.com wrote:
But the real challenge in the SO question is the 'going back in time'
part,
which I have trouble to understand : how can you modify x and y through a
multiplication and a comparison?
It can be done using
Philippe Sigaud:
Less than 1s is impressive.
To compare, on the Ideone site the third Python version (Python 2.6.4 + Psyco)
takes 1.46s and max 88 MB (this is where what Don has said about D bignums is
important):
http://ideone.com/5NvzR
Maybe with lazy int delegates ?
Right, but the devil
On 09/05/2010 07:59 AM, Philippe Sigaud wrote:
On Sun, Sep 5, 2010 at 12:00, Simen kjaeraas simen.kja...@gmail.com
mailto:simen.kja...@gmail.com wrote:
Philippe Sigaud philippe.sig...@gmail.com
mailto:philippe.sig...@gmail.com wrote:
I guess the D syntax would be
auto
2010/9/5 Denis Koroskin 2kor...@gmail.com
On Sun, 05 Sep 2010 16:59:31 +0400, Philippe Sigaud
philippe.sig...@gmail.com wrote:
But the real challenge in the SO question is the 'going back in time'
part,
which I have trouble to understand : how can you modify x and y through a
On Sun, Sep 5, 2010 at 15:56, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
equivalent to the problem:
auto solution = comp!([a,b], a*b == 8)([1,2,3], [4,5,6]);
solution is a range, in this case a one element range, containing only
[2,4].
I did a range comprehension maybe one
On Sun, Sep 5, 2010 at 16:30, Philippe Sigaud philippe.sig...@gmail.comwrote:
What you call crossProduct can be seen as zipWith!tuple(range, range2),
which
Scratch that. zipWith *is* mapping on n ranges in parallel.
On Sun, 05 Sep 2010 18:24:43 +0400, Philippe Sigaud
philippe.sig...@gmail.com wrote:
2010/9/5 Denis Koroskin 2kor...@gmail.com
On Sun, 05 Sep 2010 16:59:31 +0400, Philippe Sigaud
philippe.sig...@gmail.com wrote:
But the real challenge in the SO question is the 'going back in time'
part,
Denis Koroskin:
The code above should print:
state saved
state restored
(not tested)
On Windows, dmd 2.048, this code:
import std.c.stdio: puts;
version (Windows) {
alias int[16] jmp_buf;
extern (C) extern {
int setjmp(ref jmp_buf env);
void longjmp(ref jmp_buf
Looks very slick, much better then the current design. It gives a better
overview,
and is a relieve to the eye :)
Few things I'd like to mention:
- perhaps make the paragraph headers larger in font size, when scrolling down
it's not too easy to scan for the right paragraph titles
- the link
On Sun, 05 Sep 2010 19:17:55 +0400, bearophile bearophileh...@lycos.com
wrote:
Denis Koroskin:
The code above should print:
state saved
state restored
(not tested)
On Windows, dmd 2.048, this code:
import std.c.stdio: puts;
version (Windows) {
alias int[16] jmp_buf;
extern (C)
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in
news:i5rovm$1q4...@digitalmars.com:
For classes this must be an rvalue.
Andrei
I reported this as issue 4819.
Denis Koroskin:
Turn main into an extern(C) int main() and it works.
This version:
import std.c.stdio: puts;
version (Windows) {
alias int[16] jmp_buf;
extern (C) extern {
int setjmp(ref jmp_buf env);
void longjmp(ref jmp_buf env, int value);
}
}
struct State {
On Sun, 05 Sep 2010 20:18:13 +0400, bearophile bearophileh...@lycos.com
wrote:
Denis Koroskin:
Turn main into an extern(C) int main() and it works.
This version:
import std.c.stdio: puts;
version (Windows) {
alias int[16] jmp_buf;
extern (C) extern {
int setjmp(ref
On 09/05/2010 09:30 AM, Philippe Sigaud wrote:
On Sun, Sep 5, 2010 at 15:56, Andrei Alexandrescu
seewebsiteforem...@erdani.org mailto:seewebsiteforem...@erdani.org
wrote:
equivalent to the problem:
auto solution = comp!([a,b], a*b == 8)([1,2,3], [4,5,6]);
solution is
Philippe Sigaud philippe.sig...@gmail.com wrote:
But the real challenge in the SO question is the 'going back in time'
part,
which I have trouble to understand : how can you modify x and y through a
multiplication and a comparison?
I believe this to be possible, though horrible and
A paper I've recently read:
Verifiable Functional Purity in Java, by Matthew Finifter, Adrian Mettler,
Naveen Sastry and David Wagner:
http://www.cs.berkeley.edu/~finifter/pure-ccs08.pdf
At page 12 it says some things about D2 too (this article is not updated to the
last changes in D2):
In
Don:
That's impossible. That would make interfacing to C a nightmare.
I see.
By the way, enums which consist of flags frequently have values which
have more than one bit set. The case { A=1, B=2, C=4, D=8 } is only a
special case.
That indeed happens, but from the code that I have seen
David Gileadi wrote:
Sorry, I think it's going to stay static HTML: the website is generated
using DDoc macros and I believe Walter is unlikely to want to go in any
other direction.
Yes, because static HTML makes the pages load fast. There are a lot of web sites
out there with dynamic
Does this mean assigning to fields won't be an option anymore when using this?
E.g.:
class Foo
{
int x;
int y;
void changeXY(int x, int y)
{
this.x = x;
this.y = y;
}
}
On Sun, Sep 5, 2010 at 6:09 PM, JMRyan nos...@nospam.com wrote:
Andrei Alexandrescu
Gmail likes to eat my code for some reason, it just ate two closing
parantheses.. lol.
On Mon, Sep 6, 2010 at 12:02 AM, Andrej Mitrovic
andrej.mitrov...@gmail.com wrote:
Does this mean assigning to fields won't be an option anymore when using this?
E.g.:
class Foo
{
int x;
int y;
On Sunday 05 September 2010 15:02:10 Andrej Mitrovic wrote:
Does this mean assigning to fields won't be an option anymore when using
this?
E.g.:
class Foo
{
int x;
int y;
void changeXY(int x, int y)
{
this.x = x;
this.y = y;
}
}
No, it simply
bearophile bearophileh...@lycos.com wrote:
class or instance immutability is necessary to ensure determinism in a
concurrent program, as otherwise a mutable alias can be used to
concurrently modify the object.
That's the price of being a systems language - it is possible to subvert
the type
Ok, thanks. I never liked the lvalue rvalue names.. For example
http://en.wikipedia.org/wiki/Value_%28computer_science%29
l-value, non-lvalue, rvalue, nonlvalue.. bleh. It's the same thing as
when I see mutable, non-immutable, non-mutable, immutable sprinkled
with a few tripple negatives all
Simen kjaeraas:
So it is basically exactly like D, only no mutable global state?
It's similar, of couse. I think there is no 'pure' tag, the compiler infers if
a method is pure on the base of its arguments. In D even a function that is
technically pure is not seen as pure of you don't tag it
On Sunday 05 September 2010 16:59:19 bearophile wrote:
Simen kjaeraas:
So it is basically exactly like D, only no mutable global state?
It's similar, of couse. I think there is no 'pure' tag, the compiler infers
if a method is pure on the base of its arguments. In D even a function
that is
On 09/05/2010 05:02 PM, Andrej Mitrovic wrote:
Does this mean assigning to fields won't be an option anymore when using this?
E.g.:
class Foo
{
int x;
int y;
void changeXY(int x, int y)
{
this.x = x;
this.y = y;
}
}
No, guys, most everything will
Jonathan M Davis wrote:
Having the compiler determine purity would be cool, but it runs into a few of
problems.
The most serious one I can think of is:
Suppose you are depending on a function being pure. If the compiler determines
its purity, it *does not tell you* if it is impure. Your code
Walter Bright newshou...@digitalmars.com wrote:
Jonathan M Davis wrote:
Having the compiler determine purity would be cool, but it runs into a
few of problems.
The most serious one I can think of is:
Suppose you are depending on a function being pure. If the compiler
determines its
Andrei:
If you can write (new Foo).x = x, then you can also write this.x = x. Try it
now!
See my bug reports/enhancement requests (about three days ago in a program of
mine I have added a bug that enhancement 4407 is able to avoid):
Arguments and attributes with the same name
Walter Bright:
The most serious one I can think of is:
Just to be sure: in my original post of this thread I have not asked to change
D. I was just showing a paper.
Bye,
bearophile
++ on that bug report.
On a similar note, today I was rewriting a dsource class example
because I wanted to show that you can use this.name to assign to
fields that have the same name as a parameter. And then I accidentally
made this mistake when writing a different method:
class Foo
{
I've started playing around with Orange a little to see whether it would meet
D's cloning needs. IMHO one must-have feature for proper cloning that truly
just works is full aliasing preservation. For example, the following code
modified slightly from the Orange example doesn't work properly:
We already have:
libphobos.a Phobos 1, 32 bit
libphobos2.a Phobos 2, 32 bit
What should the 64 bit Phobos be named?
On 9/5/2010 9:39 PM, Walter Bright wrote:
We already have:
libphobos.a Phobos 1, 32 bit
libphobos2.a Phobos 2, 32 bit
What should the 64 bit Phobos be named?
No change in name, change in directory holding it.
ie.. lib64/libphobos*
That's what most major distributions do.
For
Why labor over buggy Makefiles when you could be laboring over buggy
CMake files at a much more productive level of abstraction? :o)
With excellent help from Jens Mueller and Dean Calver, CMake for D2
now passes our small suite of unit tests on both Windows and Linux.
Our tests include mixed C-D
On 05/09/2010 02:16, Jonathan M Davis wrote:
void foo(T)(T[] collection, T elem)
{
// Blah, whatever
}
I am curious, how this will look and feel once inout is working ?
inout void foo(T)(inout(T)[] collection, inout T elem)
{
// Blah, whatever}
}
On 2010-09-05 02:18, Jonathan M Davis wrote:
On Saturday 04 September 2010 12:06:23 Era Scarecrow wrote:
I'm currently porting a D1 code base to D2 which has the
following class
hierarchy:
interface Map
{
void clear ();
}
class Hashtable : Map
{
synchronized void clear () {};
}
On 2010-09-04 21:06, Era Scarecrow wrote:
I'm currently porting a D1 code base to D2 which has the
following class
hierarchy:
interface Map
{
void clear ();
}
class Hashtable : Map
{
synchronized void clear () {};
}
class HashMap : Map
{
void clear () {};
}
When I compiler
Jonathan M Davis:
Also, according to TDPL, either your _entire class_ is synchronized, or none
of
it is. So, synchronized really belongs on the class, not the function, and I
wouldn't expect it to compile if only a portion of your functions are
synchronized (though I don't know how close
Jonathan M Davis:
Also, according to TDPL, either your _entire class_ is synchronized, or
none of
it is. So, synchronized really belongs on the class, not the function, and I
wouldn't expect it to compile if only a portion of your functions are
synchronized (though I don't know how
This may be a stupid question:
Does std.socket encorporate or replace pipe usage? Ie, if I'm going to do
something along the lines of (psuedo-code):
auto parentToChild = pipe();
auto childToParent = pipe();
if(fork())
{
// talk to other process
}
else
{
// talk to other process
}
Is
Hi all,
so I have started to look at D and dug through the documentation, but
could not get a good answer on the following:
How can I have a (temporary) dynamic array on stack and make references
to it (no copying)? I successively put integers in an array (but don't
know how much there will be
Tom Kazimiers:
How can I have a (temporary) dynamic array on stack and make references
to it (no copying)? I successively put integers in an array (but don't
know how much there will be in advance) with an appender!(int[]) and get
the date out with appender.data(). Later on I pass the result
On Sunday 05 September 2010 18:02:29 Tom Kazimiers wrote:
Hi all,
so I have started to look at D and dug through the documentation, but
could not get a good answer on the following:
How can I have a (temporary) dynamic array on stack and make references
to it (no copying)? I successively
My first test shows that it may work. But I have to grow the array backwards,
and push back the array start, because that's how my stack grows (using alloca
to allocate geometrically bigger chunks). So unless you want to reverse the
items once the array is built, you have to change the
http://d.puremagic.com/issues/show_bug.cgi?id=4815
Summary: CodeView: Global and Static symbols should have
unmangled names
Product: D
Version: unspecified
Platform: Other
OS/Version: Windows
Status: NEW
http://d.puremagic.com/issues/show_bug.cgi?id=4816
Summary: template constraint and __traits(compiles, ...) don't
work properly together with a delegate
Product: D
Version: D2
Platform: Other
OS/Version: Linux
http://d.puremagic.com/issues/show_bug.cgi?id=4817
Summary: CodeView: Enum members should have simple names
Product: D
Version: unspecified
Platform: Other
OS/Version: Windows
Status: NEW
Severity: normal
Priority:
http://d.puremagic.com/issues/show_bug.cgi?id=4009
--- Comment #10 from Walter Bright bugzi...@digitalmars.com 2010-09-05
03:28:45 PDT ---
The overflow would happen when some of the data structures exceeded 128K in
size.
I checked the other seg faults for optlink in Bugzilla, but those
http://d.puremagic.com/issues/show_bug.cgi?id=4818
Summary: Taking address of shared member function - unshared
delegate
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Severity:
http://d.puremagic.com/issues/show_bug.cgi?id=4821
Summary: std.array.insert on string[]
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
http://d.puremagic.com/issues/show_bug.cgi?id=2943
--- Comment #4 from Serg Kovrov kovrov+purema...@gmail.com 2010-09-05
09:16:32 PDT ---
I do. As stated in comment for Bug 3135#c1 - an empty postblit function seem to
workaround the issue..
--
Configure issuemail:
http://d.puremagic.com/issues/show_bug.cgi?id=2943
--- Comment #5 from David Simcha dsim...@yahoo.com 2010-09-05 09:52:19 PDT ---
(In reply to comment #3)
doesn't anyone use alias this?
I mostly don't, but only b/c it's currently so buggy it's not even funny. I
just looked, I myself have
http://d.puremagic.com/issues/show_bug.cgi?id=4822
Summary: Problem with std.stdio.File.writef(%c
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
http://d.puremagic.com/issues/show_bug.cgi?id=4823
Summary: CodeView: Thread local variables are stored as shared
globals
Product: D
Version: unspecified
Platform: Other
OS/Version: Windows
Status: NEW
http://d.puremagic.com/issues/show_bug.cgi?id=4824
Summary: stopwatch unit tests fail intermitently
Product: D
Version: D2
Platform: Other
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
http://d.puremagic.com/issues/show_bug.cgi?id=4825
--- Comment #1 from nfx...@gmail.com 2010-09-05 15:46:57 PDT ---
I have to add that this bug triggers even when the const int... line on
function c is in a different function in a different module. This makes it a
very non-obvious bug, where
http://d.puremagic.com/issues/show_bug.cgi?id=4795
Brad Roberts bra...@puremagic.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=4797
Brad Roberts bra...@puremagic.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=4826
Summary: cannot create associative array and compiler crash
Product: D
Version: D2
Platform: x86_64
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
http://d.puremagic.com/issues/show_bug.cgi?id=4826
--- Comment #1 from brian-sch...@cox.net 2010-09-05 19:29:53 PDT ---
Here's the code that fails:
The second opIndexAssign is written this way because of bug 2972.
module testcase;
struct SomeStruct
{
void opIndexAssign(T)(T[string] value,
http://d.puremagic.com/issues/show_bug.cgi?id=4826
--- Comment #2 from brian-sch...@cox.net 2010-09-05 19:34:48 PDT ---
(In reply to comment #1)
That should have been:
void opIndexAssign(T)(T value, string key) if(is(T : SomeStruct))
{
}
But the error is the same either way. Bugzilla needs
70 matches
Mail list logo