I know of two languages that use import statement: Java and Python. And we all know the import antigravity joke.
Which language really introduced this statement? Was it one of the two, or another one altogether? When?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
importis just one way to specify dependency on some other class/module. Some way of specifying that has been present in many, many languages.In fact
importin Java andimportin Python do two entirely different things:importonly provides the ability to refer to a type (or field/method, if usingimport static) by its short name instead of its fully qualified name. No “module loading” of any kind happens based on animport.importactually loads a module and optionally provides a short name for some (or all) of its members.Other keywords that do somewhat similar things are
includein C andusein Perl. Many, many languages have some kind of way to specify this kind of dependency, but the technical details vary a lot.One language with an
IMPORTstatement that predates both Java and Python is Modula-2 (1978) and its successor Modula-3.