Philippe,
Thank you very much for your response. It looks similar to what I've
done in javascript by wrapping all function arguments into a single
object literal but the D alternative you propose is a little to
convoluted for a beginner like me. Perhaps I'll understand it better
after I'm
);
--
Message: 2
Date: Tue, 20 Dec 2011 21:45:26 +0100
From: Philippe Sigaudphilippe.sig...@gmail.com
To: digitalmars.D.learndigitalmars-d-learn@puremagic.com
Subject: Re: newbie question: Can D do this?
Message-ID:
caoa6bi6baym1t3phvwy9mbrpsedk_ddjwyr-7ydo5cov2dd
On Thu, Dec 22, 2011 at 16:37, clk c...@clksoft.com wrote:
Philippe,
Thank you very much for your response. It looks similar to what I've done
in javascript by wrapping all function arguments into a single object
literal but the D alternative you propose is a little to convoluted for a
On Thu, Dec 22, 2011 at 16:45, clk c...@clksoft.com wrote:
Philippe,
I don't understand the example below to simulate the list comprehension
syntax. Are input1, input2 and input3 ranges?
Yes, inputs are ranges. Sorry, I was perhaps a bit hasty in answering.
The code is on github:
In PHP frameworks often use $option arrays which are some kind of key
value pairs. they are merged with the default valuzes inside the function.
pro:
- you can pass an argument by name
- you only need to pass those who needed.
cons:
- hash arrays
it should be possible to create a similar
Timon Gehr , dans le message (digitalmars.D.learn:31142), a écrit :
On 12/20/2011 03:18 PM, clk wrote:
Thank you for your quick replies. I'm impressed by the helpfulness and
dedication of the D community!
Here's another one. Is there a way to pass arguments to functions by
keyword as in the
, please edit your Subject line so it is more specific
than Re: Contents of Digitalmars-d-learn digest...
Today's Topics:
1. Re: newbie question: Can D do this? (Ali ?ehreli)
2. Re: newbie question: Can D do this? (Kai Meyer)
3. Re: newbie question: Can D do this? (Simen Kj?r?s)
4. Re
...
Today's Topics:
1. Re: newbie question: Can D do this? (Ali ?ehreli)
2. Re: newbie question: Can D do this? (Kai Meyer)
3. Re: newbie question: Can D do this? (Simen Kj?r?s)
4. Re: newbie question: Can D do this? (Ali ?ehreli)
5. Re: newbie question: Can D do this? (Jonathan M Davis
On Tue, 20 Dec 2011 09:18:16 -0500, clk c...@clksoft.com wrote:
Thank you for your quick replies. I'm impressed by the helpfulness and
dedication of the D community!
Here's another one. Is there a way to pass arguments to functions by
keyword as in the calls to f and g below?
void f(int a =
On 20/12/2011 14:18, clk wrote:
Here's another one. Is there a way to pass arguments to functions by
keyword as in the
calls to f and g below?
I remember a discussion about year ago or so.
It seems doable to have some kind of function transformer (adaptor?) for this.
from:
int foo(int a =
On Mon, Dec 19, 2011 at 17:17, clk c...@clksoft.com wrote:
2) D doesn't seem to support the list comprehension syntax available in
python and javascript. Is this correct?
[f(x) for x in list if condition]
Correct. As other have said, it's doable by combining std functions.
As fas as I
On 20/12/2011 20:36, Philippe Sigaud wrote:
snip
That is, it expects some values, then string/values couples as
associative arrays.
snip
I've a recollection of seeing something like this in the PHP library, but I forget where.
I believe it's used in some functions that have a lot of options
On 19.12.2011 17:17, clk wrote:
1) Does D support something like the javascript 1.8 destructuring
assigment (multiple assigment in python):
[a, b] = [b, a];
I don't think so, but you can do something like this with templates:
void swap(alias a, alias b)() {
auto t = a;
a = b;
b =
On Monday, December 19, 2011 11:17:43 clk wrote:
Hello,
I'm new to this mailing list. I'm trying to learn D to eventually use
it in production code.
I'm a little bit intimidated by the fact that the topics in the d-learn
list look rather advanced to a newbie like me.
I have 3 fairly simple
On 12/19/2011 08:17 AM, clk wrote:
I'm a little bit intimidated by the fact that the topics in the d-learn
list look rather advanced to a newbie like me.
We need more newbie topics here! :)
1) Does D support something like the javascript 1.8 destructuring
assigment (multiple assigment in
On 12/19/2011 09:17 AM, clk wrote:
Hello,
I'm new to this mailing list. I'm trying to learn D to eventually use it
in production code.
I'm a little bit intimidated by the fact that the topics in the d-learn
list look rather advanced to a newbie like me.
I have 3 fairly simple questions:
1) Does
On Mon, 19 Dec 2011 17:17:43 +0100, clk c...@clksoft.com wrote:
Hello,
I'm new to this mailing list. I'm trying to learn D to eventually use
it in production code.
I'm a little bit intimidated by the fact that the topics in the d-learn
list look rather advanced to a newbie like me.
I have 3
On 12/19/2011 10:39 AM, Jonathan M Davis wrote:
it's a range (see
http://www.informit.com/articles/printerfriendly.aspx?p=1407357 for a
general
explanation of the concept of ranges)
That's a great article.[1] I hope that this chapter is more
beginner-friendly:
On Monday, 19 December 2011 at 19:01:10 UTC, Simen Kjærås wrote:
import std.typetuple : TypeTuple;
import std.typecons : tuple;
TypeTuple!(a, b) = tuple(b,a);
There is a pull request implementing multiple variable
declarations:
https://github.com/D-Programming-Language/dmd/pull/341
19 matches
Mail list logo