Skip to content

Instantly share code, notes, and snippets.

@agargiulo
Created July 23, 2015 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agargiulo/7b9f29d3716b7e3abcfd to your computer and use it in GitHub Desktop.
Save agargiulo/7b9f29d3716b7e3abcfd to your computer and use it in GitHub Desktop.
Fun with returning nothing in different languages
sub Foo {
return;
}
sub Bar {
return undef;
}
my $foo_item = Foo();
my $bar_item = Bar();
my $foo_things = [Foo()];
my $bar_things = [Bar()];
def foo():
return
def bar():
return None
foo_item = foo()
bar_item = bar()
foo_things = [foo()]
bar_things = [bar()]
def foo
return
end
def bar
return nil
end
foo_item = foo
bar_item = bar
foo_things = [foo]
bar_things = [bar]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment