Re: copying const

2015-06-24 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 24 June 2015 at 19:41:54 UTC, Freddy wrote: I was surprised when this happened, is it a bug or a feature? Feature, overwriting const or immutable data would violate the promise that it never changes. Saving a struct over another struct is just another way of overwriting the data

Re: New names - 2.068 roundup

2015-06-24 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 24 June 2015 at 14:31:42 UTC, Vladimir Panteleev wrote: Not at the call site, but in the function (i.e. the function defines a voldemort struct, constructs one, wraps that into the helper that adds implicit string conversion, and returns that). Oh yeah, we could do that.

Re: New names - 2.068 roundup

2015-06-24 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 24 June 2015 at 13:50:09 UTC, Vladimir Panteleev wrote: - I think the implementation is better done through composition Perhaps, though I was thinking of this as being just a temporary step for migration until it is deprecated - it helps a lot of code continue to just work, but

Re: std.uni.toLowerCase / .toUpperCase

2015-06-24 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 24 June 2015 at 13:43:50 UTC, Adam D. Ruppe wrote: Yes, just provide a function that works on chars and reuse map for laziness. Actually, this might not quite work because toLower/Upper might need to transform two characters at once in some alphabets. Ugh. still I do generally

Re: std.uni.toLowerCase / .toUpperCase

2015-06-24 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 24 June 2015 at 13:31:00 UTC, Jacob Carlborg wrote: How will that make things better? A user will see both toLower and toLowerCase can think: "What the h*ll is the difference between these to functions". Absolutely. I don't even like names that are just kinda similar. Ruby, for

Re: New names - 2.068 roundup

2015-06-23 Thread Adam D. Ruppe via Digitalmars-d
We disagreed on this on irc, but I ask you to consider the following which limits the code breakage a lot more than my first proposal in chat: --- import std.range; struct ToLowered(R) if(isInputRange!R) { R inputRange; this(R r) { static if(isForwardRange!R)

Re: std.experimental.color, request reviews

2015-06-23 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 23 June 2015 at 17:53:43 UTC, John Colvin wrote: Isn't this what selective imports are for? Not quite the same thing: selective imports control which symbols you pull into the current namespace, but not which code gets pulled into the binary. If you do `import foo : bar;`, the c

Re: Phobos addition formal review: std.experimental.allocator

2015-06-23 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 23 June 2015 at 16:56:55 UTC, Andrei Alexandrescu wrote: But that doesn't apply to packages that do NOT originate as big modules, so they have no backward compatibility issue. My thought isn't really about backward compatibility but about minimizing dependencies with sibling module

Re: std.experimental.color, request reviews

2015-06-23 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 23 June 2015 at 16:14:59 UTC, Marc Schütz wrote: But that's more an argument against putting anything _except_ the basic definitions into package.d, no? Then you can always exclude the more specific stuff whenever you need it, and those modules themselves can publicly import package

Re: D could catch this wave: web assembly

2015-06-23 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 23 June 2015 at 16:18:01 UTC, Nick Sabalausky wrote: Although I wouldn't put too much reliance on X, what with Wayland on the way. meh, wayland doesn't look very interesting to me, especially in this use case where I'd want a network protocol because the application runs on an iso

Re: std.experimental.color, request reviews

2015-06-23 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 23 June 2015 at 15:24:44 UTC, John Colvin wrote: std/range/package.d and std/regex/package.d both have a bunch of stuff in. Why not? Those are also mistakes (well, probably just semi-migrated from the old big module). Suppose you want some of that stuff without the rest of the pac

Re: std.experimental.color, request reviews

2015-06-23 Thread Adam D. Ruppe via Digitalmars-d
Just a quick concern, I don't think a package.d should ever have anything except imports in it. Put all the actual aliases and color lists in some other submodule that can be imported independently with minimal dependencies.

Re: D could catch this wave: web assembly

2015-06-23 Thread Adam D. Ruppe via Digitalmars-d
Nick, you might be interested in this quick thing I just wrote up: http://arsdnet.net/articles/web-apps.html A few years ago, I was talking about a new windowing system... and believe it or not, I'm still slowly moving forward with it, but I think existing X is good enough to start with for th

Re: Better forums

2015-06-18 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 18 June 2015 at 12:49:33 UTC, Vladimir Panteleev wrote: Do you mean in general (which I don't think is true), or do you have particular grievances that I might be able to address? You probably could address it, but the beauty of a distributed system is you don't have to since my s

Re: Better forums

2015-06-18 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 18 June 2015 at 05:17:22 UTC, Vladimir Panteleev wrote: Although more than half of all posts come from the web interface, about 40% use other methods. There's also people like me: when I got to post, I use the web interface (because the mailman gateway is so unbelievably bad), bu

Re: Better forums

2015-06-17 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 18 June 2015 at 02:13:13 UTC, Morbid.Obesity wrote: I suggest that subforums be used for specific topics or a tag based system like stack overflow. I think we should just use stack overflow for that. A forum is kinda chatty and not that great for searching anyway - even if you fi

Re: std.container: fork in the road

2015-06-17 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 17 June 2015 at 16:00:30 UTC, Wyatt wrote: I guess I'll have to wait for Adam's write-up, then. I'm probably going to write that one tomorrow, but won't post it until Sunday night/Monday morning. The short of it is to check for what methods are available instead of trying to n

Re: ... and the sixth wasn't far behind!

2015-06-12 Thread Adam D. Ruppe via Digitalmars-d
The di generation is actually fairly simple code, these are probably all pretty low hanging - I'd encourage anyone who wants some easy entry into dmd hacking to take a look at these.

Re: Asked on Reddit: Which of Rust, D, Go, Nim, and Crystal is the strongest and why?

2015-06-10 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 10 June 2015 at 18:18:55 UTC, Ola Fosheim Grøstad wrote: It's always a good idea to not go personal, but I think they overdo it when you're not allowed to write "he" as a general term because it is gender specific. That's actually a good idea, you might not have noticed it, but I

Re: Daily downloads in decline

2015-06-10 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 10 June 2015 at 18:10:55 UTC, Binarydepth wrote: Good! And what do you think about structuring the videos in a youtube playlist or HTML page here on dlang.org ? I'm also writing up articles about each talk on the this week in D btw: http://arsdnet.net/this-week-in-d/jun-07.html

Re: It may be useful to allow declaring variables without type

2015-06-10 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 10 June 2015 at 17:19:30 UTC, Binarydepth wrote: Hi, If it is not much trouble, care to explain how ? If it is user input, take it in the format they send it. Like: string typed_data; if(isNumeric(typed_data)) { auto number = to!int(typed_data); // do stuff with humber } e

Re: It may be useful to allow declaring variables without type

2015-06-10 Thread Adam D. Ruppe via Digitalmars-d
You can do this with variants or even just plain strings.

Re: Asked on Reddit: Which of Rust, D, Go, Nim, and Crystal is the strongest and why?

2015-06-10 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 10 June 2015 at 16:02:36 UTC, Ola Fosheim Grøstad wrote: Yeah, I think it would be nice if one could change the culture of programming so that people easily could combine any 2 languages in the same project. But shouldn't there be one language that's right for everyone? (BTW I

Re: DIP80: phobos additions

2015-06-07 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 8 June 2015 at 00:05:58 UTC, weaselcat wrote: I actively avoid adding phobos libs to my projects because it bloats my binaries and increases compile times by massive amounts. Me too... but that's not actually a problem of huge library. It is more a problem of an interconnected libr

Re: compiled program error

2015-06-07 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 7 June 2015 at 18:59:00 UTC, John Nixon wrote: double[] pvi,int_1,int_2; int_1=pvi_calc(centre); int_2=pvi_calc(n-1-centre);//pvi_calc is changing int_1! double[] pvi_calc(const int n1){ return pvi;} These are the relevant lines: pvi_calc writes to a global array (pvi) th

Re: Code behaves incorrectly if it is compiled in std.functional

2015-06-05 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 5 June 2015 at 19:45:18 UTC, krzaq wrote: const auto ans = 42; compiles fine for me, so auto clearly can be used as a type. So does "auto immutable" or "auto pure" or "pure a". They're all storage classes and any storage class can kick off a declaration: @nogc a = 10; /

Re: Throwing InvalidMemoryOperationError

2015-06-04 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 4 June 2015 at 17:51:31 UTC, Etienne Cimon wrote: I'm trying to rebuild gdb because this error is what I got: wow that's messed up. Did you try it with dmd -gc too? Or a non-debug version of the program entirely? Maybe your version of gdb has a bug in reading D debugging info.

Re: Throwing InvalidMemoryOperationError

2015-06-04 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 4 June 2015 at 16:05:37 UTC, Etienne wrote: Why not just let it fail with an access violation of some sort? You can do this at least with a filthy hack. Add this to your file with main(): extern(C) void onInvalidMemoryOperationError(void*) { asm { int 3; } } Then recompile

Re: Throwing InvalidMemoryOperationError

2015-06-04 Thread Adam D. Ruppe via Digitalmars-d
If int 3 doesn't work for some reason btw, you could always just deliberately write to a null pointer and trigger a segfault in the overridden function, would have the same result in the debugger. I feel like this onError thing is meant to be overridable by importing core.exception too, but I

Re: Throwing InvalidMemoryOperationError

2015-06-04 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 4 June 2015 at 16:32:39 UTC, Etienne Cimon wrote: Wouldn't that be with `this() in { assert() }` ? Not necessarily. Consider something like a file wrapper, if fopen is null inside the ctor, you'd generally throw on that. My concern is the fact that the destructor won't be called

Re: Throwing InvalidMemoryOperationError

2015-06-04 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 4 June 2015 at 16:12:54 UTC, Etienne Cimon wrote: On another note, considering the unimaginable amount of bugs that can stem from throwing in a constructor Throwing from a constructor is kinda important as it is the only way to signal failure on its input...

Re: Daily downloads in decline

2015-06-01 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 1 June 2015 at 21:37:49 UTC, Paulo Pinto wrote: Just did a short post to create awareness for the conference, slides and unedited videos availability. What's the link?

Re: Daily downloads in decline

2015-06-01 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 1 June 2015 at 22:43:58 UTC, weaselcat wrote: dmd's speed is fast only in comparison with C++ compilers, go runs circles around it. In an apples-to-apples comparison, dmd is faster than go. That comparison can be a bit hard to set up though. If you import std.stdio for example, dmd

Re: Daily downloads in decline

2015-06-01 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 1 June 2015 at 18:11:32 UTC, Andrei Alexandrescu wrote: 2. It's an equally big bummer that "This Week in D" failed to be there on Sunday night. I completely understand Adam's overhead, what with his still traveling and all, but the bottom line is if it's not every Sunday it's not ste

Re: Make dub part of the standard dmd distribution

2015-06-01 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 1 June 2015 at 14:09:32 UTC, ponce wrote: What happens when you find a bug in your library? Users still have to test bug fixes because what I consider a bug they might consider a feature. I dread software updates not because downloading a file or applying a patch is hard, but beca

Re: Make dub part of the standard dmd distribution

2015-06-01 Thread Adam D. Ruppe via Digitalmars-d
I think the way I'd do it is you still make projects in the repo that are referenced like normally, just it refers to a file in a specific repo instead of a whole repo. Maybe using the subpackage feature it can get close enough. I'll try using an empty source folder then do the others as a sin

Re: Make dub part of the standard dmd distribution

2015-06-01 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 1 June 2015 at 10:24:46 UTC, ketmar wrote: and now you killed the only sensible way to use it: as package manager. I don't care for it as a package manager either because it is too complex. As you know, I like to do my things as individual files. I don't go through the pain of maki

Re: Make dub part of the standard dmd distribution

2015-06-01 Thread Adam D. Ruppe via Digitalmars-d
Writing to something that requires root is just doing it wrong IMO, unless the user specifically opts in to it. /usr/anything is thus wrong, it should all be done locally. My preference is actually right in the current directory, do it on a per-project level. But if you must go higher, the use

Re: Progress on Adam Wilson's Graphics API?

2015-05-30 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 31 May 2015 at 04:46:51 UTC, lobo wrote: Again, I wonder why would you reimplement what you get from libpng? I've actually had people ask me what magic I did with my png.d because it often generates smaller files than libpng. It is easier to use an leaving out unnecessary bits made

Re: Progress on Adam Wilson's Graphics API?

2015-05-30 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 31 May 2015 at 02:16:02 UTC, Rikki Cattermole wrote: As I've already said, out of the box experience should not rely on 3rd party. Rely on, no. But package? Sure. I'd be ok with built-in etc.c.sdl bindings and such. Perhaps dub obsoletes this idea, but if someone is willing to use

Re: Proof of concept - library AA

2015-05-30 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 30 May 2015 at 14:10:35 UTC, IgorStepanov wrote: static Foo opImplicitConstructFrom(T)(T val) if(is(T : int)) I briefly mentioned this at the dconf and thinking about it a bit more, I think there's only two cases where we want implicit construction: function argument lists an

Re: Progress on Adam Wilson's Graphics API?

2015-05-30 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 30 May 2015 at 13:35:47 UTC, Rikki Cattermole wrote: Great example, if you wanted to play some music cross platform what D library what you use? Hint good luck, none really exist. I'm slowly getting through my simpleaudio.d What about window creation? Well Devisualization.Wind

Re: Progress on Adam Wilson's Graphics API?

2015-05-30 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 30 May 2015 at 14:28:57 UTC, Rikki Cattermole wrote: On 31/05/2015 2:27 a.m., ketmar wrote: SDL audio. ;-) Okay lets ignore libraries that is not D. Like that one. I think that is unnecessarily limiting. I do see your point about distribution, but using C libraries is a common

Re: sockaddr_in and InternetAddress

2015-05-28 Thread Adam D. Ruppe via Digitalmars-d
I would add it as a new constructor to InternetAddress. In the mean time, you could work around the lack of it by making a new subclass of InternetAddress that sets the member with your constructor. Like: class MyInternetAddress : InternetAddress { this(sockaddr_in addr) { this.sin =

Re: Signals

2015-05-27 Thread Adam D. Ruppe via Digitalmars-d
The way I do it is to set a global variable in the signal handler, then have the loop watch for it. So like __gshared bool terminated = false; extern(C) void handleSigTerm(int) { terminated = true; } void main() { while(!terminated) { if(select() < 0) if(errno == EINT

Re: [dconf] Share a ride SLC-hotel?

2015-05-26 Thread Adam D. Ruppe via Digitalmars-d
Random question for anyone who knows, when does the conference end each day? Like 5pm? 5:30pm?

Re: Dconf Video / Projector Information

2015-05-20 Thread Adam D. Ruppe via Digitalmars-d
Also, when are the videos going to be released this time? I'd like it on youtube as soon as possible.

Re: Let's improve D's exceptions

2015-05-15 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 15 May 2015 at 09:23:12 UTC, Jacob Carlborg wrote: So why isn't data members used more, because of the boilerplate to create a new subcalss? Yeah, I think so. A new exception subclass has to write out the long constructor signature, forward it, add the data members, write code to s

Re: Let's improve D's exceptions

2015-05-14 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 14 May 2015 at 12:26:45 UTC, w0rp wrote: I wonder if enforce should throw an Error instead, if it exists at all. Because it's designed to throw an exception you shouldn't catch. Is it really? My thought of enforce was it iwas just a lazy way to throw on cases like file not found.

Re: Let's improve D's exceptions

2015-05-14 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 14 May 2015 at 10:29:57 UTC, Kagamin wrote: Maybe also replace file name with ModuleInfo similar to how assert works? Those bug me because all it really wants from it is the name and then you need all the moduleinfo even in bare metal. Exception support requires some RTTI anyway

Re: Let's improve D's exceptions

2015-05-14 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 14 May 2015 at 10:24:45 UTC, Ola Fosheim Grøstad wrote: Using alias like this makes code hard to read. Error types should be humanly deducible at the failure site. Perhaps, I don't hate it too much here though because the alias is fairly local. Without it, you'd probably write e

Re: Let's improve D's exceptions

2015-05-14 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 14 May 2015 at 10:08:36 UTC, Jacob Carlborg wrote: It was a while since I looked at that DIP, but I'm mostly interested in the hierarchy. I think hierarchies will get better too if there were more incentive to use them - data members instead of string concat encourages new classe

Re: Let's improve D's exceptions

2015-05-13 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 13 May 2015 at 19:24:09 UTC, Jacob Carlborg wrote: One thing that is _not_ making things better is "enforce" which, if I recall correctly, throws Exception by default. Aye. enforce is one of those things that looks cool but I don't think should actually be used. It could perhap

Let's improve D's exceptions

2015-05-13 Thread Adam D. Ruppe via Digitalmars-d
Have you ever done: if(something) { import std.conv; throw new Exception("some error " ~ to!string(some_value)); } Don't you hate it? * having to import std.conv to see data from your exception is a pain * it allocates eagerly and thus isn't suitable for a lot of places * inspecting the

Re: a "success story for D" ! !!

2015-05-05 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 5 May 2015 at 12:21:52 UTC, extrawurst wrote: the github account show little activity But, a fair chunk of code. Maybe there's little activity recently because they consider it done. I haven't committed to the majority of my github things for months, but I still stand by them.

Re: [your code here] Rounding real numbers

2015-05-02 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 3 May 2015 at 02:48:32 UTC, Vladimir Panteleev wrote: Doesn't need to be PHP could also be D

Re: Closure capture loop variables

2015-05-01 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 1 May 2015 at 21:46:15 UTC, deadalnix wrote: No it does not. In JS, var declare a variable at function level, so that is why you see the behavior you see. Yes, I know, I said that a short while down in that post.

Re: Closure capture loop variables

2015-05-01 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 1 May 2015 at 17:51:05 UTC, Walter Bright wrote: Yes, they are. I thought this until just a couple weeks ago when I was shown to be pretty conclusively wrong. See the discussion here: https://issues.dlang.org/show_bug.cgi?id=2043 When a new scope is introduced, a new variable is

Re: D audio playing and analysis library?

2015-04-28 Thread Adam D. Ruppe via Digitalmars-d
idk if it would be useful at all, I'm not even happy with it myself yet, but I am writing a simpleaudio.d https://github.com/adamdruppe/arsd/blob/master/simpleaudio.d it is meant to do waveform i/o and MIDI, but I'm not happy with my first draft of the api so it is probably going to change

Re: D needs emplacement new

2015-04-27 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 27 April 2015 at 13:29:03 UTC, Casper Færgemand wrote: Doesn't the GC regard every 4/8 sequence of bytes as a pointer? Only on the stack. On the heap, it knows what type the data is and if it has a pointer or not.

Re: D needs emplacement new

2015-04-25 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 25 April 2015 at 19:08:52 UTC, weaselcat wrote: doesn't this have the issue of not calling the ctor/dtor of nested objects? You could also use .destroy(copy_of_obj); instead of __dtor which should handle that, I think. Constructors are fine because there's no default constructi

Re: D needs emplacement new

2015-04-25 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 25 April 2015 at 18:50:59 UTC, Namespace wrote: Nice name, fits better. But that should be in phobos, don't you think? meh, it might be nice to have, but not being in phobos isn't a big deal to me for little utilities like this.

Re: D needs emplacement new

2015-04-25 Thread Adam D. Ruppe via Digitalmars-d
You could just call the constructor again to reuse an object. I guess you should also reinitialize the memory, but that's pretty easy too. Instead of placement new to reuse an object, make a function like reset() or reinitialize() that destructs the first, then copies the init back over and c

Re: A valid code that won't run?

2015-04-24 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 24 April 2015 at 20:52:16 UTC, Steven Schveighoffer wrote: There is a reason nothing but Windows build of DMD supports it. You are right about not having pragma(lib anywhere but windows, pragma(lib) works on all versions of dmd, including on Linux.

Re: A valid code that won't run?

2015-04-24 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 24 April 2015 at 21:47:50 UTC, cym13 wrote: Reimplementing sure sounds like the best long-term way to go... Maybe we don't need all libcurl features Actually, I find curl doesn't provide much of what I actually need and I have to build stuff on top of it! But the hard part to reim

Re: GC.malloc is pure - wat

2015-04-24 Thread Adam D. Ruppe via Digitalmars-d
string toLower(string s); Should that be pure? Repeated calls to it, given the same input, will return the same output, but they will also most likely be separately allocated. GC.malloc might be cheating to be pure, but it does enable a lot of more logically pure stuff on top of it...

Re: Cleaned up C++

2015-04-22 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 22 April 2015 at 22:41:33 UTC, Walter Bright wrote: And you can still initialize with '= void'. This was my tip of the week two TWID's ago! http://arsdnet.net/this-week-in-d/apr-12.html

Re: I have made a discovery

2015-04-19 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 19 April 2015 at 02:50:59 UTC, Rikki Cattermole wrote: So I went with closest I thought it was to make the point. I don't understand what the point is... is it just syntax?

Re: I have made a discovery

2015-04-18 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 19 April 2015 at 02:24:06 UTC, Rikki Cattermole wrote: int[3] values = allocate!(int[3]); Why would you ever do that? int[3] is statically allocated auto values = allocate!(int[])(3); would make a lot more sense, then values would be typed perhaps to int[], but also i

Re: I have made a discovery

2015-04-18 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 19 April 2015 at 00:39:03 UTC, ketmar wrote: but it's much easier to simply write "new Exception" instead of "allocateWithMyCoolScheme!Exception". eh i would just call it "New!Exception" where the cool scheme is in the module name. So you "import mycoolscheme;" which defines the Ne

Re: I have made a discovery

2015-04-18 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 19 April 2015 at 01:19:47 UTC, Brian Schott wrote: If you overload a class's `new`, you are deciding for your class's user how it will be allocated. Without telling them btw. (Well, except the documentation or the source.) So now, they new it and expect the GC to clean it up like

Re: T.zero and T.one for numeric types

2015-04-17 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 17 April 2015 at 13:27:19 UTC, Biotronic wrote: void foo(T)(T a) {} foo!T(0); Does foo(T(0)); work? It seems like it should void foo(T)(T a) {} import std.bigint; import std.complex; void main() { foo(BigInt(0)); foo(float(0)); foo(int(0)); fo

Re: Detect the bug in the following code

2015-04-15 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 15 April 2015 at 14:44:48 UTC, Idan Arye wrote: register = true; Easy, you assigned to the wrong variable, that'd quickly be obvious at runtime too with a stack overflow. I think it sucks that true and false will implicitly convert to int though, that bites people some

Re: Why I'm Excited about D

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 8 April 2015 at 17:41:01 UTC, ixid wrote: It would be useful for debugging pipelines to be able to drop in writeln in the middle of the pipeline and pass on the data unchanged. That might be useful for debugging but I'd also be annoyed if someone used that in production code too

Re: Why I'm Excited about D

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 8 April 2015 at 17:17:21 UTC, Walter Bright wrote: writeln is an OutputRange. No, it isn't. It isn't even remotely close to one - an OutputRange is a type, writeln is a function. isOutputRange doesn't even return false for it, it outright fails to compile! File isn't an output

Re: Why I'm Excited about D

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 8 April 2015 at 16:59:27 UTC, Dicebot wrote: Just to be clear - I wouldn't allow range.copy(stdout) in my projects either, requiring any consumer to be written as dedicated expression. Worth noting that std.range.put's documentation also says use the freestanding syntax. (This i

Re: Why I'm Excited about D

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 8 April 2015 at 16:51:53 UTC, Andrei Alexandrescu wrote: File defines it. Last time this came up on reddit, I explained that *this* was exactly why I think "string".writeln is mistaken. writeln does NOT operate on its string, it doesn't tell the string to do something, it doesn

Re: Why I'm Excited about D

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 8 April 2015 at 16:49:27 UTC, Dicebot wrote: On Wednesday, 8 April 2015 at 16:47:10 UTC, Andrei Alexandrescu No. -- Andrei Yes. FILE_NOT_FOUND

Re: [OT] Regarding most used operating system among devs

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 8 April 2015 at 16:08:44 UTC, Dicebot wrote: So who is going to do the pull request? One of those Linux developers I presume? :) I actually came close to it, but it ended up being a bit of a pain. The easiest thing would be to just shove the win32.* packages in the zip, but then

Re: Which D IDE do you use?(survey)

2015-04-08 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 8 April 2015 at 16:02:20 UTC, eyveer wrote: question to vim users - how did you configure autocomplete? I just use the basic built in keyword autocomplete, mapped to the tab key for ease of access. Works for all languages!

Re: Why I'm Excited about D

2015-04-07 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 7 April 2015 at 22:22:35 UTC, Andrei Alexandrescu wrote: On 4/7/15 11:42 AM, Martin Nowak wrote: What's still missing is a faster AST interpreter for CTFE though. A JIT would be nice. -- Andrei I'm not so sure CTFE would ever get out of the warmup debt JITs incur, ctfe bits usua

Re: Why I'm Excited about D

2015-04-07 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 7 April 2015 at 06:28:49 UTC, Jacob Carlborg wrote: vibe.d has a template system. It's based on Jade, which seems to be based on Haml. Aye, though it is compile time rather than runtime which hurts the edit/run cycle - you have to recompile, redeploy (maybe), and restart just to s

Re: Why I'm Excited about D

2015-04-06 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 7 April 2015 at 00:15:51 UTC, w0rp wrote: [...]and runtime templates. The last two haven't been written yet. Really? Runtime templates aren't even hard to implement What I do with my web libs is use a minimal templating system based on dom.d. Basic things are inserted with pla

Re: Typeinfo

2015-04-02 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 3 April 2015 at 00:21:47 UTC, Andrei Alexandrescu wrote: Hey folks, is there any way to figure out whether a type is immutable or shared given its typeinfo? Yes: if it is an instance of TypeInfo_Invariant or TypeInfo_Shared. void main() { string s; char[] c;

Re: DMD compilation speed

2015-03-31 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 31 March 2015 at 19:20:20 UTC, Jake The Baker wrote: As far as memory is concerned. How hard would it be to simply have DMD use a swap file? That'd hit the same walls as the operating system trying to use a swap file at least - running out of address space, and being brutally slow

Re: Stream - What is D actually used for?

2015-03-30 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 30 March 2015 at 17:24:25 UTC, Israel wrote: Have you ever heard that phrase, "Jack of all trades, master of none"? If you could pick one language that lives up to this, which one would you pick? I'd say C++, you can do everything with it, it is just awkward. D actually is a mast

Re: D as System Language

2015-03-30 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 30 March 2015 at 17:19:38 UTC, Columbus wrote: Also I thought I would find some documentation about creating a custom runtime and so on. Which is information I didn't get from osdev.org I think there is a page on the osdev wiki somewhere, but odds are the chapter in my book is the b

Re: D as System Language

2015-03-30 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 30 March 2015 at 15:32:25 UTC, Columbus wrote: "Is there usefull documentation about using D as OS language?" I wrote briefly in my book some stuff that might help get you started https://www.packtpub.com/application-development/d-cookbook Basically you can start with an empty run

Re: Why dont dlang check NullPointer?

2015-03-26 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 27 March 2015 at 03:46:49 UTC, zhmt wrote: The code above will not print a exception message, but crashes instead. It actually will throw on Windows and can be tricked into it on Linux; it is an operating system thing more than a language thing. But... If null exception happens,

Re: Where's "This week in D?"

2015-03-25 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 25 March 2015 at 05:46:34 UTC, tcak wrote: I do not see any content that cannot be automated at all. This one was mostly automated though the summary of the threads and the decision of which ones to summarize isn't, there I go a bit beyond the content and editoralize a bit somet

Re: uniform tuple syntax

2015-03-24 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 24 March 2015 at 23:07:29 UTC, Vlad Levenfeld wrote: Anything wrong with using {}? It looks good to me, does it lead to any parsing ambiguities? In this context, it would look like a delegate/function literal or perhaps the start of a scope in other contexts. auto a = { arg1, arg

Re: Where's "This week in D?"

2015-03-24 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 24 March 2015 at 20:22:14 UTC, Steven Schveighoffer wrote: How do I get to past issues of this week in d? go to the RSS link in the header text http://arsdnet.net/this-week-in-d/twid.rss It lists all of them with links.

Re: Formal review of dtoh

2015-03-24 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 19 March 2015 at 11:51:59 UTC, John Colvin wrote: Adam, have you considered sprucing this up for review? Not possible right now, my schedule is already overloaded (I'm working two full-time jobs in addition to a variety of little things). I'm also not really up with all the rec

Re: Where's "This week in D?"

2015-03-24 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 23 March 2015 at 21:28:27 UTC, Andrei Alexandrescu wrote: No issue for the past week? -- Andrei I forgot to post it online this Sunday. Really, I need to move these to Saturday, Sundays are just packed full of non-computer time for me. http://arsdnet.net/this-week-in-d/mar-22.htm

Re: I like D

2015-03-24 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 24 March 2015 at 18:16:08 UTC, Dicebot wrote: Can be nice entry for weekly D newsletter tips & tricks. Aye, write it up!

Re: Replace core language HexStrings with library entity

2015-03-20 Thread Adam D. Ruppe via Digitalmars-d
On Friday, 20 March 2015 at 16:02:23 UTC, Dicebot wrote: Getting something into Phobos is a huge commitment. And it ties your hands and comes with all kinds of annoying trivial nonsense baggage like spaces vs tabs. I have a hard enough time bringing myself to write small functions for phobo

Re: Replace core language HexStrings with library entity

2015-03-16 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 16 March 2015 at 21:40:25 UTC, Walter Bright wrote: BTW, the motivation for x strings is that dumpers often put out results like this: The nice thing about CTFE is it could literally just use that string and snip out the pieces as needed. I really think users should learn the lang

Re: [OT] HTML: div/iframe hybrid?

2015-02-26 Thread Adam D. Ruppe via Digitalmars-d
I don't think it is a security hole, but websites typically do not get to set their viewport - the window size is under the user's control. (one of the few things they have left under the user's control!) So if you told a site to set its own size... it wouldn't really know what that is most t

Re: [OT] HTML: div/iframe hybrid?

2015-02-25 Thread Adam D. Ruppe via Digitalmars-d
Not that I know of. The way I do it is to set a static height in the css based on what I expect should be good enough, then do javascript to resize. There's a newish postMessage function that works pretty well for it. It is a pity you still can't get it to automatically size though, I'd use t

Re: Memory safety depends entirely on GC ?

2015-02-23 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 23 February 2015 at 18:16:38 UTC, Andrei Alexandrescu wrote: The typechecker must WHILE COMPILING WIDGET, NOT ITS CLIENT know whether getName() is okay or not. Aye, I haven't been following this thread closely, but I thought of this case a while ago myself and it actually led me to

<    5   6   7   8   9   10   11   12   13   >