On Saturday, 24 December 2011 at 22:15:59 UTC, Jordi Sayol wrote:
Al 24/12/11 14:20, En/na mta`chrono ha escrit:
Unlike SiegeLord's branch I've removed tango's runtime and
build on top
of druntime. This step is inevitable in order to make tango
and phobos
work side by side.
SiegeLord's
Universal Function Call Syntax. C# calls them extension methods.
Basically, the ability to call a method directly on a class (in the form
of A.MyMethod) without it being declared in the class. Usually just a
static/global method that gets rewritten. Instead of MyMethod(A), you
can use
I'll try again on this.
My reading of the current documentation on casts leaves me with the
impression that D now has only the equivalent of the C++ dynamic_cast.
This seems unreasonably restrictive given that C++ has traditional C-
style cast, dynamic_cast, static_cast, and reinterpret_cast -
On Sunday, 25 December 2011 at 08:37:21 UTC, Steve Teale wrote:
I'll try again on this.
My reading of the current documentation on casts leaves me with
the impression that D now has only the equivalent of the C++
dynamic_cast.
This seems unreasonably restrictive given that C++ has
On 12/25/2011 02:57 AM, Kapps wrote:
Universal Function Call Syntax. C# calls them extension methods.
Basically, the ability to call a method directly on a class (in the form
of A.MyMethod) without it being declared in the class. Usually just a
static/global method that gets rewritten. Instead
Steve Teale:
My reading of the current documentation on casts leaves me with the
impression that D now has only the equivalent of the C++ dynamic_cast.
I'd like this in Phobos:
http://d.puremagic.com/issues/show_bug.cgi?id=5559
Bye,
bearophile
On Saturday, 24 December 2011 at 20:19:48 UTC, Andrei
Alexandrescu wrote:
Analogies of programming language with human language are
flawed and take nowhere interesting. The only text that gets
close to the level of precision and non-ambiguity needed is
legal text; reading any amount of legal
On Sun, 25 Dec 2011 08:37:21 +, Steve Teale wrote:
So what do you think is happening here?
ColorSelectionDialog csd = new ColorSelectionDialog(Choose a
Color);
writefln(csd %s, csd);
void* vp = cast(void*) csd.getColorSelection();
ColorSelection cs = cast(ColorSelection) vp;
On 25.12.2011 00:44, Timon Gehr wrote:
Not really. Functional style code tends to be conceptually simpler.
Having code that is more readable can help. Getting rid of (({return
{return}}){return()}) makes the code more readable, whereas excessively
shortening identifiers does the opposite.
See
On 2011-12-25 02:20, Adam D. Ruppe wrote:
On Saturday, 24 December 2011 at 23:51:57 UTC, bearophile wrote:
Using certain abstractions sometimes helps to write one idea only once
in a program. Etc.
This is the biggest one, and applies to all kinds of code.
I like to write little functions with
On 2011-12-25 04:05, zhang wrote:
On Fri, 23 Dec 2011 02:21:37 -, Walter Bright
newshou...@digitalmars.com wrote:
On 12/22/2011 11:25 AM, Piotr Szturmaj wrote:
I wish D could support partial modules - partial as analogy to C#'s
partial
classes.
module std.datetime-unit1;
import
On Sunday, 25 December 2011 at 13:39:15 UTC, Steve Teale wrote:
The segfault is presumably because Widget does not have a
setCurrentColor method, but why is the cast being ignored? Is
the compiler optimizing the intermediate cast to void away? I
don't find the asm from obj2asm helpful.
I
On 2011-12-25 05:44, Andrei Alexandrescu wrote:
On 12/24/2011 07:20 PM, Adam D. Ruppe wrote:
On Saturday, 24 December 2011 at 23:51:57 UTC, bearophile wrote:
Using certain abstractions sometimes helps to write one idea only once
in a program. Etc.
This is the biggest one, and applies to all
On Sunday, 25 December 2011 at 14:00:58 UTC, Jacob Carlborg wrote:
On 2011-12-25 04:05, zhang wrote:
On Fri, 23 Dec 2011 02:21:37 -, Walter Bright
newshou...@digitalmars.com wrote:
On 12/22/2011 11:25 AM, Piotr Szturmaj wrote:
I wish D could support partial modules - partial as analogy
On Tue, 20 Dec 2011 23:38:05 +0100, Paul D. Anderson wrote:
I recall seeing several times someone mentioning they were working on a
project called SciLib or SciLb or similar. If you're that person or
if you know who that person is, could you send me an e-mail?
Hi! Author of SciD here. I
Jacob Carlborg d...@me.com wrote in message
news:jd4qg2$9r5$1...@digitalmars.com...
On 2011-12-23 22:38, Somedude wrote:
Le 23/12/2011 18:11, Nick Sabalausky a écrit :
I'm actually inching closer to being a linux guy. Being able to easily
script just about everything is pretty nice, and
On 2011-12-25 15:31, Jakob Ovrum wrote:
On Sunday, 25 December 2011 at 14:00:58 UTC, Jacob Carlborg wrote:
On 2011-12-25 04:05, zhang wrote:
On Fri, 23 Dec 2011 02:21:37 -, Walter Bright
newshou...@digitalmars.com wrote:
On 12/22/2011 11:25 AM, Piotr Szturmaj wrote:
I wish D could
Ants AI Challenge sponsored by Google is now finished, 24 people have played
this contest using D2:
http://aichallenge.org/language_profile.php?language=D
The best D entry, by Minthos, with rank 439 (over about 8000 entries!):
http://aichallenge.org/profile.php?user=4823
Minthos D2 code:
On Sun, 25 Dec 2011 15:01:31 +0100, Vladimir Panteleev wrote:
I don't understand. Casting a void* to a class bypasses all static type
checks. This is one of those cases where you tell the compiler that you
know what you're doing - and if you try to call a method that wasn't in
the original
On Sunday, 25 December 2011 at 17:07:46 UTC, bearophile wrote:
It's usually better to think of pre/post increments as
returning void, and avoid code like this (but there is _far_
worse C/D code around):
lokeLars = path[index--];
I agree that one should *generally* avoid this kind of code,
Kagamin:
Copy-deployment is an advanced format, and I think it's pretty ok
for it to be 7z.
I suggest to just offer both zip and 7zip files.
Bye,
bearophile
But not without installing 3rd party software. Windows can
handle zip files out of the box. It can't handle the others.
rar would have exactly the same problem as 7z files (though
from what I've see rar files are much more commonly used). We
_could_ use a file format other than zip, but then
I suggest to just offer both zip and 7zip files.
Sure it can be done, but I doubt zip helps availability a lot.
On 12/25/2011 02:44 PM, simendsjo wrote:
On 25.12.2011 00:44, Timon Gehr wrote:
Not really. Functional style code tends to be conceptually simpler.
Having code that is more readable can help. Getting rid of (({return
{return}}){return()}) makes the code more readable, whereas excessively
The Mac OS X installer on dlang.org/dowloads says it is for i386 but
it's actually for 64bit.
--
/Jacob Carlborg
On Sunday, 25 December 2011 at 04:44:57 UTC, Andrei Alexandrescu
wrote:
I see every letter beyond this as a liability:
Yeah, though like Jacob said, the implementation doesn't
matter as much as the idea of giving it a name.
But, if you're curious about why I wrote it long form, it's
just a
On 12/25/2011 11:53 PM, Timon Gehr wrote:
On 12/25/2011 02:44 PM, simendsjo wrote:
On 25.12.2011 00:44, Timon Gehr wrote:
Not really. Functional style code tends to be conceptually simpler.
Having code that is more readable can help. Getting rid of (({return
{return}}){return()}) makes the
Timon Gehr:
http://pastebin.com/C6vf9DQQ
If possible I suggest to remove all the BigInt from the module, and put the
bigint import into the main():
void main() {
import std.bigint;
auto h = hamming!BigInt();
writeln(take(20, h));
writeln(h()[1_691]);
On 12/26/2011 12:30 AM, bearophile wrote:
Timon Gehr:
http://pastebin.com/C6vf9DQQ
If possible I suggest to remove all the BigInt from the module, and put the
bigint import into the main():
void main() {
import std.bigint;
auto h = hamming!BigInt();
writeln(take(20, h));
On 12/25/11 5:11 PM, Jacob Carlborg wrote:
The Mac OS X installer on dlang.org/dowloads says it is for i386 but
it's actually for 64bit.
Fixed. Looking good?
Andrei
On 12/25/11 5:13 PM, Adam D. Ruppe wrote:
On Sunday, 25 December 2011 at 04:44:57 UTC, Andrei Alexandrescu wrote:
I see every letter beyond this as a liability:
Yeah, though like Jacob said, the implementation doesn't
matter as much as the idea of giving it a name.
But, if you're curious
On Sunday, December 25, 2011 15:52:25 Lars T. Kyllingstad wrote:
As others have pointed out, Cristi Cobzarenco forked my code when he was
writing a linear algebra library for GSoC. However, in the process he
has removed almost everything that is not related to linear algebra.
Sounds like they
On Saturday, December 24, 2011 21:37:12 Kapps wrote:
The two biggest things that I believe D would benefit from, in terms of
readability, are UFCS and C#-style lambdas (which were already discussed).
Something like
'array(find(test, select!(a.name)(filter!(a.num 3)(Elements'
Could be
On Saturday, December 24, 2011 22:26:02 Andrei Alexandrescu wrote:
On 12/24/2011 06:58 PM, Vladimir Panteleev wrote:
On Saturday, 24 December 2011 at 20:09:46 UTC, bearophile wrote:
GNU C has a noreturn attribute since a lot of time. I don't fully
understand why such attribute is so useful
I posted about this contest in D.learn, so it was expectable that people
try out D there without a good feel for the language and its shortcuts.
Rank 439 is respectable, but I hoped for a higher ranked D entry.
I don't know if there should to be an optimized boolean matrix in Phobos.
Is
On Monday, 26 December 2011 at 00:46:44 UTC, Jonathan M Davis
wrote:
Sounds like they should probably be merged at some point.
- Jonathan M Davis
Yeah, I've started working on Cristi's fork now that I've built a
good enough mental model of the implementation details that I can
modify the
I've found this sort of bug in xfBuild:
import std.stdio;
class Deps { }
struct Mod {
Deps deps;
}
void main() {
Mod[] compileArray;
foreach (i; 0 .. 2) {
compileArray ~= Mod(new Deps);
}
foreach (mod; compileArray) {
mod.deps = null;
}
foreach
On Monday, 26 December 2011 at 02:31:52 UTC, Adam D. Ruppe wrote:
I like an individual line of code to be dumb as a rock anyway.
I'm reminded of a discussion I had on another forum, where someone
suggested this might be because I started with assembly language.
It might be that those first
On Monday, 26 December 2011 at 00:40:47 UTC, Andrei Alexandrescu
wrote:
I understand. Personally, I am unable to bring myself to fathom
why writing this has any advantage:
if(condition) return false just avoids a negation in the
condition.
It's easier to miss a ! entirely than to miss a
Le 25/12/2011 05:27, Andrei Alexandrescu a écrit :
Got the GC book this morning, already read 2.5 chapters :o).
Andrei
You'll find that you can do a lot when GC is aware of immutability (in
functionnal languages, most things tends to be immutable).
In the actual state of druntime, the GC
On Monday, 26 December 2011 at 02:06:18 UTC, Andrej Mitrovic
wrote:
This will print false, false.
After reading the code, I thought the surprise was that it
printed true :)
Perhaps making the default foreach behavior to make copies of
structs wasn't the best idea, also due to performance
On 12/25/11 8:56 PM, deadalnix wrote:
Le 25/12/2011 05:27, Andrei Alexandrescu a écrit :
Got the GC book this morning, already read 2.5 chapters :o).
Andrei
You'll find that you can do a lot when GC is aware of immutability (in
functionnal languages, most things tends to be immutable).
In
Is there a way to change what is compiled in based on whether the -m32 or -m64
option is chosen? I can see that there are predefined versions (for X86 and
X86_64 e.g.), but I don't know if this is based on the compile options, or the
platform the compilation is being performed on. As an example,
On Monday, 26 December 2011 at 05:41:11 UTC, Nathan Coe wrote:
As an example, if I am compiling on a 64-bit intel machine, is
the version X86 or X86_64 set by default?
The predefined version identifiers specify the *target*
architecture.
Note that the default target architecture matches the
On 24.12.2011 22:12, bearophile wrote:
Caligo:
I'm hoping to see something like the above mod function in Phobos someday.
I'd like that, for both int/long/BigInts. And I'd like some functions for
BigInts:
- divmod: returns both % and div and %, but it's more efficient if you need
both
On 12/25/2011 10:57 PM, Don wrote:
On 24.12.2011 22:12, bearophile wrote:
Caligo:
I'm hoping to see something like the above mod function in Phobos someday.
I'd like that, for both int/long/BigInts. And I'd like some functions for
BigInts:
- divmod: returns both % and div and %, but it's
Hi folks,
Is there a GetAndSet function (corresponding to cas (compare and set)
function) in D?
Thanks.
25.12.2011 0:48, Mr. Anonymous пишет:
Actually, when I think of it:
int a_orig = a++;
int[] arr_orig = arr[]++;
Should be read as:
int a_orig = a;
++a;
int[] arr_orig = arr[];
++arr[];
(If I'm not mistaken, it was written in the TDPL book)
Which means no copy of arr is made, and both arrays
On 12/25/2011 09:25 AM, Adrian Mercieca wrote:
Hi folks,
Is there a GetAndSet function (corresponding to cas (compare and set)
function) in D?
Thanks.
core.atomic.cas
http://dlang.org/phobos/core_atomic.html#cas
--
Mike Wey
On Sun, 25 Dec 2011 13:37:32 +0100, Mike Wey wrote:
On 12/25/2011 09:25 AM, Adrian Mercieca wrote:
Hi folks,
Is there a GetAndSet function (corresponding to cas (compare and set)
function) in D?
Thanks.
core.atomic.cas
http://dlang.org/phobos/core_atomic.html#cas
I know of the cas
Linking the following two files gives me a link-error:
a.d:
import std.stdio;
extern (D) string test ();
void main()
{
writeln(test());
readln();
}
b.d:
string test () {
I want to save the hInstance of WinMain so I would be able to use it later in
some
other module. So how do I accomplish that ?
Am 25.12.2011 22:37, schrieb Tal:
I want to save the hInstance of WinMain so I would be able to use it later in
some
other module. So how do I accomplish that ?
just define a public variable in the global scope.
I'm quite new to this language, could you please provide a short snippet of code
to clarify ?
Am 25.12.2011 23:26, schrieb Tal:
I'm quite new to this language, could you please provide a short snippet of code
to clarify ?
--- a.d:
import std.stdio;
import b;
void main() {
writeln(some_var from Module b: \, b.some_var, \);
}
--- b.d:
public string some_var = Hello, world!;
//you
Am 25.12.2011 22:37, schrieb Tal:
I want to save the hInstance of WinMain so I would be able to use it later in
some
other module. So how do I accomplish that ?
If you don't know: You can also get the HINSTANCE with
GetModuleHandle(NULL);
On Sunday, 25 December 2011 at 22:46:33 UTC, Joshua Reusch wrote:
public string some_var = Hello, world!;
It's important to note that public is the default access level
here.
http://d.puremagic.com/issues/show_bug.cgi?id=7133
--- Comment #11 from Jakob Ovrum jakobov...@gmail.com 2011-12-25 01:03:29 PST
---
(In reply to comment #10)
In fact the oddity is that labels are considered to be statements, yet they
don't end with a semicolon.
Block, if, while, do, for,
http://d.puremagic.com/issues/show_bug.cgi?id=5605
Kenji Hara k.hara...@gmail.com changed:
What|Removed |Added
Keywords||patch, rejects-valid
http://d.puremagic.com/issues/show_bug.cgi?id=4596
Kenji Hara k.hara...@gmail.com changed:
What|Removed |Added
Keywords||patch
http://d.puremagic.com/issues/show_bug.cgi?id=7161
Denis verylonglogin@gmail.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=4539
Denis verylonglogin@gmail.com changed:
What|Removed |Added
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=4539
--- Comment #15 from Kenji Hara k.hara...@gmail.com 2011-12-25 07:29:50 PST
---
Updated patch.
https://github.com/D-Programming-Language/dmd/pull/164
A string literal should be able to bind a reference to static array type.
In the context of
http://d.puremagic.com/issues/show_bug.cgi?id=5605
Walter Bright bugzi...@digitalmars.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=4647
Walter Bright bugzi...@digitalmars.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=7164
Summary: Can't inline function literal
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
http://d.puremagic.com/issues/show_bug.cgi?id=7165
Summary: [CTFE] ice converting null pointer to bool with
constant member function
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
67 matches
Mail list logo