Re: Use .get() in MultiD Assoc Array?

2012-08-31 Thread Ali Çehreli
On 08/31/2012 11:55 AM, Ali Çehreli wrote: > class MyTable [...] > // Enables the 'auto element = myIndex in myTable' syntax That's wrong. For that syntax to work, the operator below should have been opBinaryRight. > string * opBinary(string op)(Index index) Yeah, that should have been opB

Re: segfault

2012-08-31 Thread Ellery Newcomer
On 08/31/2012 03:18 PM, Andrej Mitrovic wrote: On 8/31/12, Ellery Newcomer wrote: hey, is anyone else getting a segfault from dmd on this code? Yep on win32. thanks

Re: import std.random fails

2012-08-31 Thread deed
Reinstallation solved the case. Thanks for your prompt reply.

Re: import std.random fails

2012-08-31 Thread deed
You druntime installation is bad due to some cruft left from a previous install (the installer obviously needs some work). If you used an installer, then uninstall dmd, make sure that it's completely removed, and then reinstall it. If you installed it manually, then make sure that you blow awa

Re: import std.random fails

2012-08-31 Thread Jonathan M Davis
On Saturday, September 01, 2012 00:40:25 deed wrote: > > import std.random > > void main() {} > --- > > results in: > > Error 42: Symbol Undefined > _D4core6memory2GC6qallocFkkZS4core6memory8BLkInfo_ > Error 42: Symbol Undefined _D4core6memory2GC6extendFPvkkZk > Error 42: Symbol Undefined _

Re: import std.random fails

2012-08-31 Thread deed
On Friday, 31 August 2012 at 22:44:11 UTC, ixid wrote: You're missing the semi-colon after import std.random. Sorry, typo. Semicolon is included in the file. DMD 2.060.

Re: import std.random fails

2012-08-31 Thread ixid
You're missing the semi-colon after import std.random. import std.random; void main() {}

import std.random fails

2012-08-31 Thread deed
import std.random void main() {} --- results in: Error 42: Symbol Undefined _D4core6memory2GC6qallocFkkZS4core6memory8BLkInfo_ Error 42: Symbol Undefined _D4core6memory2GC6extendFPvkkZk Error 42: Symbol Undefined _D4core5bitop3bsrFNaNbkZi --- errorlevel 3 What is wrong?

Re: rdmd & exception def & multiple files

2012-08-31 Thread anonymous
On Friday, 31 August 2012 at 20:20:42 UTC, Charles Hixson wrote: So I only have the large case...and even there, I've been working on the project, as dmd doesn't give any problems, and so I can't guarantee without checking again that it still fails. But since nobody wants a 500 line test case

Re: Assigning global and static associative arrays

2012-08-31 Thread Jonathan M Davis
On Saturday, September 01, 2012 00:12:06 ixid wrote: > Hmm, you mean if you call the same function it creates a new copy > every time? I misunderstood you to mean it creates it once at > each site in the code it's called. enum values are basically copy-pasted everywhere that they're used. So, if y

Re: segfault

2012-08-31 Thread Andrej Mitrovic
On 8/31/12, Ellery Newcomer wrote: > hey, is anyone else getting a segfault from dmd on this code? Yep on win32.

Re: Assigning global and static associative arrays

2012-08-31 Thread ixid
Hmm, you mean if you call the same function it creates a new copy every time? I misunderstood you to mean it creates it once at each site in the code it's called.

segfault

2012-08-31 Thread Ellery Newcomer
hey, is anyone else getting a segfault from dmd on this code? struct a{ static if(i) { }elseenum z = ""; } 2.060 x64 linux and if they do, I call dibs on the bug report

Re: Assigning global and static associative arrays

2012-08-31 Thread ixid
Yep, I am aware of that, for my use it happens to be perfect but I understand that having a bunch of copies all over the place wouldn't be smart.

Re: Assigning global and static associative arrays

2012-08-31 Thread Philippe Sigaud
On Fri, Aug 31, 2012 at 10:34 PM, ixid wrote: > Philippe suggested enum allowing this: > > enum dayNumbers = [ "Monday" : 0, "Tuesday" : 1, "Wednesday" : 2, > > "Thursday" : 3, "Friday" : 4, "Saturday" : 5, > "Sunday" : 6 ]; > > Why does this seem to avoid pointer issues? Is it creating a compil

Re: Assigning global and static associative arrays

2012-08-31 Thread Philippe Sigaud
On Fri, Aug 31, 2012 at 9:56 PM, Jonathan M Davis wrote: > Except that that allocates a new AA every time that you use dayNumbers. So, > that's probably a bad idea. Oh! I keep forgetting that enums are replaced by their values. Then I think I know where some problem I had came from. Damn, just

Re: Assigning global and static associative arrays

2012-08-31 Thread ixid
Philippe suggested enum allowing this: enum dayNumbers = [ "Monday" : 0, "Tuesday" : 1, "Wednesday" : 2, "Thursday" : 3, "Friday" : 4, "Saturday" : 5, "Sunday" : 6 ]; Why does this seem to avoid pointer issues? Is it creating a compile-time associated array or run-time?

Re: rdmd & exception def & multiple files

2012-08-31 Thread Charles Hixson
On 08/31/2012 11:28 AM, cal wrote: On Friday, 31 August 2012 at 17:14:25 UTC, Charles Hixson wrote: If I ran DustMite on the original, the program got reduced down to "void main () { }" (with some extra whitespace). And does rdmd compilation still fail with the reduced case? No. But there we

Re: Assigning global and static associative arrays

2012-08-31 Thread Jonathan M Davis
On Friday, August 31, 2012 20:24:27 Philippe Sigaud wrote: > On Fri, Aug 31, 2012 at 7:04 PM, ixid wrote: > > Thank you, that certainly makes sense. > > If you're certain you won't need to modify it, you can make it a > compile-time constant: > > enum int[string] dayNumbers = > [ "Monday" : 0, "

Re: Trait to get function parameter names

2012-08-31 Thread mist
On Friday, 31 August 2012 at 19:15:14 UTC, Jacob Carlborg wrote: On 2012-08-31 16:24, mist wrote: Subject. Is that possible? I see only parameter type tuple stuff out there. I'm looking into iterating over own parameter name list inside of function. Here: http://dlang.org/traits.html#paramet

Re: Trait to get function parameter names

2012-08-31 Thread Jacob Carlborg
On 2012-08-31 16:24, mist wrote: Subject. Is that possible? I see only parameter type tuple stuff out there. I'm looking into iterating over own parameter name list inside of function. Here: http://dlang.org/traits.html#parameterNames -- /Jacob Carlborg

Re: Use .get() in MultiD Assoc Array?

2012-08-31 Thread Ali Çehreli
On 08/31/2012 08:56 AM, Paul wrote: >> You're welcome. Note that your need of having a structure which is >> both associative and ordered is, if not unheard-of, at least somewhat >> uncommon. > > I'm parsing program blocks from a proprietary HW/SW system. They provide > the data in the form of: >

Re: Use .get() in MultiD Assoc Array?

2012-08-31 Thread Philippe Sigaud
On Fri, Aug 31, 2012 at 5:56 PM, Paul wrote: > The data is in an ascii text file. > I need to be able to search it by group/block/parameter. > I need to be able to maintain group/block order. > There are ~hundred diff block types where the params and order of params are > known...though I would r

Re: rdmd & exception def & multiple files

2012-08-31 Thread cal
On Friday, 31 August 2012 at 17:14:25 UTC, Charles Hixson wrote: If I ran DustMite on the original, the program got reduced down to "void main () { }" (with some extra whitespace). And does rdmd compilation still fail with the reduced case?

Re: Assigning global and static associative arrays

2012-08-31 Thread Philippe Sigaud
On Fri, Aug 31, 2012 at 7:04 PM, ixid wrote: > Thank you, that certainly makes sense. If you're certain you won't need to modify it, you can make it a compile-time constant: enum int[string] dayNumbers = [ "Monday" : 0, "Tuesday" : 1, "Wednesday" : 2, "Thursday" : 3, "Friday"

Re: rdmd & exception def & multiple files

2012-08-31 Thread Charles Hixson
On 08/30/2012 10:46 PM, cal wrote: On Friday, 31 August 2012 at 04:00:34 UTC, Charles Hixson wrote: Perhaps I don't know enough to file a decent bug report...at least when I can't reduce the test case that shows it significantly. Dustmite refers to this tool: https://github.com/CyberShadow/Dus

Re: Assigning global and static associative arrays

2012-08-31 Thread ixid
Thank you, that certainly makes sense.

Re: Assigning global and static associative arrays

2012-08-31 Thread Jonathan M Davis
On Friday, August 31, 2012 16:38:13 ixid wrote: > Why does this not work: > > int[string] dayNumbers = > [ "Monday" : 0, "Tuesday" : 1, "Wednesday" : 2, > "Thursday" : 3, "Friday" : 4, "Saturday" : 5, > "Sunday" : 6 ]; > > void main() { > //Stuff > } > > With the error 'non-constant expression'?

Re: popFront with input variables

2012-08-31 Thread Jonathan M Davis
On Friday, August 31, 2012 15:56:32 Joseph Rushton Wakeling wrote: > Hello all, > > Is it considered legit in any circumstances for popFront to take an input > variable (e.g. a random number generator)? Or is it required always to have > no input variables? Don't do it. Technically speaking, as l

Re: Assigning global and static associative arrays

2012-08-31 Thread Mike Parker
On 9/1/2012 1:31 AM, Mike Parker wrote: On 8/31/2012 11:38 PM, ixid wrote: Why does this not work: int[string] dayNumbers = [ "Monday" : 0, "Tuesday" : 1, "Wednesday" : 2, "Thursday" : 3, "Friday" : 4, "Saturday" : 5, "Sunday" : 6 ]; void main() { //St

Re: Assigning global and static associative arrays

2012-08-31 Thread Mike Parker
On 8/31/2012 11:38 PM, ixid wrote: Why does this not work: int[string] dayNumbers = [ "Monday" : 0, "Tuesday" : 1, "Wednesday" : 2, "Thursday" : 3, "Friday" : 4, "Saturday" : 5, "Sunday" : 6 ]; void main() { //Stuff } With the error 'non-constant expre

Re: popFront with input variables

2012-08-31 Thread Simen Kjaeraas
On Fri, 31 Aug 2012 16:56:32 +0200, Joseph Rushton Wakeling wrote: Hello all, Is it considered legit in any circumstances for popFront to take an input variable (e.g. a random number generator)? Or is it required always to have no input variables? No parameters, or at least it should

Re: Use .get() in MultiD Assoc Array?

2012-08-31 Thread Paul
You're welcome. Note that your need of having a structure which is both associative and ordered is, if not unheard-of, at least somewhat uncommon. I'm parsing program blocks from a proprietary HW/SW system. They provide the data in the form of: Somegroupname/Someblockname someparam=valu

Re: popFront with input variables

2012-08-31 Thread bearophile
Joseph Rushton Wakeling: Is it considered legit in any circumstances for popFront to take an input variable (e.g. a random number generator)? Or is it required always to have no input variables? popFront is meant to be called by foreach, or to be verified by the isSomething compile-time test

popFront with input variables

2012-08-31 Thread Joseph Rushton Wakeling
Hello all, Is it considered legit in any circumstances for popFront to take an input variable (e.g. a random number generator)? Or is it required always to have no input variables? Thanks & best wishes, -- Joe

Assigning global and static associative arrays

2012-08-31 Thread ixid
Why does this not work: int[string] dayNumbers = [ "Monday" : 0, "Tuesday" : 1, "Wednesday" : 2, "Thursday" : 3, "Friday" : 4, "Saturday" : 5, "Sunday" : 6 ]; void main() { //Stuff } With the error 'non-constant expression'? This error also seems to preven

Trait to get function parameter names

2012-08-31 Thread mist
Subject. Is that possible? I see only parameter type tuple stuff out there. I'm looking into iterating over own parameter name list inside of function.

Re: my own directx tutorials

2012-08-31 Thread ElfQT
OK, nevermind I found them. ;)