Skip to main content

Ruby

There are all sorts of bizarre meta-programming ways of doing this in Ruby, and I might post one at some point, but for now here'shere’s a goofy bit of obfuscation.

def sum(*args)
  *arg_list,arg_enum=args
  arg_list.first + arg_enum.next
end

p sum(2,2)
def sum(*args)
  *arg_list,arg_enum=args
  arg_list.first + arg_enum.next
end

p sum(2,2)

Ruby

There are all sorts of bizarre meta-programming ways of doing this in Ruby, and I might post one at some point, but for now here's a goofy bit of obfuscation.

def sum(*args)
  *arg_list,arg_enum=args
  arg_list.first + arg_enum.next
end

p sum(2,2)

Ruby

There are all sorts of bizarre meta-programming ways of doing this in Ruby, and I might post one at some point, but for now here’s a goofy bit of obfuscation.

def sum(*args)
  *arg_list,arg_enum=args
  arg_list.first + arg_enum.next
end

p sum(2,2)
Source Link
histocrat
  • 22.3k
  • 4
  • 38
  • 80

Ruby

There are all sorts of bizarre meta-programming ways of doing this in Ruby, and I might post one at some point, but for now here's a goofy bit of obfuscation.

def sum(*args)
  *arg_list,arg_enum=args
  arg_list.first + arg_enum.next
end

p sum(2,2)