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:
> 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 > <shortcutter@googlemail.com <mailto:shortcutter@googlemail.com>> wrote:
On Wed, Jun 19, 2013 at 10:42 AM, Robert Klemme > <shortcutter@googlemail.com <mailto:shortcutter@googlemail.com>> wrote:
On Tue, Jun 18, 2013 at 9:59 PM, Brandon Weaver > <keystonelemur@gmail.com <mailto:keystonelemur@gmail.com>> 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
How Emacs changed my life | PPT
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