mgravell (64) [Avatar] Offline
#1
[from "ch7" version; is there a meaningful reference version for you?]

§5.3

> All of this is specific to C# 2
font bleed

-----

> Remember that Snippy will
font bleed

=====

§5.4

> In other words an Action<
font bleed

=====

§5.4.1

Listing 5.5
Works "as is", but just a thought; if you wanted to reduce the vertical length, could use double[]

instead of List<double>, using the array initializer syntax. Could either throw into a

List<double> ctor, or just tweak the action to work on IEnumerable<double>, IList<double> or

double[].

-----

> the compiler will generate ### within the class
Wasn't sure if something was missing at highlight?

=====

§5.4.2

> in particular, no event handlers do
ResolveEventHandler; don't ask me why they didn't have a settable property
Probably a handful of others; I couldn't be bothered to reflect...

-----

> only the return value from the last action to be called would be available
Well, the caller could always walk the invocation list (but this isn't well-typed); not tidy,

though

=====

§5.4.3

> then the compiler needs more help. To show you what I mean,
> ... In this situation, the compiler throws its hands up and issues an error.
You show the problem, but not the solution (similar cast to §5.2)
jon.skeet (448) [Avatar] Offline
#2
Re: §5.3 thru §5.5.6
> [from "ch7" version; is there a meaningful reference
> version for you?]

That's a fine reference - I get all the MEAP drops too smilie

> §5.3
>
> > All of this is specific to C# 2
> font bleed

Fine in my manuscript; will ignore.

> > Remember that Snippy will
> font bleed

Ditto.

> §5.4
>
> > In other words an Action<
> font bleed

Ditto. (Thanks for raising these anyway though smilie

> §5.4.1
>
> Listing 5.5
> Works "as is", but just a thought; if you wanted to
> reduce the vertical length, could use double[]
>
> instead of List<double>, using the array initializer
> syntax. Could either throw into a
>
> List<double> ctor, or just tweak the action to work
> on IEnumerable<double>, IList<double> or
> double[].

Nice one - thanks.

> > the compiler will generate ### within the class
> Wasn't sure if something was missing at highlight?

Absolutely: "a method" which is a bit clumsy, but clear enough.

> =====
>
> §5.4.2
>
> > in particular, no event handlers do
> ResolveEventHandler; don't ask me why they didn't
> have a settable property
> Probably a handful of others; I couldn't be bothered
> to reflect...

Thanks - another reviewer has pointed this out too. Will modify appropriately smilie

> > only the return value from the last action to be
> called would be available
> Well, the caller could always walk the invocation
> list (but this isn't well-typed); not tidy, though

True. Will consider being specific - might leave it though.

> §5.4.3
>
> > then the compiler needs more help. To show you what
> I mean,
> > ... In this situation, the compiler throws its
> hands up and issues an error.
> You show the problem, but not the solution (similar
> cast to §5.2)

Thanks, will fix.

(I need to add a cool hint to that section - using wildcard delegates for creating field-like events with initial no-op handlers:

public event EventHandler Whatever = delegate {};
)

Jon
mgravell (64) [Avatar] Offline
#3
Re: §5.3 thru §5.5.6
> ResolveEventHandler
[off-topic] The only reason I remembered is that it came up on an MCTS exam. Now that is just harsh - especially as one of the choices (the one I selected, IIRC) seemed to offer something more like what you might expect. Oh well, passed anyway...

Marc