On Friday, September 14, 2018 2:52:42 PM MDT H. S. Teoh via Digitalmars-d-
learn wrote:
> On Fri, Sep 14, 2018 at 07:05:35PM +, Basile B. via Digitalmars-d-
learn wrote:
> > On Friday, 14 September 2018 at 17:59:38 UTC, Josphe Brigmo wrote:
> > > Seems to break dirEntries when trying to deal wi
On Thursday, September 13, 2018 4:04:58 AM MDT Jan via Digitalmars-d-learn
wrote:
> Many thanks Adam and Steve! Works like a charm! :D
> I presumed classes are lvalues. I shouldn't make things more
> complicated than they are ;-)
Well, the variables _are_ lvalues. It's just that they're reference
On Wednesday, September 12, 2018 9:42:19 PM MDT James Blachly via
Digitalmars-d-learn wrote:
> Neia is right that I tried to cast as in the second case ( but
> without UFCS -- reserve( cast(int[]), N); ). As an aside, what
> is going on behind the scenes with the compiler when casting away
> a pr
On Wednesday, September 12, 2018 5:41:16 PM MDT James Blachly via
Digitalmars-d-learn wrote:
> When I add the "shared" attribute to an array, I am no longer
> able to call reserve because the template won't instantiate:
>
> Error: template object.reserve cannot deduce function from
> argument type
On Sunday, September 9, 2018 8:30:12 AM MDT Saurabh Das via Digitalmars-d-
learn wrote:
> Thank you for explaining all this.
>
> It is frustrating because the behaviour is very counterintuitive.
>
> I will use a workaround for now.
Ranges are fantastic, and the basic concept is solid, but a number
On Sunday, September 9, 2018 2:49:56 AM MDT rikki cattermole via
Digitalmars-d-learn wrote:
> On 09/09/2018 8:41 PM, Christian Mayer wrote:
> > On Sunday, 9 September 2018 at 08:14:41 UTC, rikki cattermole wrote:
> >> Are you aware that a string is just an alias of immutable(char)[]?
> >
> > Yes,
On Thursday, September 6, 2018 1:05:03 PM MDT Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 9/6/18 2:52 PM, Jonathan M Davis wrote:
> > On Thursday, September 6, 2018 12:21:24 PM MDT Steven Schveighoffer via
> >
> > Digitalmars-d-learn wrote:
> >> On 9/6/18 12:55 PM, Jonathan M Davis wr
On Thursday, September 6, 2018 12:21:24 PM MDT Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 9/6/18 12:55 PM, Jonathan M Davis wrote:
> > On Thursday, September 6, 2018 2:40:08 AM MDT Saurabh Das via
> > Digitalmars-d->
> > learn wrote:
> >> Is this a bug with writeln?
> >>
> >> void ma
On Thursday, September 6, 2018 11:34:18 AM MDT Adam D. Ruppe via
Digitalmars-d-learn wrote:
> On Thursday, 6 September 2018 at 17:10:49 UTC, Oleksii wrote:
> > struct Slice(T) {
> >
> > size_t capacity;
> > size_t size;
> > T* memory;
> >
> > }
>
> There's no capacity in the slice, that
On Thursday, September 6, 2018 2:40:08 AM MDT Saurabh Das via Digitalmars-d-
learn wrote:
> Is this a bug with writeln?
>
> void main()
> {
> import std.stdio, std.range, std.algorithm;
>
> auto a1 = sort([1,3,5,4,2]);
> auto a2 = sort([9,8,9]);
> auto a3 = sort([5,4,5,4]);
>
>
On Tuesday, September 4, 2018 8:33:47 PM MDT Nathan S. via Digitalmars-d-
learn wrote:
> The below writes "uint". Is this working as intended?
> https://run.dlang.io/is/Dx2e7f
>
> ---
> import std.stdio;
>
> auto foo(T = uint)(uint x)
> {
> return T.stringof;
> }
>
> auto foo(T = ulong)(ulong
On Tuesday, September 4, 2018 9:22:26 AM MDT Timoses via Digitalmars-d-learn
wrote:
> On Tuesday, 4 September 2018 at 14:26:44 UTC, Steven
>
> Schveighoffer wrote:
> > [...]
> > As general advice, I wouldn't expect const to work well with
> > Ranges anyway -- const ranges are useless (you can't it
On Sunday, August 26, 2018 5:10:29 PM MDT Nicholas Wilson via Digitalmars-d-
learn wrote:
> On Sunday, 26 August 2018 at 20:17:30 UTC, aliak wrote:
> > So if we had this:
> >
> > struct A(T) {
> >
> > auto proxy() @trusted {
> >
> > return B!T(&this);
> >
> > }
> >
> > }
> >
> > struct B(T)
On Saturday, August 25, 2018 6:53:24 AM MDT Ivo via Digitalmars-d-learn
wrote:
> I am using Clock.currTime.stdTime to get a unique timestamp in my
> program.
> Now I need to produce something similar in a different
> programming language; so I'm trying to understand how
> Clock.currTime works.
>
>
On Friday, August 24, 2018 11:36:25 AM MDT Matthew OConnor via Digitalmars-
d-learn wrote:
> I'd like to run a sequence of executables with something like
> std.process.execute, but I would like the sequence to error out
> if one of the executables returns a non-zero return code. What is
> the reco
On Friday, August 24, 2018 3:28:37 PM MDT Nick Sabalausky (Abscissa) via
Digitalmars-d-learn wrote:
> On 08/24/2018 12:30 PM, John Burton wrote:
> > On Friday, 24 August 2018 at 15:26:30 UTC, kinke wrote:
> >> On Friday, 24 August 2018 at 13:10:40 UTC, John Burton wrote:
> >>> Is in the subject. A
On Tuesday, August 21, 2018 6:56:06 PM MDT Mike Parker via Digitalmars-d-
learn wrote:
> On Tuesday, 21 August 2018 at 14:56:21 UTC, Seb wrote:
> > I'm aware, but we don't have any other process for people to
> > show their support for a DIP, do we?
> >
> >
> > And for DMD/Druntime/Phobos etc. havi
On Tuesday, August 21, 2018 1:46:31 PM MDT Jim Balter via Digitalmars-d-
learn wrote:
> That's a lot of detail. The bottom line is that the warning in
> the spec is completely wrong and should be removed -- using
> property functions is not discouraged, nor is @property.
> @property should be used,
On Tuesday, August 21, 2018 12:22:42 PM MDT QueenSvetlana via Digitalmars-d-
learn wrote:
> On Monday, 20 August 2018 at 17:55:11 UTC, JN wrote:
> > class Foo
> > {
> >
> > auto bar;
> >
> > }
> >
> > because now the compiler doesn't know what type 'bar' is
> > supposed to be.
>
> Just to clari
On Tuesday, August 21, 2018 9:04:31 AM MDT Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 8/20/18 9:15 PM, Mike Parker wrote:
> > I tend to use type inference liberally, almost always with
> > const/immutbale locals, though I tend to use auto only when the type
> > name is longer than fo
On Monday, August 20, 2018 8:29:30 PM MDT Nick Sabalausky (Abscissa) via
Digitalmars-d-learn wrote:
> On 08/20/2018 04:34 PM, Jonathan M Davis wrote:
> > foreach(T; TypesThatVariantHolds)
>
> Yea, that's what I would've just done, but I wanted to support
> user-created types not already known
On Monday, August 20, 2018 1:38:13 PM MDT Nick Sabalausky (Abscissa) via
Digitalmars-d-learn wrote:
> There are a bunch of discriminated union types available for D, but the
> only one I'm aware of that *doesn't* require a finite-sized list of
> types known ahead-of-time is Phobos's Variant. The o
On Monday, August 20, 2018 4:29:56 AM MDT Andrey via Digitalmars-d-learn
wrote:
> On Monday, 20 August 2018 at 09:56:13 UTC, Jonathan M Davis wrote:
> > It's a combination of keeping the C semantics (in general, C
> > code is valid D code with the same semantics, or it won't
> > compile) and the f
On Monday, August 20, 2018 3:19:04 AM MDT Andrey via Digitalmars-d-learn
wrote:
> On Monday, 20 August 2018 at 08:49:00 UTC, rikki cattermole wrote:
> > Yes. On x86 int's will be faster just an FYI so it does make
> > sense to use them for computation.
>
> Inconveniently always use casts. Why in D
On Sunday, August 19, 2018 9:08:39 PM MDT Nick Sabalausky (Abscissa) via
Digitalmars-d-learn wrote:
> On 08/19/2018 10:23 PM, Jonathan M Davis wrote:
> > On Sunday, August 19, 2018 6:33:06 PM MDT Nick Sabalausky (Abscissa) via
> >
> > Digitalmars-d-learn wrote:
> >> Maybe something involving using
On Sunday, August 19, 2018 6:33:06 PM MDT Nick Sabalausky (Abscissa) via
Digitalmars-d-learn wrote:
> On 08/19/2018 08:27 PM, Nick Sabalausky (Abscissa) wrote:
> > Suppose I've wrapped a Variant in a struct/class which ensures the
> > Variant *only* ever contains types which satisfy a particular c
On Sunday, August 19, 2018 12:32:17 PM MDT QueenSvetlana via Digitalmars-d-
learn wrote:
> In the D Style Guide, it says:
>
> Properties
> https://dlang.org/dstyle.html#properties
>
> Functions should be property functions whenever appropriate. In
> particular, getters and setters should generally
On Friday, August 17, 2018 2:52:53 AM MDT Andrey via Digitalmars-d-learn
wrote:
> Hello,
>
> In D there is a nice function:
> > auto Tuple!(int,"status",string,"output") executeShell (
> >
> > scope const(char)[] command,
> > const(string[string]) env = cast(const(string[string]))null,
> > Conf
On Friday, August 17, 2018 9:59:18 AM MDT Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 8/13/18 9:21 AM, Andrey wrote:
> > On Monday, 13 August 2018 at 11:53:06 UTC, rikki cattermole wrote:
> >> You must use a module constructor to initialize it.
> >
> > Tried this:
> > static this()
>
On Friday, August 17, 2018 5:19:11 AM MDT SeanC4S via Digitalmars-d-learn
wrote:
> I used CUPS to print as pdf individual pages from the standard
> library. I want to get all the basic information I need easily at
> hand.
> I used unpredictableSeed in my code. It seems to be a property
> of somet
On Thursday, August 16, 2018 10:36:34 PM MDT SeanC4s via Digitalmars-d-learn
wrote:
> I never program with a computer connected on-line. I need the
> standard library docs in some off-line format.
Personally, I'd just look at the source code then, but the dlang.org build
does seem to have a pdf t
On Wednesday, August 15, 2018 10:40:49 AM MDT Alex via Digitalmars-d-learn
wrote:
> Hi all.
> Finally, I arrived at something like this:
>
> ´´´
> void main()
> {
> S!(sarr)[] sarr;
> }
>
> struct S(alias Reference)
> {
> size_t id()
> in
> {
> // not static assert, only because a po
On Wednesday, August 15, 2018 3:21:29 AM MDT Per Nordlöw via Digitalmars-d-
learn wrote:
> Have anybody thought about non-throwing variants of std.conv.to
> typically named `tryTo`
> similar to what Folly
>
> https://github.com/facebook/folly/blob/master/folly/docs/Conv.md#non-throw
> ing-interface
On Tuesday, August 14, 2018 8:37:33 AM MDT Andrey via Digitalmars-d-learn
wrote:
> On Tuesday, 14 August 2018 at 14:07:23 UTC, Timoses wrote:
> > Here's one version:
> >
> > template StringEnumValues(alias Enum)
> > {
> >
> > import std.traits : EnumMembers;
> > string[] StringEnumValues()
On Tuesday, August 14, 2018 4:03:11 AM MDT Michael via Digitalmars-d-learn
wrote:
> The page does state that enums should trigger CTFE though.
CTFE is triggered when a value must be known at compile-time. So, if you
have something like
enum a = foo();
foo gets called at compile-time, because an
On Tuesday, August 14, 2018 3:12:30 AM MDT ixid via Digitalmars-d-learn
wrote:
> This will not compile as it says n is not known at compile time:
>
> auto fun(int n) {
> static foreach(i;0..n)
> mixin(i.to!string ~ ".writeln;");
> return;
> }
>
> enum value = 2;
>
>
> void main() {
> f
On Monday, August 13, 2018 6:14:56 AM MDT Andrey via Digitalmars-d-learn
wrote:
> On Monday, 13 August 2018 at 11:53:06 UTC, rikki cattermole wrote:
> > Unsupported. AA's don't go between CT and RT. You must use a
> > module constructor to initialize it.
>
> Will be supported in future?
Maybe, bu
On Monday, August 13, 2018 6:42:02 PM MDT zeus via Digitalmars-d-learn
wrote:
> On Tuesday, 14 August 2018 at 00:24:53 UTC, Jonathan M Davis
>
> wrote:
> > On Monday, August 13, 2018 6:06:22 PM MDT zeus via
> >
> > Digitalmars-d-learn wrote:
> >> [...]
> >
> > Why are you casting the string to a c
On Monday, August 13, 2018 6:24:53 PM MDT Jonathan M Davis via Digitalmars-
d-learn wrote:
> On Monday, August 13, 2018 6:06:22 PM MDT zeus via Digitalmars-d-learn
>
> wrote:
> > i have the following code in d and i get as result 4D77EB, also i
> > have the following code i
On Monday, August 13, 2018 6:06:22 PM MDT zeus via Digitalmars-d-learn
wrote:
> i have the following code in d and i get as result 4D77EB, also i
> have the following code in c++ wich give me as results
> 0xABCDEF123abcdef12345678909832190 how i can get in d
> 0xABCDEF123abcdef12345678
On Sunday, August 12, 2018 1:50:44 PM MDT User via Digitalmars-d-learn
wrote:
> I have to synchronize a directory. If remote file is newer I copy
> to local. If local file is newer I copy it to remote server. For
> some reason remote timestamp does not contain milliseconds, so
> comparison (localF
On Thursday, August 9, 2018 7:15:58 AM MDT aliak via Digitalmars-d-learn
wrote:
> On Thursday, 9 August 2018 at 12:01:42 UTC, Jonathan M Davis
>
> wrote:
> > On Thursday, August 9, 2018 2:37:49 AM MDT aliak via
> >
> > Digitalmars-d-learn wrote:
> >> On Wednesday, 8 August 2018 at 23:47:22 UTC, Jo
On Thursday, August 9, 2018 2:37:49 AM MDT aliak via Digitalmars-d-learn
wrote:
> On Wednesday, 8 August 2018 at 23:47:22 UTC, Jonathan M Davis
>
> wrote:
> > On Wednesday, August 8, 2018 3:54:34 PM MDT aliak via
> >
> > Digitalmars-d-learn wrote:
> >> I'm trying to debug stuff, so I want to add v
On Wednesday, August 8, 2018 3:54:34 PM MDT aliak via Digitalmars-d-learn
wrote:
> I'm trying to debug stuff, so I want to add verbose logging
>
> struct S(T) {
>this() {
> writeln("created S(T) with properties and ID");
>}
> }
>
> static a = S!int(); // bah
>
> I guess users can call
On Wednesday, August 8, 2018 5:58:50 AM MDT aliak via Digitalmars-d-learn
wrote:
> Found this out while just looking at lowerings. Wondering if
> anyone knows the semantics involved here and where they are
> documented?
It's particularly useful when dealing with stuff like C functions that
return
On Wednesday, August 8, 2018 2:15:16 AM MDT Hakan Aras via Digitalmars-d-
learn wrote:
> Given this:
>
> struct Num
> {
> this(int a) {}
> }
>
> Is there any reason why this works:
>
> Num n = 5;
>
> but this doesnt:
>
> Num funk()
> {
> return 5;
> }
>
>
> I understand that I can constru
On Saturday, August 04, 2018 17:10:32 Steven Schveighoffer via Digitalmars-
d-learn wrote:
> On 8/4/18 4:10 PM, Yuxuan Shui wrote:
> > This doesn't work:
> >
> > template A() {
> >
> > void B() {};
> >
> > }
> > template B() {
> >
> > mixin A!();
> >
> > }
> > void main() {
> >
> > B
On Friday, August 03, 2018 17:47:53 kdevel via Digitalmars-d-learn wrote:
> On Friday, 3 August 2018 at 17:27:07 UTC, Adam D. Ruppe wrote:
> > But remember, this is documentation that just happens to look
> > like code, so it is intended to be legible by people rather
> > than the compiler.
>
> I c
On Thursday, July 19, 2018 10:04:34 RazvanN via Digitalmars-d-learn wrote:
> I just don't understand why you would ever mark the destructor of
> a struct with @disable. When is that useful? If it's not, why not
> just forbit it?
There's nothing special about destructors here. You can @disable any
On Wednesday, 11 July 2018 01:46:10 MDT Piotr Mitana via Digitalmars-d-learn
wrote:
> On Tuesday, 10 July 2018 at 13:24:43 UTC, WebFreak001 wrote:
> > It's supposed to make webservers safe and not crash because of
> > segmentation faults, etc.
> >
> > If you still want to write code like you are u
On Tuesday, 10 July 2018 07:24:43 MDT WebFreak001 via Digitalmars-d-learn
wrote:
> On Tuesday, 10 July 2018 at 13:14:24 UTC, Piotr Mitana wrote:
> > Hello,
> >
> > I've recently started building a little REST application on
> > vibe.d. I decided to use the "database" library, as I need to
> > comm
On Tuesday, 10 July 2018 05:38:33 MDT kdevel via Digitalmars-d-learn wrote:
> I would like to suggest an extension of the language by
> introducing
>
> static return Expression_opt;
>
> which shall have the effect of a return plus that the remaining
> lines in the current block are treated as
On Tuesday, 10 July 2018 05:52:59 MDT kdevel via Digitalmars-d-learn wrote:
> On Saturday, 7 July 2018 at 13:03:32 UTC, rikki cattermole wrote:
> > void func() {
> >
> > return;
> >
> > func2();
> >
> > }
> >
> > Which is clearly an error. Hence why you need to add else block.
>
> There is
On Friday, July 06, 2018 11:10:27 Timoses via Digitalmars-d-learn wrote:
> I dared once again getting into immutable by adding an
> "immutable" keyword which causes a chain of actions to be taken.
> I feel like I'm lost in a jungle of immutable, inout and pure
> (perhaps more will join the party...
On Thursday, July 05, 2018 11:42:39 drug via Digitalmars-d-learn wrote:
> There were several attempts to make Qt binding for dlang, but either
> they has failed or has been stalled. It would be nice to collect that
> experience. Considering 2.081 supports C++ special member (not all but
> majority)
On Thursday, July 05, 2018 05:47:20 Flaze07 via Digitalmars-d-learn wrote:
> On Wednesday, 4 July 2018 at 16:02:25 UTC, Jonathan M Davis wrote:
> > -dip1000 fully implements scope so that it verifies that no
> > reference escapes, but it's not ready yet, let alone the
> > default behavior.
> >
> >
On Wednesday, July 04, 2018 15:47:25 JN via Digitalmars-d-learn wrote:
> Imagine I have a very short-lived class:
>
> void print(File f)
> {
> PrinterManager pm = new PrinterManager();
> pm.print(f);
> }
>
> My understanding is that PrinterManager will be GC allocated, and
> when it goes
On Wednesday, July 04, 2018 14:07:35 Timoses via Digitalmars-d-learn wrote:
> How can I return inferred storage class from interface functions?
> I can't use auto as return value in interface. Neither can I use
> "inout" as I don't pass a parameter.
>
> // Ref Type
> interface IRef
> {
>
On Monday, July 02, 2018 21:20:26 Seb via Digitalmars-d-learn wrote:
> On Monday, 2 July 2018 at 19:24:38 UTC, Chris M. wrote:
> > On Monday, 2 July 2018 at 18:48:16 UTC, Jonathan M Davis wrote:
> >> On Monday, July 02, 2018 18:26:27 Chris M. via
> >>
> >> Digitalmars-d-learn wrote:
> >>> On Monday
On Monday, July 02, 2018 14:46:28 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> It should work. We need more context to try and help figure it out. Even
> if you can't post the entire program, maybe more context from mystruct.
If the program size is too large to show a good example, then
On Monday, July 02, 2018 18:26:27 Chris M. via Digitalmars-d-learn wrote:
> On Monday, 2 July 2018 at 17:33:20 UTC, Bauss wrote:
> > On Monday, 2 July 2018 at 12:53:19 UTC, Chris M. wrote:
> >> On Friday, 29 June 2018 at 20:08:49 UTC, Chris M. wrote:
> >>> On Friday, 29 June 2018 at 19:53:27 UTC, b
On Sunday, July 01, 2018 00:42:30 spikespaz via Digitalmars-d-learn wrote:
> Hey guys, I'm getting a linker error when compiling with DMD
> `-m63` that I don't get as 23 bit.
>
> I'm importing `ShowWindow` from `core.sys.windows.winuser`, and I
> get the following:
>
> C:\D\dmd2\windows\bin\lld-lin
On Friday, June 29, 2018 09:08:40 kdevel via Digitalmars-d-learn wrote:
> On Friday, 29 June 2018 at 02:28:04 UTC, Jonathan M Davis wrote:
> > [...] really, that example needs to be completely redone.
>
> Shall I create a bug report?
Yes. Aside from someone trying it out and complaining about it,
On Friday, June 29, 2018 05:52:03 Alex via Digitalmars-d-learn wrote:
> On Thursday, 28 June 2018 at 19:02:51 UTC, Ali Çehreli wrote:
> > On 06/28/2018 11:08 AM, Mr.Bingo wrote:
> > > Thanks, why not add the ability to pass through ranges and
> >
> > arrays and
> >
> > > add it to phobos?
> >
> > M
On Friday, June 29, 2018 01:25:39 kdevel via Digitalmars-d-learn wrote:
> In https://dlang.org/phobos/std_exception.html#errnoEnforce this
> example is shown:
>
> ---
> auto f = errnoEnforce(fopen("data.txt"));
> auto line = readln(f);
> enforce(line.length); // expect a non-empty line
> ---
>
> I
On Thursday, June 28, 2018 19:45:52 kdevel via Digitalmars-d-learn wrote:
> On Thursday, 28 June 2018 at 19:22:38 UTC, Jonathan M Davis wrote:
> > Nullable makes sense in generic code, because the code isn't
> > written specifically for them, but something like
> > Nullable!MyClass in non-generic c
On Thursday, June 28, 2018 18:10:07 kdevel via Digitalmars-d-learn wrote:
> On Tuesday, 26 June 2018 at 21:54:49 UTC, Jonathan M Davis wrote:
> > [H]onestly, I don't understand why folks keep trying to put
> > nullable types in Nullable in non-generic code.
>
> How do you signify that a struct memb
On Thursday, June 28, 2018 09:26:10 Flaze07 via Digitalmars-d-learn wrote:
> On Thursday, 28 June 2018 at 08:52:33 UTC, Simen Kjærås wrote:
> > On Thursday, 28 June 2018 at 08:36:54 UTC, Flaze07 wrote:
> >> is there some sort of ways to turn range into tuple ? ( an
> >> array preferably )
> >> e.g
On Wednesday, June 27, 2018 22:59:03 Nathan S. via Digitalmars-d-learn
wrote:
> On Wednesday, 27 June 2018 at 22:39:26 UTC, Jonathan M Davis
>
> wrote:
> > You could explicitly instantiate the function template and then
> > take its address.
>
> Explicitly instantiating the template can result in
On Wednesday, June 27, 2018 22:34:46 Nathan S. via Digitalmars-d-learn
wrote:
> Let's say there's a function template `doImpl` and `doImpl(x)`
> compiles thanks to IFTI. Is there any way to get the address of
> the function that would be called in `doImpl(x)`?
You could explicitly instantiate the
On Wednesday, June 27, 2018 16:19:56 Luka Aleksic via Digitalmars-d-learn
wrote:
> Hello,
>
> In the following code:
>
> T first;
> U second;
>
> this(T arg_first, U arg_second) {
> first = arg_first;
> second = arg_second;
> }
> };
>
> void main() {
>
> pair!(char, uint) p1
n Tuesday, June 26, 2018 17:14:08 SrMordred via Digitalmars-d-learn wrote:
> Is possible to make a Custom Struct String work for D string
> constraints?
>
> eg:
>
> struct MyString
> {
> char[] arr;
> alias arr this;
> }
>
> void getString( char[] str ){}
>
> MyString().split(";"); //oops
On Tuesday, June 26, 2018 19:03:20 kdevel via Digitalmars-d-learn wrote:
> On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote:
> > On Monday, June 25, 2018 19:40:30 kdevel via
> >
> > Digitalmars-d-learn wrote:
> >> R r;
> >>
> >> if (r.s is null)
> >>
> >>throw new Exc
On Tuesday, June 26, 2018 11:28:11 Radu via Digitalmars-d-learn wrote:
> > I'm pretty sure that that's impossible. As I understand it, the
> > compiler basically just replaces aliases with what they refer
> > to and doesn't care what the original type was. And they
> > _definitely_ don't affect man
On Tuesday, June 26, 2018 09:47:44 Radu via Digitalmars-d-learn wrote:
> On Tuesday, 26 June 2018 at 09:24:15 UTC, Stefan Koch wrote:
> > On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote:
> >> Consider this https://run.dlang.io/is/HyY2qG
> >>
> >> ---
> >> void main()
> >> {
> >>
> >> impor
On Monday, June 25, 2018 19:40:30 kdevel via Digitalmars-d-learn wrote:
> Just stumbled over the following design:
>
> class S {...}
>
> class R {
>
>Nullable!S s;
>
> }
>
> s was checked in code like
>
> R r;
>
> if (r.s is null)
>throw new Exception ("some erro
On Monday, June 25, 2018 17:29:23 Robert M. Münch via Digitalmars-d-learn
wrote:
> I have two foreach loops where the inner should change the iterator
> (append new entries) of the outer.
>
> foreach(a, candidates) {
> foreach(b, a) {
> if(...) candidates ~= additionalCandidate;
> }
> }
On Monday, June 25, 2018 05:47:30 Mr.Bingo via Digitalmars-d-learn wrote:
> The problem then, if D can't arbitrarily use ctfe, means that
> there should be a way to force ctfe optionally!
If you want to use CTFE, then give an enum the value of the expression you
want calculated. If you want to do
On Monday, June 25, 2018 05:03:26 Mr.Bingo via Digitalmars-d-learn wrote:
> The compiler should be easily able to figure out that foo(3) can
> be precomputed(ctfe'ed) and do so. It can already do this, as you
> say, by forcing enum on it. Why can't the compiler figure it out
> directly?
The big pr
On Friday, June 22, 2018 14:06:06 Flaze07 via Digitalmars-d-learn wrote:
> recently, I visited the glossary and saw that functor exist in
> D...I know that functor exist C++ as a way to easily allow higher
> order function, but since D already has function and delegates,
> is there a point to funct
On Thursday, June 21, 2018 13:16:28 wjoe via Digitalmars-d-learn wrote:
> On Wednesday, 20 June 2018 at 12:22:33 UTC, Kagamin wrote:
> > Do you know how to extract information from it on an unfamiliar
> > OS? Reading stack trace is easier and self-evident.
>
> Counter question: How do you develop
On Wednesday, June 20, 2018 09:37:00 Per Nordlöw via Digitalmars-d-learn
wrote:
> On Wednesday, 20 June 2018 at 09:27:14 UTC, Per Nordlöw wrote:
> > On Monday, 18 June 2018 at 21:10:03 UTC, Steven Schveighoffer
> >
> > wrote:
> >> It just means re-doing std.conv.to, which is pretty hairy, but
> >>
On Monday, June 18, 2018 15:22:48 wjoe via Digitalmars-d-learn wrote:
> On Saturday, 16 June 2018 at 21:25:01 UTC, Jonathan M Davis wrote:
> > every feature that you can't use in betterC is considered a
> > loss, and efforts are being made to make more of them work.
> > There's always going to be a
On Monday, June 18, 2018 11:53:50 Cauterite via Digitalmars-d-learn wrote:
> On Monday, 18 June 2018 at 09:28:00 UTC, rikki cattermole wrote:
> > On 18/06/2018 9:24 PM, Mr.Bingo wrote:
> >> On Monday, 18 June 2018 at 09:10:59 UTC, rikki cattermole
> >> wrote:
> >> This doesn't work with depreciatio
On Monday, June 18, 2018 21:28:00 rikki cattermole via Digitalmars-d-learn
wrote:
> On 18/06/2018 9:24 PM, Mr.Bingo wrote:
> > On Monday, 18 June 2018 at 09:10:59 UTC, rikki cattermole wrote:
> >> On 18/06/2018 9:03 PM, Mr.Bingo wrote:
> >>> In the code I posted before about CRC, sometimes I get a
On Sunday, June 17, 2018 02:44:38 Heromyth via Digitalmars-d-learn wrote:
> Here is a struct named S:
>
> struct S
> {
> enum X = 10;
> enum Y
> {
> i = 10
> }
> enum Z = "str";
> struct S {}
> class C {}
>
> static int sx = 0;
> __gshared int gx = 0;
>
> shared void
On Saturday, June 16, 2018 22:56:38 DigitalDesigns via Digitalmars-d-learn
wrote:
> On Saturday, 16 June 2018 at 21:41:37 UTC, Jonathan M Davis wrote:
> > On Saturday, June 16, 2018 14:55:51 Steven Schveighoffer via
> >
> > Digitalmars-d- learn wrote:
> >> On 7/30/16
On 7/30/16 8:47 AM, Jonathan M Davis via Digitalmars-d-learn
> >>
> >> wrote:
> >> > I'm writing some serialization code where I need to skip
> >> > static variables. So, I have a symbol from a struct, and I'd
> >> > like to test wheth
On Saturday, June 16, 2018 14:55:51 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 7/30/16 8:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
> > I'm writing some serialization code where I need to skip static
> > variables. So, I have a symbol from a struct,
On Saturday, June 16, 2018 18:45:53 wjoe via Digitalmars-d-learn wrote:
> What you said earlier:
>
> On Monday, 11 June 2018 at 00:47:27 UTC, Jonathan M Davis wrote:
> > [...]
> >
> > 2. If the compiler knows that a function can't throw an
> > Exception, then it doesn't have to insert any of the Ex
On Saturday, June 16, 2018 13:12:13 bauss via Digitalmars-d-learn wrote:
> On Saturday, 16 June 2018 at 08:32:38 UTC, DigitalDesigns wrote:
> > mixin(`foo!(typeof(T.`~m~`));
> >
> > gives me an error about m being protected.
> >
> > Error: class `X` member `name` is not accessible.
> >
> > this als
On Saturday, June 16, 2018 07:13:28 Timoses via Digitalmars-d-learn wrote:
> On Thursday, 14 June 2018 at 17:07:09 UTC, Jonathan M Davis wrote:
> > Sure, it would save you a little bit of typing when you do
> > something like
> >
> > auto foo = new Foo;
> >
> > if makes it immutable for you, but it
On Thursday, June 14, 2018 18:11:20 wjoe via Digitalmars-d-learn wrote:
> On Wednesday, 13 June 2018 at 20:08:06 UTC, Jonathan M Davis
> wrote:
> > On Wednesday, June 13, 2018 10:56:41 wjoe via
> > The idea is that because your program is in an invalid state,
> > attempting a graceful shutdown is u
On Thursday, June 14, 2018 08:40:10 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 6/14/18 7:07 AM, Guillaume Piolat wrote:
> > On Tuesday, 12 June 2018 at 15:35:42 UTC, Steven Schveighoffer wrote:
> >> No, that's not what I mean. What I mean is:
> >>
> >> int[] arr = [1,2,3].s;
> >> int
On Thursday, June 14, 2018 08:39:48 RazvanN via Digitalmars-d-learn wrote:
> > Honestly, from what I understand of how this works, what I find
> > weird is the struct case. immutable on classes does _not_ make
> > the class itself immutable. It just makes all of its members
> > immutable - hence th
On Wednesday, June 13, 2018 14:33:48 Jonathan M Davis via Digitalmars-d-
learn wrote:
> On Wednesday, June 13, 2018 07:35:25 RazvanN via Digitalmars-d-learn
wrote:
> > Hello,
> >
> > I'm having a hard time understanding whether this inconsistency
> &g
On Wednesday, June 13, 2018 07:35:25 RazvanN via Digitalmars-d-learn wrote:
> Hello,
>
> I'm having a hard time understanding whether this inconsistency
> is a bug or intended behavior:
>
> immutable class Foo {}
> immutable struct Bar {}
>
> void main()
> {
> import std.stdio : writeln;
>
On Wednesday, June 13, 2018 10:56:41 wjoe via Digitalmars-d-learn wrote:
> On Wednesday, 13 June 2018 at 03:14:33 UTC, Jonathan M Davis
>
> wrote:
> > Most programs do not handle the case where they run out of
> > memory and cannot continue at that point. For better or worse,
> > D's GC was designe
On Wednesday, June 13, 2018 02:02:54 wjoe via Digitalmars-d-learn wrote:
> On Tuesday, 12 June 2018 at 18:41:07 UTC, Jonathan M Davis wrote:
> > On Tuesday, June 12, 2018 17:38:07 wjoe via Digitalmars-d-learn
> >
> > wrote:
> >> On Monday, 11 June 2018 at 00:47:27 UTC, Jonathan M Davis
> >>
> >> wr
On Tuesday, June 12, 2018 23:32:55 Neia Neutuladh via Digitalmars-d-learn
wrote:
> On Monday, 11 June 2018 at 00:47:27 UTC, Jonathan M Davis wrote:
> > Why do you care about detecting code that can throw an Error?
> > Errors are supposed to kill the program, not get caught. As
> > such, why does i
401 - 500 of 1863 matches
Mail list logo