|
for(var guilty=now;guilty<endOfDays;++guilty) ;
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
what's wrong / not good enough with (at the top of the file):
using IntList = System.Collections.Generic.List<int>;
|
|
|
|
|
For simple things it may work, and I use that.
But now try to make a Dictionary of those the same way.
|
|
|
|
|
Mm...
do you mean while this work...
using IntList = System.Collections.Generic.List<int>;
using DictIntList = System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<int>>;
this short cut is sadly incorrect
using IntList = System.Collections.Generic.List<int>;
using DictIntList = System.Collections.Generic.Dictionary<string, IntList>;
However either way you can still write:
var d = new DictIntList();
var l1 = new IntList();
d["doo"] = l1;
|
|
|
|
|
Super Lloyd wrote: d["doo"] = l1; I give in, and I know it's going to annoy me all day.
What song's it from?
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
|
I always had this idea one day to start to add some F# utility library to my home utility libraries....
But this project has still gone nowhere in a long time :/
|
|
|
|
|
Super Lloyd wrote: this short cut is sadly incorrect
Annoyingly, it works if you put the using statements in different scopes:
using IntList = System.Collections.Generic.List<int>;
namespace TestIt
{
using DictIntList = System.Collections.Generic.Dictionary<string, IntList>;
...
Type Alias | C# Online Compiler | .NET Fiddle[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hahah good find!
|
|
|
|
|
doesn't work in the real world.
Most of the time I need more than static typedefing. I will need to fill in a T parameter somewhere.
If using let you do like - using Fat<t> = IDictionary<t,fa<t>>; then i would use var less.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
i have to agree. for me i think it makes code clearer than the alternative in a lot of cases where generics are involved. The screen gets to cluttered with angle brackets otherwise. i hate it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Super Lloyd wrote: what's wrong / not good enough with (at the top of the file): ... Nothing, but it may impose a task on some code-readers/user to consult your pre-index if you stray from the path of mnemonic.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
well... the OP was asking for typedef. it is what it is!
Personally I like var well enough!
|
|
|
|
|
|
who needs type checking? =)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Type checking is at compile-time as usual.
|
|
|
|
|
i understand how var works, I just wasn't paying attention and wording my response very carefully.
what i meant to say is who needs explicitly named types in var decls?
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Ummm, I don't think the using clause statement is actually meant for typedef duties.
var is almost as evil as goto .
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
i know, but it's the closest thing i have.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
If you{re functioning at a high level, does that mean you{re writing code in Haskell?
CQ de W5ALT
Walt Fair, Jr.PhD P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
No, you just live in a high-rise apartment.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Doesn't that mean coding stoned?
"Go forth into the source" - Neal Morse
|
|
|
|
|
"how do i do error recovery in a lalr(1) parser"
i thought this was a much easier question
i thought this was one function called "Panic()"
now it looks like i need to rewrite my LALR stuff.
*googles frantically*
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|