Starting with leveling up our brains using Lumosity.

Lumosity

The Brain that changes itself book

Small daily practice sessions

Complete context switch.

Code Katas to complete

certain methods like ` backtick are actually methods on Kernel which gets mixed into the heierarchy somewhere.

If you tell a Proc to return it will exit the enclosing method.

Proc.new do
    p 'blah'
    return
  end

if you tell a lambda to return it will only exit the scope of the lambda not the enclosing method.

lambda {
    p 'blah'
    return
  }

  def do_something(&block)
    block
  end

  def do_something(&block)
    yield
  end
class Proc
    def memoize(*args)
      lambda { @result ||= call(args) }
    end
  end

Brain melted x4

comments powered by Disqus