On Saturday, 15 August 2015 at 02:21:46 UTC, D_Learner wrote:
Well, the actual error I got is : Error: memset cannot be
interpreted at compile time, because it has no available source
code . I seems to suggest I miss the actual code.
I guess I gave you a wrong impression of how pure relates t
On Saturday, 15 August 2015 at 02:21:46 UTC, D_Learner wrote:
Well, the actual error I got is : Error: memset cannot be
interpreted at compile time, because it has no available source
code . I seems to suggest I miss the actual code.
yeah, ctfe is different than pure functions. That's where t
On Friday, 14 August 2015 at 13:32:57 UTC, Timon Gehr wrote:
On 08/14/2015 03:26 PM, Timon Gehr wrote:
On 08/14/2015 05:12 AM, H. S. Teoh via Digitalmars-d-learn
wrote:
...
I didn't figure out how to eliminate the short slices toward
the end,
...
:o)
...
Less hacky and less efficient:
a
On Saturday, 15 August 2015 at 02:21:46 UTC, D_Learner wrote:
On Saturday, 15 August 2015 at 01:13:02 UTC, Adam D. Ruppe
wrote:
On Saturday, 15 August 2015 at 01:09:15 UTC, D_Learner wrote:
When writting a pure fucntion involving C non pure functions
like
memcpy() and memset()
Those funct
On Saturday, 15 August 2015 at 01:13:02 UTC, Adam D. Ruppe wrote:
On Saturday, 15 August 2015 at 01:09:15 UTC, D_Learner wrote:
When writting a pure fucntion involving C non pure functions
like
memcpy() and memset()
Those functions are pure already, and marked so in the newest
dmd (and I
On 08/14/2015 06:09 PM, D_Learner wrote:
> When writting a pure fucntion involving C non pure functions
If you want to live dangerously, you can use assumePure, which is found
in one of the unittest blocks of std.traits:
import std.traits;
auto assumePure(T)(T t)
if (isFunctionPointer!T || i
On Saturday, 15 August 2015 at 01:09:15 UTC, D_Learner wrote:
When writting a pure fucntion involving C non pure functions
like
memcpy() and memset()
Those functions are pure already, and marked so in the newest dmd
(and I think older ones too, though I haven't confirmed.
Your code compi
When writting a pure fucntion involving C non pure functions like
memcpy() and memset() , what could be the way around? Should I
re-write these and make them pure?
The code am converting is as below :-
int ag_cmatch(const string pattern, const string text,
int[char] bmBc , int[size] bm
On Friday, 14 August 2015 at 23:17:44 UTC, Tofu Ninja wrote:
On Friday, 14 August 2015 at 22:25:15 UTC, DarthCthulhu wrote:
Ahh, that is a much cleaner way to do it rather than using a
singleton.
By 'module level', I assume you mean in the module that
defines the Logger class? An 'import de
On Friday, 14 August 2015 at 22:25:15 UTC, DarthCthulhu wrote:
Ahh, that is a much cleaner way to do it rather than using a
singleton.
By 'module level', I assume you mean in the module that defines
the Logger class? An 'import debug.logger' or somesuch would
then give all relevant modules
On Friday, 14 August 2015 at 12:40:08 UTC, Steven Schveighoffer
wrote:
I would do it this way:
// at module level
debug(logging) {
Logger logger;
static this() { logger = new Logger;}
}
If you want to have the logger be global, add 'shared' to both
the logger and the static this.
Th
On Friday, 14 August 2015 at 20:48:43 UTC, Adam D. Ruppe wrote:
On Friday, 14 August 2015 at 20:40:13 UTC, D_Learner wrote:
>Perhaps I have to get myself a copy.
you should! There's a lot of little tips and tricks in there.
Am currently looking at your Dconf2015 talk .
My blasphemous talk
On Friday, 14 August 2015 at 20:40:13 UTC, D_Learner wrote:
>Perhaps I have to get myself a copy.
you should! There's a lot of little tips and tricks in there.
Am currently looking at your Dconf2015 talk .
My blasphemous talk as I like to call it :)
There's a bit in the video where i went
On Thursday, 13 August 2015 at 19:26:12 UTC, Adam D. Ruppe wrote:
On Thursday, 13 August 2015 at 19:13:55 UTC, D_Learner wrote:
[...]
It is currently not possible to build an associative array at
compile time and keep it as a runtime table due to the
implementation.
[...]
Am aware you ha
On Thursday, 13 August 2015 at 19:54:18 UTC, anonymous wrote:
On Thursday, 13 August 2015 at 19:13:55 UTC, D_Learner wrote:
[...]
I think you may have some fundamental misunderstandings
regarding CTFE, templates, etc. Your code seems to be half-way
between a template-based and a CTFE-bas
On 8/14/15 11:39 AM, Timon Gehr wrote:
On 08/13/2015 06:05 PM, Steven Schveighoffer wrote:
On 8/13/15 11:59 AM, Steven Schveighoffer wrote:
That is definitely a bug. It's because typeid is looking up the derived
type via the vtable, but the compiler should rewrap it with 'shared'
afterwards.
http://code.dlang.org/packages/windows-headers - as a dub package.
On 08/13/2015 06:05 PM, Steven Schveighoffer wrote:
On 8/13/15 11:59 AM, Steven Schveighoffer wrote:
That is definitely a bug. It's because typeid is looking up the derived
type via the vtable, but the compiler should rewrap it with 'shared'
afterwards.
Actually, now that I think about it, I'
It's because it's implemented in DMD only partly.
There's a bug report associated with it.
On Friday, 14 August 2015 at 07:04:53 UTC, BBasile wrote:
It's because of the key type (string is a library type).
This is not true. It's not because of the key type. And string is
not a library type.
On Wednesday, 12 August 2015 at 23:23:03 UTC, Yuxuan Shui wrote:
Is there a way to do thread-local allocations?
Yes, either manually or just putting things on the stack, but the
std.string functions you use doesn't try to do them.
You might try replacing format() with formattedWrite(), which
On 08/14/2015 03:26 PM, Timon Gehr wrote:
On 08/14/2015 05:12 AM, H. S. Teoh via Digitalmars-d-learn wrote:
...
I didn't figure out how to eliminate the short slices toward the end,
...
:o)
...
Less hacky and less efficient:
auto slidingWindow(R)(R range, int k) {
return iota(k).map!(
On 08/14/2015 05:12 AM, H. S. Teoh via Digitalmars-d-learn wrote:
On Fri, Aug 14, 2015 at 02:42:26AM +, Laeeth Isharc via Digitalmars-d-learn
wrote:
I have a range that is an array of structs. I would like to iterate
through the range, calling a function with the prior k items in the
range
On 8/14/15 5:21 AM, DarthCthulhu wrote:
This is more a theoretical exercise than specific code nitty gritty, but...
Let's say I have some code like this:
class World {
// Bunch of members and other functions
void happyDay () {
if (bCthulhuRises) {
debug(loggi
On 8/14/15 4:22 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= "
wrote:
On Thursday, 13 August 2015 at 16:05:19 UTC, Steven Schveighoffer wrote:
On 8/13/15 11:59 AM, Steven Schveighoffer wrote:
That is definitely a bug. It's because typeid is looking up the derived
type via the vtable, but the compiler sh
https://issues.dlang.org/show_bug.cgi?id=14920
On Friday, 14 August 2015 at 09:21:56 UTC, DarthCthulhu wrote:
I only want to access the logger object when the program is
compiled with the -debug option, so I don't want to pass it
along to the object constructor or set a member as a reference
to it (which is both tedious and pointless if not
This is more a theoretical exercise than specific code nitty
gritty, but...
Let's say I have some code like this:
class World {
// Bunch of members and other functions
void happyDay () {
if (bCthulhuRises) {
debug(logging) {
logge
On Friday, 14 August 2015 at 08:09:18 UTC, Edwin van Leeuwen
wrote:
On Friday, 14 August 2015 at 08:06:15 UTC, yawniek wrote:
dub add-local allows you to add local copy of a package. This
will be system wide though, not only for the current package.
i actually tried this, somehow did't work
On Thursday, 13 August 2015 at 16:05:19 UTC, Steven Schveighoffer
wrote:
On 8/13/15 11:59 AM, Steven Schveighoffer wrote:
That is definitely a bug. It's because typeid is looking up
the derived
type via the vtable, but the compiler should rewrap it with
'shared'
afterwards.
Actually, now th
On Friday, 14 August 2015 at 08:06:15 UTC, yawniek wrote:
i'm trying to have my own versions of my dependencies as git
submodules.
whats the correct way of having a chain of packages included
from git submodules so that every packages get's only picked
once?
dub add-local allows you to add
i'm trying to have my own versions of my dependencies as git
submodules.
problem:
i include a local version of vibe.d and then i add other local
versions of
packages that themselves include vibe.d
somehow my version of vibe isn't picked up by the other
dependencies and it results in an error
On Friday, 14 August 2015 at 06:48:27 UTC, Adel Mamin wrote:
Compiler dmd_2.068.0-0_amd64.deb on Ubuntu 12.04 Linux:
auto lookup = [ "one":1, "two":2 ];
The dmd error:
Error: non-constant expression ["one":1, "two":2]
Why doesn't it compile?
As a workaround I could do the assignment one elemen
On 08/13/2015 11:48 PM, Adel Mamin wrote:
Compiler dmd_2.068.0-0_amd64.deb on Ubuntu 12.04 Linux:
auto lookup = [ "one":1, "two":2 ];
The dmd error:
Error: non-constant expression ["one":1, "two":2]
I think the problem is when the variable is defined at module scope. It
works inside function
34 matches
Mail list logo