On 1/19/2015 2:35 PM, tcak wrote:
On Monday, 19 January 2015 at 04:18:47 UTC, tcak wrote:
On Sunday, 18 January 2015 at 22:25:39 UTC, anonymous wrote:
On Sunday, 18 January 2015 at 18:07:05 UTC, tcak wrote:
After these, it works perfectly. I hope this can be fixed in next
version.
Please fil
The following code example
import std.stdio, std.bitmanip;
enum E2 { a, b, c, d, e }
immutable bf = bitfields!(uint, "x", 6,
E2, "e2", 2);
struct A { mixin(bf); }
void main(string[] args)
{
A obj;
obj.x = 2;
obj.e2 = E2.a;
import core.exception: Asse
Nordlöw:
wouldn't it be better to detect the mismatches between enum
bit-sizes and bitfield lengths at compile-time instead of at
run-time?
File an enhancement and/or submit a Phobos patch.
Bye,
bearophile
On Monday, 19 January 2015 at 11:23:11 UTC, bearophile wrote:
File an enhancement and/or submit a Phobos patch.
Ok, great. I'll try fixing this in a PR.
Further...I propose to enhance `bitfields` to automatically
deduce bitfield lengths in the following way.
autoBitfields!(ubyte, "x", 3,
On Monday, 19 January 2015 at 11:40:07 UTC, Per Nordlöw wrote:
Typical deductions are
- enums: E.max - E.min + 1 (this requires offsetting logic in
I guess a trait for this, say
enum bitsizeOf(E) = return bitsNeeded(E.max - E.min + 1);
is motivated aswell, if it doesn't already exists...
Wha
On Sunday, 18 January 2015 at 16:12:24 UTC, Kagamin wrote:
http://forum.dlang.org/thread/dnxgbumzenupviqym...@forum.dlang.org
:-/
:-/
I'm inclined to write a DIP... (or fork...)
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 bits
that are needed to represent a zero-based integer:
value-set => bits
=
0,1 => 1 (*)
0
On Monday, January 19, 2015 12:04:38 via Digitalmars-d-learn 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 bits
> that are needed to represen
Per Nordlöw:
I'm looking for a function that figures out the number of bits
that are needed to represent a zero-based integer:
//
http://stackoverflow.com/questions/3272424/compute-fast-log-base-2-ceiling
uint ceilLog2(ulong x) pure nothrow @safe @nogc
in {
assert(x > 0);
} body {
On Mon, 19 Jan 2015 12:04:38 +
via Digitalmars-d-learn 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 bits
> that are needed to repre
On 1/19/15 7:04 AM, "Per =?UTF-8?B?Tm9yZGzDtnci?=
" 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 bits that are
needed to represent a zero-based i
On Monday, 19 January 2015 at 13:30:47 UTC, Steven Schveighoffer
wrote:
http://dlang.org/phobos/core_bitop.html#.bsr
It's actually an intrinsic, reduces to an instruction. Mind the
requirements for 0.
-Steve
Nice. Is this intrinsic supported for all DMD/GCD/LDC supported
platforms or do we
On Monday, 19 January 2015 at 11:49:29 UTC, Per Nordlöw wrote:
What's the name of `bitsNeeded` (binary Power) in Phobos?
core.bitop.bsr
For details see:
http://forum.dlang.org/thread/okonqhnxzqlqtxijx...@forum.dlang.org#post-kscrsodwmslgveptrxmx:40forum.dlang.org
Hi,
I am hoping to use dlib for image manipulation utility program
but I can't find any documentation for it. Am I missing
something? Any examples at least?
(also: dlib from dub does not compile with "wcslen import
conflict.", I managed to find a fix on github but bup packages
need updating
On Monday, January 19, 2015 08:30:47 Steven Schveighoffer via
Digitalmars-d-learn wrote:
> http://dlang.org/phobos/core_bitop.html#.bsr
>
> It's actually an intrinsic, reduces to an instruction. Mind the
> requirements for 0.
Sadly, I don't think that it have occurred to me from just reading the
On Monday, 19 January 2015 at 05:35:46 UTC, tcak wrote:
Fixed shm.d file is put on issue page. If someone could put a
pull request on Github with it.
shmid_ds is on version(linux) part is fixed up on it, and works
properly. But tested on 64-bit system only.
Aand it's in:
https://github.com/
On 1/19/15 12:35 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Monday, January 19, 2015 08:30:47 Steven Schveighoffer via
Digitalmars-d-learn wrote:
http://dlang.org/phobos/core_bitop.html#.bsr
It's actually an intrinsic, reduces to an instruction. Mind the
requirements for 0.
Sadly
On 1/19/15 10:49 AM, "Per =?UTF-8?B?Tm9yZGzDtnci?=
" wrote:
On Monday, 19 January 2015 at 13:30:47 UTC, Steven Schveighoffer wrote:
http://dlang.org/phobos/core_bitop.html#.bsr
It's actually an intrinsic, reduces to an instruction. Mind the
requirements for 0.
Nice. Is this intrinsic support
On Monday, January 19, 2015 13:37:12 Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 1/19/15 12:35 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
> > On Monday, January 19, 2015 08:30:47 Steven Schveighoffer via
> > Digitalmars-d-learn wrote:
> >> http://dlang.org/phobos/core_bitop.
I've done this by declaring a static array of the same length as
ViewColor!V.channels, and foreach-ing over the channels in a
colour, but this seem uglier than it need to - it would be nice
if I could just define + and = appropriately on double[] and
colours to do the right thing.
On Sunday,
On Monday, 19 January 2015 at 13:30:47 UTC, Steven Schveighoffer
wrote:
http://dlang.org/phobos/core_bitop.html#.bsr
It's actually an intrinsic, reduces to an instruction. Mind the
requirements for 0.
This works for me
https://github.com/nordlow/justd/blob/master/traits_ex.d#L406
:)
I'm trying to use ddoc to generate documentation, but get the
following error:
$ dub -b docs
Building configuration "library", build type docs
Running dmd...
source/painlessjson.d(287): Error: template
painlessjson.fromJSON(T)(JSONValue json) unmatched --- in DDoc
comment
FAIL . painlessjson s
On 1/19/15 3:46 PM, "Nordlöw" wrote:
On Monday, 19 January 2015 at 13:30:47 UTC, Steven Schveighoffer wrote:
http://dlang.org/phobos/core_bitop.html#.bsr
It's actually an intrinsic, reduces to an instruction. Mind the
requirements for 0.
This works for me
https://github.com/nordlow/justd/blo
Code is as follows:
main.d
=
import core.sys.posix.poll;
void main(){
core.sys.posix.poll.pollfd[2] pollList;
}
=
Error:
main.d:(.text._Dmain+0x15): undefined reference to
`_D4core3sys5posix4poll6pollfd6__initZ'
Remove "2" and it work
On Sunday, 18 January 2015 at 21:10:05 UTC, Phil wrote:
Hi, I'm new to D and having a go at writing some image
processing stuff using Vladimir's ae.graphics library.
To filter (i.e. perform correlations/convolutions) on a view
with colour type C, I'd like to perform intermediate
calculations
On Mon, 19 Jan 2015 21:00:55 +
tcak via Digitalmars-d-learn 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 not in link library, there is
On Monday, 19 January 2015 at 20:54:50 UTC, Steven Schveighoffer
wrote:
Cool. I would point out that the commented code suggests you
should be handling the 0 case, but you are not (when T.min ==
T.max)
I believe that should trigger a failing static assert with a good
error message as it doesn
Brilliant, thanks a lot.
That works a treat, allowing me to use c1 + c2 when c1 :: RGB and
c2 :: ChangeChannelType!(RGB, int), say.
It's not happy with doubles atm, but presumably this is sorted in
your push. Thanks again :-)
On Monday, 19 January 2015 at 21:11:34 UTC, Vladimir Panteleev
w
On Mon, 19 Jan 2015 21:00:55 +
tcak via Digitalmars-d-learn 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 reference to
`core.sys.posix.poll.p
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 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
On Mon, 19 Jan 2015 16:27:51 -0500
Steven Schveighoffer via Digitalmars-d-learn
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 wrote:
> >
> >> What is the reason of this error exactly?
> > "core.sys.posix
On 1/19/15 4:27 PM, Steven Schveighoffer 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 wrote:
What is the reason of this error exactly?
"core.sys.posix.poll.d" module is not compiled into druntime. as it is
in
On 1/19/15 4:33 PM, ketmar via Digitalmars-d-learn wrote:
On Mon, 19 Jan 2015 16:27:51 -0500
Steven Schveighoffer via Digitalmars-d-learn
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 wrote:
What is the reas
On Mon, 19 Jan 2015 16:49:34 -0500
Steven Schveighoffer via Digitalmars-d-learn
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.
>
> I think there's an expecta
On 1/19/15 4:54 PM, ketmar via Digitalmars-d-learn wrote:
On Mon, 19 Jan 2015 16:49:34 -0500
Steven Schveighoffer via Digitalmars-d-learn
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
On Mon, 19 Jan 2015 17:05:22 -0500
Steven Schveighoffer via Digitalmars-d-learn
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 even if I think I can omit the
36 matches
Mail list logo