caller trouble

2012-07-14 Thread captaindet
i need a discreet handle on the calling/instantiating source file (module). using __FILE__, it is surprisingly easy for functions (via argument) and templated functions (via template parameter) but i cannot get it working for templated classes. how can i make them aware of the calling module?

Re: caller trouble

2012-07-14 Thread Jonathan M Davis
On Saturday, July 14, 2012 01:53:34 captaindet wrote: i need a discreet handle on the calling/instantiating source file (module). using __FILE__, it is surprisingly easy for functions (via argument) and templated functions (via template parameter) but i cannot get it working for templated

Re: Creating a shared reference type

2012-07-14 Thread Minas Mina
Thanks, I've got another problem: void f() { sema.wait(); ++x; sema.notify(); } sema is the global shared Semaphore (as above) main.d(29): Error: function core.sync.semaphore.Semaphore.wait () is not callable using argument types () shared

Re: Creating a shared reference type

2012-07-14 Thread David Nadlinger
On Saturday, 14 July 2012 at 09:15:55 UTC, Minas Mina wrote: Isn't this the way shared is used (or should be used)? Should be used: probably yes. But functions/methods which are able to act on shared data must be marked so, and unfortunately, the druntime primitives are not yet annotated

Re: Immutable array initialization in shared static this

2012-07-14 Thread Tommi
On Friday, 13 July 2012 at 18:09:59 UTC, Era Scarecrow wrote: I would think the best solution is to create a mutable local version, and then assign the immutable global one when you are done. Thanks for the workaround. But I'm actually more interested in whether or not this is a compiler

ICFP2012

2012-07-14 Thread bearophile
Maybe someone is interested in participating: http://icfpcontest2012.wordpress.com/task/ Bye, bearophile

Re: ICFP2012

2012-07-14 Thread Daniel
On Saturday, 14 July 2012 at 11:01:06 UTC, bearophile wrote: Maybe someone is interested in participating: http://icfpcontest2012.wordpress.com/task/ Bye, bearophile I already am! With D aswell, but you ran away from the #d too fast for me to reply. Wouldn't mind some D help on a few

Re: Creating a shared reference type

2012-07-14 Thread Minas Mina
On Saturday, 14 July 2012 at 09:21:27 UTC, David Nadlinger wrote: On Saturday, 14 July 2012 at 09:15:55 UTC, Minas Mina wrote: Isn't this the way shared is used (or should be used)? Should be used: probably yes. But functions/methods which are able to act on shared data must be marked so,

Re: deimos libX11 undefined reference

2012-07-14 Thread Minas Mina
Try -L-lX11

Re: caller trouble

2012-07-14 Thread captaindet
On 2012-07-14 02:12, Jonathan M Davis wrote: [..] I believe that __FILE__ and __LINE__ are treated specially with functions in order for them to be filled in at the call site rather than the declaration site. If it's not working with classes, then that probably means that whatever special logic

Re: caller trouble

2012-07-14 Thread Jonathan M Davis
On Saturday, July 14, 2012 13:30:03 captaindet wrote: IIRC, __FILE__ is a template itself It's not. It's a special symbol recognized by the compiler, and ends up in several places in the grammar. - Jonathan M Davis

Re: caller trouble

2012-07-14 Thread Timon Gehr
On 07/14/2012 08:53 AM, captaindet wrote: i need a discreet handle on the calling/instantiating source file (module). using __FILE__, it is surprisingly easy for functions (via argument) and templated functions (via template parameter) but i cannot get it working for templated classes. how can i

Re: caller trouble

2012-07-14 Thread captaindet
auto _fun = fun(); //_fun == main.d auto _tfun = tfun(); //_tfun == main.d auto _tclass = new tclass!(); //_tclass.from == other.d !!! //this works but i do not want to provide __FILE__ explicitly: auto _tclassx = new tclass!(__FILE__)(); //_tclass.from == main.d //and why do i get 2 different

Re: deimos libX11 undefined reference

2012-07-14 Thread cal
On Saturday, 14 July 2012 at 12:55:21 UTC, Minas Mina wrote: Try -L-lX11 Yeah I was already linking X11. The problem was the binding, it defined a function that was never defined in the original c header, so it would not be able to find the function anywhere. Commenting the defs out in the

ufcs and integer params

2012-07-14 Thread Jay Norwood
I was looking at the xtend example 4 Distances here, and see that their new generation capability includes ability to do 3.cm 10.mm , and these result in calls to cm(3) and mm(10). http://blog.efftinge.de/ I see that similar capability was discussed for D previously at the link below.

Re: ufcs and integer params

2012-07-14 Thread Jay Norwood
I see from this other discussions that it looks like 2.059 ( or maybe 2.060) does support something like 3.cm(). Not sure from the discussion if it would also accept 3.cm as in the xtext/xtend example. http://forum.dlang.org/thread/smoniukqfxerutqrj...@forum.dlang.org

Re: ufcs and integer params

2012-07-14 Thread Jonathan M Davis
On Sunday, July 15, 2012 05:30:55 Jay Norwood wrote: I see from this other discussions that it looks like 2.059 ( or maybe 2.060) does support something like 3.cm(). Not sure from the discussion if it would also accept 3.cm as in the xtext/xtend example.