CSC302 2011S, Class 03: Ruby (2) Overview: * Leftover topics from day 1. * New ideas from 2.3. * Lab. Admin: * Apologies for not getting the reading link in proper place today. * Lessons from yesterday's session? * Reading for Monday (respond Sunday): the rest of Tate 2. * I am perenially behind. I expect to get next week's assignment posted by this evening. Sam's "What are the differences between arrays and ranges" example Why might Ruby treat blocks and functions differently? * Maybe treating them differnetly makes the language simpler * Maybe performance reasons * Maybe limited vision * Treating them as perfectly equivalent conflicts with other language design decisions Does foo mean * Call foo * The value of the "function" foo * Blocks seem to be designed more to be anonymous? From 2.3 * Ruby has kitchen sink "arrays" * Ruby provides a built in dictionary data type that people call a "hash" * For fast comparisons, Ruby provides a symbol data type * Ruby provides classes. And inheritance And mixin And ugly syntactic sugar for building getters and setters Lab reflection * Arrays seem to be passed by reference * Integers seem to be passed by name * or ...