psychoticRabbit wrote:
On Tuesday, 13 March 2018 at 06:25:39 UTC, ketmar wrote:
psychoticRabbit wrote:
So the 3 most used languages got it wrong??
yes.
do you know any other language, where a private class memeber, is not
private to the class?
(btw. that's a question, not a statement).
On Tuesday, 13 March 2018 at 06:26:13 UTC, Radu wrote:
On Tuesday, 13 March 2018 at 06:14:49 UTC, psychoticRabbit
wrote:
On Tuesday, 13 March 2018 at 06:01:43 UTC, ketmar wrote:
ah, yes, sorry: i completely forgot that C++ was invented
after c# and java. mea maxima culpa!
My point was, that
On 13/03/2018 7:14 PM, psychoticRabbit wrote:
On Tuesday, 13 March 2018 at 06:01:43 UTC, ketmar wrote:
ah, yes, sorry: i completely forgot that C++ was invented after c# and
java. mea maxima culpa!
My point was, that the 2 most widely used and popular languages on the
plant, C# and Java, de
psychoticRabbit wrote:
So the 3 most used languages got it wrong??
yes.
On Tuesday, 13 March 2018 at 06:25:39 UTC, ketmar wrote:
psychoticRabbit wrote:
So the 3 most used languages got it wrong??
yes.
do you know any other language, where a private class memeber, is
not private to the class?
(btw. that's a question, not a statement).
On Tuesday, 13 March 2018 at 06:14:49 UTC, psychoticRabbit wrote:
On Tuesday, 13 March 2018 at 06:01:43 UTC, ketmar wrote:
ah, yes, sorry: i completely forgot that C++ was invented
after c# and java. mea maxima culpa!
My point was, that the 2 most widely used and popular languages
on the pl
On Tuesday, 13 March 2018 at 06:03:11 UTC, Mike Parker wrote:
I think it's a great feature and I use it frequently. It's
allows more flexibility in class design. Without it, we'd need
another protection attribute to enable the concept of "private
to the module".
That's kind of my point. That'
On Tuesday, 13 March 2018 at 05:35:30 UTC, Amorphorious wrote:
There is another problem:
3rd: You are a brainwashed monkey who can't think for himself.
Gee..takes some real brains to come up with that one.
See, You learned a little about C++/C#/Java and think the world
must conform to what
On Tuesday, 13 March 2018 at 06:01:43 UTC, ketmar wrote:
ah, yes, sorry: i completely forgot that C++ was invented after
c# and java. mea maxima culpa!
My point was, that the 2 most widely used and popular languages
on the plant, C# and Java, decided NOT to make private, something
mean else
psychoticRabbit wrote:
On Tuesday, 13 March 2018 at 05:52:55 UTC, ketmar wrote:
psychoticRabbit wrote:
There are two problems I see:
1) it is not how C++ done it.
2) it is not how C++ done it.
and you're completely right: it is not how C++ done it.
umm...didn't you forget something:
1) i
On Tuesday, 13 March 2018 at 05:11:48 UTC, psychoticRabbit wrote:
1st - D has broken the concept of class encapsulation, simply
for convenience at the module level. Not good in my opinion.
No, it hasn't broken encapsulation. Encapsulation is at the
module level. A class or struct and any su
On Tuesday, 13 March 2018 at 05:52:55 UTC, ketmar wrote:
psychoticRabbit wrote:
There are two problems I see:
1) it is not how C++ done it.
2) it is not how C++ done it.
and you're completely right: it is not how C++ done it.
umm...didn't you forget something:
1) it is not how C# done it.
psychoticRabbit wrote:
There are two problems I see:
1) it is not how C++ done it.
2) it is not how C++ done it.
and you're completely right: it is not how C++ done it.
On Tuesday, 13 March 2018 at 05:35:30 UTC, Amorphorious wrote:
There is another problem:
3rd: You are a brainwashed monkey who can't think for himself.
No need for personal attacks. Let's keep it civil.
On Tuesday, 13 March 2018 at 05:11:48 UTC, psychoticRabbit wrote:
On Tuesday, 13 March 2018 at 02:24:38 UTC, Mike Parker wrote:
On Tuesday, 13 March 2018 at 02:06:57 UTC, psychoticRabbit
wrote:
Mmm.. I don't think I like it.
I feel you should be able to make a member of a class,
private, reg
On Tuesday, 13 March 2018 at 02:24:38 UTC, Mike Parker wrote:
On Tuesday, 13 March 2018 at 02:06:57 UTC, psychoticRabbit
wrote:
Mmm.. I don't think I like it.
I feel you should be able to make a member of a class,
private, regardless of where the class is located. This seems
to break the con
psychoticRabbit wrote:
On Tuesday, 13 March 2018 at 01:39:13 UTC, Jonathan M Davis wrote:
private is private to the module, not the class. There is no way in D to
restrict the rest of the module from accessing the members of a class.
This simplification makes it so that stuff like C++'s frie
On Tuesday, 13 March 2018 at 02:06:57 UTC, psychoticRabbit wrote:
Mmm.. I don't think I like it.
I feel you should be able to make a member of a class, private,
regardless of where the class is located. This seems to break
the concept of class encapsulation.
No. I don't like it at all.
If
On Tuesday, 13 March 2018 at 01:39:13 UTC, Jonathan M Davis wrote:
private is private to the module, not the class. There is no
way in D to restrict the rest of the module from accessing the
members of a class. This simplification makes it so that stuff
like C++'s friend are unnecessary. If y
On Tuesday, March 13, 2018 01:12:15 psychoticRabbit via Digitalmars-d-learn
wrote:
> I cannot get my head around, why private is not private, in D.
>
> How do I make a private member, private?
>
> -
> module test;
>
> import std.stdio;
>
> void main()
> {
> myClass c = new myClass();
>
Visibility modifiers in D are for the module, not class or struct.
This is very useful to be able to access internal stuff outside of the
abstraction and modify it sanely. While also keeping others at bay.
I cannot get my head around, why private is not private, in D.
How do I make a private member, private?
-
module test;
import std.stdio;
void main()
{
myClass c = new myClass();
c.myPrivateClassMember= "wtf";
writeln(c.myPrivateClassMember);
}
class myClass
{
private strin
On Monday, 12 March 2018 at 22:24:15 UTC, Xavier Bigand wrote:
mixin(implementFunctionsOf("derelict.opengl3.functions"));
As string I get the following error:
..\src\api_entry.d(16): Error: variable `mod` cannot be read at
compile time
..\src\api_entry.d(48):called from here:
`impleme
On Monday, 12 March 2018 at 22:34:10 UTC, Xavier Bigand wrote:
Ok, it works with the alias, I didn't see the last () in the
implementFunctionsOf prototype.
Thank you a lot.
no problem. :)
On Monday, 12 March 2018 at 22:28:30 UTC, Xavier Bigand wrote:
I forgot to precise, that I don't have a main, because I am
trying to create an opengl32.dll. This is why I already have a
mixin to inject to function definitions in the root scope.
you have to pass the string as a template arg s
Le 12/03/2018 à 23:28, Xavier Bigand a écrit :
Le 12/03/2018 à 23:24, Xavier Bigand a écrit :
Le 12/03/2018 à 22:30, arturg a écrit :
On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote:
Hi,
I have a CTFE function that I want to make more generic by given it a
module as parameter.
Le 12/03/2018 à 23:24, Xavier Bigand a écrit :
Le 12/03/2018 à 22:30, arturg a écrit :
On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote:
Hi,
I have a CTFE function that I want to make more generic by given it a
module as parameter.
My actual code looks like :
mixin(implementFun
Le 12/03/2018 à 22:30, arturg a écrit :
On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote:
Hi,
I have a CTFE function that I want to make more generic by given it a
module as parameter.
My actual code looks like :
mixin(implementFunctionsOf());
string implementFunctionsOf()
{
On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote:
Hi,
I have a CTFE function that I want to make more generic by
given it a module as parameter.
My actual code looks like :
mixin(implementFunctionsOf());
string implementFunctionsOf()
{
import std.traits;
string
Hi,
I have a CTFE function that I want to make more generic by given it a
module as parameter.
My actual code looks like :
mixin(implementFunctionsOf());
string implementFunctionsOf()
{
import std.traits;
string res;
foreach(name; __traits(allMembers, myHardCodedModule))
On Monday, 12 March 2018 at 02:49:34 UTC, Jonathan M Davis wrote:
On Monday, March 12, 2018 02:11:49 Jordan Wilson via
Digitalmars-d-learn wrote:
[...]
Maybe iota should be made to work, but as present, it basically
wants all three of the types it's given to be the same or
implicitly convert
On Monday, 12 March 2018 at 04:15:23 UTC, Simen Kjærås wrote:
Yeah, that's a little hole in the grammar, but there are ways:
// Declare an alias:
alias aliasOfInt = aliasOf!int;
// And use that:
assert(!aliasOfInt!string);
Or use std.meta.Instantiate:
assert(!Instantiate!(aliasOf!int, string
On Monday, 12 March 2018 at 13:04:54 UTC, Simen Kjærås wrote:
On Monday, 12 March 2018 at 10:37:00 UTC, Alex wrote:
Sure, you have.
https://dlang.org/spec/struct.html#assign-overload
Point #4.
In this case,
ref S opAssign(ref S rhs)
{
return this;
}
True. Can you fix these, too?
struct S
On Monday, 12 March 2018 at 10:37:00 UTC, Alex wrote:
Sure, you have.
https://dlang.org/spec/struct.html#assign-overload
Point #4.
In this case,
ref S opAssign(ref S rhs)
{
return this;
}
True. Can you fix these, too?
struct S {
S* ptr;
this(int dummy) {
ptr = &this;
}
void main()
{
class Foo
{
void fun(){}
}
foreach(m; __traits(allMembers, Foo))
foreach(sym; __traits(getOverloads, Foo, m))
{
}
}
this fails with:
onlineapp.d(9): Error: no property this for type
onlineapp.main.Foo
onlineapp.d(9): Error: (Foo).this cannot b
OK. With the right compiler options (ldc2 -Oz and removing -g)
the app_d file size, after stripping, becomes 10.5K.
On Monday, 12 March 2018 at 09:54:20 UTC, Simen Kjærås wrote:
But I don't have a hook to update the pointer when the struct
is moved. The GC may move my struct without informing me in any
way. In fact, even just a copy construction will break this:
struct S {
S* ptr;
this(int dummy)
On Sunday, 4 March 2018 at 16:46:56 UTC, Marc wrote:
then copy it to sources folder?
let's say I have a small library folder at C:\mylibrary\D where
I want to use dir.d from it. How do I add that file dependence
to dub? But I do not want to that file be passed directly to
dmd, I want to that
On Friday, 9 March 2018 at 13:46:33 UTC, Chris wrote:
I got this error msg today (see below):
DUB version 1.8.0, built on Mar 3 2018
vibe.d version 0.8.3
dmd 2.078.3 (the same with 2.079.0 and 2.077.0)
.dub/build/server64_72_debug-debug-linux.posix-x86_64-dmd_2079-CAC4A12AC8FE4B4625A9511E4EFEB
On Monday, 12 March 2018 at 09:38:41 UTC, Martin Tschierschke
wrote:
On Sunday, 4 March 2018 at 16:46:56 UTC, Marc wrote:
[...]
I did it this sway:
the part of dub.json:
"dependencies": {
[...]
"mylib":{
"versions": "~master",
On Monday, 12 March 2018 at 08:59:49 UTC, Alex wrote:
An incomplete type is perfectly ok, so there should be no
problem with a pointer of the same type inside a struct.
If accidentally the pointer refers "this", then it must have
been set after construction. As before construction the value
of
On Sunday, 4 March 2018 at 16:46:56 UTC, Marc wrote:
then copy it to sources folder?
let's say I have a small library folder at C:\mylibrary\D where
I want to use dir.d from it. How do I add that file dependence
to dub? But I do not want to that file be passed directly to
dmd, I want to that
On Monday, 12 March 2018 at 07:04:19 UTC, Simen Kjærås wrote:
On Saturday, 10 March 2018 at 17:43:06 UTC, Simen Kjærås wrote:
I'm not sure how fixable this is, but I am sure that there's
plenty of benefit to being able to write code like this:
struct S {
int n, m;
SomeType!(() => n + m
On Saturday, 10 March 2018 at 17:43:06 UTC, Simen Kjærås wrote:
I'm not sure how fixable this is, but I am sure that there's
plenty of benefit to being able to write code like this:
struct S {
int n, m;
SomeType!(() => n + m) a;
}
over this:
struct S {
int n, m;
auto a() { ret
44 matches
Mail list logo