By modifying the code I was able to achieve exactly what I
wanted(I have very complex interfaces but the classes using them
consist of just one line.
The code basically fixes your code to handle the setter and
getters better and to work with functions. It is not very robust
so I won't post it
On Tuesday, 31 December 2013 at 22:58:04 UTC, Jonathan M Davis
wrote:
On Tuesday, December 31, 2013 12:33:06 Charles Hixson wrote:
In ddoc, if there is a way, how could I make, say, class names
in the
generated documentation be blue? Here I only want to change
class and
struct titles, and poss
On 2014-01-01 01:52, Frustrated wrote:
Is there an easy way to implement properties of an interface within a
class instead of having to duplicate almost the exact same code with
generic properties?
interface A
{
@property int data();
@property int data(int value);
}
class B : A
{
On 2014-01-01 08:55, Orvid King wrote:
Well, unashamedly copying from my own code, I have a template defined thusly:
enum isMemberFunction(T, string member) =
is(typeof(__traits(getMember, T.init, member)) == function);
Where `T` is the type that `member` is a part of. You can also change
`func
On 2014-01-01 08:43, Frustrated wrote:
Also, how does one get the exact code string of a member instead of
having to piece it together from info from std.traits? (which requires a
lot of work)?
You mean the to get the full signature of a method? I don't think that's
possible, unless you can u
On Wednesday, 1 January 2014 at 12:19:29 UTC, Jacob Carlborg
wrote:
On 2014-01-01 08:43, Frustrated wrote:
Also, how does one get the exact code string of a member
instead of
having to piece it together from info from std.traits? (which
requires a
lot of work)?
You mean the to get the full
On Wednesday, 1 January 2014 at 12:09:40 UTC, Jacob Carlborg
wrote:
On 2014-01-01 01:52, Frustrated wrote:
Is there an easy way to implement properties of an interface
within a
class instead of having to duplicate almost the exact same
code with
generic properties?
interface A
{
@property
On Wednesday, 1 January 2014 at 10:10:23 UTC, Mineko wrote:
On Tuesday, 31 December 2013 at 22:58:04 UTC, Jonathan M Davis
wrote:
On Tuesday, December 31, 2013 12:33:06 Charles Hixson wrote:
In ddoc, if there is a way, how could I make, say, class
names in the
generated documentation be blue?
On Wednesday, 1 January 2014 at 14:47:33 UTC, Gary Willoughby
wrote:
I've added an answer to the SO question.
The answers here: http://stackoverflow.com/a/20869751/13227
On 2014-01-01 08:43, Frustrated wrote:
Also, how does one get the exact code string of a member
instead of
having to piece it together from info from std.traits? (which
requires a
lot of work)?
Have a look at
https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/internal/meta/c
On Tuesday, 31 December 2013 at 16:32:19 UTC, thedeemon wrote:
On Tuesday, 31 December 2013 at 10:42:35 UTC, ponce wrote:
$ dub --build=release --combined
I guess this is something very recent, latest binary version
from http://code.dlang.org/download doesn't know this word yet.
Erm. Ye
On Wednesday, 1 January 2014 at 15:47:47 UTC, ponce wrote:
On Tuesday, 31 December 2013 at 16:32:19 UTC, thedeemon wrote:
On Tuesday, 31 December 2013 at 10:42:35 UTC, ponce wrote:
$ dub --build=release --combined
I guess this is something very recent, latest binary version
from http://co
The popBack function returns the element you are removing from the
array, not the array itself, thus "breaking" the chaining of function.
On 01/01/2014 08:36 AM, Dfr wrote:
This is interesting, why i can't just do it simpler way ?
"this.is.a.string"
.splitter (".")
You can use `std.conv.to` to convert the dchar[] back to a string,
adding `.to!string` at the end of the dchar[] array you want to convert.
Also not that there exists two similar functions to the lazy evaluated
splitter() and joiner() in std.array: the eagerly evaluated split() and
join(); bei
, but
it's not powerful enough for your use case.
Bye,
bearophile
Is there a link available, so that I could see what is in the
making?
On Wednesday, 1 January 2014 at 14:30:46 UTC, Gary Willoughby
wrote:
On Wednesday, 1 January 2014 at 12:09:40 UTC, Jacob Carlborg
wrote:
On 2014-01-01 01:52, Frustrated wrote:
Is there an easy way to implement properties of an interface
within a
class instead of having to duplicate almost the e
On Wednesday, 1 January 2014 at 15:10:56 UTC, Dicebot wrote:
On 2014-01-01 08:43, Frustrated wrote:
Also, how does one get the exact code string of a member
instead of
having to piece it together from info from std.traits? (which
requires a
lot of work)?
Have a look at
https://github.com/r
On Wednesday, 1 January 2014 at 17:19:01 UTC, Frustrated wrote:
There seems to be a bug. When I run it on a standard member it
works fine. When I run it on a property it throws an error
src\phobos\std\traits.d(344): Error: forward reference of
variable parentPrefix
src\phobos\std\traits.d(505)
Modules confuse me as a way to organize code.
If a module is composed of multiple classes, it seems that the
module semantics in D encourages putting all those classes in one
file.
Can someone explain how to organize a set of classes into a
module (or namespace, or package) so that each clas
Thank you, very clear explained.
On Wednesday, 1 January 2014 at 16:31:43 UTC, Rémy Mouëza wrote:
You can use `std.conv.to` to convert the dchar[] back to a
string, adding `.to!string` at the end of the dchar[] array you
want to convert.
Also not that there exists two similar functions to the
Jonathan:
Is there a link available, so that I could see what is in the
making?
Yes, this is two thirds of my proposal:
http://www.digitalmars.com/d/archives/digitalmars/D/enum_pre-conditions_217595.html
Bye,
bearophile
On Wed, 01 Jan 2014 17:43:53 +, Afshin wrote:
> Modules confuse me as a way to organize code.
>
> If a module is composed of multiple classes, it seems that the module
> semantics in D encourages putting all those classes in one file.
>
> Can someone explain how to organize a set of classes
Afshin:
Can someone explain how to organize a set of classes into a
module (or namespace, or package) so that each class can have
their own file?
Lot of D code is not made of classes :-) There are also lot of
free functions, some templates, some type definitions, some
interfaces, some globa
On 01/01/2014 06:58 AM, Gary Willoughby wrote:
On Wednesday, 1 January 2014 at 14:47:33 UTC, Gary Willoughby wrote:
I've added an answer to the SO question.
The answers here: http://stackoverflow.com/a/20869751/13227
That's richer coloring, alright. It looks quite nice. But the example
doe
C compilers like D compilers will pack a struct of two 16-bit
words into a 32-bit type if you don't force an alignment:
http://dlang.org/attribute.html#align
What you should avoid is having a data type start at an
address that is not a multiple of its size, especially when it
comes to SIMD.
Working
Thanks much for the help, both of you :). I thought there might
be a very simple way to do this, since it's so intuitive to
change '4' to 4. I've basically just been subtracting 48 from
everything, but I suppose aesthetically it's a bit nicer to
convert from string instead.
Am Wed, 01 Jan 2014 07:27:54 +
schrieb "Meta" :
> Your code is working correctly. D's chars, for all values up to
> 255, are the same as the ASCII character set.
UTF-8 reuses the ASCII mapping which is only defined from 0 to
127. Everything above is not ASCII and 255 is in fact not even
defi
On Wednesday, 1 January 2014 at 20:08:24 UTC, Marco Leise wrote:
Am Wed, 01 Jan 2014 07:27:54 +
schrieb "Meta" :
Your code is working correctly. D's chars, for all values up
to 255, are the same as the ASCII character set.
UTF-8 reuses the ASCII mapping which is only defined from 0 to
127
I'm calling an external C function which returns a string
delivered via a char*. When i print this string out, like this:
char* result = func();
writefln("String: %s", *result);
I only get one character printed. I guess this is expected
because i'm only returned a pointer to the first char. I
On Wednesday, 1 January 2014 at 23:03:06 UTC, Gary Willoughby
wrote:
I'm calling an external C function which returns a string
delivered via a char*. When i print this string out, like this:
char* result = func();'
you can then do
string r = to!string(result);
or
char[] r = result[0 .. str
On Wednesday, 1 January 2014 at 23:03:06 UTC, Gary Willoughby
wrote:
I'm calling an external C function which returns a string
delivered via a char*. When i print this string out, like this:
char* result = func();
writefln("String: %s", *result);
I only get one character printed.
You're not
I'm a little OCD - who cares about memory to that degree
anymore when we have gigabytes of RAM? This might not even come
into play on the Raspberry Pi.
Memory is very important when it comes to performance, the moving
of memory is the single most energy demanding task the CPU (and
the GPU for
Seen this on Reddit:
http://www.catb.org/esr/structure-packing/
It could be useful to have in Phobos some template that given
pair-name pairs (or a struct type) returns those fields in a
better packed order (without using align()).
See also:
https://d.puremagic.com/issues/show_bug.cgi?id=887
Given that D has contracts built into the language (which is one
of my favorite features of D by far) it seems to me that it
should be possible to document the pre and post conditions of a
contract using a contract section in Ddoc. I have been reading
through the documentation on Ddoc to see if
Ross Hays:
I am putting this topic in the learn forum because I may be
wrong and it may be possible. If, however, it is not possible,
that maybe it is worth a official suggestion?
Currently contracts don't go in DDoc, but they could.
Bye,
bearophile
On Thu, Jan 02, 2014 at 03:42:53AM +, bearophile wrote:
> Ross Hays:
>
> >I am putting this topic in the learn forum because I may be wrong
> >and it may be possible. If, however, it is not possible, that
> >maybe it is worth a official suggestion?
>
> Currently contracts don't go in DDoc, bu
36 matches
Mail list logo