My Recent Pastes (173 and counting)

Pastes by Defiler (173 and counting)

Below are the 15 most recent pasties by Defiler.

June 01, 2007
1:07PM EDT
by Defiler

## Ruby code
class Object
  def should_equal(other)
    puts "testing equality of #{self} and #{other}"
    self

June 01, 2007
12:44PM EDT
by Defiler

### ruby code
class Object
  def should_equal(other)
    puts "testing equality of #{self} and #{other}"
    self

June 01, 2007
11:50AM EDT
by Defiler

  alias fail! fail
  def fail(err = nil, *rest)
    begin 
      E2MM.Fail(self, err, *rest)
    rescue E2MM::ErrNotRegisteredException

May 31, 2007
10:06PM EDT
by Defiler

#hydra>cat adhoc/case_with_splat.rb
x =  case 'z'
     when *['a', 'b', 'c', 'd']
        "foo" 
     when *['x', 'y', 'z']

May 31, 2007
7:51PM EDT
by Defiler

sirb(eval):001> "case\nwhen true\np 'hi'\nwhen false\np 'bye'\nelse\np 'wtf'\nend".to_sexp
=> [:newline, 8, "(eval)", [:when, [:array, [:true]], [:newline, 3, "(eval)", [:fcall, :p, [:array, [:str, "hi"]]]]]]

May 31, 2007
7:48PM EDT
by Defiler

#hydra>cat adhoc/case_without_arg.rb                                                               
case
when true
  p 'hi'
when false

May 31, 2007
7:39PM EDT
by Defiler

Index: shotgun/lib/grammar.y
===================================================================
--- shotgun/lib/grammar.y        (revision 1228)
+++ shotgun/lib/grammar.y        (working copy)
@@ -329,7 +329,6 @@

May 31, 2007
7:29PM EDT
by Defiler

case
when true
  p 'hi'
when false
  p 'bye'

May 31, 2007
2:10PM EDT
by Defiler

{ # X! and x!
  my $t = 'C[3]  x!8 C[2]';
  my @a = (0x73..0x77);
  my $p = pack($t, @a);
  is($p, "\x73\x74\x75\0\0\0\0\0\x76\x77");

May 31, 2007
12:32PM EDT
by Defiler

>> class Foo
>> def initialize
>> p 5
>> end
>> end

May 30, 2007
8:40PM EDT
by Defiler

  def open_metaclass
    <<-CODE
    stack_push(object_metaclass(state, stack_pop()));
    CODE
  end

May 30, 2007
8:11PM EDT
by Defiler

def unleash_the_hounds
  puts "home again home again"
  @evil = false
  yield
end

May 30, 2007
4:16PM EDT
by Defiler

(0..10).each do |block_param|
    block_var = block_param * 2
     puts "block_var = #{block_var}, block_param = #{block_param}" 
    for i in 1..5
        puts "i = #{i}, block_var = #{block_var}, block_param = #{block_param}" 

May 30, 2007
2:02PM EDT
by Defiler

#hydra>cat nested.rb 
(0..10).each do |block_param|
    block_var = block_param * 2
    puts "block_var = #{block_var}, block_param = #{block_param}" 
    for i in 1..5

May 29, 2007
9:30PM EDT
by Defiler

hydra>cat nested.rb                                                                                       
(0..10).each do |block_param|
    block_var = block_param * 2
    puts "block_var = #{block_var}, block_param = #{block_param}" 
    for i in 1..5

Next page

Previous page