On Thursday, 19 February 2015 at 04:38:32 UTC, 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 ,
Kagamin:
Doesn't let normally declare a new variable?
You are right, yours is a valid point... So tie could be a
better name after all.
Bye,
bearophile
Ola Fosheim Grøstad:
Maybe change the name to tie:
http://www.cplusplus.com/reference/tuple/tie/
?
I prefer let, it's much more traditional and descriptive. C++
standard library is often a bad example to follow...
Bye,
bearophile
On Thursday, 19 February 2015 at 10:52:40 UTC, Kagamin wrote:
On Thursday, 19 February 2015 at 09:50:25 UTC, bearophile wrote:
I prefer let, it's much more traditional and descriptive.
C++ standard library is often a bad example to follow...
Doesn't let normally declare a new variable?
Mengu:
that's a great example to show d's strength. thank you.
It's also a great way to show what's missing in D syntax.
Bye,
bearophile
On Thursday, 19 February 2015 at 04:38:32 UTC, thedeemon wrote:
let (name, age) = getTuple();
Maybe change the name to tie:
http://www.cplusplus.com/reference/tuple/tie/
?
On Thursday, 19 February 2015 at 09:50:25 UTC, bearophile wrote:
I prefer let, it's much more traditional and descriptive. C++
standard library is often a bad example to follow...
Doesn't let normally declare a new variable?
On Thursday, 19 February 2015 at 04:38:32 UTC, 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 ,
Or even more obvious (VBA,TSQL):
set (x,y,z) = [1,2,3];
On Thursday, 19 February 2015 at 09:46:13 UTC, Ola Fosheim
Grøstad wrote:
On Thursday, 19 February 2015 at 04:38:32 UTC, thedeemon wrote:
let (name, age) = getTuple();
Maybe change the name to tie:
http://www.cplusplus.com/reference/tuple/tie/
?
SML, OCaml, Haskell, F#, ATS, Rust, Swift and
On Thursday, 19 February 2015 at 09:31:59 UTC, ponce wrote:
That's pretty neat! May I turn this code into a d-idioms? Name
and link will be kept of course.
Sure, if you wish. There was just one person using this thing
until today, so I dunno whether it deserves to be in that list.
On 02/19/2015 11:04 AM, thedeemon wrote:
SML, OCaml, Haskell, F#, ATS, Rust, Swift and others have it as let
keyword, so personally I'd prefer continuing that tradition.
It's semantically different though because it doesn't declare the variables.
On 02/19/2015 12:59 PM, bearophile wrote:
It's also a great way to show what's missing in D syntax.
True that.
Kagamin:
Or even more obvious (VBA,TSQL):
set (x,y,z) = [1,2,3];
I prefer to use set as in Python, to define sets:
s = set([1, 2, 3])
2 in s
True
Bye,
bearophile
On 19/02/2015 04:38, thedeemon wrote:
int x, y, z, age;
string name;
let (name, age) = getTuple(); // tuple
let (x,y,z) = argv[1..4].map!(to!int); // lazy range
let (x,y,z) = [1,2,3]; // array
SomeStruct s;
let (s.a, s.b) = tuple(3, piggies);
Alternatively
let reads better either way I think.
let this and that equal this other thing.
On Thu, Feb 19, 2015 at 2:00 PM, bearophile via Digitalmars-d-announce
digitalmars-d-announce@puremagic.com wrote:
Kagamin:
Doesn't let normally declare a new variable?
You are right, yours is a valid
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
Many of the beta-2 files are missing from downloads.dlang.org,
and all of them are missing from ftp.digitalmars.com.
On Thu, Feb 19, 2015 at 8:30 AM, ketmar via Digitalmars-d-announce
digitalmars-d-announce@puremagic.com wrote:
On Thu, 19 Feb 2015 06:50:29 -0800, Bill Baxter via Digitalmars-d-announce
wrote:
If you weren't deliberately making a joke, you might want to google
milf.
no jokes, it's
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.
On 2/19/2015 2:06 PM, Brian Schott wrote:
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
Many of the beta-2 files are missing from downloads.dlang.org, and all of
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/
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
dfmt is a D source code formatting tool.
https://github.com/Hackerpilot/dfmt/
https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
On Thursday, 19 February 2015 at 14:50:43 UTC, Bill Baxter wrote:
If you weren't deliberately making a joke, you might want to
google milf.
What do you mean? It was my birthday! I became one year older!
On Thu, 19 Feb 2015 06:50:29 -0800, Bill Baxter via Digitalmars-d-announce
wrote:
If you weren't deliberately making a joke, you might want to google
milf.
no jokes, it's Serious Bussiness! do you think that our project architect
will allow to build our own milf without googling? or our
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
'lib32mscoff' should be in there,what do you think?
Frank
On 19/02/2015 17:00, Nick Treleaven wrote:
Alternatively std.typetuple.TypeTuple can be used instead of let
not for ranges and arrays though
Yes, but `tuple` overloads could be added for those.
Or not - the length isn't known at compile-time.
Tuple already
supports construction from a
If you weren't deliberately making a joke, you might want to google milf.
And if you were... Hmm interesting sense of humor you have there.
On Feb 18, 2015 11:40 PM, via Digitalmars-d-announce
digitalmars-d-announce@puremagic.com wrote:
On Wednesday, 18 February 2015 at 22:37:34 UTC, ketmar
On Thursday, 19 February 2015 at 13:52:29 UTC, Nick Treleaven
wrote:
On 19/02/2015 04:38, thedeemon wrote:
int x, y, z, age;
string name;
let (name, age) = getTuple(); // tuple
let (x,y,z) = argv[1..4].map!(to!int); // lazy range
let (x,y,z) = [1,2,3]; // array
On 19/02/2015 14:59, John Colvin wrote:
On Thursday, 19 February 2015 at 13:52:29 UTC, Nick Treleaven wrote:
On 19/02/2015 04:38, thedeemon wrote:
int x, y, z, age;
string name;
let (name, age) = getTuple(); // tuple
let (x,y,z) = argv[1..4].map!(to!int); // lazy range
let (x,y,z)
On Thu, 19 Feb 2015 07:39:31 +, Ola Fosheim Grøstad wrote:
That's quite ok. I enjoy just looking at D code by different authors to
get a picture of how the language is used in real code. So thanks for
sharing!
same for me. i have a habit of downloading various D libraries and poking
those useless options...
the next version have an awesome option editor. about 100
settings just for the editor and the highlither
http://imgur.com/RdmHyKJ
On Friday, 20 February 2015 at 02:21:01 UTC, Brian Schott wrote:
https://github.com/Hackerpilot/dfmt/
https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0
Congrats, I found the reformatting a bit harsh from time to time,
but it's a good opportunity to finally settle style discussions.
33 matches
Mail list logo