Re: Custom Exponents

2013-12-14 Thread Nathan M. Swan
On 12/14/13 8:22 PM, Malkierian wrote: Alright, so I'm trying to do hex string to integer conversion, but I can't for the live of me find how to do exponent calculation in D. Java has a Math.pow() function that allows you to specify the base and the exponent, but all I've seen in D's libraries

Re: Building druntime on MAC OS X

2013-11-15 Thread Nathan M. Swan
On 11/15/13 6:19 PM, Andrew Edwards wrote: I am having little problem building druntime on Mac OS X 10.9 (Mavericks) and am wondering if anyone has experienced with this and some guidance on how to fix it. Here is my command: make -f posix.mak install DMD=../install/bin/dmd And here is the

Re: dub: should we make it the de jure package manager for D?

2013-09-10 Thread Nathan M. Swan
On Tuesday, 10 September 2013 at 20:48:58 UTC, Andrei Alexandrescu wrote: We've been experimenting with http://code.dlang.org for a while and things are going well. In particular Sönke has been very active about maintaining and improving it, which brings further confidence in the future of the

Re: How do you guys debug large programs?

2013-05-28 Thread Nathan M. Swan
On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote: This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working

Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets

2013-05-13 Thread Nathan M. Swan
On Sunday, 12 May 2013 at 21:16:33 UTC, Nick Sabalausky wrote: There is need for mysql-native https://github.com/rejectedsoftware/mysql-native to support both Vibe.d's sockets and Phobos sockets. Since Phobos's and Vibe.d's sockets have incompatible APIs, my design converts most of the types

Re: dtutor.org: a call to action

2013-05-05 Thread Nathan M. Swan
On Sunday, 5 May 2013 at 19:37:02 UTC, Tyro[17] wrote: The main contributors of D are doing a wonderful job of enhancing the language. I can confidently say that we are leagues ahead of where we stood a just two years ago. But there has been a long cry for documentation that has gone

Re: dtutor.org: a call to action

2013-05-05 Thread Nathan M. Swan
On Sunday, 5 May 2013 at 22:06:17 UTC, Nathan M. Swan wrote: On Sunday, 5 May 2013 at 19:37:02 UTC, Tyro[17] wrote: The main contributors of D are doing a wonderful job of enhancing the language. I can confidently say that we are leagues ahead of where we stood a just two years ago

Re: dtutor.org: a call to action

2013-05-05 Thread Nathan M. Swan
On Sunday, 5 May 2013 at 20:27:57 UTC, Andrei Alexandrescu wrote: Would be great to showcase a site using runestone (I browsed the README real quick without finding one). interactivepython.org

embd 0.1.0 - embedded D

2013-03-06 Thread Nathan M. Swan
Announcing the release of embd, a low-level (i.e. small) API for embedding D code into text: https://github.com/carlor/embd It's a bit of an inconvenient API, but it's customizable and gives the client control in what gets passed to the template. I hope some of you find it useful! NMS

Re: embd 0.1.0 - embedded D

2013-03-06 Thread Nathan M. Swan
On Wednesday, 6 March 2013 at 11:29:51 UTC, Sönke Ludwig wrote: Am 06.03.2013 10:08, schrieb Nathan M. Swan: Announcing the release of embd, a low-level (i.e. small) API for embedding D code into text: https://github.com/carlor/embd It's a bit of an inconvenient API, but it's customizable

Re: The new std.process is ready for review

2013-02-23 Thread Nathan M. Swan
Jonathan M Davis wrote: On Saturday, February 23, 2013 18:39:10 H. S. Teoh wrote: Alternatively, I would push for renaming the old std.process to something like old.process (or something else), which is much less of a breakage than deleting it from Phobos outright -- existing code just need to

Re: vibe.d 0.7.12 released

2013-02-12 Thread Nathan M. Swan
On Monday, 11 February 2013 at 21:41:33 UTC, Jacob Carlborg wrote: On 2013-02-11 22:07, FG wrote: The problem I have with those is that they are designed for HTML. What if I wanted to make an email template instead? Erb is like a Ruby preprocessor that can be used for any format. It's used

Re: drop html docs from the dmd distribution?

2013-02-03 Thread Nathan M. Swan
On Monday, 4 February 2013 at 00:26:06 UTC, FG wrote: On 2013-02-04 00:58, Walter Bright wrote: They seem rather pointless, considering: 1. them being on the web is better anyway 2. the new pdf version of the spec Theoretically: It's useful, because the docs' version matches the compiler,

Re: @property - take it behind the woodshed and shoot it?

2013-01-24 Thread Nathan M. Swan
On Thursday, 24 January 2013 at 08:35:01 UTC, Walter Bright wrote: This has turned into a monster. We've taken 2 or 3 wrong turns somewhere. Perhaps we should revert to a simple set of rules. 1. Empty parens are optional. If there is an ambiguity with the return value taking (), the () go on

Re: dmd json file output

2013-01-23 Thread Nathan M. Swan
On Wednesday, 23 January 2013 at 20:02:36 UTC, Jacob Carlborg wrote: On 2013-01-23 18:09, Timon Gehr wrote: That still requires at least one of two secondary parsers. Technically yes, but there's already a demangler available in Phobos/druntime. Not every program using the json output

Re: Operator overloading question

2013-01-20 Thread Nathan M. Swan
On Monday, 21 January 2013 at 06:19:47 UTC, Joseph Cassman wrote: Please refer to http://dpaste.dzfl.pl/edit/b73ef2cd The code is contrived but is trying to focus on overloading the + and * operators for a struct. Here is the output. /home/c215/c527.d(36): Error: incompatible types for ((x)

Re: parallel() and random number generation

2013-01-15 Thread Nathan M. Swan
On Monday, 14 January 2013 at 22:24:22 UTC, Joseph Rushton Wakeling wrote: Hello all, One of the claims made for pseudo-random number generation in D is that rndGen (default RNG) is thread-safe, that is, each instance is unique to its thread and is seeded with unpredictableSeed, which should

Proposal: DPM, the D Package Manager

2013-01-02 Thread Nathan M. Swan
Here's my proposal for a D Package Manager. I want to make sure it has a good design before I write any code, so here it is: http://wiki.dlang.org/User:Nathan_M._Swan/DPM_Proposal I know there are many gaps in this, I want to see which are the most important to fill. I plan to make a

Re: Better forum

2012-12-06 Thread Nathan M. Swan
On Thursday, 6 December 2012 at 18:55:19 UTC, Andrei Alexandrescu wrote: On 12/6/12 1:47 PM, Nick Sabalausky wrote: This one isn't. Neither is Vibe.d's: http://news.rejectedsoftware.com What do they use? Andrei Vibenews, kinda like this forum:

Re: MS ODBC encoding issue

2012-12-04 Thread Nathan M. Swan
On Tuesday, 4 December 2012 at 07:59:40 UTC, Sam Hu wrote: Greetings! Any help would be much appreicated in advance as I've really struggled for quite long time! I wrote a class wrapper for MS ODBC Access database.When I try to run query on an Access database file,all fields contains

Re: dmd demangling

2012-11-22 Thread Nathan M. Swan
On Thursday, 22 November 2012 at 08:00:41 UTC, Brad Roberts wrote: On 11/21/2012 10:36 PM, Nathan M. Swan wrote: We can't post to dmd-internals anymore, so I assume I should post here. Um... what? The list hasn't changed configs since it was setup. Anyone can subscribe, all new members go

dmd demangling

2012-11-21 Thread Nathan M. Swan
We can't post to dmd-internals anymore, so I assume I should post here. Is there any demangle function in the dmd code, or should I write my own? (I'm working on automatic demangling for linker error messages) Thanks, Nathan M. Swan

Re: Bulding latest DMD and associated projects from github master

2012-11-19 Thread Nathan M. Swan
On Monday, 19 November 2012 at 00:40:10 UTC, Rob T wrote: First I cloned everything from github master, and that went well but I'm now encountering a lot of silly stumbling blocks due to inadequate documentation, for example it's clear how to build anything - period. There may be

Re: UDAs - Restrict to User Defined Types?

2012-11-08 Thread Nathan M. Swan
On Wednesday, 7 November 2012 at 23:18:41 UTC, Walter Bright wrote: Started a new thread on this. On 11/7/2012 3:05 AM, Leandro Lucarella wrote: OK, that's another thing. And maybe a reason for listening to people having more experience with UDAs than you. For me the analogy with Exceptions

Re: deprecate deprecated?

2012-11-07 Thread Nathan M. Swan
On 11/06/2012 10:03 PM, monarch_dodra wrote: On Tuesday, 6 November 2012 at 23:56:13 UTC, Walter Bright wrote: I know there's been some long term unhappiness about the deprecated attribute - it's all-or-nothing approach, poor messages, etc. Each change in it changes the language and the

Re: [ ArgumentList ] vs. @( ArgumentList )

2012-11-07 Thread Nathan M. Swan
On 11/06/2012 10:18 AM, Walter Bright wrote: For User Defined Attributes. In the north corner we have the current champon: --- [ ArgumentList ] Pros: precedent with C# looks nice Cons: not so greppable parsing ambiguity with [array literal].func(); -- In the

Re: Multidimensional slicing

2012-10-25 Thread Nathan M. Swan
), where n is the number of links. The slicing of a[i] is O(1). The two associative arrays is probably your best bet, but I'm no expert on this. Hope it helps, Nathan M. Swan

Linking with phobos on compiled dmd, osx 64bit

2012-10-10 Thread Nathan M. Swan
Hello all! I've been hacking on dmd, and something hasn't been working. This is how I compile it: cd dmd/src make -f posix.mak cd ../../druntime make -f posix.mak cd ../phobos make -f posix.mak MODEL=64 cp generated/osx/release/64/libphobos2.a /usr/local/lib/

Re: is array an InputRange?

2012-10-05 Thread Nathan M. Swan
On Friday, 5 October 2012 at 13:39:56 UTC, ref2401 wrote: import std.range; int[] numbers = [1, 3, 5, 7, 9, 11]; auto rangeObject = inputRangeObject(numbers); auto inputRange = cast(InputRange!(int[]))rangeObject; why does 'inputRange' equal null? Suggested reading:

Re: classes structs

2012-09-19 Thread Nathan M. Swan
On Thursday, 20 September 2012 at 01:42:26 UTC, David Currie wrote: On Tuesday, 18 September 2012 at 18:42:33 UTC, Timon Gehr wrote: On 09/18/2012 07:07 AM, David Currie wrote: [ALL CAPS] It does not matter who is the loudest guy in the room. If you have a point to make, just make it.

Re: Running unittests in a D library

2012-09-19 Thread Nathan M. Swan
On Wednesday, 19 September 2012 at 18:49:12 UTC, Chris Molozian wrote: Hey all, I'm sure that this is a rather daft question but I've tried to search the d.learn mailing list and must have missed a question about it. I've read the unit testing documentation on dlang.org and I know that

Re: GC vs. Manual Memory Management Real World Comparison

2012-09-05 Thread Nathan M. Swan
On Wednesday, 5 September 2012 at 11:03:03 UTC, Benjamin Thaut wrote: I rewrote a 3d game I created during my studies with D 2.0 to manual memory mangement. If I'm not studying I'm working in the 3d Engine deparement of Havok. As I needed to pratice manual memory management and did want to get

Re: The best programming advice I ever got

2012-08-29 Thread Nathan M. Swan
On Wednesday, 29 August 2012 at 14:53:39 UTC, Andrei Alexandrescu wrote: Not directly related to D, but hopefully a hook :o). http://www.informit.com/articles/article.aspx?p=1945828 Andrei Great article. Learning to learn is really what distinguishes vocational training from true

Re: best practices tutorial needed (for function signature, class vs struct, etc)

2012-08-29 Thread Nathan M. Swan
On Saturday, 25 August 2012 at 20:37:27 UTC, timotheecour wrote: Is there a best practices page on this site to use as reference for those FAQ, that AFAIK are not in the docs: * when to use class vs struct (eg

Re: Consistency, Templates, Constructors, and D3

2012-08-24 Thread Nathan M. Swan
On Friday, 24 August 2012 at 05:14:39 UTC, F i L wrote: We replace it with special factory functions. Example: class Person { string name; uint age; this new(string n, uint a) { name = n; age = a; } } void main() { auto philip =

Re: Exception programming difficult

2012-08-13 Thread Nathan M. Swan
On Sunday, 12 August 2012 at 03:02:50 UTC, Marco Leise wrote: I just got a bit frustrated and wanted to say that I like working with Exceptions in Java a lot more. I don't. When writing a simple command line program, when there's an error, it usually means the user messed up and I can't

Re: Exception programming difficult

2012-08-13 Thread Nathan M. Swan
On Monday, 13 August 2012 at 10:02:23 UTC, Marco Leise wrote: Thoughts ? I like this idea - you can use checked exceptions, but you aren't forced. Though I think private and free functions should by default just use @throws(Exception). Not using @throws is like saying I don't pay

Re: Convert little imperative code to functional coding style

2012-08-10 Thread Nathan M. Swan
On Friday, 10 August 2012 at 18:26:56 UTC, Timon Gehr wrote: Is this what you are looking for? import std.stdio; import std.range: iota; import std.algorithm: map, filter, joiner; import std.typecons : tuple; import std.math : sqrt, floor; void main(){ immutable

Re: What would need to be done to get sdc.lexer to std.lexer quality?

2012-08-03 Thread Nathan M. Swan
On Thursday, 2 August 2012 at 07:22:57 UTC, Bernard Helyer wrote: Gonna spend some time massaging this into a Walter-Approved (tm) lexer. It's got some ways to go. Are there any specific ways I could help? NMS

Type safety + auto = win!

2012-07-27 Thread Nathan M. Swan
A story: Playing around with functional programming, I started trying to implement interesting functions in Lisp. It all went well until permute, a function which isn't that complicated but involves lists, lists of lists, and lists of lists of lists. This was so confusing and complicated

Re: Chaining a dynamic number of Ranges

2012-07-21 Thread Nathan M. Swan
On Saturday, 21 July 2012 at 16:42:50 UTC, Enerqi wrote: Hello I'm playing around with my first D program and can't figure out a way to chain a dynamic number of ranges. In this example I'm trying to chain a two dimensional array into effectively a one dimensional array, so I can later sort

Re: reference to 'self' inside a function

2012-07-20 Thread Nathan M. Swan
On Tuesday, 17 July 2012 at 16:56:17 UTC, angel wrote: I propose to introduce a reference to the current function, much like 'this' in a class method. Call it 'self' or 'thisFunc', or whatever ... What might this be good for ? For implementing recursion in a lambda function. Writing in

Re: Concurrency in D

2012-06-27 Thread Nathan M. Swan
On Wednesday, 27 June 2012 at 22:34:51 UTC, Minas Mina wrote: I have been playing latetly with std.concurrency and core.thread. I like both, but they are entirely different approaches to concurrency. Aren't they great? ;) std.concurrency: Uses message passing. Does not allow passing of

Re: Template Interface

2012-06-13 Thread Nathan M. Swan
On Wednesday, 13 June 2012 at 13:34:25 UTC, Nick Treleaven wrote: On 12/06/2012 18:56, Nathan M. Swan wrote: When writing a generic function which takes an unknown type, the signature is written like so: void fun(L)(L l) if (isList!L); While writing a generic interface is written like so

Template Interface

2012-06-12 Thread Nathan M. Swan
When writing a generic function which takes an unknown type, the signature is written like so: void fun(L)(L l) if (isList!L); While writing a generic interface is written like so: template isList(L) { enum bool isList = is(typeof( (inout int _dummy=0) { L l; if

Re: Code-File structure

2012-06-12 Thread Nathan M. Swan
On Tuesday, 12 June 2012 at 07:04:15 UTC, Henrik Valter Vogelius Hansson wrote: Hi! I'm new to D and trying everything out. Got the basics down which are very straightforward and similar to other languages. My professional background is primarily in C/C++-variants and Ruby if it helps. I

Re: Array Concatenate

2012-06-08 Thread Nathan M. Swan
On Friday, 8 June 2012 at 12:41:13 UTC, Paul wrote: If this works... D programming book section 4.1.9 Expanding auto a = [87, 40, 10]; a ~= 42; assert(a== [87, 40, 10, 42]); why doesnt' this work? DeletedBlks ~= matchOld[0]; the dmd compiler comes back with Error: cannot append type string

Re: mutable reference pointer

2012-06-06 Thread Nathan M. Swan
On Wednesday, 6 June 2012 at 11:45:34 UTC, Gor Gyolchanyan wrote: I had this idea for a long time now and was trying to find a reason why it was a bad idea. I failed to find that reason, so here it is: The idea is to have a mutable reference: int a; // This is a mutable reference (essentially

Re: More synchronized ideas

2012-06-05 Thread Nathan M. Swan
On Tuesday, 5 June 2012 at 05:14:36 UTC, Nathan M. Swan wrote: On Monday, 4 June 2012 at 11:17:45 UTC, Michel Fortin wrote: After trying to make sense of the thread synchronized (this[.classinfo]) in druntime and phobos, I had to write my opinion on all this somewhere that wouldn't

Re: More synchronized ideas

2012-06-04 Thread Nathan M. Swan
On Monday, 4 June 2012 at 11:17:45 UTC, Michel Fortin wrote: After trying to make sense of the thread synchronized (this[.classinfo]) in druntime and phobos, I had to write my opinion on all this somewhere that wouldn't be instantly lost in a bazilion of posts. It turned out into something

Re: synchronized (this[.classinfo]) in druntime and phobos

2012-05-28 Thread Nathan M. Swan
On Monday, 28 May 2012 at 23:55:04 UTC, Alex Rønne Petersen wrote: On 29-05-2012 01:46, Jonathan M Davis wrote: On Tuesday, May 29, 2012 01:38:25 Alex Rønne Petersen wrote: I should probably add that Java learned it long ago, and yet we adopted it anyway... blergh. The lesson learned from

Re: Simplified socket creation and handling

2012-05-21 Thread Nathan M. Swan
On Monday, 21 May 2012 at 17:54:56 UTC, Adam D. Ruppe wrote: On Saturday, 19 May 2012 at 20:33:49 UTC, Nathan M. Swan wrote: It has some pitfalls (e.g. I can't find a good way to stop the server) When I use it, I just leave it open in a terminal window. Control+C can then kill it. (I'm

Re: std.concurrency.send

2012-05-20 Thread Nathan M. Swan
On Sunday, 20 May 2012 at 04:09:50 UTC, japplegame wrote: public: void startLogger(LogConstructorArgs args) { loggerTid = spawn(loggerThread, args); } void log(string msg, OtherOptions oo) { loggerTid.send(LogMsg(msg, oo)); } void stopLogger() { loggerTid.send(QuitMsg()); } private:

Re: std.concurrency.send

2012-05-19 Thread Nathan M. Swan
On Saturday, 19 May 2012 at 13:26:20 UTC, japplegame wrote: Multithreading in D confuses me more and more. import std.concurrency; import std.stdio; shared Tid tid; void main() { send(cast(Tid)tid, Hello, World); } void worker() { writeln(receiveOnly!string); } shared static this() { tid

Re: Simplified socket creation and handling

2012-05-19 Thread Nathan M. Swan
On Friday, 18 May 2012 at 06:35:59 UTC, Jarl André wrote: I am a Java developer who is tired of java.nio and similar complex socket libraries. In Java you got QuickServer, the ultimate protocol creation centered socket library. You don't have to write any channels and readers and what not.

Re: std.concurrency.send

2012-05-19 Thread Nathan M. Swan
On Saturday, 19 May 2012 at 21:13:14 UTC, japplegame wrote: You don't need to mark Tids as shared. Okay. I'm writting logger. Logger is global object and it is running in its own separate thread (for example, writting logs to remote database). My application has several threads and all of

Re: deprecating std.stream, std.cstream, std.socketstream

2012-05-15 Thread Nathan M. Swan
On Monday, 14 May 2012 at 15:02:11 UTC, Steven Schveighoffer wrote: In other words, a stream of bytes, not a good range (who wants to get one byte at a time?). A stream of UTF text broken into lines, a very good range. There are several cases where one would want one byte at the time; e.g.

Re: deprecating std.stream, std.cstream, std.socketstream

2012-05-13 Thread Nathan M. Swan
On Sunday, 13 May 2012 at 21:39:07 UTC, Walter Bright wrote: 4. they should present a range interface, not a streaming one I was just about to make a post suggesting that! You could easily integrate std.io with std.algorithm to do some pretty cool things. NMS

Re: What library functionality would you most like to see in D?

2012-05-10 Thread Nathan M. Swan
On Thursday, 10 May 2012 at 19:11:48 UTC, sclytrack wrote: I want to see the following library feature the most. apt-get install d-library-name Or even better: a D packaging system

Re: Notice/Warning on narrowStrings .length

2012-04-27 Thread Nathan M. Swan
On Friday, 27 April 2012 at 06:12:01 UTC, H. S. Teoh wrote: On Thu, Apr 26, 2012 at 09:55:54PM -0400, Nick Sabalausky wrote: [...] Crazy stuff! Some of them look rather similar to Arabic or Korean's Hangul (sp?), at least to my untrained eye. And then others are just *really*

Re: What to do about default function arguments

2012-04-25 Thread Nathan M. Swan
On Thursday, 26 April 2012 at 03:44:27 UTC, Walter Bright wrote: A subtle but nasty problem - are default arguments part of the type, or part of the declaration? See http://d.puremagic.com/issues/show_bug.cgi?id=3866 Currently, they are both, which leads to the nasty behavior in the bug

[Kinda OT] httpd permissions

2012-04-25 Thread Nathan M. Swan
How do I deal with this (on OSX); are CGI programs not allowed to write to files? How to change this? Thanks, NMS test.d: #!/usr/local/bin/rdmd import std.stdio; void main() { writeln(Content-type: text/plain\r\n\r\nHello, World!); } error log: [Wed Apr 25 00:03:01 2012] [error]

Re: [Kinda OT] httpd permissions

2012-04-25 Thread Nathan M. Swan
Have you checked that your web server has write access to /Users/nathanmswan/Sites/ ? Yes, it works now, thanks! NMS P.S. Sorry this might be in the wrong forum, but now I can advertise my homepage as index.d instead of compiling it and having it be index.cgi

Re: Pointer to variables in D

2012-04-25 Thread Nathan M. Swan
On Thursday, 26 April 2012 at 02:43:35 UTC, Victor Vicente de Carvalho wrote: Hi there, In c++ one can access a pointer to a class/struct variable using this semantic: struct C { int x; }; int C::* ptr = C::x; C foo; foo.*ptr = 10; assert(foo.x == 10); It is possible to do something

Re: XSort - Sorting algorithms (including Timsort!)

2012-04-11 Thread Nathan M. Swan
On Thursday, 12 April 2012 at 03:04:49 UTC, Xinok wrote: I just wanted to share this. I started a project a few weeks ago on Github to implement several sorting algorithms in D. In total, there are 8 modules at the moment, each implementing a sorting algorithm or combination thereof.

Re: An idea to improve eponymous templates

2012-04-11 Thread Nathan M. Swan
On Thursday, 12 April 2012 at 02:21:46 UTC, Reid Levenick wrote: Firstly, I had no idea where suggestions should go, and I saw a few others here and thus here I am. I was writing some code that depended heavily on my own eponymous templates, and decided to change the names of some of them to

Encodings

2012-04-08 Thread Nathan M. Swan
For most of the string processing I do, I read/write text in UTF-8 and convert it to UTF-32 for processing (with std.utf), so I don't have to worry about encoding. Is this a good or bad paradigm? Is there a better way to do this? What method do all of you use? Just curious, NMS

deimos libX11 not compiling

2012-04-08 Thread Nathan M. Swan
I'm not sure if I would post this here, but: https://github.com/D-Programming-Deimos/libX11/issues/7

Re: UFCS for D

2012-03-30 Thread Nathan M. Swan
On Thursday, 29 March 2012 at 00:21:38 UTC, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/rif9x/uniform_function_call_syntax_for_the_d/ Andrei The primitives/utility distinction is an idea I've thought about a lot. UFCS is justifiable not only as a syntactic

structs, tids, and concurrency.

2012-03-30 Thread Nathan M. Swan
Nesting a Tid in a struct is interpreted as having local aliasing, though a bare Tid is not. This doesn't work, though commenting out receiveOnly!S() and tid.send(S(thisTid)) works: - import std.stdio; import std.concurrency; void main() { auto thread = spawn(function void(Tid tid)

Re: Documentation Layout

2012-03-28 Thread Nathan M. Swan
On Wednesday, 28 March 2012 at 14:47:53 UTC, Adam D. Ruppe wrote: On Wednesday, 28 March 2012 at 06:20:57 UTC, James Miller wrote: 1. The Jump To index. I did a little program called improveddoc that builds nicer tables: http://arsdnet.net/d-web-site/improveddoc.d makes:

Re: Documentation Layout

2012-03-28 Thread Nathan M. Swan
On Wednesday, 28 March 2012 at 22:43:19 UTC, foobar wrote: Categories - worst idea ever. What's better: int a; // this is size OR int size; Same thing applies here - code MUST be self documenting as much as possible. But categories are still useful, e.g., when you want a function in

Re: Issue 3789, stucts equality

2012-03-27 Thread Nathan M. Swan
On Monday, 26 March 2012 at 21:25:06 UTC, Alvaro wrote: Maybe it makes more sense that struct==struct applies == to each of its fields. It would be the same as bitwise comparison for simple primitive types, but would be more useful with other types such as strings. +1

Re: dcaflib

2012-03-26 Thread Nathan M. Swan
On Monday, 26 March 2012 at 13:56:46 UTC, Dejan Lekic wrote: Nathan, what terminals are supported? Only ANSI / VT* or some other types of terminals as well? I've only tested it on OSX Terminal, but I read about the features on a Linux website, and have used the ANSI escape code Wikipedia

Re: Proposal for a MessageQueue (was Re: public MessageBox)

2012-03-23 Thread Nathan M. Swan
On Friday, 23 March 2012 at 12:36:42 UTC, David Nadlinger wrote: Are you trying to build std.concurrency from Git master against Phobos 2.058 or something like that? David I cloned from git://github.com/D-Programming-Language/phobos.git NMS

Re: Proposal for a MessageQueue (was Re: public MessageBox)

2012-03-22 Thread Nathan M. Swan
On Thursday, 22 March 2012 at 15:53:56 UTC, Sean Kelly wrote: I can see adapting the API so that each thread has a default message queue (keep in mind that we'll be adding interprocess messaging at some point via the same routines). I'm not yet clear how the existence of alternate message

Re: Proposal for a MessageQueue (was Re: public MessageBox)

2012-03-22 Thread Nathan M. Swan
On Thursday, 22 March 2012 at 21:27:40 UTC, Sean Kelly wrote: On Mar 22, 2012, at 12:06 PM, Nathan M. Swan nathanms...@gmail.com wrote: On Thursday, 22 March 2012 at 15:53:56 UTC, Sean Kelly wrote: I can see adapting the API so that each thread has a default message queue (keep in mind

Re: Proposal for a MessageQueue (was Re: public MessageBox)

2012-03-22 Thread Nathan M. Swan
On Friday, 23 March 2012 at 00:14:00 UTC, Sean Kelly wrote: While sending messages like a bare string might be good for example code, any real application is going to use structured messages whose type is specific to what the message is for, contains fields like sender Tid, etc. It seems like

Re: public MessageBox

2012-03-21 Thread Nathan M. Swan
On Wednesday, 21 March 2012 at 19:53:55 UTC, Sean Kelly wrote: On Mar 20, 2012, at 8:37 PM, Nathan M. Swan wrote: After playing around with making a library with uses threads, I realized it would be nice if there could be multiple inter-thread mailboxes than just one per thread. That way

Proposal for a MessageQueue (was Re: public MessageBox)

2012-03-21 Thread Nathan M. Swan
On Wednesday, 21 March 2012 at 03:37:35 UTC, Nathan M. Swan wrote: After playing around with making a library with uses threads, I realized it would be nice if there could be multiple inter-thread mailboxes than just one per thread. That way, client code and third-party library code don't

public MessageBox

2012-03-20 Thread Nathan M. Swan
After playing around with making a library with uses threads, I realized it would be nice if there could be multiple inter-thread mailboxes than just one per thread. That way, client code and third-party library code don't interfere with each other. So this is my proposal: that

dcaflib

2012-03-16 Thread Nathan M. Swan
In a post from a few weeks ago, someone mentioned terminal colors. Currently, I have one that works with bash (cmd pending) at https://github.com/carlor/dcaflib. Example code: import dcaflib.ui.terminal; import std.stdio; void main() { fgColor = TermColor.RED; writeln(this is red!);

Re: comma inside is expression

2012-03-14 Thread Nathan M. Swan
On Thursday, 15 March 2012 at 02:34:45 UTC, Jos van Uden wrote: I've been reading the tutorial on templates and found this example: template rank(T) { static if (is(T t == U[], U)) // is T an array of U, for some type U? enum rank = 1 + rank!(U); // then let’s recurse down.

Re: dereferencing null

2012-03-05 Thread Nathan M. Swan
On Friday, 2 March 2012 at 04:53:02 UTC, Jonathan M Davis wrote: It's defined. The operating system protects you. You get a segfault on *nix and an access violation on Windows. Walter's take on it is that there is no point in checking for what the operating system is already checking for -

Re: dereferencing null

2012-03-05 Thread Nathan M. Swan
On Tuesday, 6 March 2012 at 06:27:31 UTC, Jonathan M Davis wrote: scope(failure) is _not_ guaranteed to always execute on failure. It is _only_ guaranteed to run when an Exception is thrown. Any other Throwable - Errors included - skip all finally blocks, scope statements, and destructors.

Re: dereferencing null

2012-03-04 Thread Nathan M. Swan
On Saturday, 3 March 2012 at 02:51:41 UTC, Walter Bright wrote: Adding in software checks for null pointers will dramatically slow things down. What about the debug/release difference? Isn't the point of debug mode to allow checks such as assert, RangeError, etc? Segmentation fault: 11

dereferencing null

2012-03-01 Thread Nathan M. Swan
Am I correct that trying to use an Object null results in undefined behavior? Object o = null; o.opCmp(new Object); // segmentation fault on my OSX machine This seems a bit non-D-ish to me, as other bugs like this throw Errors (e.g. RangeError). It would be nice if it would throw a

in not working with enum'd AA

2012-02-27 Thread Nathan M. Swan
I don't think this should happen: private enum KeywordsToTypes = [ importd: TT.KwIMPORT, publicd: TT.KwPUBLIC, protectedd : TT.KwPROTECTED, privated : TT.KwPRIVATE, staticd: TT.KwSTATIC, ]; static this() {

Re: in not working with enum'd AA

2012-02-27 Thread Nathan M. Swan
On Monday, 27 February 2012 at 09:13:24 UTC, Jonathan M Davis wrote: It would be far better to use immutable. - Jonathan M Davis That doesn't work either, as it says: Error: non-constant expression

Re: The Right Approach to Exceptions

2012-02-18 Thread Nathan M. Swan
On Saturday, 18 February 2012 at 18:52:05 UTC, Andrei Alexandrescu wrote: There's a discussion that started in a pull request: https://github.com/alexrp/phobos/commit/4b87dcf39efeb4ddafe8fe99a0ef9a529c0dcaca Let's come up with a good doctrine for exception defining and handling in Phobos.

Immutability, problems with debugging

2012-02-17 Thread Nathan M. Swan
I'm working on a novice solver of the travelling salesman problem, and when I decided to go concurrent I had to make everything immutable. Now this happens: /usr/share/dmd/src/phobos/std/format.d(1782): Error: function object.Object.toString () is not callable using argument types ()

Immutability, problems with debugging

2012-02-17 Thread Nathan M. Swan
I'm working on a novice solver of the travelling salesman problem, and when I decided to go concurrent I had to make everything immutable. Now this happens: /usr/share/dmd/src/phobos/std/format.d(1782): Error: function object.Object.toString () is not callable using argument types ()

Re: Immutability, problems with debugging

2012-02-17 Thread Nathan M. Swan
On Friday, 17 February 2012 at 10:49:19 UTC, Nathan M. Swan wrote: I'm working on a novice solver of the travelling salesman problem, and when I decided to go concurrent I had to make everything immutable. Now this happens: /usr/share/dmd/src/phobos/std/format.d(1782): Error: function

The website structure

2012-02-16 Thread Nathan M. Swan
I want to create a fork of the website GitHub respiratory with a modified sidebar, but I don't see where I could do that. Thanks, NMS

Re: [RFC] Ini parser

2012-02-16 Thread Nathan M. Swan
On Thursday, 16 February 2012 at 20:50:23 UTC, Robik wrote: Feel free to share suggestions, changes, help me make it better :). It's great, I think I could find uses for it. One thing that confuses me about the implementation is that the IniSection has an array of key-value pairs. I think

Message-Passing

2012-01-19 Thread Nathan M. Swan
I want to applaud Sean Kelly and everyone who worked on std.concurrency for a great API, and wish that I could easily write Cocoa applications with it. I'm writing a screen recording program in Objective-C, and to make sure each frame has an equal length, I have two threads: one that takes