Created
July 23, 2015 23:02
-
-
Save agargiulo/7b9f29d3716b7e3abcfd to your computer and use it in GitHub Desktop.
Fun with returning nothing in different languages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub Foo { | |
return; | |
} | |
sub Bar { | |
return undef; | |
} | |
my $foo_item = Foo(); | |
my $bar_item = Bar(); | |
my $foo_things = [Foo()]; | |
my $bar_things = [Bar()]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo(): | |
return | |
def bar(): | |
return None | |
foo_item = foo() | |
bar_item = bar() | |
foo_things = [foo()] | |
bar_things = [bar()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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