2
Is it correct to state that every primitive type is a first-class citizen in a programming language? If not, for what reason? This may vary from language to language?
2
Is it correct to state that every primitive type is a first-class citizen in a programming language? If not, for what reason? This may vary from language to language?
Browser other questions tagged language-independent paradigms
You are not signed in. Login or sign up in order to post.
What does "citizens" mean? I’ve never heard that term before in programming.
– user28595
@Articuno, here a reference.
– Bruno Peres
@Articuno another
– Jéf Bueno
It is not easy to answer this, it is a little ambiguous. I think the type is not, the value yes, but there are controversies.
– Maniero
@bigown In Ruby, for example, "everything is an object". You can call a method directly from number 10, for example (10.to_s). It is difficult to know what is not a first-class citizen in this language according to the definitions you have around.
– Bruno Peres
That’s not true, that’s language marketing, there’s a lot of stuff in it that’s not object :) That you’ve essentially shown any language can. Even if you say that all values are objects, this can be said of all languages. It lacks better definition. Then language can give a definition that only meets your interest, so it gets complicated.
– Maniero