Sign In
Fabulous Adventures In Coding
Eric Lippert's Blog
Tags
Aargh! (8)
accuracy (6)
anonymous types (3)
Arrays (8)
ASP (11)
AStar (5)
Async (15)
bad jokes (14)
Begging the question (4)
Benford's Law (3)
Best Of FAIC (12)
Big Words (5)
Books (22)
Breaking Changes (24)
Brittle Base Classes (6)
C# (317)
C# 4.0 (39)
C# 5.0 (9)
Cargo Cult Programming (4)
cast operator (3)
Channel 9 (6)
Charts (4)
closures (3)
Code Generation (10)
Code Quality (29)
COM Programming (57)
Conditional Operator (3)
Continuation Passing Style (11)
Conversions (16)
Covariance and Contravariance (22)
customer service (4)
declaration spaces (5)
Dialogue (14)
English Usage (11)
exception handling (9)
Floating Point Arithmetic (14)
grammars (9)
graph colouring (5)
Hashing (8)
High Dimensional Spaces (5)
Immutability (27)
integer arithmetic (5)
Interviewing (8)
Introduction (6)
It Hurts When I Do This (5)
Iterators (10)
JScript (93)
JScript .NET (29)
keywords (4)
Lambda Expressions (20)
Language Design (59)
local variables (3)
localization (3)
Mathematics (14)
Memory Management (13)
Metablogging (9)
Mistakes (4)
Music (6)
myths (7)
namespaces (5)
Non-computer (37)
Optional arguments (5)
Overload Resolution (9)
Pages (25)
Performance (48)
precedence (4)
precision (7)
protected (7)
Puzzles (46)
queries (3)
quotable quotations (4)
Quotes (3)
Rants (51)
Rarefied Heights (51)
Recursion (26)
reference (4)
Regular Expressions (13)
Relationships (4)
Salt (4)
Science (12)
scope (5)
Scripting (189)
Security (46)
shadowcasting (6)
SimpleScript (30)
Software development methodology (13)
Static Methods (6)
Threading (18)
Topological Sort (4)
Type Inference (17)
type safety (4)
unsafe code (4)
Value Types (11)
VBScript (80)
Video (12)
virtual dispatch (9)
VSTO (10)
warnings (5)
What's The Difference? (11)
Zombies (4)
Browse by Tags
MSDN Blogs
>
Fabulous Adventures In Coding
>
All Tags
>
iterators
Tagged Content List
Blog Post:
Iterator Blocks Part Seven: Why no anonymous iterators?
Eric Lippert
This annotation to a comment in part five I think deserves to be promoted to a post of its own. Why do we disallow anonymous iterators? I would love to have anonymous iterator blocks. I want to say something like: IEnumerable<int> twoints = ()=>{ yield return x; yield return x*10; }; foreach...
on
24 Aug 2009
Blog Post:
Iterator Blocks, Part Six: Why no unsafe code?
Eric Lippert
There are three good reasons to disallow unsafe blocks inside an iterator block. First, it is an incredibly unlikely scenario. The purpose of iterator blocks is to make it easy to write an iterator that walks over some abstract data type. This is highly likely to be fully managed code; it's simply...
on
27 Jul 2009
Blog Post:
Iterator Blocks, Part Five: Push vs Pull
Eric Lippert
A while back I posted some commentary I did for the Scripting Summer Games where I noted that there is an isomorphism between "pull" sequences and "push" events. Normally you think of events as something that "calls you", pushing the event arguments at you. And normally you think of a sequence as something...
on
23 Jul 2009
Blog Post:
Iterator blocks Part Four: Why no yield in catch?
Eric Lippert
Now that you know why we disallow yielding in a finally, it’s pretty straightforward to see why we also disallow yielding in a catch. First off, we still have the problem that it is illegal to “goto” into the middle of the handler of a try-protected region. The only way to enter a catch block is via...
on
20 Jul 2009
Blog Post:
Iterator Blocks, Part Three: Why no yield in finally?
Eric Lippert
There are three scenarios in which code could be executing in a finally in an iterator block. In none of them is it a good idea to yield a value from inside the finally, so this is illegal across the board. The three scenarios are (1) normal cleanup, (2) exception cleanup, and (3) iterator disposal....
on
16 Jul 2009
Blog Post:
Iterator Blocks, Part Two: Why no ref or out parameters?
Eric Lippert
A long and detailed discussion of how exactly we implement iterator blocks would take me quite a while, and would duplicate work that has been done well by others already. I encourage you to start with Raymond’s series, which is a pretty gentle introduction: part 1 , part 2 , part 3 . If you want a more...
on
13 Jul 2009
Blog Post:
Iterator Blocks, Part One
Eric Lippert
There is a constant tension in language design between solving general problems and solving specific problems; finding the right spot on the general-to-specific spectrum can be quite tricky. The design of iterator blocks yields (ha ha) a germane example. At almost every step along the way, there are...
on
9 Jul 2009
Blog Post:
Iterators at the Summer Games
Eric Lippert
Ed "Scripting Guy" Wilson was kind enough to ask me to be a guest commentator at this years Summer Scripting Games , which have just completed. I've been working on a series for this blog about some unusual cases in the design of the "iterator block" feature in C# 2.0; this bit from my commentary...
on
26 Jun 2009
Blog Post:
Psychic Debugging, Part Two
Eric Lippert
A number of readers have the mysterious fifth sense which gives them the ability to deduce that the GetBars method from yesterday's post contains a yield return and is therefore an iterator. Remember, as the standard states (in section 10.14.4): [...] execution of the code in the iterator block occurs...
on
6 Sep 2007
Blog Post:
Psychic Debugging, Part One
Eric Lippert
Here is a compiler bug report I got the other day. The user is trying to write a unit test for a method which takes a Foo and returns a collection of Bar s. The test is supposed to confirm that GetBars throws an exception if the argument is null . The test was failing with “got no exception”. The user...
on
5 Sep 2007
Page 1 of 1 (10 items)