> On Fri, Mar 23, 2001 at 09:40:03PM +0900, Harry Ohlsen noted: > > I may be giving a quick introduction to Ruby to a Linux user group > > over the weekend (ie, in the next 48 hours, Sydney time). > > > > Dave Thomas has kindly allowed me to use his slides, and I've been > > writing examples to go with some of them, over and above the code > > that's in the slides themselves. > > > > What I'd be interested in, if anyone can help me, would be some short > > code snippets that show off some of Ruby's features (and I'm pretty > > much a newbie, so I'm sure there are lots of things I don't know > > about). > > > > In particular, I would guess a lot of the audience will know perl, so > > examples of how to do things that perl can do and that people think > > are important features of perl would be useful, so when someone says > > "perl can do this; can ruby?" I'll be able to show them how it's done. > > > > Similarly for python I guess. > > > > Note, I'm not looking to say "Ruby's better than X because ...", just > > to be able to say "If you were to write stuff in ruby, you can still > > do the things you currently do in X". Of course, if the Ruby version > > happens to be cleaner or more flexible in some way, so much the > > better. > > > > I'd prefer complete code snippets that I can actually run, but I'm > > happy to write some code to call anything you can provide ... so long > > as I understand how it works :-). > > > > Thanks in advance. If you need to throw something basic in there as well--like to show differences in OO syntax--I have a Beats class that I implemented in both Perl and Python. It's an object for translating the time to and from the Swatch .beats system. I commented it for presentation because I was going to give it to my old CS professor. All it would need is for you to implement it in Ruby. E-mail me if you'd like the code. Michael