Re: toUTFz and WinAPI GetTextExtentPoint32W

2011-09-20 Thread Trass3r
Are you sure that the call requires the string to be null terminated? I do not know that winapi function, but this might work: bool test(HDC dc, string str, SIZE* s) { auto wstr = to!(wchar[])str; GetTextExtentPoint32W(dc, wstr.ptr, wstr.length, s); ... It doesn't need to be null-terminated f

Re: toUTFz and WinAPI GetTextExtentPoint32W

2011-09-20 Thread Trass3r
bool test(HDC dc, string str, int len, SIZE* s) { wchar[] wstr = toUTFz!(wchar*)str; GetTextExtentPoint32W(dc wstr.ptr, wstr.length, s); toUTFz returns a wchar*, not a wchar[].

Re: attribute decl in version decl

2011-09-19 Thread Trass3r
Change it to the following, and you're golden. extern(System): That only fixes this particular issue. I once had the following case that can't be done: version(V1) { extern(System): } else { extern(C): }

Re: D, DLLs, UnrealScript and UDK (Sort of a complex question)

2011-09-19 Thread Trass3r
So, my question is THIS: Can I write a "windows" DLL file in D that would have functions that can be accessible from a compiled C++ program? (Actually, in this case, it's UnrealScript that is compiled into a C++ exe.) It's perfectly possible to create DLLs with D, also see http://www.d-prog

Re: attribute decl in version decl

2011-09-19 Thread Trass3r
Am 18.09.2011, 18:55 Uhr, schrieb Ellery Newcomer : Just came across some old D code that does this: version(linux){ extern(C): } in dmd 2.055, the extern(C) is not being applied to the OpenGL decls. should it? Walter once said it was deliberate. That extern(C) is only valid in

Re: port c macro to D

2011-09-15 Thread Trass3r
Also by static function you probably mean private in D. No, I meant for mixin I nead static functions, but I just realized, it also works without the static keyword. I think static has no meaning in global scope, only in function scope where it tells the compiler you don't want a closure.

Re: port c macro to D

2011-09-15 Thread Trass3r
Am 15.09.2011, 13:37 Uhr, schrieb Matthias Pleh : When porting c-code to D, I come consitently to the problem, how to convert such a c-macro: #define V(a,b,c) glVertex3d( a size, b size, c size ); #define N(a,b,c) glNormal3d( a, b, c ); N( 1.0, 0.0, 0.0); V(+,-,+); V(+,-,-); V(+,+,-); V(+,+,+);

Re: How to get WinDbg to show a call stack on Windows 7?

2011-09-12 Thread Trass3r
You could also use cv2pdb's -C option and Visual Studio to debug dmd.

Re: D on other platforms than Win,Lin,Mac?

2011-09-06 Thread Trass3r
At least for gdc only hello-world like code works. Real code hits this issue: https://bitbucket.org/goshawk/gdc/issue/215/alignment-of-struct-members-wrong-on-arm Did you ever try with LDC?

Re: D on other platforms than Win,Lin,Mac?

2011-09-06 Thread Trass3r
For a language that aims at C/C++'s domain, it's extremely depressing that this is still the case. I *really* think this needs to be one of D's top priorities at this point. I honestly see it as D's #1 biggest glaring hole We have much bigger problems that need attention. And there's nothin

Re: Out of Source Unittests

2011-09-06 Thread Trass3r
If you really need that you could use the import expression to mixin your unittests. But you should really put the unittests next to the tested code. A good editor could fold it anyway.

Re: D on other platforms than Win,Lin,Mac?

2011-09-06 Thread Trass3r
I've heard that our company is considering the T20 from Toradex.com for a new project with remote hardware. The platform runs on Nvidia Tegra and Linux. Since I have been very impressed by the D programming language, for some years now, could it be possible to use D in such projects? You'

Re: get size of function

2011-08-31 Thread Trass3r
Am 31.08.2011, 12:05 Uhr, schrieb maarten van damme : Am I sure those functions aren't shift around during optimization? No. It's just an ugly hack and likely to go up in flames. Also what you try could only work with PIC but even then... for now the function is working like a charm. int

Re: Reading by character and by line from stdin

2011-08-25 Thread Trass3r
A nifty way of reading by byte is Of course I mean by character.

Re: Reading by character and by line from stdin

2011-08-25 Thread Trass3r
I'd like to know how to read from stdin one character at a time, read with whitespace as a delimiter, and read line by line. A nifty way of reading by byte is the undocumented (only the writer is documented): import std.stdio; void main() { foreach(c; LockingTextReader(stdin)) .

Re: making a really simple dll.

2011-08-19 Thread Trass3r
Am 19.08.2011, 04:29 Uhr, schrieb maarten van damme : "as for the linux side" I though dmd was unable to generate shared libs on linux? But GDC and LDC are.

Re: making a really simple dll.

2011-08-18 Thread Trass3r
Am 18.08.2011, 21:42 Uhr, schrieb Kai Meyer : 2) check if there are any exported functions (via .def or export()), if not, export them all That's insane. Larger projects have tons of functions and may only need to export a few. The language includes the export keyword to export functions and

Re: making a really simple dll.

2011-08-18 Thread Trass3r
Am 18.08.2011, 21:17 Uhr, schrieb Adam D. Ruppe : We should make a mixin template DllMain that has a generic main. We should also have a -shared switch that transparently includes all of the boilerplate crap: particularly the .def file, maybe even a default DllMain if none exists.

Re: making a really simple dll.

2011-08-18 Thread Trass3r
Example: https://bitbucket.org/trass3r/matd/src/tip/examples/mmfile/

Re: making a really simple dll.

2011-08-18 Thread Trass3r
I looked at the dll documentation and I'm baffled by the time I get to the first line: __gshared HINSTANCE g_hInst; and then it starts talking about dll_process_attach. I don't want to attach processes, I want to compute an integer. The Dllmain is needed so the D runtime is properly initiali

Re: htod

2011-08-12 Thread Trass3r
I'm working on a tool to convert C header files to D modules based on clang. But currently it's not a prioritized project. I also played with the idea. Clang's Rewrite facilities should be perfect for that. Yeah, I'm using Rewrite, if I recall correctly. Should really be a community effort :

Re: htod

2011-08-12 Thread Trass3r
htod is a fork of dmc or something, right? Yep. How difficult is it to update the program to make it more user friendly? Only Walter can. Is the source public? No. Would it be better to use gcc or clang instead? Hell yeah. Clang's predestined for that.

Re: htod

2011-08-12 Thread Trass3r
Am 12.08.2011, 13:35 Uhr, schrieb Jacob Carlborg : On 2011-08-12 11:36, simendsjo wrote: htod is a fork of dmc or something, right? How difficult is it to update the program to make it more user friendly? Is the source public? Would it be better to use gcc or clang instead? htod is a great thou

Re: Anybody seen *working* postgresql client library binding?

2011-08-11 Thread Trass3r
Maybe http://arsdnet.net/dcode/postgres.d

Re: Something weird with threads.

2011-08-07 Thread Trass3r
- Error: template std.concurrency.spawn(T...) cannot deduce template function from argument types !()(void delegate()) As the message already tells a class method yields a delegate and not a function. Check if that method could be made static. But if you really need to do it this way, you m

Re: Using templates to declare function prototypes

2011-07-31 Thread Trass3r
Am 31.07.2011, 17:34 Uhr, schrieb Andrej Mitrovic : Why is there both a System and Windows linkage type if they're the same? Is this a C++ legacy? Well Windows always means stdcall while System changes its meaning on Posix.

Re: Versioned extern?

2011-07-29 Thread Trass3r
http://d.puremagic.com/issues/show_bug.cgi?id=5739#c3

Re: D and MySQL

2011-07-19 Thread Trass3r
The DataObject is found in database.d - it is meant to work generically with any database backend. Damn, we should really have a common project for database stuff.

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
Someone want to look at the assembly? The .exe is to large for the newsgroup, so only the code is attached. I've only tried compiling with dmd 2.054 Maybe you could post only rdmd.obj?

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
Whats the best way to debug this? Sprinkle printf's around? Probably. Should happen in that getDependencies function, shouldn't it?

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
I cannot compile anything without first compiling rdmd with -g. Compiling rdmd with -g and running cv2pdb on it works. Really strange. If we just had a stack trace.

Re: D and MySQL

2011-07-19 Thread Trass3r
Am 19.07.2011, 20:49 Uhr, schrieb Adam Ruppe : foreach(line; mysql.query("select id, name from users where id > ?", 5)) { // access to columns by name writefln("%s: %s", line["id"], line["name"]); // alternatively, you can write: writefln("%s: %s",

Re: D and MySQL

2011-07-19 Thread Trass3r
http://prowiki.org/wiki4d/wiki.cgi?DatabaseBindings There is some information, but it's probably outdated. Please update that wiki once you know more :) Apart from that I only know of this binding: http://dsource.org/projects/ddbi

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
There is something wrong with either dmd or rdmd though.. If I compile rdmd (with my patch, haven't tried the original) without -g, it crashes when trying to compile anything... Does this also happen if you compile it with -g and then run cv2pdb on it?

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
Seems I could use github direcly: https://github.com/D-Programming-Language/tools/pull/3 Thanks! But we should really also try to track down why rdmd crashes on Windows.

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
The -L-ldl isn't recognized by optlink. OPTLINK : Warning 9: Unknown Option : LDL What's the equivalent? I think you don't need it on Windows. But according to the demo dsss.conf files you might need -lladvapi32 Might also be -L-Ladvapi32. It tries to pick up zlib1.dll from my Intel WiFi progra

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
dmd.d...? That's what I was talking about. it calls dmd @...rsp and rsp contains dmd again. So it in fact calls dmd dmd ... We should really get rid of the response file crap and call dmd directly. This would also clean up rdmd --dry-run

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
So your command line is simply "rdmd --build-only --chatty -I\d\ext\gtkd\src -L-ldl t.d"? Yes, and in theory that would be enough. (if it didn't put 'dmd' in the .rsp) rdmd calls "dmd -I\d\ext\gtkd\src -L-ldl -v -o- "t.d" -I"." >t.d.deps", and then segfaults (win7x64). Doesn't segfault on

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
What is the command line? rdmd segfaults on me using this: c:\temp>rdmd --build-only --chatty -I\d\ext\gtkd\src t.d dmd -I\d\ext\gtkd\src -v -o- "t.d" -I"." >t.d.deps dmd -I~/coding/gtkD/src/ -L-ldl -v -o- 'test.d' -I'.' >test.d.deps dmd '@/tmp/.rdmd/rdmd.6FC1F920EA8D2136FC5ECC4E5ED4404A.rsp'

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
I built the fourth example (http://dsource.org/projects/gtkd/wiki/CodeExamples) using rdmd and it worked fine (regarding gtkD). (svn version of gtkD) There's a rdmd bug though. 'rdmd --build-only --chatty -I~/coding/gtkD/src/ -L-ldl test.d' doesn't directly work cause the .rsp file contain

Re: gtkD doesn't compile on windows

2011-07-19 Thread Trass3r
atk => DD-atk DD-atk_static.rf: No such file or directory Command c:\d\dsss-0.78-x86-windows\bin\rebuild.exe returned with code 1, aborting. Error: Command failed, aborting. Doesn't dsss have some kind of verbose mode? Did you try with another build tool?

Re: Problems building Qtd on Windows

2011-07-19 Thread Trass3r
Giving up... Tried 3 versions of qt + 2 of cmake + 2 of qtd. Is windows not supported anymore? Was it ever? I always hit that: http://dsource.org/projects/qtd/ticket/54

Re: Problems with static linking of c libraries

2011-07-14 Thread Trass3r
Am 14.07.2011, 16:36 Uhr, schrieb Danny Arends : Hey all, I'm trying to build a D application which statically links in the the blas and lapack libraries (from http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html ). When downloading the pre-build libraries from the website I link th

Re: template instance cannot use local 'f' as parameter to non-global template

2011-07-13 Thread Trass3r
I've seen this error before... *searches memory and old code* Here you go: http://d.puremagic.com/issues/show_bug.cgi?id=3051 I think this is yet another issue. The inner template argument is not something on the stack but it is a template argument.

Re: template instance cannot use local 'f' as parameter to non-global template

2011-07-13 Thread Trass3r
Am 13.07.2011, 16:58 Uhr, schrieb Tyro[a.c.edwards] : Don't know it this is the right answer or a possible bug but it does the trick: void h() { import std.stdio; write("h()"); } class Bla { mixin wrap!h; } mixin template wrap(alias f) { void blub(typeof(&f) g = &f) {

Re: template instance cannot use local 'f' as parameter to non-global template

2011-07-13 Thread Trass3r
Am 13.07.2011, 16:02 Uhr, schrieb Steven Schveighoffer : void h() {} class Bla { mixin wrap!h; } mixin template wrap(alias f) { void blub(alias g = f)() { g(); } } As a workaround, is there a reason you need blub to be parameterized? I m

Re: template instance cannot use local 'f' as parameter to non-global template

2011-07-13 Thread Trass3r
Anybody an idea?

Re: Declaring a D pointer to a C function

2011-07-12 Thread Trass3r
Is this going to be fixed any time soon? Allowing callbacks with D calling convention where a C callback is expected should be an error, and this is like the 10th time I've ran into this bug. http://d.puremagic.com/issues/show_bug.cgi?id=3797

Re: Running DMD tests

2011-07-12 Thread Trass3r
Am 12.07.2011, 20:57 Uhr, schrieb David Nadlinger : or use your normal system-wide installation which probably has all the paths set up correctly by specifying the DMD variable: »make DMD=/usr/local/bin/dmd«. Thanks a lot for that hint!

Re: Running DMD tests

2011-07-12 Thread Trass3r
Am 13.06.2011, 23:55 Uhr, schrieb Peter Alexander : I'm trying to run the test suite for DMD, but I'm running into issues. Do I need to set up my environment differently to run dmd in development? How can I get around this? To quote IRC: In theory it's simple: go to dmd/test and run make.

template instance cannot use local 'f' as parameter to non-global template

2011-07-12 Thread Trass3r
Is this a bug? If not, how do you make it work? void h() {} class Bla { mixin wrap!h; } mixin template wrap(alias f) { void blub(alias g = f)() { } } void main() { Bla b = new Bla(); b.blub(); } test.d(18): Error: template instance cannot use lo

Re: Declaring a D pointer to a C function

2011-07-12 Thread Trass3r
You should declare the function pointer without the "extern(C)". Example: alias int function(void* test) FTInitFunc; extern(C) int foo(void* test){ } FTInitFunc foo_ptr = &foo; This worked for me. That's a bug.

Re: translate a macro to D

2011-07-07 Thread Trass3r
The TYPESIZE macro is used within another macro which defines constants. #define M(a,b,size) \ ((a) << SHIFT_A) | \ ((b) << SHIFT_B) | \ ((size) << SHIFT_SIZE)) #define MM(a,b,type)M((a),(b),(TYPESIZE(type))) Example: #define C1MM(1, 2, struct A) #define

Re: translate a macro to D

2011-07-06 Thread Trass3r
Am 06.07.2011, 16:15 Uhr, schrieb teo : What is the best way to translate following to D? #define MAKELONG(a, b) \ ((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16)) The point is I would like to be able to use that at compile-time. The macro is supposed to define some constants. Just

Re: Dynamic multidimensional arrays

2011-07-05 Thread Trass3r
If you want it to by dynamic all the way, you need to put the dimensions in the parens like above. Personally, I _never_ put them in the brackets, even when the dynamic array has just one dimension. It's just simpler to always put them in the parens and not worry about it. Maybe we should f

Re: how to reduce a debug symbol error?

2011-06-28 Thread Trass3r
First: are you compiling *all* modules with -gc rather than -g? Ah ok, somehow I was mislead into thinking that the gdb patches allow you to use -g. It works now though line numbers are more messed up than I'm used to from cv2pdb + VS. There I only have the usual problems with mixins but h

how to reduce a debug symbol error?

2011-06-28 Thread Trass3r
Starting my cl4d executable with 'gdb main -readnow' results in Reading symbols from main...expanding to full symbols...Die: DW_TAG_type_unit (abbrev 4, offset 0x6a) parent at offset: 0xb has children: FALSE attributes: DW_AT_byte_size (DW_FORM_data1) constant: 16 DW_AT_type (DW_

Re: Undefined function, even though imported

2011-06-14 Thread Trass3r
Am 14.06.2011, 02:43 Uhr, schrieb Loopback : Thanks for all the answers! Seems like rdmd did the trick. I don't see why this isn't built in to dmd though No one does ;) I've also stumbled upon an additional error with the win32 DirectX bindings, but this seems D related actually. When I comp

Re: Undefined function, even though imported

2011-06-13 Thread Trass3r
Shouldn't the linker/compiler be able to solve this on its own then? Use rdmd or xfBuild to automatically compile all needed modules.

Re: Undefined function, even though imported

2011-06-13 Thread Trass3r
Importing it means dmd knows about the function and emits a call but doesn't automatically generate the function code. This is only done if you also pass the file containing it to dmd.

Re: Is it reasonable to learn D

2011-06-08 Thread Trass3r
http://h3.gd/code/nucleus/ I lol'd at the suggestion to upgrade my FF4 to a modern HTML5-compliant browser. ^^ No problems with Opera.

Re: Is it reasonable to learn D

2011-06-07 Thread Trass3r
- The D compiler has only bad code optimization Yep, but there is LDC and GDC which use LLVM and GCC as backends respectively. - There are no maintained GUI libraries I wouldn't agree with that. Some people are still working on GtkD, QtD and DWT. - The development of the compiler is very

Re: Is it reasonable to learn D

2011-06-07 Thread Trass3r
Am 07.06.2011, 23:02 Uhr, schrieb Fabian : I can't see any changes on this web page: http://www.dsource.org/projects/dwt/wiki That doesn't mean anything. Development sometimes takes place behind the scenes or in forks at github or bitbucket.

Re: Problem with dsss 0.78 rebuild error: out of memory

2011-06-07 Thread Trass3r
Both tools are dead.

Re: Linking with/Debugging static C/C++ libraries

2011-05-30 Thread Trass3r
Am 30.05.2011, 04:09 Uhr, schrieb Jeff Slutter : One of the things that's important to us is being able to link against some existing C/C++ static libraries (built with VS 2008, so PE COFF format). Good luck with that. DLLs are no problem but static libraries are another story. objconv has ne

Re: What are the reasons for this syntax??

2011-05-24 Thread Trass3r
Read about import types here: http://www.digitalmars.com/d/2.0/module.html#ImportDeclaration

Re: web development in D

2011-05-22 Thread Trass3r
Very interesting benchmarks!

Re: web development in D

2011-05-21 Thread Trass3r
Have a look at the recent thread titled 'How To Dynamic Web Rendering?' Adam Ruppe has created a package for web development with D and it seems to work like a charm.

Re: status of shared-libs on Windows?

2011-05-20 Thread Trass3r
Thanks, Trass3r et al! I'll give it a try in D, then. Of course you can't create 64Bit dlls though ;)

Re: status of shared-libs on Windows?

2011-05-19 Thread Trass3r
Am 20.05.2011, 01:44 Uhr, schrieb Jimmy Cao : I've even created a dll that is used as a keylogger hook thing for Windows with only D. Just remembering that I also created a COM dll with D to intercept DirectDraw calls in an old game.

Re: status of shared-libs on Windows?

2011-05-19 Thread Trass3r
(I've already successfully created and used Matlab .mex/.dll plugins with D)

Re: status of shared-libs on Windows?

2011-05-19 Thread Trass3r
Am 19.05.2011, 22:28 Uhr, schrieb Graham Fawcett : Hi folks, I've only used D on Linux so far, so I'm not clear on the current shared-library story on Windows. Consider an existing C++ application that can be extended by writing plugins, which are usually written in C or C++, and compiled a

Re: Memory corruption rant.

2011-05-18 Thread Trass3r
Am 18.05.2011, 03:51 Uhr, schrieb Jesse Phillips : Trass3r Wrote: Could it be a stack corruption? That would make the most sense for the behavior I'm seeing, but I don't really know how to corrupt the stack without using ASM, and even then I'd probably fail. Could al

Re: Memory corruption rant.

2011-05-17 Thread Trass3r
Could it be a stack corruption?

Re: correct way to create boiler plate code

2011-05-16 Thread Trass3r
foreach runs at runtime, while mixin is expanded at compile time. Not the whole truth though. foreach over tuples gets unrolled at compile time so you can do stuff like: // +=, -=, ... Vector opOpAssign(string op, U)(U s) { foreach (i, _; tuple) mixin("tuple[i] " ~ op ~

Re: correct way to create boiler plate code

2011-05-16 Thread Trass3r
string[] funcs = ["tan"]; calling mixin a compile time has the following error... Error 1 Error: variable func cannot be read at compile time C:\D\SVNProjects\trunk\xcellD\xcell1\trig.d 22 That's because funcs is mutable. Try to make it immutable or enum.

Re: object.d: Error: module object is in file 'object.d' which cannot be read

2011-03-27 Thread Trass3r
"object.d: Error: module object is in file 'object.d' which cannot be read Specify path to file 'object.d' with -I switch " Could it be you also deleted the dmd.conf in the local dmd/linux/bin?

Re: object.d: Error: module object is in file 'object.d' which cannot be read

2011-03-27 Thread Trass3r
object.d: Error: module object is in file 'object.d' which cannot be read import path[0] = /etc/../../src/phobos import path[1] = /etc/../../src/druntime/import As you can see dmd.conf uses relative paths. That guide needs an overhaul. The easiest way is to copy the contents of the zip archive

Re: Want to help DMD bugfixing? Write a simple utility.

2011-03-24 Thread Trass3r
Is there a copy of the official D grammar somewhere online? I wrote a lexer for my Compiler class and would love to try and apply it to another grammar. The official D grammar is spread among the specification. But I recall that someone compiled a complete grammar for D1 some time ago.

Re: Best practice for strings across D1 and D2

2011-03-17 Thread Trass3r
nedbrek Wrote: > 2) What is the best way to make the same declarations work for D1 and D2? > It seems everything inside a "version" statement must parse correctly, and > D1 doesn't want to parse "immutable(char)"... You may also use versioned aliases. Just include the D2 code via a string mixin

Re: Help passing D strings to C libs

2011-03-14 Thread Trass3r
I'm having trouble passing D strings (char[]) to SDL, in particular SDL_LoadBMP(), I keep receiving a segfault. Heres the code: void setImg(string path) { // concat null terminating char to string and cast to c type string when // passing to SDL_LoadBMP() path ~= "\0"; image =

Re: enum with classes/structs

2011-03-10 Thread Trass3r
... or does enumerations only support constant-expressions? Thanks! Yep, enum is a compile-time thing.

Re: Iterating a typle tuple of templates

2011-03-04 Thread Trass3r
bearophile Wrote: > It seems "t" is not useful... Yep, foreach over tuples is kinda messed up. Same with reference tuple foreach: http://d.puremagic.com/issues/show_bug.cgi?id=2411 Direct access doesn't work but accessing via [i] does.

Re: About const and C functions

2011-03-02 Thread Trass3r
Am 01.03.2011, 23:33 Uhr, schrieb bearophile : Do you know why DMD doesn't give a compilation error here? import core.stdc.stdio: sscanf; immutable int value = 5; void main() { sscanf("10".ptr, "%d".ptr, &value); } What's the D signature of sscanf?

Re: How-to manipulate a C array with D2 vector operations?

2011-02-28 Thread Trass3r
I am trying to implement a D2 function that has this C signature (it gets called from a C module and I cannot change the caller): extern(C) read_into(char *buffer, size_t buf_len); I would like to use D's vector (or array-wise according to TDPL) operations on buffer but I cannot find a way, how

Re: Version very simple?

2011-02-28 Thread Trass3r
Note that negation and logical and can basically be simulated: !bla -> version(bla) {} else ... bla && blub -> version(bla) version(blub) {...}

Re: Ini parsing library in D ?

2011-02-28 Thread Trass3r
http://www.dprogramming.com/ini.php

%x and floats

2011-02-24 Thread Trass3r
Why doesn't this work: import std.stdio; void main() { float a,b=0; writefln("%x %x", a, b); } std.format.FormatError: std.format floating

Re: "__gshared static" versus "static __gshared"

2011-02-23 Thread Trass3r
http://d.puremagic.com/issues/show_bug.cgi?id=4419

Re: OpenGL in D2

2011-02-21 Thread Trass3r
> I've found a few OpenGL projects, like bindings > (http://www.dsource.org/projects/bindings/) and derelict > (http://www.dsource.org/projects/derelict/), but I still can't find any way to > easily use or install them (for D2 on Ubuntu). Use derelict2 from svn and xfBuild. Then you just need to t

Re: Invoke garbage collector?

2011-02-09 Thread Trass3r
However, I need the resources to be freed more quickly than the GC is apparently doing You could use scoped instances if you need to clean them up soon after creation.

Re: Debugging D?

2011-02-06 Thread Trass3r
Are debug symbols compiled with -gc stored in a separate file? Visual Studio refuses to debug my things Nope. Plus you need to use cv2pdb to debug with Visual

Re: C# interop

2011-01-30 Thread Trass3r
As Simen said, there was an attempt to create an IL backend but it hasn't been updated since Aug 2009 and even it compiled you probably wouldn't have much fun with it. You could try to use a C bridge. But even then, I don't see the benefit.

Re: How can you read and understand the source of *naryFun in functional.d?

2011-01-29 Thread Trass3r
Save this somewhere or it will be lost here ;)

shared library loader (wrapper for GetProcAddress & Co)

2011-01-25 Thread Trass3r
I can't seem to find something like that in phobos. Is it missing or am I overlooking it?

Re: template magic

2011-01-25 Thread Trass3r
> How do you not pass them in a safe manner? If you are casting things, of course you don't get type safety. Yep, I was talking about non-template functions. Only way to pass an arbitrary function is via void*

Re: template magic

2011-01-25 Thread Trass3r
> 2. What is the reason for Phobos defining param funcs as template params? Correct me if I'm wrong but there's no way to pass an arbitrary function to a function in a type-safe way. If you use pointers and casts you can't check if the passed function meets certain requirements (parameters, return

template this parameters

2011-01-25 Thread Trass3r
Why do they exist and why does typeof(this) strip constness? import std.stdio; struct S { const void foo(this T)(int i) { writeln(typeid(T)); } const void bar() { writeln(typeid(typeof(this))); } } void main() { const(S) s; (&s).foo(1); S s2;

Re: Anyone have a clue how to download the Orange repository?

2011-01-23 Thread Trass3r
The "problem" is it uses a Mercurial repository.

Re: Assigning Interface to Object

2011-01-21 Thread Trass3r
Speaking of COM.. has anyone successfully used COM interfaces in D2? I once tried to create a DDraw proxy dll but I can't remember how good it worked. https://bitbucket.org/trass3r/ddrawproxy

<    1   2   3   4   >