Hello,
is there a way to say something like
---
int a, b;
AliasTuple!(a, b) = tuple(4,5);
assert(a == 4 b == 5);
---
without having to write an own AliasTuple template ? I want to use it
for functions returning multiple values.
Joshua Reusch
I think something like this is implemented in a dmd pull request.
I found a way doing this with a simple function:
---
void explode(R, T...)(R range, ref T values) {
static if(hasLength!R) assert(range.length == T.length);
foreach(i, value; range) values[i] = value;
}
---
but a more self-documenting version would be nice.
Am 16.12.2011, 17:47 Uhr, schrieb dune do-...@email.com:
Never tried this before:
Tried (with D2.057) to use the embedded documentation option with:
/**
* documentation here
*/
and the html files are generated but they only contain a html skeleton
and no documentation.
This comment
What?
Sorry but I don't understand...
What I posted was an example, in reality there is tons of code inside the d
file.
Thanks
On 12/16/2011 06:12 PM, dune wrote:
What?
Sorry but I don't understand...
What I posted was an example, in reality there is tons of code inside the d
file.
Thanks
That is not what you said. Obviously you should always give an example
that actually fails, especially when you claim it does.
What I posted was an example, in reality there is tons of code inside
the d file.
Show the file, or part of it.
hrsmallPage generated by a
href=http://www.digitalmars.com/d/2.0/ddoc.html;Ddoc/a. /small
/body/html
Ah looks like that must be updated to dlang.org too
I didn't realize that stuff like this will not work as expected:
[code]
/***
* Brief summary of what
* myfunc does, forming the summary section.
*
* First paragraph of synopsis description.
*
* Second paragraph of
* synopsis description.
*/
void myfunc() {
On Fri, 16 Dec 2011 14:00:11 +0100, Joshua Reusch yos...@arkandos.de
wrote:
Hello,
is there a way to say something like
---
int a, b;
AliasTuple!(a, b) = tuple(4,5);
assert(a == 4 b == 5);
---
without having to write an own AliasTuple template ? I want to use it
for functions returning
There is one in dranges:
http://dsource.org/projects/dranges
It is not officially documented, and I don't know how good it actually is,
but here's what documentation exists:
http://svn.dsource.org/projects/dranges/trunk/dranges/docs/reftuple.html
Hmm, thanks Simen, but no. It was a simple
Am 16.12.2011, 19:45 Uhr, schrieb dune do-...@email.com:
I didn't realize that stuff like this will not work as expected:
[code]
/***
* Brief summary of what
* myfunc does, forming the summary section.
*
* First paragraph of synopsis description.
*
*
Does anyone know of a prettyprint program for D code?
I use a text editor rather than an IDE and it would be nice if I
could standardize the format of my code. It's not onerous to do
it by hand but it can be tedious.
My text editor (Boxer) does pretty well on syntax highlighting
(other than
On Fri, 16 Dec 2011 23:59:58 +0100
Paul D. Anderson paul.d.removethis.ander...@comcast.andthis.net
wrote:
Does anyone know of a prettyprint program for D code?
I use a text editor rather than an IDE and it would be nice if I
could standardize the format of my code. It's not onerous to do
On Fri, 16 Dec 2011 14:00:11 +0100, Joshua Reusch yos...@arkandos.de
wrote:
Hello,
is there a way to say something like
---
int a, b;
AliasTuple!(a, b) = tuple(4,5);
assert(a == 4 b == 5);
---
without having to write an own AliasTuple template ? I want to use it
for functions returning
A small quiz. This Python2 code:
m1 = [[A', B']]
print m1
m2 = m1 + [[]]
print m2
Prints:
[[A', B']]
[[A', B'], []]
What does this D2 program print?
import std.stdio;
void main() {
string[][] m1 = [[A', B']];
writeln(m1);
string[][] m2 = m1 ~ [[]];
writeln(m2);
}
Bye,
Don't forget that string is an alias for immutable(char)[].
The immutable isn't important here, but the fact that
strings are arrays is.
char[][][] is the real type here.
Am 17.12.2011 01:23, schrieb Simen Kjærås:
On Fri, 16 Dec 2011 14:00:11 +0100, Joshua Reusch yos...@arkandos.de
wrote:
Hello,
is there a way to say something like
---
int a, b;
AliasTuple!(a, b) = tuple(4,5);
assert(a == 4 b == 5);
---
without having to write an own AliasTuple template ? I
Uncrustify + UniversalIndentGUI. The latter comes packaged with
uncrustify, but it might not ship with the latest version which had
some D-related bugfixes.
19 matches
Mail list logo