[phobos] D std.bind

Andrei Alexandrescu andrei at erdani.com
Wed Jun 16 14:57:20 PDT 2010


(Added Phobos.) We haven't tested std.bind in a long time. With the 
advent of function literals etc., it seems pointless. Walter and I think 
it should be deprecated.

Andrei

Jason Spencer wrote:
> Hi, 
> 
> I've been trying to get the simplest program that uses bind() to work with D 2.046 (or 2.036 or 2.047), but I've run into problem after problem.  First, it seems D2 tightened up const handling, and the NullAlias struct of type const EmptySlot would match is expressions.  After fixing that, I'm now getting:
> 
> C:\Jason\D>dmd bTest.d
> C:\tools\dmd2\windows\bin\..\..\src\phobos\std\binder.d(230): Error: alias std.bind.Tuple!().Tuple.meta template identifier prependT is not a member of alias meta
> C:\tools\dmd2\windows\bin\..\..\src\phobos\std\binder.d(775): Error: no property 'prependT!(T)' for type 'Tuple!()'
> C:\tools\dmd2\windows\bin\..\..\src\phobos\std\binder.d(775): Error: alias std.bind.dynArgTypes!(i,Tuple!(int),Tuple!(DynArg!(0)),1).prependType!(int,DynArg!(0)).res cannot alias an expression __error
> 
> I'm a D newbie, and the syntax is too much for to start on without getting a couple of practice programs down first.  
> 
> Do you know if anyone has tested std.bind in recent releases?  I've talked to Tom, but he doesn't seem to be supporting it, esp. in D 2.  I've also posted on DigitalMars.D.  Any other ideas?
> 
> Thanks,
> Jason


More information about the phobos mailing list