File Imports ============ ```Example from 1 languages: JavaScript import { helloWorld } from "./helloWorld.js"; ``` ```Example from 1 languages: C // If a header file is included within <>, the preprocessor will search a predetermined directory path to locate the header file. If the header file is enclosed in "", the preprocessor will look for the header file in the same directory as the source file. #include <stdio.h> #include "stdio.h" ``` ```Example from 1 languages: Python import datetime oTime = datetime.datetime.now() from my_pkg import my_funcs ``` ```Example from 1 languages: Java import javax.swing.*; import javax.swing.JOptionPane; // use fully qualified name without import: javax.swing.JOptionPane.showMessageDialog(null, "Hi"); // There are 166 packages containing 3279 classes and interfaces in Java 5. // import java.io.*; Input-output classes. ``` ```Example from 1 languages: CSS @import 'custom.css'; ``` ```Example from 1 languages: Perl use Digest::MD5 'md5_hex'; ``` ```Example from 1 languages: Ruby load 'filename.rb' require 'filename' require 'trig.rb' ``` ```Example from 1 languages: PHP <?php include 'vars.php'; require 'filename'; // FATAL error if fails ``` ```Example from 1 languages: Go import ( "fmt" "math" ) import . "fmt" import _ "io" import log "github.com/foo/bar" import m "math" ``` ```Example from 1 languages: TypeScript import { ZipCodeValidator } from "./ZipCodeValidator"; /// <reference path="../typings/jquery.d.ts"/> /// <reference path="components/someclass.ts"/> import moo = module('moo'); /// <amd-dependency path="legacy/moduleA" name="moduleA"/> ``` ```Example from 1 languages: C# using static System.Console; using static System.Math; class Program { static void Main() { WriteLine(Sqrt(3*3 + 4*4)); } } ``` ```Example from 1 languages: R source("filename.r") ``` ```Example from 1 languages: Bash source ./bash.sh ``` ```Example from 1 languages: Rust use ::std::fs; // Imports from the `std` crate, not the module below. use self::std::fs as self_fs; // Imports the module below. mod my; use self::foo::Zoo as _; #[path = "foo.rs"] mod c; ``` ```Example from 1 languages: Swift import UIKit import UIKit.UITableViewController let tvc = UITableViewController() let vc = UIViewController() let label = UILabel() ``` ```Example from 1 languages: MATLAB import pkg.cls1 import pkg.pkfcn ``` ```Example from 1 languages: Kotlin import foo.Bar // Bar is now accessible without qualification import foo.* // everything in 'foo' becomes accessible import bar.Bar as bBar // bBar stands for 'bar.Bar' ``` ```Example from 1 languages: Haskell import Data.Maybe import Mod as Foo import Mod (x,y, (+++)) import qualified Mod import Mod hiding (x,y,(+++)) import qualified Mod hiding (x,y) ``` ```Example from 1 languages: Clojure (load "fun") (load "files/fun") (load-file "./files/fun.clj") (defproject project-a :dependencies [[org.clojure/clojure "1.5.1"] [project-b "0.1.0"]]) (require '[clojure.string :as string]) (use '[clojure.string :only [split]]) (import 'java.util.Date) (java.util.Date.) (require 'clojure.contrib.def 'clojure.contrib.except 'clojure.contrib.sql) (require '(clojure.contrib def except sql)) ``` ```Example from 1 languages: Elixir # Alias the module so it can be called as Bar instead of Foo.Bar alias Foo.Bar, as: Bar # Require the module in order to use its macros require Foo # Import functions from Foo so they can be called without the `Foo.` prefix import Foo # Invokes the custom code defined in Foo as an extension point use Foo ``` ```Example from 1 languages: Erlang -include("my_records.hrl"). -include("incdir/my_records.hrl"). -include("/home/user/proj/my_records.hrl"). -include("$PROJ_ROOT/my_records.hrl"). -include_lib("kernel/include/file.hrl"). ``` ```Example from 1 languages: Objective-C // #import ensures that a file is only ever included once so that you never have a problem with recursive includes. #import <Foundation/Foundation.h> #include <asl.h> #include <mach/mach.h> ``` ```Example from 1 languages: Julia # Files and file names are mostly unrelated to modules; modules are associated only with module expressions. # One can have multiple files per module, and multiple modules per file: using MyModule using MyModule: x, p import MyModule import MyModule.x, MyModule.p import MyModule: x, p module Foo include("file1.jl") include("file2.jl") end ``` ```Example from 1 languages: Dart import 'file-system.dart'; import 'dart:math' as math; ``` ```Example from 1 languages: Racket (require (prefix-in tcp: racket/tcp)) ``` ```Example from 1 languages: Crystal require "../../spec_helper" ``` ```Example from 1 languages: Pug //- index.pug doctype html html include includes/head.pug body h1 My Site p Welcome to my super lame site. include includes/foot.pug ``` ```Example from 1 languages: Chapel import use ``` ```Example from 1 languages: F# open module-or-namespace-name open System.IO open List open Seq ``` ```Example from 1 languages: Gleam import gleam/io import unix/cat as kitty import animal/cat.{Cat, stroke} ``` ```Example from 1 languages: Node.js const fs = require("fs") ``` ```Example from 1 languages: C3 import std::io; ``` ```Example from 1 languages: Ballerina import ballerina/http; import ballerina/io; ``` ```Example from 1 languages: Wa-lang import ( "math" "strings" ) import "strings" => . import "io" => _ import "math" => m ``` ```Example from 1 languages: Toit import .library import library import library show * ``` ```Example from 1 languages: Slope (load-mod my-module) (load "examples/test.slo") ``` ```Example from 1 languages: Scroll import settings.scroll ``` ```Example from 1 languages: nomnoml #import: filename ``` ```Example from 1 languages: Flow9 import runtime; ``` ```Example from 1 languages: X10 import x10.io.Console; ``` ```Example from 1 languages: ArkScript (import std.List) (import std.Math :max) ``` ```Example from 1 languages: Veryl // file scope import import $sv::SvPackage::*; module ModuleA { import PackageA::*; import PackageA::paramA; } package PackageA { local paramA: u32 = 1; } ``` ```Example from 1 languages: Cyber import m 'math' ``` ```Example from 1 languages: Xtext import "http://www.xtext.org/example/Domainmodel" import "http://www.xtext.org/example/Domainmodel" as dmodel ``` ```Example from 1 languages: Jule use std::fs use std::sys::{self, open, O_RDWR} use std::math::* ``` ```Example from 1 languages: bog let {print} = import "std.io" ``` ```Example from 1 languages: Cwerg import fmt ``` ```Example from 1 languages: Speedie import Proj ``` * Languages *with* File Imports include JavaScript, C, Python, Java, CSS, Perl, Ruby, PHP, Go, TypeScript, C#, R, Bash, Rust, Swift, MATLAB, Kotlin, Haskell, Clojure, Elixir, Erlang, Objective-C, Julia, Dart, Racket, Crystal, Pug, Chapel, F#, Gleam, Node.js, C3, Ballerina, Wa-lang, progsbase, Toit, Slope, Scroll, nomnoml, Flow9, X10, ArkScript, Veryl, Dale, Cyber, Xtext, Jule, bog, Cwerg, SAKO, Aardvark, Speedie * Languages *without* File Imports include HTML, JSON, mmCIF * View all concepts with or missing a *hasImports* measurement http://pldb.info/../lists/explorer.html#columns=rank~id~appeared~tags~creators~hasImports&searchBuilder=%7B%22criteria%22%3A%5B%7B%22condition%22%3A%22null%22%2C%22data%22%3A%22hasImports%22%2C%22origData%22%3A%22hasImports%22%2C%22type%22%3A%22num%22%2C%22value%22%3A%5B%5D%7D%5D%2C%22logic%22%3A%22AND%22%7D missing http://pldb.info/../lists/explorer.html#columns=rank~id~appeared~tags~creators~hasImports&searchBuilder=%7B%22criteria%22%3A%5B%7B%22condition%22%3A%22!null%22%2C%22data%22%3A%22hasImports%22%2C%22origData%22%3A%22hasImports%22%2C%22type%22%3A%22num%22%2C%22value%22%3A%5B%5D%7D%5D%2C%22logic%22%3A%22AND%22%7D with Built with Scroll v178.2.3