juicy question!
signature.asc
Description: PGP signature
On Sat, 24 Jan 2015 20:49:01 +, Dominikus Dittes Scherkl wrote:
Maybe I'm just too stupid, but I cannot manage to call a simple function
with all 256 possible values of ubyte with iote:
int foo(ubyte c);
auto myRange = iota(0,256).map!foo;
-- Error: function foo(ubyte c) is not
On Sat, 24 Jan 2015 11:17:03 +, Bayan Rafeh wrote:
Apparently byKeyValue does not exist for associative arrays, should it?
void main() {
int[string] a;
a.byKeyValue(); //Error: byKeyValue doesn't exist.
}
If it shouldn't could someone remove it from the documentation?
On Sat, 24 Jan 2015 18:55:58 +, tcak wrote:
main.d ===
class Car{
public void makeBeep( char c ){}
public void makeBeep( string s ){}
}
class Tesla: Car{
override public void makeBeep( char c ){
On Sat, 24 Jan 2015 10:52:26 -0800, H. S. Teoh via Digitalmars-d-learn
wrote:
On Sat, Jan 24, 2015 at 06:15:29PM +, tcak via Digitalmars-d-learn
wrote:
Is there any way to run only unittest codes, and ignore main function?
DMD is running both of them when I use -unittest.
On Sat, 24 Jan 2015 11:11:35 -0800, H. S. Teoh via Digitalmars-d-learn
wrote:
On Sat, Jan 24, 2015 at 07:02:35PM +, ketmar via Digitalmars-d-learn
wrote:
On Sat, 24 Jan 2015 10:52:26 -0800, H. S. Teoh via Digitalmars-d-learn
wrote:
On Sat, Jan 24, 2015 at 06:15:29PM +, tcak via
On Sat, 24 Jan 2015 19:55:10 +, Suliman wrote:
Look for Passing unrecognized options through in the documentation.
Oh I see, but first part of question is still actual.
And also what is benefits of using getopt instead of parsing args[]
manually?
well... you can skip writing custom
On Thu, 22 Jan 2015 18:39:25 +, Adam D. Ruppe wrote:
On Thursday, 22 January 2015 at 16:22:14 UTC, ketmar via
Digitalmars-d-learn wrote:
i miss it in Phobos.
I'm sure it'd fail the phobos review process though. But since it is an
independent file (or it + characterencodings.d for full
On Thu, 22 Jan 2015 11:40:52 +
Gary Willoughby via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Thursday, 22 January 2015 at 11:23:49 UTC, Nordlöw wrote:
What is the meaning of selectors such as
`a[href]`
used in
doc.querySelectorAll(`a[href]`)
?
On Wed, 21 Jan 2015 23:50:59 +
anon via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wednesday, 21 January 2015 at 23:47:46 UTC, ketmar via
Digitalmars-d-learn wrote:
On Wed, 21 Jan 2015 23:44:49 +
anon via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com
On Wed, 21 Jan 2015 23:44:49 +
anon via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
I have the following C code, how can I do the same in D.
Info **info;
info = new Info*[hl + 2];
int r;
for(r = 0; r hl; r++)
{
info[r] = new Info[vl + 2];
}
info[r] = NULL;
On Tue, 20 Jan 2015 07:00:31 -0500
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 1/19/15 4:49 PM, Steven Schveighoffer wrote:
I figured it out, poll.d is missing from here:
https://github.com/D-Programming-Language/druntime/blob/master/mak/SRCS
On Tue, 20 Jan 2015 09:29:45 +
qqiang via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I am writing a tree data structure, and I have the following code:
```D
final class Node {
private {
int val_;
Node parent_;
Node left_;
Node right_;
On Tue, 20 Jan 2015 14:45:26 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
ketmar:
Jonathan explains it very well. i can add the only thing: don't
use `const` until you forced to. ;-)
In D use immutable (or const) everywhere you can. Possibly mark
On Tue, 20 Jan 2015 17:59:38 +
JC via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
The following code throws a
core.exception.InvalidMemoryOperationError@(0), anyone have an
idea of what is causing it?
---
import std.stdio;
class Test
{
this()
{
On Mon, 19 Jan 2015 16:49:34 -0500
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
I figured it out, poll.d is missing from here:
https://github.com/D-Programming-Language/druntime/blob/master/mak/SRCS
So it's for some reason not purposely included.
On Mon, 19 Jan 2015 17:05:22 -0500
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
BTW, I've seen linker errors happen when you don't include a module,
even if there's seemingly nothing to deal with in there. To the point
where I just include all modules
On Mon, 19 Jan 2015 12:04:38 +
via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
As a follow-up to
http://forum.dlang.org/thread/fdfwrdtjcawprvvko...@forum.dlang.org#post-qxudiyoygnvvbovhjfgt:40forum.dlang.org
I'm looking for a function that figures out the number of
On Mon, 19 Jan 2015 21:00:55 +
tcak via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
What is the reason of this error exactly?
core.sys.posix.poll.d module is not compiled into druntime. as it is
in include path, compiler sees it and you can use `pollfd` struct.
but as it's
On Mon, 19 Jan 2015 21:00:55 +
tcak via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
p.s. i love new binutils!
% dmd z00.d
z00.o: In function `D main':
z00.d:(.text._Dmain+0xa): undefined reference to
`core.sys.posix.poll.pollfd.init$'
z00.d:(.text._Dmain+0x10): undefined
On Mon, 19 Jan 2015 16:27:51 -0500
Steven Schveighoffer via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 1/19/15 4:16 PM, ketmar via Digitalmars-d-learn wrote:
On Mon, 19 Jan 2015 21:00:55 +
tcak via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
What
On Thu, 15 Jan 2015 11:48:23 +
Francesco Cattoglio via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Tuesday, 13 January 2015 at 18:52:25 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 13 Jan 2015 18:36:15 +
aldanor via Digitalmars-d-learn
digitalmars-d
On Wed, 14 Jan 2015 12:37:33 +
seany via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wednesday, 14 January 2015 at 12:25:12 UTC, ketmar via
Digitalmars-d-learn wrote:
just forgot about that
crappy scripting stuff and write your code in D!
Actually I want to serve
On Wed, 14 Jan 2015 01:16:52 +
Bauss via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Is it possible to access a pointer by its offsets.
Ex. write a 32bit integer to a byte pointer at ex. offset 4.
yes, it is. it's same as in c/c++, except that you have to add one
magic
On Wed, 14 Jan 2015 11:40:25 +
seany via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
I am new to vibe.d and plying a bit with it.
I notice, that in case of Apache, there is a root directory,
often by default under /var/www or /srv/http (resp. ftp) if you
are using
On Tue, 13 Jan 2015 17:08:37 +
Laeeth Isharc via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
I just finished reading aldanor's blog, so I know he is slightly
allergic to naked functions and prefers classes ;)
that's due to absense of modules in C/C++. and namespaces aren't
On Tue, 13 Jan 2015 18:12:44 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Tuesday, 13 January 2015 at 16:43:09 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 13 Jan 2015 16:17:51 +
aldanor via Digitalmars-d-learn
digitalmars-d-learn
On Tue, 13 Jan 2015 18:14:40 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
// thanks ketmar for answering another one of my stupid questions
on n.g. :)
ah, 'cmon, your questions aren't stupid at all! ;-)
signature.asc
Description: PGP signature
On Tue, 13 Jan 2015 17:09:31 +
Dominikus Dittes Scherkl via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
/// interpret an array of one type as an array of a different
type.
may i point you to this?
import std.stdio;
void main () {
ubyte[] a = [42,0,0,0,
On Tue, 13 Jan 2015 18:36:15 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Tuesday, 13 January 2015 at 18:19:42 UTC, ketmar via
Digitalmars-d-learn wrote:
and then you can go with structures in the first place, i think.
remember that you have that k00l
On Tue, 13 Jan 2015 18:35:15 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I guess two of my gripes with UFCS is (a) you really have to use
public imports in the modules where the target types are defined
so you bring all the symbols in whether you want it or
On Mon, 12 Jan 2015 22:07:13 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I see, thanks! :) I've started liking structs more and more
recently as well and been pondering on how to convert a
class-based code that looks like this (only the base class has
any
On Mon, 12 Jan 2015 23:06:16 +
jmh530 via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I had seen some stuff on alias thing, but I hadn't bothered to
try to understand it until now. If I'm understanding the first
example a href=http://dlang.org/class.html#AliasThis;here/a,
On Mon, 12 Jan 2015 22:07:13 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I see, thanks! :) I've started liking structs more and more
recently as well and been pondering on how to convert a
class-based code that looks like this (only the base class has
any
On Tue, 13 Jan 2015 13:56:05 +
tcak via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
it works normal now. But it doesn't explain above issue. What's
the relation between a new thread and a module's initialiser?
yes.
signature.asc
Description: PGP signature
On Tue, 13 Jan 2015 10:06:25 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Nordlöw:
Has there been any discussions on
making map require pure functions now that we have each?
Perhaps I'd like Phobos map and filter to be annotated with
pure and to
On Tue, 13 Jan 2015 11:26:01 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
ketmar:
that will effectively rule out any usage of some global vars or
other
external state, turning it into either unnecessary mess, or
unusable
theoretical crap.
On Tue, 13 Jan 2015 16:08:15 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Tuesday, 13 January 2015 at 08:33:57 UTC, ketmar via
Digitalmars-d-learn wrote:
On Mon, 12 Jan 2015 22:07:13 +
aldanor via Digitalmars-d-learn
digitalmars-d-learn
On Tue, 13 Jan 2015 16:17:51 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
This discussion:
http://forum.dlang.org/thread/bqtcdpsopxmnfbjyr...@forum.dlang.org
-- led me wondering if it would be possible to create some
crippled version of a class proxy that
On Tue, 13 Jan 2015 20:52:13 +
Dominikus Dittes Scherkl via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Tuesday, 13 January 2015 at 20:11:45 UTC, anonymous wrote:
On Tuesday, 13 January 2015 at 20:00:57 UTC, Dominikus Dittes
Scherkl wrote:
So if I have a function
On Tue, 13 Jan 2015 20:00:56 +
Dominikus Dittes Scherkl via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
p.s. i don't intend to stop you from doing what you want to do, in no
way. i was just trying to show you some things that you can
accidentally missed. sorry if it looks
On Mon, 12 Jan 2015 16:32:30 +
Oleg via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Monday, 12 January 2015 at 15:59:43 UTC, Adam D. Ruppe wrote:
Why are you using ref? Take that off and you can pass any
array, including null, with ease.
Because dynamic arrays are
On Mon, 12 Jan 2015 19:29:53 +
jmh530 via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
the proper answer is too long to write (it will be more an article that
a forum answer ;-), so i'll just give you some directions:
import std.typecons;
{
auto b = scoped!B(); //
On Mon, 12 Jan 2015 20:14:19 +
jmh530 via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Thanks for the reply, I wasn't familiar with scoped. I was aware
that structs are on the stack and classes are on the heap in D,
but I didn't know it was possible to put a class on the
On Mon, 12 Jan 2015 21:37:27 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Monday, 12 January 2015 at 20:30:45 UTC, ketmar via
Digitalmars-d-learn wrote:
it even has `RefCounted!`, but it doesn't play well with
classes yet
(AFAIR).
I wonder if it's
On Mon, 12 Jan 2015 16:53:59 +
Oleg via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Monday, 12 January 2015 at 16:44:42 UTC, ketmar via
Digitalmars-d-learn wrote:
nope, it means exactly what is written there. except that
dynamic array
is represented by struct
On Sun, 11 Jan 2015 11:41:08 +
Martin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Is there a way to get Tuple (and Typedef) from the std.typecons
module to generate a new type that is unique on every
instantiation? What I mean is:
alias T1 = Tuple!(int, int);
alias
On Sun, 11 Jan 2015 12:00:19 +
Martin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
as for `Typedef!` -- you can use it's third arg, cookie:
import std.typecons;
alias T1 = Tuple!(int, int);
alias T2 = Tuple!(int, int);
alias T1New = Typedef!(T1,
On Sun, 11 Jan 2015 20:00:03 +
Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Can someone please tell me what I'm doing wrong here, the sql
INSERT statement fails for some reason. I don't fully understand
the callback function yet (I borrowed this from a C tutorial
On Fri, 09 Jan 2015 15:36:21 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Friday, 9 January 2015 at 14:03:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Fri, 09 Jan 2015 13:54:00 +
Robert burner Schadek via Digitalmars-d-learn
digitalmars-d
On Fri, 09 Jan 2015 09:36:01 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Sorry,it's only a example .Thank you work hard,but it's
not what I want.
'indexOfAny ' function should do this work.
”he is at home ,[home,office,”sea,plane], in
On Fri, 09 Jan 2015 14:11:49 +
Robert burner Schadek via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Friday, 9 January 2015 at 14:03:21 UTC, ketmar via
Digitalmars-d-learn wrote:
std.regex can use CTFE to compile regular expressions (yet it
sometimes
slower
On Fri, 09 Jan 2015 13:54:00 +
Robert burner Schadek via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Friday, 9 January 2015 at 13:25:17 UTC, ketmar via
Digitalmars-d-learn wrote:
if you *really* concerned with speed here, you'd better
consider using
regular
On Fri, 09 Jan 2015 12:46:53 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
The code is the best,and it's better than indexOfAny in C#:
import std.algorithm, std.stdio;
void main ()
{
auto places = [ home, office, sea,plane];
auto strWhere = He
On Fri, 09 Jan 2015 13:06:09 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Friday, 9 January 2015 at 10:02:53 UTC, ketmar via
Digitalmars-d-learn wrote:
import std.algorithm, std.stdio;
void main () {
string s = he is at home
Hello.
disclaimer: please, ignore compiler inlining abilities while you are
reading this post. i'll give some reasoning later.
let's imagine that we have such function:
void putPixel (int x, int y, uint color) {
if ((color0xff) == 0) {
// replace pixel
} else if ((color0xff) !=
On Fri, 09 Jan 2015 07:10:14 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Thursday, 8 January 2015 at 15:15:59 UTC, Robert burner
Schadek wrote:
use canFind like such:
bool a = canFind(strs,s) = 1;
let the compiler figger out what the types
On Thu, 08 Jan 2015 23:06:38 +
Nordlöw via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Thursday, 8 January 2015 at 16:11:07 UTC, ketmar via
Digitalmars-d-learn wrote:
how can it? compiler doesn't know what the code is supposed to
do. if
compilers will know
On Thu, 08 Jan 2015 15:59:10 +
Nordlöw via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Thursday, 8 January 2015 at 15:49:46 UTC, Dragos Carp wrote:
On Thursday, 8 January 2015 at 15:45:27 UTC, Nordlöw wrote:
Is
key in aa ? aa[key] : ValueType.init;
the most
On Tue, 06 Jan 2015 14:08:30 +
Laeeth Isharc via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
I realize Walter has far better things to work on, but value of
having a translation tool is considerable, since it opens up easy
access to an enormous range of libraries. It is
On Tue, 06 Jan 2015 21:25:49 +
Suliman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Tuesday, 6 January 2015 at 21:19:38 UTC, bearophile wrote:
Suliman:
void foo()
{
writeln(test);
writeln(mystring);
}
foo();
}
I guess you have
On Sat, 03 Jan 2015 12:14:54 +
via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Saturday, 3 January 2015 at 00:12:35 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
In D, if a type is not marked as shared, then it is by
definition
thread-local, and the
On Sat, 03 Jan 2015 01:00:58 -0800
Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On 01/02/2015 09:07 PM, ketmar via Digitalmars-d-learn wrote:
structure instance with const fields can be initialized only once, upon
creation. so did `Test myTest1;` -- you
On Sat, 03 Jan 2015 14:45:24 +1030
ted via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Well, I just cleared up some of my misunderstanding.
I did not realise the mA (within struct Test) would be a _copy_ of arg, not
a reference (pointer) to arg.
So the more correct code
On Sat, 03 Jan 2015 15:56:58 +1030
ted via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Ironically, I'm trying to use const in an effort to understand it...but
there seems to be an unusual amount of pain until I grok it.
just remember that `const` infects everything down to the
On Sat, 03 Jan 2015 16:40:14 +1030
ted via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
I'm now taking the view that const is there for the compiler to optimise
code on the basis that nothing can alter it once set (and can only be set
on initialisation). So I see your point
On Sat, 03 Jan 2015 14:45:24 +1030
ted via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
p.s. also please note that structs in D are always passed by value and
copied (until you not explicitly ask for something another). so:
MyStruct a;
MyStruct b;
b = a;
actually does
On Sat, 03 Jan 2015 13:25:31 +1030
ted via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
I get the following error from the code below: (dmd2.066.1, linux)
test.d(26): Error: cannot modify struct myTest1 Test with immutable members
Is this expected?
If so, how can I
On Fri, 02 Jan 2015 10:40:22 +
novice2 via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Thanx Daniel, thanx Ketmar.
I just thinked that this is some sort of bug.
May be DMD should not change mangled name of external function...
Bit i dont know.
with `extern(C)` it
On Thu, 01 Jan 2015 12:32:33 +
Idan Arye via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
If I have an associative array and I only modify it's values,
without changing the keys, can I assume that the order won't
change?
please, don't: this is implementation-specific.
On Thu, 01 Jan 2015 17:51:45 +
novice2 via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I want to use external or C function.
It used only one time from one D function.
I want do declare C function inside D function.
I don't want to declare C function in global scope.
On Wed, 31 Dec 2014 15:36:16 +
Darrell via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
So far attempts to run regex on binary data causes
Invalid UTF-8 sequence.
Attempts to pass ubyte also didn't work out.
current regex engine assumes that you are using UTF-8 encoded
On Wed, 31 Dec 2014 06:03:04 +
bitwise via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
How do you get the current DateTime?
Why doesn't DateTime have DateTime.now?
but it has! ;-)
auto now = cast(DateTime)Clock.currTime;
signature.asc
Description: PGP signature
On Sun, 28 Dec 2014 20:21:45 +
Aiden via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Thanks for the information. At least I've discovered a reasonably
tidy way of wrapping Mutex up so that it's not quite as painful
casting everything:
shared class SharedMutex {
On Sun, 28 Dec 2014 17:34:50 +
via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Sunday, 28 December 2014 at 16:05:32 UTC, bearophile wrote:
(IMHO it must be).
Disallowing is an alternative to consider. Even defined behaviour
can be unintuitive and error prone.
yep,
On Sun, 28 Dec 2014 19:02:59 +0100
Joseph Rushton Wakeling via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
A question that suddenly occurred to me, and I realized I didn't know the
answer.
Why is it necessary/desirable to define separate .length and .opDollar
methods
On Sun, 28 Dec 2014 14:07:18 -0800
AuoroP via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
let me give you a riddle:
struct ExampleTemplate(T) {
T value;
auto opAdd (typeof(this) that) inout {
import std.traits : Unqual;
Unqual!(typeof(this)) result;
On Sat, 27 Dec 2014 17:38:55 +
Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Saturday, 27 December 2014 at 17:36:39 UTC, Derix wrote:
What am I missing ? Or, to put it more simply, what would be the
correct dmd command line to import a module defined
On Sat, 27 Dec 2014 23:43:54 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Is there a way to do something like this while keeping the
destructor nogc?
class Foo {
shared static Foo[id] registry;
int id;
this(int id) {
this.id =
On Sat, 27 Dec 2014 23:43:54 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Is there a way to do something like this while keeping the
destructor nogc?
class Foo {
shared static Foo[id] registry;
int id;
this(int id) {
this.id =
On Sat, 27 Dec 2014 23:34:06 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Friday, 26 December 2014 at 15:58:18 UTC, aldanor wrote:
Please ignore the missing new keywords in the code and other
minor typos :)
Any opinions please?.. Would be much
On Sun, 28 Dec 2014 06:14:09 +
Jack via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
I'm trying to create a sort of downloader where it will
download multiple pages of comics which are in .jpg format.
Now the problem is, that when I used the download() function:
On Sun, 28 Dec 2014 06:51:14 +
Jack via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
As much as my brotherhood senses push me into revealing the
links(they're in json), doing that will reveal my guilty
pleasures and fetishes. Well, anywho, thanks for that. I
appreciate
On Sun, 28 Dec 2014 07:24:53 +
Jack via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Well it's not really that much of a link really. I swear.
It's just like fapping to drawings or some sort of thing.
Not really THAT good of a comic. *sweats*
so that's not one of that
On Sun, 28 Dec 2014 07:44:33 +
Jack via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
How does one compile for Windows on a Linux Machine using dub?
I've been using the platform : [windows] configuration in my
dub.json to no avail since my Windows installation keeps on
On Wed, 24 Dec 2014 13:38:59 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Imagine there's a template that wraps arbitrary functions and may
throw exceptions depending on their returned values (see a
simplified example below). However, if an exception occurs,
On Wed, 24 Dec 2014 14:04:50 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Wednesday, 24 December 2014 at 13:48:26 UTC, ketmar via
Digitalmars-d-learn wrote:
the `object.Exception@wrap.d` is not a backtrace result, this
is the
result of Exception
has to generate new parameterized function, of course. sorry.
signature.asc
Description: PGP signature
On Wed, 24 Dec 2014 17:05:45 +
Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
So `if (isSet!bit1)` becomes `if (cast(bool)(embeddedTest.bits
bit1)`. That doesn't work, however. I get an error message saying
need 'this' for 'bits' of type 'int'. Is there a way to
On Wed, 24 Dec 2014 19:52:31 +
Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
Hmm, I confused myself over when the expression is interpreted. I
got it into my head that the template expansion would somehow
delay interpretation of the expression so it could be
On Thu, 25 Dec 2014 02:07:51 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I'm wondering how to best implement the following pattern: the
constructor of a class has some required and some optional
arguments; and one of the (optional) arguments also controls
On Thu, 25 Dec 2014 03:07:55 +
aldanor via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Thursday, 25 December 2014 at 02:28:47 UTC, ketmar via
Digitalmars-d-learn wrote:
happy hacking! ;-)
Thanks once again! I think this mostly solves it. Would it be
possible
On Tue, 23 Dec 2014 15:37:12 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
you will find the different:
D: PROCESSENTRY32* pe32 =
cast(PROCESSENTRY32*)GC.calloc(PROCESSENTRY32.sizeof);
C++:PROCESSENTRY32 pe32;
GC.calloc means: memset ?!
do you see
On Tue, 23 Dec 2014 22:57:07 +
Winter M. via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I've run into a problem while trying to coerce array values from
a variant; specifically,
char[] a = aVariant.coerce!(char[]); // This works just fine.
byte[] b =
On Wed, 24 Dec 2014 00:24:44 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
On Tuesday, 23 December 2014 at 20:22:12 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 23 Dec 2014 15:37:12 +
FrankLike via Digitalmars-d-learn
digitalmars-d-learn
On Sun, 21 Dec 2014 16:42:45 +
FrankLike via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
I want to get that : pragma(link, SUBSYSTEM WINDOWS,4.0);
But get error:pragma link unrecognized pragma(link)?
How can I to do?
Thank you.
you have to patch the compiler to
On Fri, 19 Dec 2014 10:22:01 +
Colin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Thursday, 18 December 2014 at 22:29:30 UTC, Ali Çehreli wrote:
On 12/18/2014 02:51 AM, Colin wrote:
vi, and it does indeed have a '\n' at the end of file.
Ah, I see. That's
On Fri, 19 Dec 2014 10:22:01 +
Colin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Thursday, 18 December 2014 at 22:29:30 UTC, Ali Çehreli wrote:
On 12/18/2014 02:51 AM, Colin wrote:
vi, and it does indeed have a '\n' at the end of file.
Ah, I see. That's
On Fri, 19 Dec 2014 10:41:03 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Can you tell why? :-)
'cause lazy ranges can't be optimised in compile time? ;-)
signature.asc
Description: PGP signature
On Fri, 19 Dec 2014 12:20:34 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
anon:
Changed to
return data.map!(n = foo2(data, i + 1,
max)).cache.joiner.array;
then it produced the same result as array version.
`map.cache.join` resulted in
601 - 700 of 1079 matches
Mail list logo