Re: Get the name of a function and the parameters?

2009-04-28 Thread Georg Wrede
Jarrett Billingsley wrote: Don't you love it? "Most C++ template features are discovered." So are D's. Well, one could say that this is the very definition of a well working metaprogramming system. After all, the whole idea of templates is to let the programmer invent new ways to use the l

Re: Get the name of a function and the parameters?

2009-04-28 Thread Jarrett Billingsley
On Tue, Apr 28, 2009 at 10:23 PM, Daniel Keep wrote: > That requires f to be a type, which loses you the actual names.  And you > cannot (last time I checked) have aliases in a tuple. Check again - tuples can be any arbitrary mix of types, expressions, and aliases. :)

Re: Get the name of a function and the parameters?

2009-04-28 Thread Daniel Keep
Jarrett Billingsley wrote: > On Tue, Apr 28, 2009 at 3:07 PM, grauzone wrote: >> I'd like to pass several functions at once. Is there a way to make this >> variadic? The obvious approach (writing "NameOfFunc(alias f...)") fails with >> a syntax error. > > Sure, you'd just make it NameOfFunc(f..

Re: Get the name of a function and the parameters?

2009-04-28 Thread Jarrett Billingsley
On Tue, Apr 28, 2009 at 3:07 PM, grauzone wrote: > > I'd like to pass several functions at once. Is there a way to make this > variadic? The obvious approach (writing "NameOfFunc(alias f...)") fails with > a syntax error. Sure, you'd just make it NameOfFunc(f...) and then recursively instantiate,

Re: Get the name of a function and the parameters?

2009-04-28 Thread grauzone
Jarrett Billingsley wrote: On Sun, Apr 26, 2009 at 12:23 PM, Jacob Carlborg wrote: Is it possible to get the name of a function and the names of the function parameters? Name of a function? Yes. public template NameOfFunc(alias f) { version(LDC) const char[] NameOfFu

Re: D-styled data file

2009-04-28 Thread Saaa
I changed the prototype to: void get(in char[] varName, ...) I'm not totally happy with it because I only need one variadic argument and : How do I get the .stringof of an variadic type? _arguments[0].stringof doesn't work :) How do I mutate the original argument? (ref) Please tell me if I'm

parser generator for D2

2009-04-28 Thread dfan
hi all, is there a parser generator that works for/with the current D2?? thanks for any help dfan

Re: Get the name of a function and the parameters?

2009-04-28 Thread Jacob Carlborg
Jarrett Billingsley wrote: On Mon, Apr 27, 2009 at 6:56 AM, Jacob Carlborg wrote: I found that this: void foo (int x, int y) { } void main () { pragma(msg, typeof(&foo).stringof); } gave this result: void function(int x, int y) So now I just have to get the names out of there. Intere

Re: pyd still usable?

2009-04-28 Thread Jarrett Billingsley
On Tue, Apr 28, 2009 at 4:05 AM, Simen Haugen wrote: > > It uses templates for bindings, and if I remember correctly, dmd hits the > limit for max variable name length when using templates. > I hit the limit somewhere around 8 functions I think. Actually the name limit hasn't been a problem for s

Installation on (64 bit) Linux

2009-04-28 Thread Brandon Moore
I managed to get a working system-wide dmd installation. It would have been easier if the Ubuntu packages or linux installation instructions actually set things up so the compiler could find the interface definitions, and if the required dependencies on a 64-bit (Ubuntu) system were documented out

Re: pyd still usable?

2009-04-28 Thread Simen Haugen
Jarrett Billingsley wrote: On Mon, Apr 27, 2009 at 11:18 AM, mpt wrote: Which versions of tango+gdc+pyd do I need to get stuff to work? I'd like to use D+Python on 32 or 64 bit Linux. I've tried a number of tango/gdc bundles and pyd rc/trunk, but there are always compiler and linker errors. Ho