Click here to Skip to main content
15,923,789 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is there a use for... Pin
BillWoodruff27-Aug-11 18:16
professionalBillWoodruff27-Aug-11 18:16 
GeneralRe: Is there a use for... Pin
Narf the Mouse27-Aug-11 19:36
Narf the Mouse27-Aug-11 19:36 
AnswerRe: Is there a use for... Pin
jschell28-Aug-11 8:03
jschell28-Aug-11 8:03 
GeneralRe: Is there a use for... Pin
Narf the Mouse28-Aug-11 8:56
Narf the Mouse28-Aug-11 8:56 
AnswerRe: Is there a use for... Pin
Narf the Mouse28-Aug-11 11:33
Narf the Mouse28-Aug-11 11:33 
GeneralRe: Is there a use for... [modified] Pin
BillWoodruff28-Aug-11 19:37
professionalBillWoodruff28-Aug-11 19:37 
AnswerRe: Is there a use for... Pin
BobJanova30-Aug-11 0:20
BobJanova30-Aug-11 0:20 
GeneralRe: Is there a use for... Pin
Narf the Mouse30-Aug-11 0:38
Narf the Mouse30-Aug-11 0:38 
I apologize if you did read this particular post, but it sounds like you didn't, so I'm reposting it.

<quote>
Valid in current paradigm:
C#
var a = 5.5;

Invalid in current paradigm, but valid if paradigm theoretically adopted by C#:
C#
a = new func<double>(delegate() { return 5.5; });

Using a theoretical library of additional functions, both are valid:
C#
DTBase<double> a = (DTVar<double>)5.5;
a = new DTFunc<double>(delegate() { return 5.5; });


The key point is that, instead of being a specific type of variable, "a" is now defined by what you get when you call it.


If you're wondering what use being able to type variables by what they return when "called" is, a few suggested thoughts are:
C#
Dictionary<string, DTBase<double>> formulasForGame; // Functions, equations, single variables and file reads. 

C#
List<DTBase<string>> urlRetrieval; // Retrieves urls from various places and sources. Optionally, a list of DTArgs<string>. 

C#
List<DTFunc<string, string>> chatRelays; // A set of functions that relay text strings for chat according to the specific sending needs of each specific receiver and sender. 


And any other situation where you want a generic, quick way to access data by type, not implementation. That is to say, counting double and Func(double) as separate implementations, but the same type.

Thank you for your patience and interest. Smile | :)
GeneralRe: Is there a use for... Pin
BobJanova30-Aug-11 6:52
BobJanova30-Aug-11 6:52 
AnswerRe: Is there a use for... Pin
GParkings1-Sep-11 7:04
GParkings1-Sep-11 7:04 
GeneralRe: Is there a use for... Pin
Narf the Mouse1-Sep-11 7:16
Narf the Mouse1-Sep-11 7:16 
GeneralRe: Is there a use for... Pin
GParkings1-Sep-11 7:23
GParkings1-Sep-11 7:23 
GeneralRe: Is there a use for... Pin
Narf the Mouse1-Sep-11 8:26
Narf the Mouse1-Sep-11 8:26 
QuestionInheritance Pin
lukeer26-Aug-11 3:47
lukeer26-Aug-11 3:47 
AnswerRe: Inheritance Pin
Rob Philpott26-Aug-11 3:55
Rob Philpott26-Aug-11 3:55 
AnswerRe: Inheritance Pin
MicroVirus26-Aug-11 4:17
MicroVirus26-Aug-11 4:17 
GeneralMessage Removed Pin
26-Aug-11 5:40
mentorNot Active26-Aug-11 5:40 
GeneralRe: Inheritance Pin
MicroVirus26-Aug-11 6:09
MicroVirus26-Aug-11 6:09 
GeneralMessage Removed Pin
26-Aug-11 7:10
mentorNot Active26-Aug-11 7:10 
GeneralRe: Inheritance Pin
jschell26-Aug-11 8:36
jschell26-Aug-11 8:36 
GeneralRe: Inheritance Pin
MicroVirus26-Aug-11 14:05
MicroVirus26-Aug-11 14:05 
GeneralMessage Removed Pin
26-Aug-11 15:00
mentorNot Active26-Aug-11 15:00 
GeneralRe: Inheritance Pin
Anna-Jayne Metcalfe27-Aug-11 0:04
Anna-Jayne Metcalfe27-Aug-11 0:04 
GeneralRe: Inheritance Pin
Hans Dietrich27-Aug-11 6:04
mentorHans Dietrich27-Aug-11 6:04 
GeneralRe: Inheritance Pin
Anna-Jayne Metcalfe27-Aug-11 6:17
Anna-Jayne Metcalfe27-Aug-11 6:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.