As far as I am concerned, first class usually means that:
- Can be stored in a variable
- Can be passed to or returned from a function
- Can form complex data structure like list
So, as for Python where everything is an object, everything is first class citizen. Am I right? Even functions are first class citizens.
# functions
# can be treated as objects
def toUpper(text):
return text.upper()
print toUpper('abc')
Upperize = toUpper
print Upperize('abc')
What about R? Is everything in R is first class object? Or is there any exception?
Any thoughts would be helpful.