Re: How to simplify nested ifs

2018-03-16 Thread Satoshi via Digitalmars-d-learn
On Tuesday, 13 March 2018 at 12:23:06 UTC, Ozan Süel wrote: Hi I have a construction like the following if (source) { if (source.pool) { if (source.pool.repository) { if (source.pool.repository.directory) { if (source.pool.repository.directory.users) { // do

Re: What do you want to see for a mature DLang?

2017-12-29 Thread Satoshi via Digitalmars-d
On Friday, 29 December 2017 at 07:53:51 UTC, IM wrote: I will start: -- Better compiler errors, better compiler errors, better compiler errors. I really wish that the compiler errors could receive some refinement. Mostly it feels like some error text just being thrown at me. It needs

Re: Global variable type does not match previous declaration

2017-12-16 Thread Satoshi via Digitalmars-d-learn
On Saturday, 16 December 2017 at 09:04:05 UTC, Satoshi wrote: I commented out the TypeInfo declarations and got the same error but on different symbol. object.d(1569): Error: Function type does not match previously declared function with the same mangled name: _d_dynamic_cast

Re: Global variable type does not match previous declaration

2017-12-16 Thread Satoshi via Digitalmars-d-learn
I commented out the TypeInfo declarations and got the same error but on different symbol. object.d(1569): Error: Function type does not match previously declared function with the same mangled name: _d_dynamic_cast https://github.com/Rikarin/Trinix/blob/master/Kernel/object.d#L1569

Re: Global variable type does not match previous declaration

2017-12-14 Thread Satoshi via Digitalmars-d-learn
On Thursday, 14 December 2017 at 12:18:22 UTC, Nicholas Wilson wrote: On Wednesday, 13 December 2017 at 21:39:40 UTC, Satoshi wrote: On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote: [...] Compiling with ldc2 -debuglib= -defaultlib= -code-model=kernel -disable-red-zone -w -wi

Re: Global variable type does not match previous declaration

2017-12-13 Thread Satoshi via Digitalmars-d-learn
On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote: What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZ Actually, I'm working on OS with minimal D

Global variable type does not match previous declaration

2017-12-13 Thread Satoshi via Digitalmars-d-learn
What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZ Actually, I'm working on OS with minimal D runtime and I'm unable to compile object.d source code:

Re: bootable vibed

2017-12-11 Thread Satoshi via Digitalmars-d
On Saturday, 9 December 2017 at 05:07:46 UTC, Elronnd wrote: Note to anyone trying to implement this (I might try, but I don't have the expertise to...): http://wiki.osdev.org/D_Bare_Bones, http://wiki.osdev.org/D_barebone_with_ldc2, and https://github.com/PowerNex/PowerNex None of D's

Re: Looking for a job in USA

2017-11-26 Thread Satoshi via Digitalmars-d
Thanks everyone for your advices and helping me with finding job in the US. I applied for about 300 jobs at companies like Apple, M$, Amazon, Google, etc. and got one offer in Canada, so it's half-win for me. :) Thanks! BTW: Walter, why you don't use IP Board instead of this, custom made

Re: Looking for a job in USA

2017-11-20 Thread Satoshi via Digitalmars-d
On Monday, 20 November 2017 at 09:15:15 UTC, Adam Wilson wrote: To get an H1B you'll want to get a job with one of the majors. Microsoft, Google, Apple, Amazon. There are smaller companies, but the majors have a dedicated team of lawyers who can guide your H1B through the process. It is the

Re: Looking for a job in USA

2017-11-20 Thread Satoshi via Digitalmars-d
On Monday, 20 November 2017 at 10:38:59 UTC, user1234 wrote: On Saturday, 18 November 2017 at 08:59:53 UTC, Satoshi wrote: On Saturday, 18 November 2017 at 01:31:09 UTC, Indigo wrote: On Wednesday, 15 November 2017 at 17:32:50 UTC, Satoshi wrote: Hi, as the title says, I'm looking for a job

Re: Looking for a job in USA

2017-11-18 Thread Satoshi via Digitalmars-d
On Saturday, 18 November 2017 at 01:31:09 UTC, Indigo wrote: On Wednesday, 15 November 2017 at 17:32:50 UTC, Satoshi wrote: Hi, as the title says, I'm looking for a job opportunity in the USA (H1B visa sponsorship required). I'm experienced Software Engineer with a demonstrated history of

Re: What do people here use as an IDE?

2017-11-17 Thread Satoshi via Digitalmars-d
On Wednesday, 13 October 2010 at 01:58:19 UTC, Michael Stover wrote: Elephant appears dead. Poseidon's activity is extremely low and is still alpha after 5 years. LEDS is even less active, and DDT doesn't have a release yet. What do actual D programmers use? -Mike vim

Looking for a job in USA

2017-11-15 Thread Satoshi via Digitalmars-d
Hi, as the title says, I'm looking for a job opportunity in the USA (H1B visa sponsorship required). I'm experienced Software Engineer with a demonstrated history of working in the security and investigations industry. Skilled in C, C++, D, C#, SQL, Object-Oriented Programming, Software

Re: Project Elvis

2017-11-12 Thread Satoshi via Digitalmars-d
It's for you! https://i.imgur.com/NNgrSyP.png

Re: Project Elvis

2017-11-12 Thread Satoshi via Digitalmars-d
On Sunday, 12 November 2017 at 08:33:34 UTC, Satoshi wrote: I'm going to start focusing my attention on rewriting (some) of FreeBSD userland, using D ..and see what happens. (btw. such programs can easily be migrated to Linux/OSX too...or the new 'System D' ..when it arrives ;-) You should

Re: Project Elvis

2017-11-12 Thread Satoshi via Digitalmars-d
On Sunday, 12 November 2017 at 04:40:21 UTC, codephantom wrote: On Sunday, 12 November 2017 at 01:00:46 UTC, bauss wrote: I'm tired so I will end my post here. And I'm going to end all my posts here, cause I'm sick of arguing with MSFT fanboys, who want to restrain D's development by tying

Re: Project Elvis

2017-11-12 Thread Satoshi via Digitalmars-d
On Sunday, 12 November 2017 at 03:25:47 UTC, codephantom wrote: But everyone wants a more modular, more refined, more modern, more secure operating system ...and a more secure systems programming language. How rewriting Linux from scratch will enhance security of the OS? By introducing

Re: Project Elvis

2017-11-11 Thread Satoshi via Digitalmars-d
On Saturday, 11 November 2017 at 11:18:24 UTC, codephantom wrote: I'd like D to think bigger than just duplicating what's out there, and being 'compatible' with this and that operating system - or just be marketed as a quicker way to compile your slow c++ code. I'd wouldn't mind seeing a

Re: Project Elvis

2017-11-10 Thread Satoshi via Digitalmars-d
On Friday, 10 November 2017 at 12:27:22 UTC, codephantom wrote: On Friday, 10 November 2017 at 11:55:52 UTC, Jonathan M Davis wrote: [...] Well, you just got it wrong, and your comments were unfair, and actually, your comment were 'bashing' on me! I simply used a humourous youtube video,

Re: Project Elvis

2017-11-10 Thread Satoshi via Digitalmars-d
On Friday, 10 November 2017 at 12:06:42 UTC, codephantom wrote: On Friday, 10 November 2017 at 11:45:25 UTC, Satoshi wrote: How many corporations is using D right now? 10? Windows is still dominant OS and there are a lot of job opportunities for C#. D is unusable for startups or

Re: Project Elvis

2017-11-10 Thread Satoshi via Digitalmars-d
On Friday, 10 November 2017 at 11:26:41 UTC, codephantom wrote: On Friday, 10 November 2017 at 11:19:39 UTC, Satoshi wrote: You are judging C# Umm... I have 17y in C# programming. Was one of the first to take it up. Have designed/developed apps for large corporates. Umm... My old colleague

Re: Project Elvis

2017-11-10 Thread Satoshi via Digitalmars-d
On Friday, 10 November 2017 at 11:12:38 UTC, codephantom wrote: On Friday, 10 November 2017 at 10:51:28 UTC, Jonathan M Davis wrote: we're trying to have a technical discussion. - Jonathan M Davis And will someone please tell me, where is technical benefit of putting this crap (?: or ??)

Re: Project Elvis

2017-11-10 Thread Satoshi via Digitalmars-d
On Friday, 10 November 2017 at 08:24:59 UTC, codephantom wrote: On Friday, 10 November 2017 at 05:23:53 UTC, Adam Wilson wrote: MSFT spends a LOT of time studying these things. It would be wise to learn for free from the money they spent. Is that the same company that made Windows 10? Not

Re: Project Elvis

2017-11-07 Thread Satoshi via Digitalmars-d
On Monday, 6 November 2017 at 19:13:59 UTC, Adam Wilson wrote: On 10/28/17 04:38, Andrei Alexandrescu wrote: [...] C# has extensive experience with this operator and I think it would be wise to study the history of what they did and why the did it. NOTE: I understand that other languages

Re: Project Elvis

2017-11-06 Thread Satoshi via Digitalmars-d
On Monday, 6 November 2017 at 08:06:54 UTC, Jonathan M Davis wrote: On Monday, November 06, 2017 07:10:43 bauss via Digitalmars-d wrote: On Monday, 6 November 2017 at 00:20:09 UTC, Neia Neutuladh wrote: > On Saturday, 28 October 2017 at 11:38:52 UTC, Andrei > > Alexandrescu wrote: >> [...] > >

Re: Project Elvis

2017-10-30 Thread Satoshi via Digitalmars-d
On Sunday, 29 October 2017 at 20:37:21 UTC, bauss wrote: On Sunday, 29 October 2017 at 20:15:41 UTC, Ola Fosheim Grøstad wrote: [...] But casting to bool is what you use to tell whether something is valid or not. true = valid, false = invalid. If you want 0 to be valid for a type then you

Re: My two cents

2017-10-25 Thread Satoshi via Digitalmars-d
On Tuesday, 24 October 2017 at 20:36:47 UTC, Walter Bright wrote: On 10/24/2017 3:36 AM, Satoshi wrote: Can you provide an example? I'd start with https://dlang.org/spec/interface.html You'll see the same thing with Windows COM programming, and using interfaces in Java. view.di

Re: My two cents

2017-10-24 Thread Satoshi via Digitalmars-d
On Tuesday, 24 October 2017 at 10:20:43 UTC, Walter Bright wrote: On 10/24/2017 1:13 AM, Satoshi wrote: But it's quite useless to me. That's what interfaces are for. Define your View and Button as interfaces. The implementations of interfaces are completely hidden from the derived class.

Re: My two cents

2017-10-24 Thread Satoshi via Digitalmars-d
On Tuesday, 24 October 2017 at 08:06:55 UTC, Atila Neves wrote: On Tuesday, 24 October 2017 at 07:17:08 UTC, Satoshi wrote: On Monday, 23 October 2017 at 21:42:03 UTC, Atila Neves wrote: On Monday, 23 October 2017 at 21:14:18 UTC, bauss wrote: On Monday, 23 October 2017 at 12:48:33 UTC, Atila

Re: My two cents

2017-10-24 Thread Satoshi via Digitalmars-d
On Tuesday, 24 October 2017 at 07:55:49 UTC, Walter Bright wrote: On 10/24/2017 12:21 AM, Satoshi wrote: what about this: -- file.d class Foo {   private int bar;   private string text;   void call() { } } --- file.di class Foo {   call(); } and then I want to inherit

Re: My two cents

2017-10-24 Thread Satoshi via Digitalmars-d
On Monday, 23 October 2017 at 15:21:02 UTC, Kagamin wrote: On Friday, 20 October 2017 at 09:49:34 UTC, Adam Wilson wrote: Others are less obvious, for example, async/await is syntax sugar for a collection of Task-based idioms in C#. Now I think it's doesn't fit D. async/await wasn't made for

Re: My two cents

2017-10-24 Thread Satoshi via Digitalmars-d
On Monday, 23 October 2017 at 20:47:26 UTC, Walter Bright wrote: On 10/18/2017 1:56 AM, Satoshi wrote: Unable to publish closed source library without workaround and ugly PIMPL design. Consider this: --- file s.d struct S { int x; this(int x) { this.x = x; }

Re: My two cents

2017-10-24 Thread Satoshi via Digitalmars-d
On Monday, 23 October 2017 at 21:42:03 UTC, Atila Neves wrote: On Monday, 23 October 2017 at 21:14:18 UTC, bauss wrote: On Monday, 23 October 2017 at 12:48:33 UTC, Atila Neves wrote: On Monday, 23 October 2017 at 09:13:45 UTC, Satoshi wrote: On Wednesday, 18 October 2017 at 08:56:21 UTC,

Re: My two cents

2017-10-23 Thread Satoshi via Digitalmars-d
On Wednesday, 18 October 2017 at 08:56:21 UTC, Satoshi wrote: Hi, I had been using D for almost 6 years and I want to share my opinion with you. I don't want to blame anyone but I'll focus more on bad things and possible improvements. And this is just how I see D from my perspective. (Sorry

Re: My two cents

2017-10-20 Thread Satoshi via Digitalmars-d
On Friday, 20 October 2017 at 08:32:36 UTC, Jonathan M Davis wrote: On Friday, October 20, 2017 08:09:59 Satoshi via Digitalmars-d wrote: On Friday, 20 October 2017 at 04:26:24 UTC, Jonathan M Davis wrote: > On Friday, October 20, 2017 02:20:31 Adam D. Ruppe via > > Digitalmar

Re: My two cents

2017-10-20 Thread Satoshi via Digitalmars-d
On Friday, 20 October 2017 at 04:26:24 UTC, Jonathan M Davis wrote: On Friday, October 20, 2017 02:20:31 Adam D. Ruppe via Digitalmars-d wrote: On Friday, 20 October 2017 at 00:26:19 UTC, bauss wrote: > return foo ? foo : null; > > where > > return foo ?? null; would be so much easier. return

Re: My two cents

2017-10-18 Thread Satoshi via Digitalmars-d
On Wednesday, 18 October 2017 at 09:03:27 UTC, Andrea Fontana wrote: I think you missed many things for example: On Wednesday, 18 October 2017 at 08:56:21 UTC, Satoshi wrote: e.g. auto result = device.start(foo, bar); // This is RPC to remote server returning Task!Bar // do some important

Re: My two cents

2017-10-18 Thread Satoshi via Digitalmars-d
+syntactic sugar for dynamic types some better explaining tutorials and examples about shared. After 6 years I'm still unable to use it properly.

My two cents

2017-10-18 Thread Satoshi via Digitalmars-d
Hi, I had been using D for almost 6 years and I want to share my opinion with you. I don't want to blame anyone but I'll focus more on bad things and possible improvements. And this is just how I see D from my perspective. (Sorry for my English, I'm too lazy to take the lessons). First, D

Re: Hiring D programmers (with cryptography and blockchain knowledge are preferred)

2017-08-14 Thread Satoshi via Digitalmars-d-announce
Thanks for the interesting idea. I decided to try something similar. (just for fun). Decentralized Social Network (DecNet): Is a conjunction of facebook, twitter and reddit. Clients: Can create their own profiles (private key, public key, address, profile file) and share them through the

Re: Single exe vibe.d app

2017-04-06 Thread Satoshi via Digitalmars-d-learn
On Wednesday, 5 April 2017 at 12:42:23 UTC, evilrat wrote: On Wednesday, 5 April 2017 at 12:13:38 UTC, Satoshi wrote: Hi, How can I build single exe application with vibe.d (windows)? now it require zlib.dll, libeay32.dll and ssleay32.dll But I need it as single app. btw, if all you need is

Single exe vibe.d app

2017-04-05 Thread Satoshi via Digitalmars-d-learn
Hi, How can I build single exe application with vibe.d (windows)? now it require zlib.dll, libeay32.dll and ssleay32.dll But I need it as single app.

Re: pImpl in D

2017-04-04 Thread Satoshi via Digitalmars-d
test/Foo.di(3,1): Error: class test.Foo.FooPrivate is forward referenced when looking for 'opAssign' forward reference in Foo.di test/Bar.d(14,25): Error: cannot implicitly convert expression (p) of type test.BarPrivate.BarPrivate to test.Foo.FooPrivate I'm unable to cast from BarPrivate

pImpl in D

2017-04-04 Thread Satoshi via Digitalmars-d
Hi, do someone have any experience with pImpl and inheritance in D? I tried something like: // FooPrivate.d class FooPrivate { int a; } // BarPrivate.d import FooPivate; class BarPrivate : FooPrivate { string b; } // Foo.d import FooPrivate; class Foo { protected FooPrivate

Re: .di generator fix

2017-04-03 Thread Satoshi via Digitalmars-d
On Monday, 3 April 2017 at 16:41:15 UTC, Stefan Koch wrote: On Monday, 3 April 2017 at 11:16:41 UTC, Satoshi wrote: https://issues.dlang.org/show_bug.cgi?id=16590 6 months from reporting this bug and there is still no usable fix... How to test: 1. generate di files from druntime and phobos

.di generator fix

2017-04-03 Thread Satoshi via Digitalmars-d
https://issues.dlang.org/show_bug.cgi?id=16590 6 months from reporting this bug and there is still no usable fix... How to test: 1. generate di files from druntime and phobos 2. compile any bigger project like vibe.d to .di files instead of .d files. 3. fix bugs

Re: How to continue after the book?

2017-03-28 Thread Satoshi via Digitalmars-d-learn
On Tuesday, 28 March 2017 at 07:27:31 UTC, I Lindström wrote: After getting the basics down, how did you continue when learning programming in general? I do have a need for which I've been trying out a few languages and D seems by far the best for me. Should I just start doing that project

Re: Can you fix this code to avoid using pointers?

2017-03-11 Thread Satoshi via Digitalmars-d-learn
On Saturday, 11 March 2017 at 12:35:42 UTC, XavierAP wrote: I do not really think it's a bad solution, to check several scalar arguments that must obey the same condition; just wondering if you have better ideas. Try to avoid modifying the function's signature and defining custom types, unless

Create doc simultaneously with compilation

2017-02-19 Thread Satoshi via Digitalmars-d-learn
Why is not possible to create documentation, compile code and generate header files simultaneously? When I pass -D and -Dd flags to ldc2 command it won't create doc until I don't pass -o- flag too.

Re: Force inline

2017-02-19 Thread Satoshi via Digitalmars-d-learn
On Sunday, 19 February 2017 at 19:19:25 UTC, berni wrote: Is it possible to force a function to be inlined? Comparing a C++ and a D program, the main difference in speed (about 20-30%) is, because I manage to force g++ to inline a function while I do not find any means to do the same on D.

Re: CTFE Status 2

2017-02-18 Thread Satoshi via Digitalmars-d
Will be possible to make precompiled headers and distribute it with static library for example?

Re: Release D 2.073.1

2017-02-16 Thread Satoshi via Digitalmars-d-announce
On Thursday, 16 February 2017 at 17:35:27 UTC, Martin Nowak wrote: Glad to announce D 2.073.1. http://dlang.org/download.html This point release fixes a few issues over 2.073.0, see the changelog for more details. http://dlang.org/changelog/2.073.1.html -Martin Why wasn't

Re: Questionnaire

2017-02-09 Thread Satoshi via Digitalmars-d-announce
1. Why your company uses D? I can use D only for very small apps in my job. My own project use D because it was the best language what I found when I started developing OS from scratch 5 years ago. 2. Does your company uses C/C++, Java, Scala, Go, Rust? We use C/C++, Java 3. If yes,

dep files

2017-02-01 Thread Satoshi via Digitalmars-d-learn
Hi, I'm using package.d file for the project, where is each file imported. In each file is imported only that one package file (like `import Foo;`). Problem is with .dep files. dep file for each source file contains all source files of the project just because it imports that package.

Re: Why not promoting team work?

2017-01-17 Thread Satoshi via Digitalmars-d
On Saturday, 14 January 2017 at 03:05:44 UTC, nbro wrote: On Saturday, 14 January 2017 at 02:57:05 UTC, ketmar wrote: On Saturday, 14 January 2017 at 02:28:34 UTC, nbro wrote: How could you do such a thing? freakin' easy: just pay people to do what you want. either that, or people will keep

Re: Gui in D: I miss this project

2017-01-10 Thread Satoshi via Digitalmars-d
On Monday, 9 January 2017 at 21:41:37 UTC, aberba wrote: This seemed to be an effort (among others) to bring GUI cross platform to standard D but some language/compiler/Phobos/Deimos/manpower issues were the drag. https://github.com/Devisualization We now have DLangUI. I wonder what the

Re: What are you planning, D related, for 2017 ?

2017-01-02 Thread Satoshi via Digitalmars-d
On Monday, 2 January 2017 at 15:16:31 UTC, Basile B. wrote: Write your plan here, and let's take a rendez-vous next year, to check those plans !! I want to release beta version of GUI Framework, build tool and IDE for D.

Re: D future ...

2016-12-28 Thread Satoshi via Digitalmars-d
On Wednesday, 28 December 2016 at 19:51:38 UTC, Jerry wrote: You don't need the source of the GUI framework to use a compiled program. If you are developing both the GUI and the IDE, then you don't need interface files. You can just use the D source code. Once you compile the IDE no one will

Re: D future ...

2016-12-28 Thread Satoshi via Digitalmars-d
On Wednesday, 28 December 2016 at 12:55:17 UTC, YAHB wrote: Sorry, to be honest I didn't take you seriously. Your bug report, so the starter of this off topic fork, is barely understandable: impossible to understand if it was a language issue, an issue of the header function generator...

Re: D future ...

2016-12-28 Thread Satoshi via Digitalmars-d
On Wednesday, 28 December 2016 at 12:43:03 UTC, bachmeier wrote: On Wednesday, 28 December 2016 at 08:35:52 UTC, Satoshi wrote: I'm working on a commercial IDE and GUI framework for a year and half and I'm not able to release any version due to this bug[1]. ... Please, stop adding new

Re: D future ...

2016-12-28 Thread Satoshi via Digitalmars-d
On Wednesday, 28 December 2016 at 12:14:02 UTC, YAHB wrote: But what's the real issue ? You want to release a pre-compiled static library with headers ? Yes. you'll be in front of another issue then: "dmd_personality"... unless you release the static library for DMD, LDC, GDC, + each

Re: D future ...

2016-12-28 Thread Satoshi via Digitalmars-d
On Wednesday, 28 December 2016 at 12:03:53 UTC, YAHB wrote: Making header files manually is a wast of time what i don't have. Write your own header generator. Yes, why not to write my own language. Pfff...too hard to use an AST visitor. And that wants to release a commercial IDE. Compiler

Re: D future ...

2016-12-28 Thread Satoshi via Digitalmars-d
On Wednesday, 28 December 2016 at 11:18:10 UTC, YAHB wrote: On Wednesday, 28 December 2016 at 10:52:45 UTC, Satoshi wrote: On Wednesday, 28 December 2016 at 10:52:45 UTC, Satoshi wrote: Making header files manually is a wast of time what i don't have. Write your own header generator. Yes,

Re: D future ...

2016-12-28 Thread Satoshi via Digitalmars-d
On Wednesday, 28 December 2016 at 09:37:06 UTC, Jerry wrote: Personally I'm not really looking for an IDE, I've settled for a text editor with a plugin for it. IDEs tend to be bulky and not be very good at manipulating text or rather lacking features to do so. It depends on specific IDE. I

Re: D future ...

2016-12-28 Thread Satoshi via Digitalmars-d
On Wednesday, 28 December 2016 at 03:21:03 UTC, Jerry wrote: On Tuesday, 27 December 2016 at 16:36:10 UTC, Laeeth Isharc wrote: On Monday, 19 December 2016 at 23:02:59 UTC, Benjiro wrote: So if you want to improve the language and its ecosystem, the best way is to contribute pull requests or

rtInfo()

2016-12-14 Thread Satoshi via Digitalmars-d-learn
Hello, is rtInfo() already used by GC? I need to store some data for each class so I'm using this template and m_rtInfo in TypeInfo_Class but now it seems that GC is not working properly in some cases. Thanks.

Re: @property

2016-12-09 Thread Satoshi via Digitalmars-d-learn
On Thursday, 8 December 2016 at 22:09:14 UTC, Jonathan M Davis wrote: On Thursday, December 08, 2016 16:54:57 Adam D. Ruppe via Digitalmars-d- learn wrote: [...] Yeah, it's pretty common for folks to slap @property on functions to make it clear that it's intended to be used as a property

@property

2016-12-08 Thread Satoshi via Digitalmars-d-learn
Hello, is there any advantage of marking function as @property?? class Foo { void objectValue(Object value) { } Object objectValue() { } } auto foo = new Foo; // This works fine without @property attribute foo.objectValue = null; auto bar = foo.objectValue;

@trusted AKA most useless statement ever

2016-11-25 Thread Satoshi via Digitalmars-d
Simply, it should be replaced by: void safeFunc() @safe { unsafe { auto vi = doUnsafeCall(); } } @trusted functions are prohibited by d-idiom (so I don't know why are still in D). So, when I need to create a simple window with OpenGL context I need to write about 10-15 calls

Re: A simplification of the RvalueRef idiom

2016-11-22 Thread Satoshi via Digitalmars-d-learn
or I have simple class class View { this(Rectangle frame) {...} this(float, float, float, float) { ... } this(Point, Size) { ... } } then struct Point, Size and Rectangle (Point, Size) now I need to write 2 overloads for View class taking 4 floats or (Point, Size) and this must do in every

Re: A simplification of the RvalueRef idiom

2016-11-22 Thread Satoshi via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 19:16:56 UTC, Ali Çehreli wrote: On 11/22/2016 08:05 AM, Satoshi wrote: I don't have extensive experience with other languages. In fact, the only other languages that I can claim proficiency are C and C++. (I also know Python just enough to find it incredible

Re: A simplification of the RvalueRef idiom

2016-11-22 Thread Satoshi via Digitalmars-d-learn
On Monday, 21 November 2016 at 20:04:51 UTC, Ali Çehreli wrote: First, a reminder that we have this great resource of D idioms: https://p0nce.github.io/d-idioms/#Rvalue-references:-Understanding-auto-ref-and-then-not-using-it The link above has an idiom of mixing in a byRef() member function

Re: null this

2016-11-21 Thread Satoshi via Digitalmars-d-learn
On Monday, 21 November 2016 at 10:25:17 UTC, Satoshi wrote: Hello, how can calling method on local struct throw "null this"? struct is initialized by .init and have default values. struct Foo { Bar bar; static struct Bar { float x, y, z; } Bar getBar() { return bar; } }

Re: null this

2016-11-21 Thread Satoshi via Digitalmars-d-learn
cast(ulong) but is not null. It won't work just in special cases what I cannot reproduce easily.

null this

2016-11-21 Thread Satoshi via Digitalmars-d-learn
Hello, how can calling method on local struct throw "null this"? struct is initialized by .init and have default values. struct Foo { Bar bar; static struct Bar { float x, y, z; } Bar getBar() { return bar; } } then Foo foo = Foo.init; auto b = foo.getBar(); // throw "null

Class copy

2016-11-10 Thread Satoshi via Digitalmars-d-learn
Hello, how can I copy class when I have pointer to the parent of it? eg. class Foo { int m_a; this(const(Foo) other) { m_a = other.m_a; } } class Bar : Foo { int m_b; this(const(Bar) other) { super(other); m_b = other.m_b; } R dup(this

Re: Linux Kernel in D?

2016-11-01 Thread Satoshi via Digitalmars-d
On Tuesday, 1 November 2016 at 12:12:29 UTC, Heisenberg wrote: Just an idea. Do you think it would have any advantage compared to the one that is written in C? Look at https://github.com/Rikarin/Trinix for example

Re: Bug in header file generation

2016-10-25 Thread Satoshi via Digitalmars-d
I posted 3 more bugs what I found. Seriously, can someone fix these bugs, please? Thanks! https://issues.dlang.org/show_bug.cgi?id=16590

Re: Typesafe variadic argument taking struct

2016-10-20 Thread Satoshi via Digitalmars-d-learn
On Thursday, 20 October 2016 at 16:04:00 UTC, Nordlöw wrote: On Thursday, 20 October 2016 at 12:48:34 UTC, Satoshi wrote: Hello, why ... cannot be used with structs? struct Foo { this(int a) { } } void bar(Foo foo...) { } bar(42); Being explicit about these things makes complex code

Re: Typesafe variadic argument taking struct

2016-10-20 Thread Satoshi via Digitalmars-d-learn
On Thursday, 20 October 2016 at 12:52:42 UTC, rikki cattermole wrote: On 21/10/2016 1:48 AM, Satoshi wrote: Hello, why ... cannot be used with structs? struct Foo { this(int a) { } } void bar(Foo foo...) { } bar(42); Because an int is not a Foo. Oh, really? I didn't notice that...

Typesafe variadic argument taking struct

2016-10-20 Thread Satoshi via Digitalmars-d-learn
Hello, why ... cannot be used with structs? struct Foo { this(int a) { } } void bar(Foo foo...) { } bar(42);

Re: Bug in header file generation

2016-10-17 Thread Satoshi via Digitalmars-d
On Monday, 17 October 2016 at 07:54:33 UTC, Mike Parker wrote: On Monday, 17 October 2016 at 07:50:17 UTC, Satoshi wrote: On Saturday, 15 October 2016 at 06:55:31 UTC, Uplink_Coder wrote: On Saturday, 15 October 2016 at 06:51:44 UTC, Satoshi wrote: Hello, can someone look at this quite simple

Re: Bug in header file generation

2016-10-17 Thread Satoshi via Digitalmars-d
On Saturday, 15 October 2016 at 06:55:31 UTC, Uplink_Coder wrote: On Saturday, 15 October 2016 at 06:51:44 UTC, Satoshi wrote: Hello, can someone look at this quite simple bug in dmd please? https://issues.dlang.org/show_bug.cgi?id=16590 I cannot release non-opensource libraries without this.

Bug in header file generation

2016-10-16 Thread Satoshi via Digitalmars-d
Hello, can someone look at this quite simple bug in dmd please? https://issues.dlang.org/show_bug.cgi?id=16590 I cannot release non-opensource libraries without this.

Re: ptrdiff_t of class.tupleof entry

2016-10-11 Thread Satoshi via Digitalmars-d-learn
On Monday, 10 October 2016 at 18:21:10 UTC, Jonathan M Davis wrote: On Monday, October 10, 2016 17:57:15 Satoshi via Digitalmars-d-learn wrote: [...] You can use the offsetof property of a member variable to find out the offset between its address and the address of the beginning

ptrdiff_t of class.tupleof entry

2016-10-10 Thread Satoshi via Digitalmars-d-learn
Hello, How can I take an ptrdiff_t of any tupleoff entry from class during compilation? I need something like this: template Test(T, int i) { enum Test = [i] - [0]; } and then use it like: class AnyClass { int a; int b; int c; string d; } enum Addr = Test!(AnyClass, 3); void

Re: Problems with "shared"

2016-10-10 Thread Satoshi via Digitalmars-d-learn
On Sunday, 9 October 2016 at 21:32:23 UTC, ag0aep6g wrote: On 10/09/2016 10:57 PM, jython234 wrote: 1. Where do I use the "shared" keyword? What doesn't work is creating an unshared object of a class that only has a shared constructor. To create both shared and unshared objects, you need

Re: Class attributes

2016-10-03 Thread Satoshi via Digitalmars-d-learn
On Sunday, 2 October 2016 at 17:22:57 UTC, Basile B. wrote: On Sunday, 2 October 2016 at 15:54:38 UTC, Satoshi wrote: Hello, why pure @safe nothrow @nogc struct Point { } isn't same as struct Point { pure: @safe: nothrow: @nogc: } ?? This is not specified but attributes aren't applied to

Class attributes

2016-10-02 Thread Satoshi via Digitalmars-d-learn
Hello, why pure @safe nothrow @nogc struct Point { } isn't same as struct Point { pure: @safe: nothrow: @nogc: } ??

Re: Easy sockets - don't exist yet?

2016-09-27 Thread Satoshi via Digitalmars-d-learn
On Monday, 26 September 2016 at 23:40:10 UTC, Vincent wrote: Hello, guys! I was very surprised that module 'socketstream' was deprecated. Usually if something become obsolete, there is some perfect replacement! But my digging in Inet and forums gave nothing, but "outdated" examples with

Re: [your code here]

2016-09-16 Thread Satoshi via Digitalmars-d
On Friday, 16 September 2016 at 08:40:08 UTC, alam wrote: give me code if (2b || !2b) { //to be or not to be? It's funny becasue its true }

Re: Properties don't work as expected

2016-07-05 Thread Satoshi via Digitalmars-d-learn
On Tuesday, 5 July 2016 at 10:52:10 UTC, zodd wrote: Property functions are used wrong by a compiler when it needs to get and set a value at the same time: [...] Try @property ref int value() { return value_; }

Re: D is crap

2016-07-03 Thread Satoshi via Digitalmars-d
On Sunday, 3 July 2016 at 04:37:02 UTC, D is crap wrote: Basically there is no great IDE for D, in fact, there is none. They are all general purpose IDE's that have been configured to compile D code. Great! Except they don't work well because they wern't designed for D. (e.g., template

Re: executeShell doesn't work but system does

2016-06-27 Thread Satoshi via Digitalmars-d-learn
On Sunday, 26 June 2016 at 19:01:07 UTC, cym13 wrote: On Sunday, 26 June 2016 at 17:56:08 UTC, Satoshi wrote: On Sunday, 26 June 2016 at 15:37:03 UTC, "Smoke" Adams wrote: system("cls") works but executeShell doesn't. system is depreciated. What's going on? The docs say that it creates a new

Re: executeShell doesn't work but system does

2016-06-26 Thread Satoshi via Digitalmars-d-learn
On Sunday, 26 June 2016 at 15:37:03 UTC, "Smoke" Adams wrote: system("cls") works but executeShell doesn't. system is depreciated. What's going on? The docs say that it creates a new process. I simply want to clear the console! I have problem with executeShell on windows 10 (LDC 1.0.0)

Re: Project Highlight: The PowerNex Kernel

2016-06-26 Thread Satoshi via Digitalmars-d-announce
On Saturday, 25 June 2016 at 18:42:20 UTC, Wild wrote: On Friday, 24 June 2016 at 15:09:41 UTC, Satoshi wrote: On Friday, 24 June 2016 at 14:09:12 UTC, Mike Parker wrote: Not that long ago, Dan Printzell announced his D OS Kernel, PowerNex [1], in this forum. It is now the subject of the

Re: Project Highlight: The PowerNex Kernel

2016-06-24 Thread Satoshi via Digitalmars-d-announce
On Friday, 24 June 2016 at 14:09:12 UTC, Mike Parker wrote: Not that long ago, Dan Printzell announced his D OS Kernel, PowerNex [1], in this forum. It is now the subject of the first project highlight on the D Blog [2]. [1] https://github.com/Vild/PowerNex [2]

Re: problem using ldc 1.0.0 as D compiler

2016-06-21 Thread Satoshi via Digitalmars-d
On Tuesday, 21 June 2016 at 17:30:38 UTC, yawniek wrote: On Tuesday, 21 June 2016 at 16:26:14 UTC, Satoshi wrote: On Monday, 20 June 2016 at 11:28:58 UTC, Antonio Corbi wrote: Hi folks! I'm using ldc version: LDC - the LLVM D compiler (1.0.0): based on DMD v2.070.2 and LLVM 3.8.0 built

Re: problem using ldc 1.0.0 as D compiler

2016-06-21 Thread Satoshi via Digitalmars-d
On Monday, 20 June 2016 at 11:28:58 UTC, Antonio Corbi wrote: Hi folks! I'm using ldc version: LDC - the LLVM D compiler (1.0.0): based on DMD v2.070.2 and LLVM 3.8.0 built with DMD64 D Compiler v2.071.0 Default target: x86_64-unknown-linux-gnu Host CPU: core2 [...] I have the same

  1   2   >