From: Stu Date: 2013-06-20T15:27:04+09:00 Subject: Re: getting the most out of Ruby --089e0160c5ce9565d304df9008f3 Content-Type: text/plain; charset=ISO-8859-1 Yes that s the book I was recommending. Though not a panacea it's an excellent place to begin when your first learning ruby and have some experience with other programming language concepts. Though it doesn't touch shell or system programming it shows the ruby object model and meta model and also explains enough functional programming for those who are new to that as well. I wouldn't consider it complete on the pure functional programming paradigm but it definitely shows you the "Ruby way" of programming which ultimately ends up with this unique language build on many paradigms. Those of you who plan on reading this book I recommend exploring the concepts with the ruby repl irb, or the fancier one pry, to get the best experience while manipulating the language within the language. Though pry has an wrapper to open the users preferred editor within it's repl, since it's inspired by emacs/clisp/slime, I used a gem interactive_editor which allows does the same thing with irb where you can call vim from inside irb; type some ruby code like a method or class definition; then on save it pushes the code into the running irb repl. It's a wonderful way to grok the language while having fun doing quick experiments and hacks without the overhead of running a separate terminal or typing require -- it supports other editors and easy to mod. Though I never got around to it I altered it to support unix ed and graphical x11 editors which it dynamically picked up the locally installed system editors by altering the runtime code from a apropos/grep call from inside the gem. I can't think of any programming language which has the same hack value as Ruby. There really are no limitations with ruby. It really is a smart programming language built by a programmer for programmers. ~Stu On Wed, Jun 19, 2013 at 11:51 PM, Eliezer Croitoru wrote: > are you talking about this book?? > http://www.amazon.com/**Metaprogramming-Ruby-Program-** > Like-Pros/dp/1934356476 > > Eliezer > > > On 06/20/2013 12:40 AM, Stu wrote: > >> >> >> On Tue, Jun 18, 2013 at 6:09 PM, robin wood > > wrote: >> Brandon W. wrote in post #1112804: >> > Blocks, Lambdas, Closures, Metaprogramming, and Enumerables are the >> huge >> > topics. Master them and you'll see a huge difference. >> >> Got any resources you used to help get your head around all these? >> >> I felt that the book "Meta-Programming Ruby" was very eye opening. It >> explains the object model in the first 100 pages. I recommend it based >> on what you've said. I rarely push books but that one seems to be >> written by someone who thought through the pedagogical approach of Ruby >> paradigm with everyone coming from different programming backgrounds. >> >> >> On Wed, Jun 19, 2013 at 3:45 AM, Robert Klemme >> >> >> wrote: >> >> >> >> >> On Wed, Jun 19, 2013 at 10:42 AM, Robert Klemme >> >> >> wrote: >> >> >> >> >> On Tue, Jun 18, 2013 at 9:59 PM, Brandon Weaver >> >> >> wrote: >> >> The biggest jumping point for me is when I stopped trying to >> program Ruby like C# and started programming Ruby like Ruby. >> >> :-) >> >> Coming from C land you have tendencies towards a lot of >> imperative techniques, and Ruby is not solely imperative. >> Learning the functional side of Ruby is essential to >> graduate into advanced topics. >> >> I'd be careful labeling Ruby as "functional". The only >> "functional" about Ruby is that with lambda you can have >> anonymous functions which you can pass around. The core feature >> of funct >> >> >> Sorry, somehow I hit the wrong button and GMail just sent off the >> email. What I wanted to say: >> >> I'd be careful labeling Ruby as "functional". The only "functional" >> about Ruby is that with lambda you can have anonymous functions >> which you can pass around and create higher order functions. The >> core feature of functional programming for me was always functions >> without side effects. And that is not part of Ruby. Of course, you >> _can_ code lambdas without side effects - but the language does not >> enforce this. >> >> Kind regards >> >> robert >> >> >> I agree with you. I am very careful with when I write statements like >> that hence I said "style" as in functional style. I am very used to That >> lambda is important though. It is essentially the primitive of >> functional programming( i.e. everything can be build from combination of >> lambdas) though it would be not very efficient and is something which >> may be explained from a pure "theoretical language" it's neat to know. >> Some people have ported base scheme implementations to ruby( as those >> guys port that language to everything) with just the lambda (once again >> neat but not really useful)... bus scheme I believe is one which is the >> main 7( or 9) original lisp primitives in 40 lines of code. >> >> Though from an analytical point of view it's refreshing when the >> language creator explains his motivations when creating ruby: >> http://blade.nagaokaut.ac.jp/**cgi-bin/scat.rb/ruby/ruby-**talk/179642 >> http://www.slideshare.net/**yukihiro_matz/how-emacs-**changed-my-life >> >> There are some others besides lambda and eval in recent ruby releases >> such as both callcc and curry. But lambda the ultimate for those who are >> into language creation. I recall a higher order cons enumerators. But it >> wasn't a pure cons (each_cons maybe). If we had cons we could create our >> own literals and further car/cdr would simply be aliases to first and >> *rest of the list which for the most part is basically an array with >> whitespace instead of commas for delimitation. >> >> ~Stu >> >> > > --089e0160c5ce9565d304df9008f3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Yes that s the book I was recommending. Though n= ot a panacea it's an excellent place to begin when your first learning = ruby and have some experience with other programming language concepts. Tho= ugh it doesn't touch shell or system programming it shows the ruby obje= ct model and meta model and also explains enough functional programming for= those who are new to that as well. I wouldn't consider it complete on = the pure functional programming paradigm but it definitely shows you the &q= uot;Ruby way" of programming which ultimately ends up with this unique= language build on many paradigms.

Those of you who plan on reading this book I recommend exploring = the concepts with the ruby repl irb, or the fancier one pry, to get the bes= t experience while manipulating the language within the language. Though pr= y has an wrapper to open the users preferred editor within it's repl, s= ince it's inspired by emacs/clisp/slime, I used a gem interactive_edito= r which allows does the same thing with irb where you can call vim from ins= ide irb; type some ruby code like a method or class definition; then on sav= e it pushes the code into the running irb repl. It's a wonderful way to= grok the language while having fun doing quick experiments and hacks witho= ut the overhead of running a separate terminal or typing require -- it supp= orts other editors and easy to mod. Though I never got around to it I alter= ed it to support unix ed and graphical x11 editors which it dynamically pic= ked up the locally installed system editors by altering the runtime code fr= om a apropos/grep call from inside the gem.

I can't think of any programming language which has the same hack v= alue as Ruby. There really are no limitations with ruby. It really is a sma= rt programming language built by a programmer for programmers.

~Stu



On Wed, Jun 19, 2013 at 11:51 PM, Eliezer Croitoru <eliezer@ng= tech.co.il> wrote:
are you talking about this book??
http://www.amazon.com/Metaprogramming-= Ruby-Program-Like-Pros/dp/1934356476

Eliezer


On 06/20/2013 12:40 AM, Stu wrote:


On Tue, Jun 18, 2013 at 6:09 PM, robin wood <lists@ruby-forum.com
<mailto:lists@= ruby-forum.com>> wrote:
Brandon W. wrote in post #1112804:
=A0> Blocks, Lambdas, Closures, Metaprogramming, and Enumerables are the= huge
=A0> topics. Master them and you'll see a huge difference.

Got any resources you used to help get your head around all these?

I felt that the book "Meta-Programming Ruby" was very eye opening= . It
explains the object model in the first 100 pages. I recommend it based
on what you've said. I rarely push books but that one seems to be
written by someone who thought through the pedagogical approach of Ruby
paradigm with everyone coming from different programming backgrounds.


On Wed, Jun 19, 2013 at 3:45 AM, Robert Klemme
<shortcu= tter@googlemail.com <mailto:shortcutter@googlemail.com>> wrote= :




=A0 =A0 On Wed, Jun 19, 2013 at 10:42 AM, Robert Klemme
=A0 =A0 <shortcutter@googlemail.com <mailto:shortcutter@googlemail.com>&g= t; wrote:




=A0 =A0 =A0 =A0 On Tue, Jun 18, 2013 at 9:59 PM, Brandon Weaver
=A0 =A0 =A0 =A0 <keystonelemur@gmail.com <mailto:keystonelemur@gmail.com>> w= rote:

=A0 =A0 =A0 =A0 =A0 =A0 The biggest jumping point for me is when I stopped = trying to
=A0 =A0 =A0 =A0 =A0 =A0 program Ruby like C# and started programming Ruby l= ike Ruby.

=A0 =A0 =A0 =A0 :-)

=A0 =A0 =A0 =A0 =A0 =A0 Coming from C land you have tendencies towards a lo= t of
=A0 =A0 =A0 =A0 =A0 =A0 imperative techniques, and Ruby is not solely imper= ative.
=A0 =A0 =A0 =A0 =A0 =A0 Learning the functional side of Ruby is essential t= o
=A0 =A0 =A0 =A0 =A0 =A0 graduate into advanced topics.

=A0 =A0 =A0 =A0 I'd be careful labeling Ruby as "functional".= =A0The only
=A0 =A0 =A0 =A0 "functional" about Ruby is that with lambda you c= an have
=A0 =A0 =A0 =A0 anonymous functions which you can pass around. =A0The core = feature
=A0 =A0 =A0 =A0 of funct


=A0 =A0 Sorry, somehow I hit the wrong button and GMail just sent off the =A0 =A0 email. =A0What I wanted to say:

=A0 =A0 I'd be careful labeling Ruby as "functional". =A0The = only "functional"
=A0 =A0 about Ruby is that with lambda you can have anonymous functions
=A0 =A0 which you can pass around and create higher order functions. =A0The=
=A0 =A0 core feature of functional programming for me was always functions<= br> =A0 =A0 without side effects. =A0And that is not part of Ruby. =A0Of course= , you
=A0 =A0 _can_ code lambdas without side effects - but the language does not=
=A0 =A0 enforce this.

=A0 =A0 Kind regards

=A0 =A0 robert


I agree with you. I am very careful with when I write statements like
that hence I said "style" as in functional style. I am very used = to That
lambda is important though. It is essentially the primitive of
functional programming( i.e. everything can be build from combination of lambdas) though it would be not very efficient and is something which
may be explained from a pure "theoretical language" it's neat= to know.
Some people have ported base scheme implementations to ruby( as those
guys port that language to everything) with just the lambda (once again
neat but not really useful)... bus scheme I believe is one which is the
main 7( or 9) original lisp primitives in 40 lines of code.

Though from an analytical point of view it's refreshing when the
language creator explains his motivations when creating ruby:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/r= uby/ruby-talk/179642
http://www.slideshare.net/yukihiro_matz/how-ema= cs-changed-my-life

There are some others besides lambda and eval in recent ruby releases
such as both callcc and curry. But lambda the ultimate for those who are into language creation. I recall a higher order cons enumerators. But it wasn't a pure cons (each_cons maybe). If we had cons we could create ou= r
own literals and further car/cdr would simply be aliases to first and
*rest of the list which for the most part is basically an array with
whitespace instead of commas for delimitation.

~Stu




--089e0160c5ce9565d304df9008f3--