Re: let (x,y) = ...
On 2015-02-19 05:38, thedeemon wrote: Creating tuples and returning them from functions is trivial in D: auto getTuple() { return tuple("Bob", 42); } but using them afterwards can be confusing and error prone auto t = getTuple(); writeln("name is ", t[0], " age is ", t[1]); I really missed the ML syntax to write let (name, age) = getTuple(); Didn't someone create a pull request for something like: auto(name, age) = getTuple(); Or was it a DIP? -- /Jacob Carlborg
Re: We are Beta (2.067.0-b2)
On 2015-02-19 23:06, Brian Schott wrote: Many of the beta-2 files are missing from downloads.dlang.org, and all of them are missing from ftp.digitalmars.com. This makes testing the Debian packages or using DVM impossible. As a workaround for DVM use can manually download the zip file and place it in ~/.dvm/archives. Then run "dvm install ..." as usually. -- /Jacob Carlborg
Re: Berlin D Meetup Feb 2015
Just a reminder that this is happening tonight at 19:30. For those coming from further away the closest U-Bahn is Kottbusser Tor on the U1 and U8. The directions for getting to the room (from the http://co-up.de/ website) are: Go through the big metal gate to the left of Adalbertstr. 7, straight to the far end of the courtyard, and in the first tunnel to your right. Ring the bell marked "co.up 3.OG" and come up to the 3rd floor. If you are attending an evening/weekend meetup, you may find the big gate closed. In that case, go back in the direction of Kottbusser Tor to the small gate at Adalbertstr. 5-6. Reach through the bars to turn the handle and make your way straight through the tunnel, left through a second tunnel and then straight past the bike rack until you see the door of our building, across from the mailboxes. Looking forward to seeing everyone and to Joseph's talk.
Re: let (x,y) = ...
On Friday, 20 February 2015 at 09:12:26 UTC, Jacob Carlborg wrote: On 2015-02-19 05:38, thedeemon wrote: Creating tuples and returning them from functions is trivial in D: auto getTuple() { return tuple("Bob", 42); } but using them afterwards can be confusing and error prone auto t = getTuple(); writeln("name is ", t[0], " age is ", t[1]); I really missed the ML syntax to write let (name, age) = getTuple(); Didn't someone create a pull request for something like: auto(name, age) = getTuple(); Or was it a DIP? This one, by Kenji? http://wiki.dlang.org/DIP32
Re: dfmt 0.1.0
On Friday, 20 February 2015 at 05:53:32 UTC, Brian Schott wrote: On Friday, 20 February 2015 at 05:23:45 UTC, Joakim wrote: On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote: dfmt is a D source code formatting tool. https://github.com/Hackerpilot/dfmt/ https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0 Thanks, you should list some of the formatting changes it makes in the README. It doesn't do formatting changes. It wipes out the formatting during lexing and builds it up from scratch. The only thing that gets preserved is that it will look at line numbers on comments and try to keep them in roughly the same place. (For example, "//" comments that are on the end of a line instead of on the next line) Several examples in the README would indeed be nice.
Re: dfmt 0.1.0
On 2015-02-20 03:21, Brian Schott wrote: dfmt is a D source code formatting tool. https://github.com/Hackerpilot/dfmt/ https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0 I looked at the tests, in particular "contracts.d.ref". I would expect an empty newline between an instance variable and a method. -- /Jacob Carlborg
Re: We are Beta (2.067.0-b2)
On Wednesday, 18 February 2015 at 14:13:25 UTC, Martin Nowak wrote: Find more information on the dmd-beta mailing list. http://forum.dlang.org/thread/54e41ca2.4060...@dawg.eu Thanks! Note: dmd.2.067.0-b2.dmg is missing.
Reloaded for dub
Hi Just thought I would share this in case anyone else finds it useful. I wrote a tiny utility that detects changes to D files and then rebuilds and re-executes the main binary using dub. I use for developing with vibe.d and other dub D project that have an executable binary. The code is here: https://github.com/kingsleyh/reloaded essentially you just run dub in the root and it builds the reloaded binary. Then you just copy that binary to the root of your dub project and ./reloaded and then as soon as you make a change to a D file your code will be built and executed. --K
Re: Reloaded for dub
On 02/20/2015 03:00 PM, Kingsley wrote: I use for developing with vibe.d and other dub D project that have an executable binary. The code is here: https://github.com/kingsleyh/reloaded Nice, want to contribute? https://github.com/D-Programming-Language/dub/issues/446
Re: We are Beta (2.067.0-b2)
On 02/19/2015 11:06 PM, Brian Schott wrote: Many of the beta-2 files are missing from downloads.dlang.org, and all of them are missing from ftp.digitalmars.com. This makes testing the Debian packages or using DVM impossible. Quote from the dmd-beta post. > We had some troubles with the documentation generation. In order to not delay the beta even further the zip files don't contain documentation, the dman tool is missing and there are no installers. We'll try to deliver those subsequently or with the next beta.
Re: Reloaded for dub
On 2015-02-20 at 15:00, Kingsley wrote: Just thought I would share this in case anyone else finds it useful. I wrote a tiny utility that detects changes to D files and then rebuilds and re-executes the main binary using dub. I see two problems: 1. It doesn't sleep for a few seconds after detecting that a file has changed, so when you upload several changed source files, recompilation may start before all of them are updated and either fail or produce something strange. 2. It works like this: if (changed) { kill(projectName); build() && run(projectName); sleep(); } As a result, if the compilation fails, no application will be running. Probably a better approach would be to have the application copied to a different place and run from there. Then the loop would look like this (I also added an extra unittest run before the running application is replaced): if (changed) { sleep(); build() && test() && kill(dest) && copy(projectName, dest) && run(dest); sleep(); } In this approach your program is almost always running. You only have to figure out how to provide `dest`. Perhaps via command line arguments where you provide a path (or just a directory).
Re: dfmt 0.1.0
On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote: dfmt is a D source code formatting tool. https://github.com/Hackerpilot/dfmt/ https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0 Great! I've been using clang-format lately for my C++ code and it's really blown me away how good it is. It's not opinionated about how things should be, it just does whatever style you've set it to. The Visual Studio plugin they have just gives me a keyboard shortcut and when I hit it, it formats the current line or selection. I waste almost no time formatting code now. I just type and hit the format key and move on. If it formatted something differently than how I would have done it I just let it be because how it formatted is usually almost as good anyway. I feel like it's been as big of boon to my coding speed as learning vim was. From what I understand they implemented a LaTeX style weighted line breaker which would explain why it works so much better than a typical code formatter. It's very smart about how it does line breaks. This seems to make all the difference. This is all to say I hope dfmt becomes as awesome as clang-format is at some point. Hopefully I can find some time to contribute.
Re: dfmt 0.1.0
On Friday, 20 February 2015 at 23:00:25 UTC, Brad Anderson wrote: From what I understand they implemented a LaTeX style weighted line breaker which would explain why it works so much better than a typical code formatter. It's very smart about how it does line breaks. This seems to make all the difference. dfmt uses a weighting system for line breaks as well, though because this is 0.1.0 it doesn't always do what I expect it to do.
Re: Reloaded for dub
On 21/02/2015 3:00 a.m., Kingsley wrote: Hi Just thought I would share this in case anyone else finds it useful. I wrote a tiny utility that detects changes to D files and then rebuilds and re-executes the main binary using dub. I use for developing with vibe.d and other dub D project that have an executable binary. The code is here: https://github.com/kingsleyh/reloaded essentially you just run dub in the root and it builds the reloaded binary. Then you just copy that binary to the root of your dub project and ./reloaded and then as soon as you make a change to a D file your code will be built and executed. --K *whistles* https://github.com/rikkimax/livereload