On Monday, 16 May 2016 at 22:54:31 UTC, ag0aep6g wrote:
On 05/17/2016 12:43 AM, Alex wrote:
The point is, that in my model the slice has a meaning itself.
So, the
language provides one of a needed constructs...
Huh? As far as I understand, the pointer of the slice is
invalid, and you never d
On Monday, 16 May 2016 at 15:57:52 UTC, Dsby wrote:
you can remove "auto ref". and I remove the "auto ref" in my
use.
if used the "alias T", It can not handle all while when the T
is a delegate.
in C++ std::bind, the arguments order you can sort by used. in
D I do not find how to enablemen
I just incorporated DerelictALURE into a project and it compiled
and linked fine, but when I ran the executable, it aborted with:
derelict.util.exception.SharedLibLoadException@N:\DUB_Packages\DerelictOrg\DerelictUtil\source\derelict\util\exception.d(35):
Failed to load one or more sharedlibra
On 05/16/2016 01:24 PM, Q. Schroll wrote:
Lets say I want to print a table with floats. How can it be formatted
like that:
| 2.4 |
| 12.2 |
| 8.131 |
| 17.44 |
Also acceptable is
| 2.400 |
| 12.200 |
| 8.131 |
| 17.440 |
but not
| 02.4 |
| 12.2 |
| 08.131 |
| 17.44 |
or any other so
On Monday, 16 May 2016 at 11:05:40 UTC, Nordlöw wrote:
Does Phobos contain any standard small-size-optimized (SSO)
array that starts with a stack array and union-converts into a
standard builtin D-array when grown beyond the size of the
stack array?
Have a look at tempCString, but it's for in
On Monday, 16 May 2016 at 20:24:51 UTC, Q. Schroll wrote:
Lets say I want to print a table with floats. How can it be
formatted like that:
| 2.4 |
| 12.2 |
| 8.131 |
| 17.44 |
Also acceptable is
| 2.400 |
| 12.200 |
| 8.131 |
| 17.440 |
but not
| 02.4 |
| 12.2 |
| 08.131 |
| 17.44
Am Mon, 16 May 2016 20:24:51 +
schrieb Q. Schroll :
> Lets say I want to print a table with floats. How can it be
> formatted like that:
> | 2.4 |
> | 12.2 |
> | 8.131 |
> | 17.44 |
> Also acceptable is
> | 2.400 |
> | 12.200 |
> | 8.131 |
> | 17.440 |
Use %#6.3f to get the above ou
On Monday, 16 May 2016 at 11:05:40 UTC, Nordlöw wrote:
Does Phobos contain any standard small-size-optimized (SSO)
array that starts with a stack array and union-converts into a
standard builtin D-array when grown beyond the size of the
stack array?
No.
If not has anybody put together one?
On 05/17/2016 12:53 AM, Alex wrote:
Just as the reality (in my head) is: you can count something without
having written the natural numbers before you start to count...
iota does that, too. A iota struct doesn't store all the numbers it will
emit. Just like a slice, a iota struct stores two nu
On 05/17/2016 12:43 AM, Alex wrote:
The point is, that in my model the slice has a meaning itself. So, the
language provides one of a needed constructs...
Huh? As far as I understand, the pointer of the slice is invalid, and
you never dereference it. What kind of additional meaning can the sli
On Monday, 16 May 2016 at 22:30:38 UTC, ag0aep6g wrote:
On 05/16/2016 11:33 PM, Alex wrote:
Well... not wanting to have a variable, which stores numbers,
which are
natural numbers, beginning with zero, used for counting only.
But you have such a variable: b. I may still be missing the
point.
On Monday, 16 May 2016 at 22:28:04 UTC, ag0aep6g wrote:
I can't say that I understand the setup you describe. But are
you sure that iota has a higher cost than (ab)using a slice?
I mean, they're pretty much exactly the same: an offset, a
length, and an increment operation. If inlining doesn'
On 05/16/2016 11:33 PM, Alex wrote:
Well... not wanting to have a variable, which stores numbers, which are
natural numbers, beginning with zero, used for counting only.
But you have such a variable: b. I may still be missing the point.
On 05/16/2016 11:35 PM, Alex wrote:
Background:
Say, I have objects of kind E, which operate on structs of kind M. The
problem: if an action is done on a struct, say M42, there should be also
some action done on other structs, which have some relation to M42, but
neither the operating object, nor
On Monday, 16 May 2016 at 21:41:20 UTC, Steven Schveighoffer
wrote:
Hey, there's nothing wrong with for-loops. Just trying to
answer the question :)
You could also do something like:
foreach(i; 0 .. b.length) writeln(&b[i]);
Ha! Yes! :)
Thanks :)
-Steve
On 5/16/16 5:38 PM, Alex wrote:
On Monday, 16 May 2016 at 21:15:16 UTC, Steven Schveighoffer wrote:
On 5/16/16 4:39 PM, Alex wrote:
// something that does not worked as expected:
// how to rewrite a for loop
for(auto i = 0; i < b.length; i++) writeln(&b[i]);
// into a foreac
On Monday, 16 May 2016 at 21:15:16 UTC, Steven Schveighoffer
wrote:
On 5/16/16 4:39 PM, Alex wrote:
// something that does not worked as expected:
// how to rewrite a for loop
for(auto i = 0; i < b.length; i++) writeln(&b[i]);
// into a foreach loop?
What you need is a ran
Background:
Say, I have objects of kind E, which operate on structs of kind
M. The problem: if an action is done on a struct, say M42, there
should be also some action done on other structs, which have some
relation to M42, but neither the operating object, nor M42 is
aware of them (and the ac
On Monday, 16 May 2016 at 21:04:32 UTC, ag0aep6g wrote:
Typo here. Should be `ptr[a .. b]`.
Thanks
void main()
{
void* ptr; // this will stay uninitialized during the
whole program
run
The pointer is being initialized, though. To null, which is why
your shenanigans below work relia
On 5/16/16 4:39 PM, Alex wrote:
// something that does not worked as expected:
// how to rewrite a for loop
for(auto i = 0; i < b.length; i++) writeln(&b[i]);
// into a foreach loop?
What you need is a range that produces void * instead element itself.
This would probably
On 05/16/2016 10:39 PM, Alex wrote:
// This function is intentionally templated, as it should take slices
and return something
// boundchecked only
@nogc T[] getSlice(T)(T* ptr, size_t a, size_t b)
{
return T[a .. b];
Typo here. Should be `ptr[a .. b]`.
}
void main()
{
void* ptr; /
There is also another counter-obvious bit regarding current
implementation - it only tracks lifetime of actual references.
Check this example:
ref int wrap ( return ref int input )
{
return input;
}
int badWrapper()
{
int z;
{
int x = 42;
z = wrap(x);
}
retu
Hi all!
Let's talk about void pointers a little bit. Found this already
http://forum.dlang.org/thread/codoixfeqstvqswir...@forum.dlang.org?page=1
but my question/problem differs from the above, so maybe, I have
found a useful application for void pointers...
Form of the posting: I have some qu
Lets say I want to print a table with floats. How can it be
formatted like that:
| 2.4 |
| 12.2 |
| 8.131 |
| 17.44 |
Also acceptable is
| 2.400 |
| 12.200 |
| 8.131 |
| 17.440 |
but not
| 02.4 |
| 12.2 |
| 08.131 |
| 17.44 |
or any other solutions with leading zeros.
On Thursday, 12 May 2016 at 14:02:30 UTC, Dsby wrote:
https://github.com/putao-dev/collie
Thank you very much for this library I wasn't aware of.
I see it's using the Reactor pattern (select/kevent/epoll of
Posix) by opposition to the Proactor pattern (IOCP on Windows)
[D. Schmidt et al, P
On Thursday, 12 May 2016 at 22:51:17 UTC, Andrew Edwards wrote:
The following preprocessor directives are frequently
encountered in C code, providing a default constant value where
the user of the code has not specified one:
#ifndef MIN
#define MIN 99
#endif
On Monday, 16 May 2016 at 15:33:09 UTC, Dicebot wrote:
tl; dr: DIP25 is so heavily under-implemented in its current
shape it can be considered 100% broken and experimenting will
uncover even more glaring holes.
Well, it's always fun to find the holes in things ... :-)
To be more precise, judg
On Monday, 16 May 2016 at 15:11:26 UTC, chmike wrote:
On Thursday, 12 May 2016 at 10:38:37 UTC, Dsby wrote:
[...]
Thank you. Would you agree to help me understand it ?
The only thing I don't understand is why the function template
argument is defined as T and the argument as auto ref T fun.
tl; dr: DIP25 is so heavily under-implemented in its current
shape it can be considered 100% broken and experimenting will
uncover even more glaring holes.
To be more precise, judging by experimental observation,
currently dip25 only works when there is explicitly a `ref`
return value in func
On Thursday, 12 May 2016 at 10:38:37 UTC, Dsby wrote:
I write one, bind functon to a delegate.
In here:
https://github.com/putao-dev/collie/blob/master/source/collie/utils/functional.d
this is the code:
auto bind(T,Args...)(auto ref T fun,Args args) if
(isCallable!(T))
{
alias FUNTYPE
Hello all,
Consider a struct that wraps a pointer to some other piece of
data as follows:
struct MyWrapper(T)
{
private T* data;
public this(ref T input)
{
this.data = &input;
}
... other methods that use `this.data` ...
}
Is t
On Monday, 16 May 2016 at 11:13:52 UTC, ag0aep6g wrote:
On 05/16/2016 11:24 AM, Stefan wrote:
source/protocols.d(40,34): Error: uninitialized variable
'value' cannot
be returned from CTFE
Ouch. That's not a good error message. There is no `value` on
that line.
I've filed an issue:
https:/
On 05/16/2016 11:24 AM, Stefan wrote:
source/protocols.d(40,34): Error: uninitialized variable 'value' cannot
be returned from CTFE
Ouch. That's not a good error message. There is no `value` on that line.
I've filed an issue: https://issues.dlang.org/show_bug.cgi?id=16030
this ist the code
Does Phobos contain any standard small-size-optimized (SSO) array
that starts with a stack array and union-converts into a standard
builtin D-array when grown beyond the size of the stack array?
If not has anybody put together one?
Hello, i try to port some go code to D
i get this error messages from my current code.
source/protocols.d(40,34): Error: uninitialized variable 'value'
cannot be returned from CTFE
source/protocols.d(41,34): Error: uninitialized variable 'value'
cannot be returned from CTFE
source/protocols.d(4
35 matches
Mail list logo