lect6 - Yin Lou CS 2026, Spring 2010 First assignment due...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Yin Lou CS 2026, Spring 2010 First assignment due today Second assignment will be released due in one week Function parameters: ref, out, params Iterators Advanced C# topics: Nullable types Partial Classes Generics Delegates Anonymous methods Events Treat functions as first- class objects Pass functions to other functions OCaml C/C++ Java No equivalent way to get function pointers use inner classes (or interfaces) that contain methods map (fun x -> x*x) [1; 2; 3] ;; typedef int (*fptr) (int); int apply(fptr f, int var) { return f(var); } int F(int var) { .. } fptr f = F; apply(f,10); //same as F(10) An objectified function Is a type that references a method behaves like C/C++ style function pointer inherits from System.Delegate sealed implicitly eg. delegate int Func(int x) defines a new type Func: takes int, returns int declared like a function with an extra keyword Contrast C syntax: typedef int (*fptr)(int); stores a list of methods to call...
View Full Document

This document was uploaded on 03/15/2010.

Page1 / 16

lect6 - Yin Lou CS 2026, Spring 2010 First assignment due...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online