On Sunday, 18 March 2018 at 18:45:23 UTC, Steven Schveighoffer
wrote:
If we could go back in time and talk with a young Walter about
the consequences of choosing the scheme the way it is, maybe he
might have made different choices, but at this point, it's hard
to change it.
I think this h
On Sunday, 18 March 2018 at 11:12:46 UTC, Alex wrote:
´´´
Are there any scenarios in which the person writing the class,
would want to encapsulate their class, or some parts of it,
from the rest of a module (while being forced to put the class
in this module)?
´´´
The answer is no. As the p
On Sun, Mar 18, 2018 at 07:51:18PM +, aberba via Digitalmars-d-learn wrote:
> On Friday, 16 March 2018 at 21:15:33 UTC, H. S. Teoh wrote:
> > On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via Digitalmars-d-learn
> > wrote:
> > > [...]
> >
> > The usual way I do this is to decouple the code
On Monday, March 19, 2018 00:14:11 Drone1h via Digitalmars-d-learn wrote:
> I am not sure whether I can make it work with "inout" instead of
> "const". Perhaps I am missing something.
...
> May I ask that you confirm that this is what you suggested ?
> Thank you.
Marking a empty or front with inou
First of all, thank you all for the replies. It has taken me some
time to learn a bit more to be able to understand at least some
parts of them. I have a further question below the quotes.
On Tuesday, 30 January 2018 at 01:20:09 UTC, Jonathan M Davis
wrote:
On Tuesday, January 30, 2018 01:05:5
On Saturday, 17 March 2018 at 10:34:41 UTC, dom wrote:
Hi,
I am looking for a method to log the current function name +
parameters.
Getting the name of the current function is simply possible
with __PRETTY_FUNCTION__
Is there some possibility to generically access the parameters
of a function
On Sunday, 18 March 2018 at 22:57:15 UTC, aliak wrote:
// But you get a:
// Error: Using the result of a comma expression is not
allowed
// writeln(mixin(arguments!f));
You can't mix part of a function call in: "Mixed in text must
form complete declarations, statements, or expres
On Sunday, 18 March 2018 at 14:15:37 UTC, Stefan Koch wrote:
On Sunday, 18 March 2018 at 12:59:06 UTC, tipdbmp wrote:
I can't read assembly but it seems to me that it doesn't:
https://godbolt.org/g/PCsnPT
I think C++'s sort can take a "function object" that can get
inlined.
Correct it does no
On Saturday, 17 March 2018 at 10:34:41 UTC, dom wrote:
Hi,
I am looking for a method to log the current function name +
parameters.
Getting the name of the current function is simply possible
with __PRETTY_FUNCTION__
Is there some possibility to generically access the parameters
of a function
On Sunday, 18 March 2018 at 18:04:13 UTC, Tony wrote:
On Tuesday, 13 March 2018 at 06:03:11 UTC, Mike Parker wrote:
D is not C++, C#, or Java. C++ uses friend to get around the
issue. Java has no solution. I don't know about C#.
Java has four protection levels. If you don't explicitly
sp
On Sunday, March 18, 2018 19:51:18 aberba via Digitalmars-d-learn wrote:
> On Friday, 16 March 2018 at 21:15:33 UTC, H. S. Teoh wrote:
> > On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via
> >
> > Digitalmars-d-learn wrote:
> >> [...]
> >
> > The usual way I do this is to decouple the code from
On Sunday, March 18, 2018 18:59:39 Tony via Digitalmars-d-learn wrote:
> On Sunday, 18 March 2018 at 18:32:42 UTC, Jonathan M Davis wrote:
> > They're similar, but there are differences. For instance, you
> > can do package(a) in D in order to do something like put the
> > stuff in a.b.c in package
On Friday, 16 March 2018 at 21:15:33 UTC, H. S. Teoh wrote:
On Fri, Mar 16, 2018 at 08:17:49PM +, aberba via
Digitalmars-d-learn wrote:
[...]
The usual way I do this is to decouple the code from the real
database backend by templatizing the database driver. Then in
my unittest I can ins
On Sunday, 18 March 2018 at 19:01:11 UTC, Joe wrote:
I managed to get it working by declaring a D dynamic array,
appending n_recs pointers to it and using it as argument to
sort. Unfortunately, I then had to copy from the dynamic array
to the fixed array in order to continue using the latter. A
On Sunday, 18 March 2018 at 18:11:02 UTC, Dmitry Olshansky wrote:
Well since recs is array of pointers this looks like a null
pointer in your data.
The usual ways to fix that is either print stuff or poke around
in debugger to see if a Record* is null or .name is null.
The problem is that al
On Sunday, 18 March 2018 at 18:32:42 UTC, Jonathan M Davis wrote:
They're similar, but there are differences. For instance, you
can do package(a) in D in order to do something like put the
stuff in a.b.c in package a rather than a.b.
Is there a known situation where it makes sense to put mo
On 3/17/18 5:56 AM, Nick Treleaven wrote:
On Tuesday, 13 March 2018 at 13:59:00 UTC, Steven Schveighoffer wrote:
If you limit to class members, then you have to do something like C++
friends, which are unnecessarily verbose.
Not if you also have a module-level visibility modifier, which could
On Sunday, 18 March 2018 at 18:11:02 UTC, Dmitry Olshansky wrote:
On Sunday, 18 March 2018 at 16:45:16 UTC, Joe wrote:
[...]
No it just creates a pair of pointer to recs[0] + length of
recs, like this:
struct Array
{
size_t length;
Record* ptr;
}
In D it’s typed as Record[] and has a n
On Sunday, March 18, 2018 18:04:13 Tony via Digitalmars-d-learn wrote:
> On Tuesday, 13 March 2018 at 06:03:11 UTC, Mike Parker wrote:
> > D is not C++, C#, or Java. C++ uses friend to get around the
> > issue. Java has no solution. I don't know about C#.
>
> Java has four protection levels. If you
On Sunday, 18 March 2018 at 16:45:16 UTC, Joe wrote:
On Sunday, 18 March 2018 at 13:10:08 UTC, Dmitry Olshansky
wrote:
Do this to get the usual ptr + length:
sort!((a, b) => to!string((*a).name) <
to!string((*b).name))(recs[]);
Also to!string would be computed on each compare anew. May
want
On Tuesday, 13 March 2018 at 06:03:11 UTC, Mike Parker wrote:
D is not C++, C#, or Java. C++ uses friend to get around the
issue. Java has no solution. I don't know about C#.
Java has four protection levels. If you don't explicitly specify
[private, protected, public] the protection level
On 3/18/18 8:34 AM, Viktor wrote:
Hey,
I'm trying to convert an old legacy app to D and have a couple of
questions. It has been a very fun weekend!
First, I could not make std.container.rbtree use a delegate for a
comparator. The docs say it should be possible, but I got a weird error.
I t
On Sunday, 18 March 2018 at 13:10:08 UTC, Dmitry Olshansky wrote:
Do this to get the usual ptr + length:
sort!((a, b) => to!string((*a).name) <
to!string((*b).name))(recs[]);
Also to!string would be computed on each compare anew. May want
to use schwartzSort to avoid that, on 10 elements the
On Sunday, 18 March 2018 at 15:42:18 UTC, Andrey Kabylin wrote:
On Sunday, 18 March 2018 at 15:32:47 UTC, Michael wrote:
On Sunday, 18 March 2018 at 14:58:52 UTC, Andrey Kabylin wrote:
In DList we have method remove, but I can't understand how
this method works, I want write somethink like this
On Sunday, 18 March 2018 at 15:32:47 UTC, Michael wrote:
On Sunday, 18 March 2018 at 14:58:52 UTC, Andrey Kabylin wrote:
In DList we have method remove, but I can't understand how
this method works, I want write somethink like this:
void unsubscribe(EventsSubscriber subscriber) {
subscriber
On Sunday, 18 March 2018 at 14:58:52 UTC, Andrey Kabylin wrote:
In DList we have method remove, but I can't understand how this
method works, I want write somethink like this:
void unsubscribe(EventsSubscriber subscriber) {
subscribers.remove(subscriber);
}
The remove function seems to exp
On Sunday, 18 March 2018 at 14:58:52 UTC, Andrey Kabylin wrote:
In DList we have method remove, but I can't understand how this
method works, I want write somethink like this:
void unsubscribe(EventsSubscriber subscriber) {
subscribers.remove(subscriber);
}
So I guess you would want someth
In DList we have method remove, but I can't understand how this
method works, I want write somethink like this:
void unsubscribe(EventsSubscriber subscriber) {
subscribers.remove(subscriber);
}
On 2018-03-17 16:42, Seb wrote:
Yes, use -static
Here's how we build the DTour:
https://github.com/dlang-tour/core/blob/master/dub.sdl
FYI, -static is not support on macOS.
--
/Jacob Carlborg
On Sunday, 18 March 2018 at 12:59:06 UTC, tipdbmp wrote:
I can't read assembly but it seems to me that it doesn't:
https://godbolt.org/g/PCsnPT
I think C++'s sort can take a "function object" that can get
inlined.
Correct it does not get in-lined.
Even with -O3 it does not.
The reason is that
On Sunday, 18 March 2018 at 12:59:06 UTC, tipdbmp wrote:
I can't read assembly but it seems to me that it doesn't:
https://godbolt.org/g/PCsnPT
I think C++'s sort can take a "function object" that can get
inlined.
add "-O3" also to the compiler switches.
On Sunday, 18 March 2018 at 11:29:47 UTC, Joe wrote:
On Monday, 12 March 2018 at 03:50:42 UTC, Joe wrote:
On Monday, 12 March 2018 at 03:13:08 UTC, Seb wrote:
Out of interest: I wonder what's your usecase for using
qsort. Or in other words: why you can't use the high-level
std.algorithm.sortin
I can't read assembly but it seems to me that it doesn't:
https://godbolt.org/g/PCsnPT
I think C++'s sort can take a "function object" that can get
inlined.
Hey,
I'm trying to convert an old legacy app to D and have a couple of
questions. It has been a very fun weekend!
First, I could not make std.container.rbtree use a delegate for a
comparator. The docs say it should be possible, but I got a weird
error.
I tracked it down to RedBlackTreee.op
On Monday, 12 March 2018 at 03:50:42 UTC, Joe wrote:
On Monday, 12 March 2018 at 03:13:08 UTC, Seb wrote:
Out of interest: I wonder what's your usecase for using qsort.
Or in other words: why you can't use the high-level
std.algorithm.sorting.sort?
This is only temporary. I will be using
std
On Sunday, 18 March 2018 at 10:45:55 UTC, psychoticRabbit wrote:
On Sunday, 18 March 2018 at 10:14:30 UTC, Alain Soap wrote:
[...]
" Private - All fields and methods that are in a private block,
can only be accessed in the module (i.e. unit) that contains
the class definition. They can be ac
On Sunday, 18 March 2018 at 09:56:31 UTC, psychoticRabbit wrote:
However, are there no scenarios in which the person writing
that module, would not want to encapsulate their class, or some
parts of it, from the rest of the module (while not being
forced to put the class in it's own file)?
If
On Sunday, 18 March 2018 at 10:14:30 UTC, Alain Soap wrote:
BTW i think adding this can be useful. The FreePascal language
has `strict private` for example.
" Private - All fields and methods that are in a private block,
can only be accessed in the module (i.e. unit) that contains the
class d
On Saturday, 17 March 2018 at 23:54:22 UTC, psychoticRabbit wrote:
On Saturday, 17 March 2018 at 21:33:01 UTC, Adam D. Ruppe wrote:
On Saturday, 17 March 2018 at 21:22:44 UTC, arturg wrote:
maybe extend that to a list of types?
this is basically what C++ friend does and D was trying to
avoid
On Saturday, 17 March 2018 at 17:51:50 UTC, John Chapman wrote:
I'm trying to replace the old std.streams in my app with
ranges. I'm interfacing with a networking library to which I
supply a callback that when invoked provides the requested
data. I write that data to an output range, but later
On Sunday, 18 March 2018 at 05:01:39 UTC, Amorphorious wrote:
The fact is, the creator of the class is also the creator of
the module.. and preventing him from having full access to the
class is ignorant. He doesn't need to encapsulate himself.
Encapsulation is ONLY meant to reduce dependenci
On Saturday, 17 March 2018 at 23:54:22 UTC, psychoticRabbit wrote:
In D, I would prefer no breaking change here. Leave private as
it is.
My suggestion has no breaking change and it works just like the
package attribute already works.
Also you shouldn't allow multiple types for it, that would
On Sunday, 18 March 2018 at 05:01:39 UTC, Amorphorious wrote:
Why do you insist that you know how everything works and you
are the harbinger of truth. The fact is, you don't know squat
about what you are talking about and you just want to conform D
to your naive ignorant ...etc...etc..etc
43 matches
Mail list logo