Re: Compile/link Win64

2014-01-15 Thread Nick Sabalausky
On 1/12/2014 5:37 PM, Erik van Velzen wrote: On Friday, 10 January 2014 at 21:47:23 UTC, Nick Sabalausky wrote: Hmm, I hadn't ever uninstalled it. Regardless, *now* I've just uninstalled and reinstalled the Windows SDK, and re-ran vcvarsall.bat. The %WindowsSdkDir% is now set, but I'm still

Compile/link Win64

2014-01-10 Thread Nick Sabalausky
I never seem to be able to remember how to get 64-bit going on windows. I've extracted the zip for DMD 2.064.2, I ran the vcvarsall.bat, but trying to compile this trivial hello world: import std.stdio; void main() { writeln(Hello); } [path_to]dmd.2.064.2\dmd2\windows\bin\dmd -m64

Re: Compile/link Win64

2014-01-10 Thread Nick Sabalausky
On 1/10/2014 3:06 PM, Vladimir Panteleev wrote: On Friday, 10 January 2014 at 20:02:49 UTC, Nick Sabalausky wrote: LINK : fatal error LNK1104: cannot open file 'shell32.lib' What are your LIB and LIBPATH environment variables set to? echo %LIB% C:\Program Files (x86)\Microsoft Visual Studio

Re: Compile/link Win64

2014-01-10 Thread Nick Sabalausky
On 1/10/2014 3:19 PM, Brad Anderson wrote: I don't have VC2008 so I unfortunately could not test while I was working on the installer/sc.ini update. Rainer says 2008 does work though. With modern VC there is a vcvars32.bat and vcvars64.bat to choose whether to use the 32-bit or 64-bit

Re: Compile/link Win64

2014-01-10 Thread Nick Sabalausky
On 1/10/2014 3:26 PM, Nick Sabalausky wrote: On 1/10/2014 3:19 PM, Brad Anderson wrote: I don't have VC2008 so I unfortunately could not test while I was working on the installer/sc.ini update. Rainer says 2008 does work though. With modern VC there is a vcvars32.bat and vcvars64.bat to choose

Re: Compile/link Win64

2014-01-10 Thread Nick Sabalausky
On 1/10/2014 3:56 PM, Rainer Schuetze wrote: On 10.01.2014 21:34, Nick Sabalausky wrote: On 1/10/2014 3:26 PM, Nick Sabalausky wrote: On 1/10/2014 3:19 PM, Brad Anderson wrote: I don't have VC2008 so I unfortunately could not test while I was working on the installer/sc.ini update. Rainer

Re: val.init

2013-10-06 Thread Nick Sabalausky
On Thu, 03 Oct 2013 11:59:05 +0200 Rene Zwanenburg renezwanenb...@gmail.com wrote: struct A { int i = 5; } void main() { writeln(A.init.i); } prints 5. Ahh, ok, I think that's what confused me.

Re: 'pp' for D?

2013-10-01 Thread Nick Sabalausky
On Sun, 29 Sep 2013 16:31:14 +0200 linkrope linkr...@github.com wrote: I want to pretty-print the representation of a value of a generic type T. In Ruby, I would use 'pp': value = 'hello' pp value # prints hello - with quotes! value = 42 pp value # prints 42

val.init

2013-10-01 Thread Nick Sabalausky
I thought variable.init was different from T.init and gave the value of the explicit initializer if one was used. Was I mistaken?: import std.stdio; void main() { int a = 5; writeln(a.init); // Outputs 0, not 5 }

Error building doc's chm

2013-08-24 Thread Nick Sabalausky
Not sure if I'm doing something wrong here, but using DMD 2.063.2 on Win, trying to build the CHM docs like this: git clone https://github.com/D-Programming-Language/druntime.git git clone https://github.com/D-Programming-Language/phobos.git git clone

Re: Win32: How to get the stack trace when compiling with a windows subsystem?

2013-08-18 Thread Nick Sabalausky
On Sun, 18 Aug 2013 16:07:20 +0200 Andrej Mitrovic andrej.mitrov...@gmail.com wrote: catch (Throwable thr) { stderr.writeln(thr.msg); stderr.writeln(thr.msg); // No trace stderr.writeln(thr); // Includes trace However, I'm guessing it probably doesn't solve the other

std.regex not linking on FreeBSD

2013-08-13 Thread Nick Sabalausky
Ok this is kinda weird. On FreeBSD 9.1, DMD 2.063.2, this hello world works fine: # cat hello.d import std.stdio; void main() { writeln(Hello); } # rdmd --force hello.d Hello But this trivial std.regex usage results in a giant stream

Re: std.regex not linking on FreeBSD

2013-08-13 Thread Nick Sabalausky
On Tue, 13 Aug 2013 22:34:11 -0400 Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: But this trivial std.regex usage results in a giant stream of linker errors: # cat testRegex.d import std.regex; void main() { auto r = regex(aaa); } I

Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-12 Thread Nick Sabalausky
On Sun, 11 Aug 2013 22:11:26 +0200 Jacob Carlborg d...@me.com wrote: On 2013-08-11 03:57, Nick Sabalausky wrote: I'm familiar with building DMD/Phobos on linux32/64 (and I assume freebsd is much the same, aside from having to install GNU make), but I know OSX is different in that the 32/64

Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-12 Thread Nick Sabalausky
On Mon, 12 Aug 2013 10:33:24 +0200 Jacob Carlborg d...@me.com wrote: On 2013-08-12 09:33, Nick Sabalausky wrote: Thanks, I was indeed able to compile DMD/phobos on the system (after a lng and surprisingly non-trivial download and install process for xcode/gcc). Oh, really? I guess

Re: Compiling DMD/Phobos on OSX (vs linux)

2013-08-12 Thread Nick Sabalausky
On Mon, 12 Aug 2013 12:11:13 -0400 Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: I see. In that case, the tools's posix.mak needs to be fixed, ideally by generating the executables into a subdirectory instead of tools's root. I'll put together a pull req. https://github.com/D

Compiling DMD/Phobos on OSX (vs linux)

2013-08-10 Thread Nick Sabalausky
I'm familiar with building DMD/Phobos on linux32/64 (and I assume freebsd is much the same, aside from having to install GNU make), but I know OSX is different in that the 32/64-bits bins are combined. I don't have access to a modern OSX machine ATM, but I might have a little bit of time with one

Re: Scope of temporaries as function arguments

2013-06-28 Thread Nick Sabalausky
On Fri, 28 Jun 2013 07:11:05 +0200 Maxim Fomin ma...@maxim-fomin.ru wrote: On Friday, 28 June 2013 at 04:54:56 UTC, Nick Sabalausky wrote: Probably a silly question, but I wanted to double-check... If you have this: struct Foo {...} bar(Foo()); Then regardless

Scope of temporaries as function arguments

2013-06-27 Thread Nick Sabalausky
Probably a silly question, but I wanted to double-check... If you have this: struct Foo {...} bar(Foo()); Then regardless of optimizations (aside from any optimizer bugs, of course) the Foo temporary can't go out of scope or have its dtor called until bar finishes executing, right? Or

Linking etc.c.sqlite3 on Win32

2013-05-25 Thread Nick Sabalausky
Ok, uhhh...How do I do it? I did already grab http://www.sqlite.org/2013/sqlite-dll-win32-x86-3071700.zip which contains sqlite3.dll and sqlite3.def, FWIW.

Re: Linking etc.c.sqlite3 on Win32

2013-05-25 Thread Nick Sabalausky
On Sun, 26 May 2013 00:03:01 +0200 Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On 5/25/13, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: Ok, uhhh...How do I do it? Never used sqlite, but for implicit linking you need an import library which you then just pass to DMD

Simple delete directory tree?

2013-04-26 Thread Nick Sabalausky
Does phobos have a simple way to delete a directory tree? std.file.rmdir(path) and std.file.remove(path) don't seem to do it.

Re: Simple delete directory tree?

2013-04-26 Thread Nick Sabalausky
On Fri, 26 Apr 2013 22:55:36 +0200 Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On Friday, 26 April 2013 at 20:54:41 UTC, Nick Sabalausky wrote: Does phobos have a simple way to delete a directory tree? std.file.rmdir(path) and std.file.remove(path) don't seem to do it. Try

Re: Simple delete directory tree?

2013-04-26 Thread Nick Sabalausky
On Fri, 26 Apr 2013 23:15:20 +0200 Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On 4/26/13, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: I don't know how I managed to overlook that! Thanks :) I'd actually prefer if it was an enum or some other default parameter

Re: Simple delete directory tree?

2013-04-26 Thread Nick Sabalausky
On Fri, 26 Apr 2013 17:01:43 -0400 Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: On Fri, 26 Apr 2013 22:55:36 +0200 Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On Friday, 26 April 2013 at 20:54:41 UTC, Nick Sabalausky wrote: Does phobos have a simple way to delete

Vararg-templated class with matching member func

2013-04-06 Thread Nick Sabalausky
I have a feeling I'm missing something obvious, but how do I create something like this?: class Foo(TArgs...) { void func(/+ args must exactly match TArgs +/) { } } new Foo(int).func(5); // Ok new Foo(int, string).func(5, hello); // Ok // Error! Overload not found! new

Re: Vararg-templated class with matching member func

2013-04-06 Thread Nick Sabalausky
On Sun, 07 Apr 2013 01:53:34 +0200 bearophile bearophileh...@lycos.com wrote: Nick Sabalausky: I have a feeling I'm missing something obvious, but how do I create something like this?: class Foo(TArgs...) { void func(/+ args must exactly match TArgs

get size of class instance (not reference)?

2013-02-25 Thread Nick Sabalausky
These just give me the size of a *reference* to the class: class Foo {...} Foo.sizeof typeid(Foo).tsize How can I get the size of a non-subclassed *instance*?

Re: get size of class instance (not reference)?

2013-02-25 Thread Nick Sabalausky
On Tue, 26 Feb 2013 01:54:44 +0100 bearophile bearophileh...@lycos.com wrote: Nick Sabalausky: How can I get the size of a non-subclassed *instance*? Is this enough? http://dlang.org/traits.html#classInstanceSize Ahh, yes, of course. I had a feeling I was overlooking something

goto (outer) case

2013-02-18 Thread Nick Sabalausky
Consider these nested switches: --- enum Foo {a, b} enum Bar {bar} auto foo = Foo.a; auto bar = Bar.bar; final switch(foo) { case Foo.a: final switch(bar) { case Bar.bar: XX break; } break; case Foo.b: break; }

Re: goto (outer) case

2013-02-18 Thread Nick Sabalausky
On Mon, 18 Feb 2013 22:30:48 -0500 Steven Schveighoffer schvei...@yahoo.com wrote: Hm.. wouldn't plain goto work: final switch(foo) { case Foo.a: final switch(bar) { case Bar.bar: goto HORRIBLE_HACK; break; } break; case Foo.b:

Can remove AA elements during foreach?

2013-02-16 Thread Nick Sabalausky
Is this both legal and safe?: foreach(key; assocArray) if(key != foobar) assocArray.remove(foobar); If not, then what about this?: foreach(key; assocArray.byKey()) if(key != foobar) assocArray.remove(foobar);

Re: Can remove AA elements during foreach?

2013-02-16 Thread Nick Sabalausky
On Sat, 16 Feb 2013 16:20:30 -0800 H. S. Teoh hst...@quickfur.ath.cx wrote: On Sat, Feb 16, 2013 at 06:59:59PM -0500, Nick Sabalausky wrote: Is this both legal and safe?: foreach(key; assocArray) if(key != foobar) assocArray.remove(foobar); If not, then what about

Re: AA.clear()?

2013-02-16 Thread Nick Sabalausky
On Sat, 16 Feb 2013 16:58:27 -0800 H. S. Teoh hst...@quickfur.ath.cx wrote: On Sat, Feb 16, 2013 at 07:20:29PM -0500, Nick Sabalausky wrote: Didn't there used to be an AA.clear (maybe a different name?) to clear an assoc array? There doesn't appear to be any mention of it here: http

UFCS opDispatch

2013-01-16 Thread Nick Sabalausky
Unfortunately, opDispatch [silently] takes precedence over UFCS. I don't suppose there's any way to make a UFCS function call override opDispatch without either ditching UFCS or altering/removing the opDispatch itself?

Re: Processes

2013-01-15 Thread Nick Sabalausky
On Sun, 13 Jan 2013 15:01:30 +0100 Tomas butkustomas...@gmail.com wrote: Hey, guys. I need to get all running processes list, and kill one. (example: Find all processes and if skype.exe is running, kill it.) Sounds like a fantastic tool! I'd love to see it when it's done! I might actually

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-13 Thread Nick Sabalausky
On Tue, 13 Nov 2012 11:56:57 +0100 Don Clugston d...@nospam.com wrote: I recommend deskzilla lite. D is on its list of supported open-source projects. It maintains a local copy of the entire bugzilla database, so you're not restricted to the slow and horrible html interface. Awesome! I

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-10 Thread Nick Sabalausky
On Sat, 10 Nov 2012 10:33:39 + (UTC) Manfred Nowak svv1...@hotmail.com wrote: Nick Sabalausky wrote: I really don't see the relevance Please look at the definition of R: struct R { int value; d_list!R Rlist; } If no recursion was wanted the OP should have written

Re: Is there a way to initialize a non-assigned structure declaration (or is it a definition)?

2012-11-10 Thread Nick Sabalausky
On Sat, 10 Nov 2012 00:35:05 +0100 Too Embarrassed To Say khea...@eapl.org wrote: auto p3 = Parameterized!(int, double, bool, char)(57, 7.303, false, 'Z'); // compiles // but not // Parameterized!(int, double, bool, char)(93, 5.694, true, 'K') p4; That's as expected. Variable

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-09 Thread Nick Sabalausky
On Fri, 9 Nov 2012 20:57:42 + (UTC) Manfred Nowak svv1...@hotmail.com wrote: Rob T wrote: What is happening however, is that the templates are not doing what would be expected if the type was introduced manually The expectations might be wrong. With Templates one is able to

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-09 Thread Nick Sabalausky
On Fri, 9 Nov 2012 14:04:26 + (UTC) Manfred Nowak svv1...@hotmail.com wrote: Sorrily no one seems to have recognized this sentence in digitalmars.D.learn:40918: Because `R' can recurse infinitely over `Ancor' a mooring and a way to that mooring is needed. In regex-parlor this

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-09 Thread Nick Sabalausky
On Sat, 10 Nov 2012 06:29:02 +0100 Rob T r...@ucora.com wrote: If anyone is interested, here's my current work-a-round ... // original code that fails ... [...] // modified code that works ... [...] Thanks again for all your help! I've gone ahead and filed a minimized test case,

Re: Recursive data structure using template won't compile

2012-11-08 Thread Nick Sabalausky
On Thu, 08 Nov 2012 07:39:27 +0100 Rob T r...@ucora.com wrote: I want to create a simple recursive data structure as follows: struct R { int value; d_list!R Rlist; } // d-linked list with templated payload struct d_list( T ) { struct node { T payload;

Re: Recursive data structure using template won't compile

2012-11-08 Thread Nick Sabalausky
On Thu, 08 Nov 2012 19:19:52 +0400 Dmitry Olshansky dmitry.o...@gmail.com wrote: 11/8/2012 10:39 AM, Rob T пишет: I want to create a simple recursive data structure as follows: struct R { int value; d_list!R Rlist; } Not possible - you don't know the size of R at this

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-08 Thread Nick Sabalausky
On Thu, 08 Nov 2012 22:46:46 +0100 Rob T r...@ucora.com wrote: So is there a way to retain identical struct types for R by disabling the not-so-useful-in-my-case template recursion? There is no template recursion in your code (you have *exactly* 3 concrete types even after all template

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-08 Thread Nick Sabalausky
On Thu, 08 Nov 2012 23:28:05 +0100 Rob T r...@ucora.com wrote: It could be that the template system simply does not operate as we expect, which IMO would be unfortunate because it will describe a system somewhat unrelated to actual coding (a problem C++ templates are infamous for), or

Re: Compilable Recursive Data Structure ( was: Recursive data structure using template won't compile)

2012-11-08 Thread Nick Sabalausky
On Fri, 9 Nov 2012 01:17:09 + (UTC) Manfred Nowak svv1...@hotmail.com wrote: Nick Sabalausky wrote: ALL 3 types have an exact, FINITE size. There *IS NO RECURSION* here. This conclusion is wrong. Otherwise one can conclude that `s' is not recursing on itself in this code

Interesting C header translation problem

2012-10-30 Thread Nick Sabalausky
Came across this: #ifdef __GNUC__ #define PACKED __attribute__((packed)) #else #define PACKED #endif typedef enum { // Lots o' stuff } PACKED my_enum_t; typedef struct { // Lots o' stuff const void *ptr; } PACKED my_struct_t;

Re: How to place char* of stringZ to ubyte[]?

2012-10-30 Thread Nick Sabalausky
On Mon, 29 Oct 2012 19:50:57 +0100 bearophile bearophileh...@lycos.com wrote: denizzzka: I am trying to send to remote host utf8 text with zero byte at end (required by protocol) What if your UTF8 string coming from D already contains several zeros? If you need to send a string

Callbacks and interfacing with C

2012-10-30 Thread Nick Sabalausky
Ok, a C function pointer like this: struct MyStruct{ int (*foo)(int); }; Translates to D as this: struct MyStruct{ int function(int) foo; } But what about calling conventions? There isn't any int extern(C) function(int) is there? Not sure if that would even make

Re: Interesting C header translation problem

2012-10-30 Thread Nick Sabalausky
On Tue, 30 Oct 2012 11:05:28 +0100 Alex Rønne Petersen a...@lycus.org wrote: On 30-10-2012 10:41, Nick Sabalausky wrote: Came across this: #ifdef __GNUC__ #define PACKED __attribute__((packed)) #else #define PACKED #endif typedef enum

Re: Callbacks and interfacing with C

2012-10-30 Thread Nick Sabalausky
On Tue, 30 Oct 2012 11:15:55 +0100 Alex Rønne Petersen a...@lycus.org wrote: On 30-10-2012 11:13, Nick Sabalausky wrote: Ok, a C function pointer like this: struct MyStruct{ int (*foo)(int); }; Translates to D as this: struct MyStruct{ int

Re: Friends?

2012-10-19 Thread Nick Sabalausky
On Fri, 19 Oct 2012 14:36:59 -0400 Jonathan M Davis jmdavisp...@gmx.com wrote: On Friday, October 19, 2012 20:01:20 Alex Rønne Petersen wrote: On 19-10-2012 08:23, Jacob Carlborg wrote: On 2012-10-18 20:51, Philippe Sigaud wrote: I mean, the 'package' access modifier. So did I.

Re: std.stream, BOM, and deprecation

2012-10-14 Thread Nick Sabalausky
On Sat, 13 Oct 2012 18:53:48 -0700 Charles Hixson charleshi...@earthlink.net wrote: If std.stream is being deprecated, what is the correct way to deal with file BOMs. This is particularly concerning utf8 files, which I understand to be a bit problematic, as there isn't, actually, a utf8

Re: Good D book

2012-10-13 Thread Nick Sabalausky
On Sat, 13 Oct 2012 11:29:29 +0200 Jeremy DeHaan dehaan.jerem...@gmail.com wrote: I've been using D for a few months now, and i love it. It dawned on me that it would be nice to have some books to go over though! I saw The D Programming Language by Andrei Alexandrescu on Amazon, and I

Re: Automated D code editing?

2012-10-12 Thread Nick Sabalausky
On Fri, 12 Oct 2012 19:51:02 +0200 Lubos Pintes lubos.pin...@gmail.com wrote: Hi, I am still playing with DGUI library. Besides other things, I would like to convert enum names from THIS_STUPID_NAMING_CONVENTION_WHICH_I_ABSOLUTELY_HATE to thisGoodOne. Obviously I could do this by hand but

Re: getting to know dmd and druntime

2012-07-22 Thread Nick Sabalausky
On Sun, 22 Jul 2012 11:30:14 +0200 maarten van damme maartenvd1...@gmail.com wrote: Right now I'm a bit confused. I assume that the garbage collector and some other parts from druntime need startup code. But what gets run first is my main method in the d file I compile. Actually, that's just

DMD Bug or not? foreach over struct range

2012-05-16 Thread Nick Sabalausky
This code: -- import std.stdio; struct Foo { int val; @property bool empty() { return val = 5; } @property int front() { return val; } void popFront() { val++; } } void main() { Foo foo;

Re: DMD Bug or not? foreach over struct range

2012-05-16 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.826.1337151940.24740.digitalmars-d-le...@puremagic.com... No. That's expected. Your range is a value type, so it got copied when you used it with foreach. But foreach isn't a function, it's a flow-control statement.

Re: DMD Bug or not? foreach over struct range

2012-05-16 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.828.1337154007.24740.digitalmars-d-le...@puremagic.com... On Wednesday, May 16, 2012 03:29:23 Nick Sabalausky wrote: Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.826.1337151940.24740.digitalmars-d-le

Re: DMD Bug or not? foreach over struct range

2012-05-16 Thread Nick Sabalausky
Actually, I think I'm going to move this over to digitalmars.D. Seems a more appropriate place at this point.

How to prevent direct public creation of a struct?

2012-05-03 Thread Nick Sabalausky
I want to do something like this: -- module moduleFoo; // Only allow certain values of str template foo(string str) { static assert(str == a || str == b || str == c); immutable foo = Foo(str); } struct Foo { // Only a, b, and c should be

Re: How to prevent direct public creation of a struct?

2012-05-03 Thread Nick Sabalausky
Brad Anderson e...@gnuk.net wrote in message news:jhsccvjskiqqzzqbd...@forum.dlang.org... On Thursday, 3 May 2012 at 21:36:53 UTC, Nick Sabalausky wrote: I want to do something like this: -- module moduleFoo; // Only allow certain values of str

No implicitly convert derived ptr to base ptr?

2012-04-24 Thread Nick Sabalausky
The compiler rejects this: class Base {} class Derived : Base {} void main() { Base*basePtr; Derived* derivedPtr; basePtr = derivedPtr; // ERROR } Is that really correct that it shouldn't be allowed?

Re: Higher-order functions?

2012-04-10 Thread Nick Sabalausky
Jonas H. jo...@lophus.org wrote in message news:mailman.1600.1334099651.4860.digitalmars-d-le...@puremagic.com... Hi everyone, does D have any runtime higher-order function facilities? (I'm not talking about templates.) Yes. Fully. Many are already in the std lib:

Re: Higher-order functions?

2012-04-10 Thread Nick Sabalausky
Timon Gehr timon.g...@gmx.ch wrote in message news:jm2hnp$s0s$1...@digitalmars.com... (Well, the standard way to do what that python code does is using templates. auto car_prices = map!(car = car.get_price)(list_of_cars);// lazy range auto car_prices = array(map!(car =

Re: Simple operator precidence chart (and associativity)?

2012-03-14 Thread Nick Sabalausky
Timon Gehr timon.g...@gmx.ch wrote in message news:jjpmov$305u$1...@digitalmars.com... On 03/14/2012 01:20 AM, Nick Sabalausky wrote: Timon Gehrtimon.g...@gmx.ch wrote in message // 8 shift operators == !=== \ // 9 relational operators

Re: Checking for possibility of implicit conversions

2012-03-14 Thread Nick Sabalausky
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.662.1331746435.4860.digitalmars-d-le...@puremagic.com... On Wed, Mar 14, 2012 at 06:08:24PM +0100, Adam D. Ruppe wrote: if(is(T : S)) http://dlang.org/expression.html#IsExpression this is form #2. Ahh, thanks. I keep

Re: Checking for possibility of implicit conversions

2012-03-14 Thread Nick Sabalausky
Nick Sabalausky a@a.a wrote in message news:jjqp0n$1pga$1...@digitalmars.com... What might make that a little confusing, though, is that string *literals* which are not suffixed with c/w/d are *not* necessarily string, but rather can acually *be* (ie, not implicitly convertable

Simple operator precidence chart (and associativity)?

2012-03-13 Thread Nick Sabalausky
I'm reading through D's grammar spec, and maybe it's just not enough sleep or some such, but my brain is turning to mud: Is there a simple operator precidence chart somewhere? (Also, for associativity: Assign and OpAssign are right-associative and everything else is left-associative, correct?)

Re: Simple operator precidence chart (and associativity)?

2012-03-13 Thread Nick Sabalausky
Timon Gehr timon.g...@gmx.ch wrote in message news:jjokc7$t3j$1...@digitalmars.com... On 03/13/2012 11:29 PM, Nick Sabalausky wrote: I'm reading through D's grammar spec, and maybe it's just not enough sleep or some such, but my brain is turning to mud: Is there a simple operator

Get name of enum val at compile-time?

2012-01-15 Thread Nick Sabalausky
Is there a way to get the name of an enum value at compile-time? For instance: import std.stdio; enum Foo { hello } void main() { writeln(Foo.hello); } That prints hello. But what I need is to get hello into a string at compile-time. Of course, I could just manually write a ctfe-able

Re: Get name of enum val at compile-time?

2012-01-15 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.388.1326617938.16222.digitalmars-d-le...@puremagic.com... On Sunday, January 15, 2012 03:53:09 Nick Sabalausky wrote: Is there a way to get the name of an enum value at compile-time? For instance: import std.stdio; enum Foo

Re: Get name of enum val at compile-time?

2012-01-15 Thread Nick Sabalausky
Timon Gehr timon.g...@gmx.ch wrote in message news:jevefv$2je6$1...@digitalmars.com... On 01/15/2012 09:34 PM, Nick Sabalausky wrote: import std.conv; enum Foo { hello } enum x = to!string(); enum x = to!string(Foo.hello); Goddamnnit, what the fuck is wrong with me? Yes that works :)

Re: Class for fetching a web page and parse into DOM

2011-12-15 Thread Nick Sabalausky
Adam D. Ruppe destructiona...@gmail.com wrote in message news:nlccexskkftzaapfd...@dfeed.kimsufi.thecybershadow.net... On Thursday, 15 December 2011 at 09:55:22 UTC, breezes wrote: Is there a class that can fetch a web page from the internet? And is std.xml the right module for parsing it

Profile DMD

2011-12-01 Thread Nick Sabalausky
Is there an easy way to profile DMD similar to how DMD itself has the -profile switch?

Re: Slincing behaviour

2011-11-11 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.866.1321013026.24802.digitalmars-d-le...@puremagic.com... On Friday, November 11, 2011 11:46:02 RenatoL wrote: int[7] arr = [1,2,3,4,5,6,7]; writeln(arr[$..$]); this simply prints a newline... I expected a runtime error (or

Re: [beginner] Why nothing is printed to stdout ?

2011-11-02 Thread Nick Sabalausky
Kagamin s...@here.lot wrote in message news:j8rlig$145l$1...@digitalmars.com... Jonathan M Davis Wrote: Though if you don't get used to putting ./ in front of the names of binaries that you're running in the current directory, you're going to have other problems. The suggestion does fix

Re: how to use curl to download a file

2011-11-02 Thread Nick Sabalausky
Jesse Phillips jessekphillip...@gmail.com wrote in message news:j8rj3c$uc2$1...@digitalmars.com... etc.c.curl is meant for those that know curl and wish to use it. etc.curl has been delayed but is intended for those that wish to access the internet. In the meantime, the proposed etc.curl is

Re: [beginner] Why nothing is printed to stdout ?

2011-11-02 Thread Nick Sabalausky
Steven Schveighoffer schvei...@yahoo.com wrote in message news:op.v4bh35eaeav7ka@localhost.localdomain... On Tue, 01 Nov 2011 14:23:52 -0400, Graham Fawcett fawc...@uwindsor.ca wrote: Too much work! Just put alias test='./test' in your .profile, and be happy. :) That's a cool trick

Re: [beginner] Why nothing is printed to stdout ?

2011-10-30 Thread Nick Sabalausky
Frédéric Galusik fr...@salixosnospam.org wrote in message news:j8j77l$pfv$1...@digitalmars.com... Hi, Can someone give me a clue on why nothing is printed to stdout ? I wish a list of files with their size. code: // import std.stdio; import std.file; void main(string[] args) {

Re: Fake global associative array literals

2011-10-28 Thread Nick Sabalausky
bearophile bearophileh...@lycos.com wrote in message news:j8eflp$q3o$1...@digitalmars.com... What do you think about a rewrite rule that changes code like: int[int] aa = [1:2, 3:4]; void main() {} Into: int[int] aa; static this() { aa = [1:2, 3:4]; } void main() {} You generally

Re: FIFO stack

2011-10-27 Thread Nick Sabalausky
Ary Manzana a...@esperanto.org.ar wrote in message news:j89gle$9nn$1...@digitalmars.com... On 10/26/11 1:28 PM, Jonathan M Davis wrote: On Wednesday, October 26, 2011 09:00 Dominic Jones wrote: Also an plain array is a good stack. :) I'd rather not use a plain array because (I assume) that

Re: FIFO stack

2011-10-27 Thread Nick Sabalausky
Dominic Jones dominic.jo...@qmul.ac.uk wrote in message news:j89arh$2ua3$1...@digitalmars.com... Also an plain array is a good stack. :) I'd rather not use a plain array because (I assume) that when I push or pop using arrays, a swap array is created to resize the original. If this is not

Re: FIFO stack

2011-10-27 Thread Nick Sabalausky
Ary Manzana a...@esperanto.org.ar wrote in message news:j8buhd$1s80$1...@digitalmars.com... On 10/27/11 8:38 AM, Nick Sabalausky wrote: Ary Manzanaa...@esperanto.org.ar wrote in message news:j89gle$9nn$1...@digitalmars.com... On 10/26/11 1:28 PM, Jonathan M Davis wrote: On Wednesday

Workaround to 3051? (Passing alias to member function don't work)

2011-10-25 Thread Nick Sabalausky
Anyone know a workaround to #3051 - Passing alias to member function does not work? (Hopefully besides just making fun either static or global) http://d.puremagic.com/issues/show_bug.cgi?id=3051

Re: gtkD problems and general gui question.

2011-10-24 Thread Nick Sabalausky
%u f...@bar.com wrote in message news:j7k3c7$25jg$1...@digitalmars.com... Finally, is gtkD the way to go when it comes to learning gui with D? Which gui is the most popular with D? Which one has a future? And which is the easiest to learn? IMO, GTK itself (ie, not just gtkD) is terrbile

Re: gtkD problems and general gui question.

2011-10-24 Thread Nick Sabalausky
Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.367.1319465270.24802.digitalmars-d-le...@puremagic.com... On 10/24/11, Nick Sabalausky a@a.a wrote: (ie, garbage non-native controls) In reality you don't even need to use native controls to create a true native look

Bug? aliasing member of instance

2011-10-22 Thread Nick Sabalausky
Is this a compiler bug? struct Foo { int a; } Foo foo; alias foo.a b; void main() { b = 5; // -- Error } dmd test.d test.d(11): Error: need 'this' to access member a I did this on DMD 2.055

Re: Bug? aliasing member of instance

2011-10-22 Thread Nick Sabalausky
Timon Gehr timon.g...@gmx.ch wrote in message news:j7u9ld$i8t$1...@digitalmars.com... alias has never worked for instance members, even if they are accessible at compile time. Any idea if it's supposed to work?

Re: Bug? aliasing member of instance

2011-10-22 Thread Nick Sabalausky
Timon Gehr timon.g...@gmx.ch wrote in message news:j7ve1p$2rds$1...@digitalmars.com... On 10/22/2011 11:03 PM, Nick Sabalausky wrote: Timon Gehrtimon.g...@gmx.ch wrote in message news:j7u9ld$i8t$1...@digitalmars.com... alias has never worked for instance members, even if they are accessible

.di files have implementation??

2011-10-22 Thread Nick Sabalausky
I think I've misunderstood something about .di files: $ cat testDI.d private int foo(){ return 1; } $ dmd -H -c testDI.d $ cat testDI.di // D import file generated from 'testDI.d' private int foo() { return 1; } Why does the .di file include the body of foo? In fact, why does it have foo at

Re: .di files have implementation??

2011-10-22 Thread Nick Sabalausky
Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.331.1319338165.24802.digitalmars-d-le...@puremagic.com... It's because the function is small enough to be inlineable, you can't inline it if you've only got the prototype in the header file. So it's optimizations at play.

Re: .di files have implementation??

2011-10-22 Thread Nick Sabalausky
Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.333.1319338819.24802.digitalmars-d-le...@puremagic.com... It could also be considered a little bit dangerous. E.g. you could forget to regenerate header files after compilation and potentially leave the user code with an

Re: Simple I know, but could use some help compiling with make

2011-10-07 Thread Nick Sabalausky
Ola Ost ola...@gmail.com wrote in message news:j6hqkh$lk0$1...@digitalmars.com... I had exactly this problem too, I asked on the Derelict forums: http://www.dsource.org/forums/viewtopic.php?t=5856sid=8ebff671fafec3bd8962ddfceaf99eb8 At the moment I've resolved this by building Derelict with

Re: how do I use newsgroup server?

2011-09-30 Thread Nick Sabalausky
%u y...@yo.com wrote in message news:j655f0$fm8$1...@digitalmars.com... Hello. I go to digitalmars to read digitalmars.D.learn newsgroup, but I have to click the http link. The http interface is kind of awkward. I'd like to try the newsgroup link. But, I don't know how to use it. How do

Re: how do I use newsgroup server?

2011-09-30 Thread Nick Sabalausky
Nick Sabalausky a@a.a wrote in message news:j6562i$gov$1...@digitalmars.com... %u y...@yo.com wrote in message news:j655f0$fm8$1...@digitalmars.com... Hello. I go to digitalmars to read digitalmars.D.learn newsgroup, but I have to click the http link. The http interface is kind of awkward

Re: how do I use newsgroup server?

2011-09-30 Thread Nick Sabalausky
%u y...@yo.com wrote in message news:j656f0$hpm$1...@digitalmars.com... == Quote from Nick Sabalausky (a@a.a)'s article %u y...@yo.com wrote in message news:j655f0$fm8$1...@digitalmars.com... Hello. I go to digitalmars to read digitalmars.D.learn newsgroup, but I have to click the http

Re: how do I use newsgroup server?

2011-09-30 Thread Nick Sabalausky
Nick Sabalausky a@a.a wrote in message news:j657vh$kda$1...@digitalmars.com... %u y...@yo.com wrote in message news:j656f0$hpm$1...@digitalmars.com... == Quote from Nick Sabalausky (a@a.a)'s article %u y...@yo.com wrote in message news:j655f0$fm8$1...@digitalmars.com... Hello. I go

Re: how do I use newsgroup server?

2011-09-30 Thread Nick Sabalausky
%u y...@yo.com wrote in message news:j65a5r$nhr$1...@digitalmars.com... Directions look very promising. My outlook complains about problem connecting to the server. So, when I tried to ping the ip address of news.digitalmars.com, all requests time out. So is it just that the server is

<    1   2   3   4   5   >