Re: Announcing: D support in SWIG

2011-01-19 Thread Jordi
Hi, I just wanted to drop a note to say that i have tried it and it works quite well. I am wrapping a small C++ library and using in my D application. Thanks! j. On 11/21/2010 06:27 PM, klickverbot wrote: In a nutshell, SWIG is a »glue code« generator, allowing you to access C/C++

Re: Announcing: D support in SWIG

2011-01-19 Thread Trass3r
I just wanted to drop a note to say that i have tried it and it works quite well. I am wrapping a small C++ library and using in my D application. Is there a tutorial (not 50 pages of text) about what needs to be done to support a C++ library?

Re: Announcing: D support in SWIG

2011-01-19 Thread Jordi
On 01/19/2011 07:16 PM, Trass3r wrote: I just wanted to drop a note to say that i have tried it and it works quite well. I am wrapping a small C++ library and using in my D application. Is there a tutorial (not 50 pages of text) about what needs to be done to support a C++ library? I don't

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-19 Thread spir
On 01/18/2011 06:11 AM, Ali Çehreli wrote: Thanks to all that has contributed, I am also following this thread with great interest. :) Michel Fortin wrote: I mean, a grapheme is a slice of a string, can have multiple code points (like a string), can be appended the same way as a string, can

Fixes for http://d.puremagic.com/issues/show_bug.cgi?id=4883 coming

2011-01-19 Thread Andrei Alexandrescu
I moved a bunch of functions from std.string to std.array and std.algorithsm. I did my best to minimize impact but there will be some effects on user code, particularly if it qualifies names explicitly. Please let me know if you think of better ways of dealing with this transition.

string repr range levels [was: Re: VLERange: ...]

2011-01-19 Thread spir
On 01/19/2011 08:43 AM, Ali Çehreli wrote: Michel Fortin wrote: On 2011-01-17 17:54:04 -0500, Michel Fortin michel.for...@michelf.com said: So perhaps the best interface for strings would be to provide multiple range-like interfaces that you can use at the level you want. That's what

Re: What Makes A Programming Language Good

2011-01-19 Thread spir
On 01/18/2011 07:10 PM, bearophile wrote: spir: The D styleguide requires on one hand capitalised names for types, and lowercase for filenames on the other. How are we supposed to make them match? Why do you want them to match? Because when a module defines a type Foo (or rather, it's what

Re: DVCS (was Re: Moving to D)

2011-01-19 Thread Walter Bright
KennyTM~ wrote: You should use LF ending, not CRLF ending. I never thought of that. Fixing that, it gets further, but still innumerable errors: walter@mercury:~$ ./buildmeld [sudo] password for walter: Reading package lists... Done Building dependency tree Reading state information... Done

Re: DVCS (was Re: Moving to D)

2011-01-19 Thread Vladimir Panteleev
On Wed, 19 Jan 2011 13:11:07 +0200, Walter Bright newshou...@digitalmars.com wrote: KennyTM~ wrote: You should use LF ending, not CRLF ending. I never thought of that. Fixing that, it gets further, but still innumerable errors: If apt-get update doesn't fix it, only an update will -

Re: What Makes A Programming Language Good

2011-01-19 Thread spir
On 01/19/2011 05:16 AM, Jesse Phillips wrote: This is what the Open Scalable Language Toolchains talk is about http://vimeo.com/16069687 The idea is that the compile has the job of compiling the program and providing information about the program to allow other tools to make use of the

Re: DVCS (was Re: Moving to D)

2011-01-19 Thread Walter Bright
Vladimir Panteleev wrote: On Wed, 19 Jan 2011 13:11:07 +0200, Walter Bright newshou...@digitalmars.com wrote: KennyTM~ wrote: You should use LF ending, not CRLF ending. I never thought of that. Fixing that, it gets further, but still innumerable errors: If apt-get update doesn't fix it,

Re: Fixes for http://d.puremagic.com/issues/show_bug.cgi?id=4883 coming

2011-01-19 Thread spir
On 01/19/2011 10:20 AM, Andrei Alexandrescu wrote: I moved a bunch of functions from std.string to std.array and std.algorithsm. I did my best to minimize impact but there will be some effects on user code, particularly if it qualifies names explicitly. Hello Andrei, Will the online doc

Re: What Makes A Programming Language Good

2011-01-19 Thread bearophile
spir: Because when a module defines a type Foo (or rather, it's what is exported), I like it to be called Foo.d. Generally D modules contain many types. Bye, bearophile

Re: What Makes A Programming Language Good

2011-01-19 Thread Daniel Gibson
Am 19.01.2011 07:35, schrieb Vladimir Panteleev: On Wed, 19 Jan 2011 08:09:11 +0200, Austin Hastings ah0801...@yahoo.com wrote: On 1/19/2011 12:50 AM, Vladimir Panteleev wrote: On Wed, 19 Jan 2011 07:16:40 +0200, Austin Hastings ah0801...@yahoo.com wrote: None of them worked. Most of

Re: What Makes A Programming Language Good

2011-01-19 Thread Vladimir Panteleev
On Wed, 19 Jan 2011 12:57:42 +0200, spir denis.s...@gmail.com wrote: Because when a module defines a type Foo (or rather, it's what is exported), I like it to be called Foo.d. A module called doFoo.d would certainly mainly define a func doFoo. So, people directly know what's in there (and

Re: What Makes A Programming Language Good

2011-01-19 Thread Jacob Carlborg
On 2011-01-19 06:55, Andrei Alexandrescu wrote: On 1/18/11 11:37 PM, Vladimir Panteleev wrote: On Tue, 18 Jan 2011 22:17:08 +0200, Walter Bright newshou...@digitalmars.com wrote: Vladimir Panteleev wrote: IMO, sticking to the C-ism of one object file at a time and dependency on external

Re: What Makes A Programming Language Good

2011-01-19 Thread Jacob Carlborg
On 2011-01-18 17:29, Andrei Alexandrescu wrote: On 1/18/11 6:36 AM, Lutger Blijdestijn wrote: Vladimir Panteleev wrote: On Tue, 18 Jan 2011 13:35:34 +0200, Lutger Blijdestijn lutger.blijdest...@gmail.com wrote: I'm pretty happy that my Fedora repositories are just a handful, most of which

Re: What Makes A Programming Language Good

2011-01-19 Thread nedbrek
Vladimir Panteleev vladi...@thecybershadow.net wrote in message news:op.vpjlwrletuz...@cybershadow.mshome.net... On Wed, 19 Jan 2011 08:09:11 +0200, Austin Hastings ah0801...@yahoo.com wrote: On 1/19/2011 12:50 AM, Vladimir Panteleev wrote: Actually, you're probably right here. To my

Re: What Makes A Programming Language Good

2011-01-19 Thread spir
On 01/19/2011 12:56 PM, bearophile wrote: spir: Because when a module defines a type Foo (or rather, it's what is exported), I like it to be called Foo.d. Generally D modules contain many types. Yep, but often one is the main exported element. When there are several, hopefully sensibly

Re: What Makes A Programming Language Good

2011-01-19 Thread Gour
On Wed, 19 Jan 2011 14:07:27 +0100 Jacob Carlborg d...@me.com wrote: I'm not an expert but I've been thinking for a while about doing a package system for D, basically RubyGems but for D. Have you thought about waf (which already has some support for D as build system) and it is intended to

Re: What Makes A Programming Language Good

2011-01-19 Thread Adam Ruppe
Jim wrote: I never claimed that file storage was an optimisation. The compiler can optimise better by seeing more source code (or a greater AST if you will) at compile time. Inlining, for example, can only occur within a compilation unit. I'm arguing that a file is not the optimal compilation

Re: What Makes A Programming Language Good

2011-01-19 Thread Adam Ruppe
Andrei wrote: We need a package system that takes Internet distribution into account. Do you think something like my simple http based system would work? Fetch dependencies. Try to compile. If the linker complains about missing files, download them from http://somewebsite/somepath/filename,

Re: What Makes A Programming Language Good

2011-01-19 Thread Daniel Gibson
Am 19.01.2011 14:56, schrieb Adam Ruppe: Andrei wrote: We need a package system that takes Internet distribution into account. Do you think something like my simple http based system would work? Fetch dependencies. Try to compile. If the linker complains about missing files, download them

Re: What Makes A Programming Language Good

2011-01-19 Thread Adam Ruppe
Daniel Gibson wrote: That'd suck horribly for bigger projects, and also when you've got a lot of dependencies, I guess Maybe, especially if the dependencies have dependencies (it'd have to download one set before knowing what to look for for the next set), but that is a one time cost - after

Re: What Makes A Programming Language Good

2011-01-19 Thread Andrei Alexandrescu
On 1/19/11 7:56 AM, Adam Ruppe wrote: Andrei wrote: We need a package system that takes Internet distribution into account. Do you think something like my simple http based system would work? Fetch dependencies. Try to compile. If the linker complains about missing files, download them

Re: join

2011-01-19 Thread Ary Manzana
On 1/18/11 4:25 PM, Andrei Alexandrescu wrote: I implemented a simple separatorless joiner as follows: auto joiner(RoR)(RoR r) Hi Andrei, What does it do? How do you use it? And why prime? When I read it I remember the meaning of prime number. I just looked up in the dictionary, it seems

Re: What Makes A Programming Language Good

2011-01-19 Thread Jacob Carlborg
On 2011-01-19 14:39, Gour wrote: On Wed, 19 Jan 2011 14:07:27 +0100 Jacob Carlborgd...@me.com wrote: I'm not an expert but I've been thinking for a while about doing a package system for D, basically RubyGems but for D. Have you thought about waf (which already has some support for D as

Re: What Makes A Programming Language Good

2011-01-19 Thread Jacob Carlborg
On 2011-01-19 14:56, Adam Ruppe wrote: Andrei wrote: We need a package system that takes Internet distribution into account. Do you think something like my simple http based system would work? Fetch dependencies. Try to compile. If the linker complains about missing files, download them

Re: Potential patent issues

2011-01-19 Thread Jeff Nowakowski
On 01/18/2011 05:52 PM, BlazingWhitester wrote: Walter, could you give some comments about this? Does dmd violate anything? It's probably in Walter's best interest to not even look at it. On the one hand, it's probably a crap software patent that the Patent Office has been handing out like

Re: join

2011-01-19 Thread Andrei Alexandrescu
On 1/19/11 11:39 AM, Ary Manzana wrote: On 1/18/11 4:25 PM, Andrei Alexandrescu wrote: I implemented a simple separatorless joiner as follows: auto joiner(RoR)(RoR r) Hi Andrei, What does it do? How do you use it? Given a range of ranges, joiner concatenates them all with an optional

Re: join

2011-01-19 Thread Andrej Mitrovic
On 1/19/11, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: import std.algorithm, std.stdio; void main() { auto stuff = [ coat, husky, sled, ]; writeln(joiner(stuff)); writeln(joiner(stuff, ; )); } coat; husky; sled This will be great for string mixins. int first,

Re: What Makes A Programming Language Good

2011-01-19 Thread Jacob Carlborg
On 2011-01-19 18:44, Jacob Carlborg wrote: On 2011-01-19 14:39, Gour wrote: On Wed, 19 Jan 2011 14:07:27 +0100 Jacob Carlborgd...@me.com wrote: I'm not an expert but I've been thinking for a while about doing a package system for D, basically RubyGems but for D. Have you thought about waf

Re: DVCS (was Re: Moving to D)

2011-01-19 Thread retard
Wed, 19 Jan 2011 03:11:07 -0800, Walter Bright wrote: KennyTM~ wrote: You should use LF ending, not CRLF ending. I never thought of that. Fixing that, it gets further, but still innumerable errors: [snip] I already told you in message digitalmars.d:126586 ..your Ubuntu version isn't

Re: Potential patent issues

2011-01-19 Thread retard
Wed, 19 Jan 2011 12:50:46 -0500, Jeff Nowakowski wrote: On 01/18/2011 05:52 PM, BlazingWhitester wrote: Walter, could you give some comments about this? Does dmd violate anything? It's probably in Walter's best interest to not even look at it. On the one hand, it's probably a crap

Re: What Makes A Programming Language Good

2011-01-19 Thread Nick Sabalausky
nedbrek nedb...@yahoo.com wrote in message news:ih6o0g$2geu$1...@digitalmars.com... Vladimir Panteleev vladi...@thecybershadow.net wrote in message news:op.vpjlwrletuz...@cybershadow.mshome.net... On Wed, 19 Jan 2011 08:09:11 +0200, Austin Hastings ah0801...@yahoo.com wrote: On 1/19/2011

Re: What Makes A Programming Language Good

2011-01-19 Thread Nick Sabalausky
spir denis.s...@gmail.com wrote in message news:mailman.710.1295434677.4748.digitalmar...@puremagic.com... On 01/18/2011 07:10 PM, bearophile wrote: spir: The D styleguide requires on one hand capitalised names for types, and lowercase for filenames on the other. How are we supposed to make

Re: Potential patent issues

2011-01-19 Thread Nick Sabalausky
retard r...@tard.com.invalid wrote in message news:ih7dih$q49$2...@digitalmars.com... Wed, 19 Jan 2011 12:50:46 -0500, Jeff Nowakowski wrote: On 01/18/2011 05:52 PM, BlazingWhitester wrote: Walter, could you give some comments about this? Does dmd violate anything? It's probably in

Re: What Makes A Programming Language Good

2011-01-19 Thread retard
Wed, 19 Jan 2011 13:56:17 +, Adam Ruppe wrote: Andrei wrote: We need a package system that takes Internet distribution into account. Do you think something like my simple http based system would work? Fetch dependencies. Try to compile. If the linker complains about missing files,

Re: Potential patent issues

2011-01-19 Thread Andrej Mitrovic
Or pack your bags and move to Europe. :p

Re: What Makes A Programming Language Good

2011-01-19 Thread Adam Ruppe
retard wrote: A build tool without any kind of dependency versioning support is a complete failure. You just delete the old files and let it re-download them to update. If the old one is working for you, simply keep it.

Re: What Makes A Programming Language Good

2011-01-19 Thread bearophile
spir: Yep, but often one is the main exported element. That's not true for Phobos, my dlibs1, and lot of my code that uses those libs. When there are several, hopefully sensibly related, exported things, then it's easy to indicate: mathFuncs, stringTools, bitOps... while still following D

Re: What Makes A Programming Language Good

2011-01-19 Thread retard
Wed, 19 Jan 2011 19:41:47 +, Adam Ruppe wrote: retard wrote: A build tool without any kind of dependency versioning support is a complete failure. You just delete the old files and let it re-download them to update. If the old one is working for you, simply keep it. I meant that if

Re: What Makes A Programming Language Good

2011-01-19 Thread Vladimir Panteleev
On Wed, 19 Jan 2011 21:41:47 +0200, Adam Ruppe destructiona...@gmail.com wrote: retard wrote: A build tool without any kind of dependency versioning support is a complete failure. You just delete the old files and let it re-download them to update. If the old one is working for you, simply

Re: DVCS (was Re: Moving to D)

2011-01-19 Thread retard
Wed, 19 Jan 2011 19:15:54 +, retard wrote: Wed, 19 Jan 2011 03:11:07 -0800, Walter Bright wrote: KennyTM~ wrote: You should use LF ending, not CRLF ending. I never thought of that. Fixing that, it gets further, but still innumerable errors: [snip] I already told you in

Re: Implicit delegate conversions

2011-01-19 Thread Steven Schveighoffer
On Mon, 17 Jan 2011 14:39:02 -0500, Tomek Sowiński j...@ask.me wrote: Steven Schveighoffer napisał: I think this is one place where D can improve by vast amounts without a lot of effort (no change in code generation, just in implicit casting). Yeah, my thoughts exactly. And bumping into a

Re: What Makes A Programming Language Good

2011-01-19 Thread Adam Ruppe
I meant that if the latest version 0.321 of the project 'foobar' depends on 'bazbaz 0.5.8.2' Personally, I'd just prefer people to package their damned dependencies with their app But, a configuration file could fix that easily enough. Set one up like this: bazbaz =

Re: What Makes A Programming Language Good

2011-01-19 Thread retard
Wed, 19 Jan 2011 20:01:28 +, Adam Ruppe wrote: I meant that if the latest version 0.321 of the project 'foobar' depends on 'bazbaz 0.5.8.2' Personally, I'd just prefer people to package their damned dependencies with their app But, a configuration file could fix that easily

Re: What Makes A Programming Language Good

2011-01-19 Thread Adam Ruppe
Vladimir Panteleev wrote: Your tool will just download the latest version of Y and the whole thing crashes and burns. My problem is I don't see how that'd happen in the first place. Who would distribute something they've never compiled? If they compiled it, it would have downloaded the other

Re: What Makes A Programming Language Good

2011-01-19 Thread Andrej Mitrovic
Meh. Just give us File access in CTFE and we'll be done talking about build tools. Just run DMD on the thing and the app automagically tracks and downloads all of its dependencies. Im kidding. But file access in CTFE would be so damn cool. :)

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-19 Thread Steven Schveighoffer
On Tue, 18 Jan 2011 01:11:04 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 1/17/11 11:48 PM, Jonathan M Davis wrote: On Monday 17 January 2011 15:13:42 spir wrote: See range bug evoked above. opApply is the only workaround AFAIK. Also, ranges cannot yet provide indexed

Re: What Makes A Programming Language Good

2011-01-19 Thread Jesse Phillips
Adam Ruppe Wrote: Vladimir Panteleev wrote: Your tool will just download the latest version of Y and the whole thing crashes and burns. My problem is I don't see how that'd happen in the first place. Who would distribute something they've never compiled? If they compiled it, it would

Re: What Makes A Programming Language Good

2011-01-19 Thread Adam Ruppe
retard wrote: How it goes is you come up with more and more features if you spend sometime THINKING about the possible functionality for such a tool. It, as written now, does everything I've ever wanted. If I try to do every possible function, it'll never be done. The question is what's

Re: Potential patent issues

2011-01-19 Thread Nick Sabalausky
Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.724.1295465996.4748.digitalmar...@puremagic.com... Or pack your bags and move to Europe. :p I thought Europe was getting software patents?

Re: Potential patent issues

2011-01-19 Thread Andrej Mitrovic
You're thinking EU. :p On 1/19/11, Nick Sabalausky a@a.a wrote: Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.724.1295465996.4748.digitalmar...@puremagic.com... Or pack your bags and move to Europe. :p I thought Europe was getting software patents?

Re: What Makes A Programming Language Good

2011-01-19 Thread Adam Ruppe
Jesse Phillips wrote: But if they haven't done any development on it for the last year, but the library it depends on has... Unless you give library authors write access to your hard drive, it doesn't matter. They can't make your old, saved version magically disappear. If you then distribute

Re: Potential patent issues

2011-01-19 Thread retard
Wed, 19 Jan 2011 15:44:38 -0500, Nick Sabalausky wrote: Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.724.1295465996.4748.digitalmar...@puremagic.com... Or pack your bags and move to Europe. :p I thought Europe was getting software patents? It's the US

Re: DVCS

2011-01-19 Thread Gour
On Wed, 19 Jan 2011 19:15:54 + (UTC) retard r...@tard.com.invalid wrote: ..your Ubuntu version isn't supported anymore. They might have already removed the package repositories for unsupported versions and that might indeed lead to problems That's why we wrote it would be better to use

Re: Potential patent issues

2011-01-19 Thread Nick Sabalausky
retard r...@tard.com.invalid wrote in message news:ih7jv4$q49$7...@digitalmars.com... Wed, 19 Jan 2011 15:44:38 -0500, Nick Sabalausky wrote: Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.724.1295465996.4748.digitalmar...@puremagic.com... Or pack your bags and move

Re: Potential patent issues

2011-01-19 Thread Simen kjaeraas
Nick Sabalausky a@a.a wrote: retard r...@tard.com.invalid wrote in message news:ih7jv4$q49$7...@digitalmars.com... Wed, 19 Jan 2011 15:44:38 -0500, Nick Sabalausky wrote: Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message

Re: What Makes A Programming Language Good

2011-01-19 Thread Mafi
Am 19.01.2011 21:22, schrieb Andrej Mitrovic: Meh. Just give us File access in CTFE and we'll be done talking about build tools. Just run DMD on the thing and the app automagically tracks and downloads all of its dependencies. Im kidding. But file access in CTFE would be so damn cool. :) What

Re: What Makes A Programming Language Good

2011-01-19 Thread Jesse Phillips
Adam Ruppe Wrote: Jesse Phillips wrote: But if they haven't done any development on it for the last year, but the library it depends on has... Unless you give library authors write access to your hard drive, it doesn't matter. They can't make your old, saved version magically disappear.

xxxInPlace or xxxCopy?

2011-01-19 Thread Andrei Alexandrescu
I'm consolidating some routines from std.string into std.array. They are specialized for operating on arrays, and include the likes of insert, remove, replace. One question is whether operations should be performed in place or on a copy. For example: string s = Mary has a lil lamb.; //

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread bearophile
Andrei: One question is whether operations should be performed in place or on a copy. For example: Strings are meant to be immutable, and the functional style is simpler to understand and safer to use, so I firmly suggest the default (with shorter names) functions to create a new

Another task

2011-01-19 Thread bearophile
Now and then I like to test Phobos with simple tasks, to see how it's going. This simple task is to create a dynamic array of pairs (tuples) like: [(10,aa), (30,bb), (50,cc)] from the associative array: [1:'a', 2:'b', 3:'c'] If possible read things lazily from the associative array.

Re: DVCS

2011-01-19 Thread Vladimir Panteleev
On Wed, 19 Jan 2011 23:18:13 +0200, Gour g...@atmarama.net wrote: On Wed, 19 Jan 2011 19:15:54 + (UTC) retard r...@tard.com.invalid wrote: ..your Ubuntu version isn't supported anymore. They might have already removed the package repositories for unsupported versions and that might indeed

filter!(not!(predicate))(someInputRange) does not compile

2011-01-19 Thread Jens Mueller
Hi, I cannot make the following compile. import std.functional; import std.array; import std.algorithm; import std.stdio; void main() { auto numbers = [0, 1, 2, 3, 4, 5]; bool alwaysTrue(uint a) { return true; } alias not!(alwaysTrue) alwaysFalse; numbers =

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread so
Strange, we are again on the opposite sides... Second one looks much better to me. I think, most of the time we need inplace, and it deserves the better syntax.

Re: What Makes A Programming Language Good

2011-01-19 Thread Jesse Phillips
Mafi Wrote: Am 19.01.2011 21:22, schrieb Andrej Mitrovic: Meh. Just give us File access in CTFE and we'll be done talking about build tools. Just run DMD on the thing and the app automagically tracks and downloads all of its dependencies. Im kidding. But file access in CTFE would

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Jesse Phillips
Andrei Alexandrescu Wrote: So that would make copying the default behavior. Alternatively, we could make in-place the default behavior and ask for the Copy suffix: Do what sort does. On another thought what about: auto s = replace(s1[], lil, li'l); isn't the empty [] the specification for

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread bearophile
so: Strange, we are again on the opposite sides... Second one looks much better to me. I think, most of the time we need inplace, and it deserves the better syntax. In the meantime the world is going more functional... :-) Bye, bearophile

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Jonathan M Davis
On Wednesday, January 19, 2011 15:33:16 Andrei Alexandrescu wrote: I'm consolidating some routines from std.string into std.array. They are specialized for operating on arrays, and include the likes of insert, remove, replace. One question is whether operations should be performed in place

Re: filter!(not!(predicate))(someInputRange) does not compile

2011-01-19 Thread Andrei Alexandrescu
On 1/19/11 5:53 PM, Jens Mueller wrote: Hi, I cannot make the following compile. import std.functional; import std.array; import std.algorithm; import std.stdio; void main() { auto numbers = [0, 1, 2, 3, 4, 5]; bool alwaysTrue(uint a) { return true; } alias not!(alwaysTrue)

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Andrei Alexandrescu
On 1/19/11 6:53 PM, Jonathan M Davis wrote: On Wednesday, January 19, 2011 15:33:16 Andrei Alexandrescu wrote: I'm consolidating some routines from std.string into std.array. They are specialized for operating on arrays, and include the likes of insert, remove, replace. One question is whether

Re: filter!(not!(predicate))(someInputRange) does not compile

2011-01-19 Thread Jens Mueller
Andrei Alexandrescu wrote: On 1/19/11 5:53 PM, Jens Mueller wrote: Hi, I cannot make the following compile. import std.functional; import std.array; import std.algorithm; import std.stdio; void main() { auto numbers = [0, 1, 2, 3, 4, 5]; bool alwaysTrue(uint a) { return

Re: Another task

2011-01-19 Thread Simen kjaeraas
bearophile bearophileh...@lycos.com wrote: Now and then I like to test Phobos with simple tasks, to see how it's going. This simple task is to create a dynamic array of pairs (tuples) like: [(10,aa), (30,bb), (50,cc)] from the associative array: [1:'a', 2:'b', 3:'c'] If possible read

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Simen kjaeraas
bearophile bearophileh...@lycos.com wrote: auto s1 = replace(s, lil, li'l); assert(s == Mary has a lil lamb.); You probably meant: assert(s1 == Mary has a lil lamb.); Nope. (s1 == Mary has a li'l lamb.) (s == Mary has a lil lamb.). -- Simen

Re: DVCS

2011-01-19 Thread Jeff Nowakowski
On 01/19/2011 04:18 PM, Gour wrote: That's why we wrote it would be better to use some rolling release like Archlinux where distro cannot become so outdated that it's not possible to upgrade easily. https://wiki.archlinux.org/index.php/FAQ : Q) Why would I not want to use Arch? A) [...] you

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Jonathan M Davis
On Wednesday, January 19, 2011 17:10:07 Andrei Alexandrescu wrote: On 1/19/11 6:53 PM, Jonathan M Davis wrote: On Wednesday, January 19, 2011 15:33:16 Andrei Alexandrescu wrote: I'm consolidating some routines from std.string into std.array. They are specialized for operating on arrays, and

Re: Another task

2011-01-19 Thread bearophile
Simen kjaeraas: Why use map()? The correct solution for this looks like so: import std.range; void main( ) { auto aa = [1:a, 2:b, 3:c]; auto result = zip( aa.keys, aa.values ); } That result is not the requested one: [(10,aa), (30,bb), (50,cc)] And that result is not

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread bearophile
Andrei: Problem is, even though the example uses strings, the functions apply to all arrays. Important general rule: if converting string functions into generic functions makes them worse string functions, then don't move them to the algorithm module, or create special string functions for

Re: Another task

2011-01-19 Thread bearophile
That result is not the requested one: [(10,aa), (30,bb), (50,cc)] Sorry, the last tuple is (30,cc). Bye, bearophile

Re: Another task

2011-01-19 Thread bearophile
Simen kjaeraas: Soz, I read a bit too fast. It /is/ lazy, though perhaps not the way you meant. This returns the right thing, but does not *read* lazily from the AA, a task I am unsure how, if at all possible, one should perform. In the task was written: If possible read things lazily from

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Jerry Quinn
Andrei Alexandrescu Wrote: On 1/19/11 6:53 PM, Jonathan M Davis wrote: On Wednesday, January 19, 2011 15:33:16 Andrei Alexandrescu wrote: I'm consolidating some routines from std.string into std.array. They are specialized for operating on arrays, and include the likes of insert, remove,

Re: Another task

2011-01-19 Thread Simen kjaeraas
bearophile bearophileh...@lycos.com wrote: D AAs have byKey and byValue that return a lazy iterator. So if we add a byItem or byPair or byKeyValue you are able to read pairs lazily :-) byKey is essentially an opApply. You have to wrap it in a fiber to make it work with the range interface:

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread so
And honestly, from the standpoint of code simplicity and understandability, there's a lot to be said for making copies being the default rather than mutation. You can then use the InPlace versions if you need the boost in efficiency. - Jonathan M Davis Isn't simplicity and understandability

Re: What Makes A Programming Language Good

2011-01-19 Thread Jesse Phillips
Adam D. Ruppe Wrote: Jesse Phillips wrote: You can have the author release packaged libraries for developers to use and the author should do this. So this begs the question of what is the repository for? It's so you have a variety of libraries available at once with minimal hassle when

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread bearophile
so: Isn't simplicity and understandability favors the in-place style on these type of algorithms? Nope, functional-style code is what you are looking for :-) As Jesse Phillips said, it is same as sort. You have to think of the normal sort as a performance hack, something that is good

Re: DVCS

2011-01-19 Thread Gary Whatmore
Jeff Nowakowski Wrote: On 01/19/2011 04:18 PM, Gour wrote: That's why we wrote it would be better to use some rolling release like Archlinux where distro cannot become so outdated that it's not possible to upgrade easily. https://wiki.archlinux.org/index.php/FAQ : Q) Why would I

Re: What Makes A Programming Language Good

2011-01-19 Thread Gary Whatmore
Jesse Phillips Wrote: DSSS seemed to provide a great amount of simplicity and power... the problem is that it didn't always work. I always wondered what happened to that boy. He had impressive coding skills and lots of pragmatic common sense. There was at least one weakness in his persona

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Jonathan M Davis
On Wednesday 19 January 2011 18:36:55 so wrote: And honestly, from the standpoint of code simplicity and understandability, there's a lot to be said for making copies being the default rather than mutation. You can then use the InPlace versions if you need the boost in efficiency. -

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Andrei Alexandrescu
On 1/19/11 8:36 PM, so wrote: And honestly, from the standpoint of code simplicity and understandability, there's a lot to be said for making copies being the default rather than mutation. You can then use the InPlace versions if you need the boost in efficiency. - Jonathan M Davis Isn't

Re: What Makes A Programming Language Good

2011-01-19 Thread nedbrek
Nick Sabalausky a@a.a wrote in message news:ih7dj0$s4j$1...@digitalmars.com... nedbrek nedb...@yahoo.com wrote in message news:ih6o0g$2geu$1...@digitalmars.com... Vladimir Panteleev vladi...@thecybershadow.net wrote in message news:op.vpjlwrletuz...@cybershadow.mshome.net... On Wed, 19

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Andrei Alexandrescu
On 1/19/11 9:11 PM, Jonathan M Davis wrote: On Wednesday 19 January 2011 18:36:55 so wrote: And honestly, from the standpoint of code simplicity and understandability, there's a lot to be said for making copies being the default rather than mutation. You can then use the InPlace versions if you

Re: What Makes A Programming Language Good

2011-01-19 Thread Andrei Alexandrescu
On 1/19/11 9:04 PM, Gary Whatmore wrote: Jesse Phillips Wrote: DSSS seemed to provide a great amount of simplicity and power... the problem is that it didn't always work. I always wondered what happened to that boy. He had impressive coding skills and lots of pragmatic common sense. There

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Andrej Mitrovic
One common mistake newbies make in Python is calling the sorted method and expecting it to sort in place: x = [3, 2, 1] sorted(x) [1, 2, 3] sorted returned a new list x [3, 2, 1] x stayed the same There are a few functions in the Python lib that have InPlace added to their names to

Re: filter!(not!(predicate))(someInputRange) does not compile

2011-01-19 Thread Andrei Alexandrescu
On 1/19/11 7:19 PM, Jens Mueller wrote: Andrei Alexandrescu wrote: On 1/19/11 5:53 PM, Jens Mueller wrote: Hi, I cannot make the following compile. import std.functional; import std.array; import std.algorithm; import std.stdio; void main() { auto numbers = [0, 1, 2, 3, 4, 5];

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Andrej Mitrovic
On 1/20/11, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: One common mistake newbies make in Python is calling the sorted method and expecting it to sort in place: x = [3, 2, 1] sorted(x) [1, 2, 3] sorted returned a new list x [3, 2, 1] x stayed the same There are a few

Re: DVCS

2011-01-19 Thread Gour
On Wed, 19 Jan 2011 20:28:43 -0500 Jeff Nowakowski j...@dilacero.org wrote: Q) Why would I not want to use Arch? A) [...] you do not have the ability/time/desire for a 'do-ityourself' GNU/Linux distribution I've feeling that you just copied the above from FAQ and never actually tried

Re: DVCS

2011-01-19 Thread Gour
On Wed, 19 Jan 2011 21:57:46 -0500 Gary Whatmore n...@spam.sp wrote: This is something the Gentoo and Arch fanboys don't get. First of all I spent 5yrs with Gentoo before jumping to Arch and those are really two different beasts. With Arch I practically have zero-admin time after I did my 1st

Re: about float double

2011-01-19 Thread bearophile
spir: Is there somewhere a (clear) doc about float/double internals? Some more particuliar questions: What is the internal bit layout? (mantissa, sign, exponent) There is the real type too (= 10 bytes). Bye, bearophile

  1   2   >