brucefengnju / blog Goto Github PK
View Code? Open in Web Editor NEWthis my blog back. http://blog.brucefeng.info
this my blog back. http://blog.brucefeng.info
ns用来定义当前的命名空间,可以配合import,require,use进行使用。
(ns foo.bar
(:refer-clojure :exclude [ancestors printf])
(:require [clojure.contrib sql sql.tests])
(:use [my.lib this that])
(:import [java.util Date Timer Random]
(java.sql Connection Statement)))
require 是将clojure load进入当前的命名空间,会跳过已经load进来的lib。 :require可以配合 :as, :only, :include, :exclude, :refer, :all等等一起使用。
;; alias clojure.java.io as iouser=> (require '[clojure.java.io :as io])nil
user=> (io/file "Filename")#<File Filename>
;; alias clojure.java.io as io using prefixesuser=> (require '(clojure.java [io :as io2])nil
user=> (io2/file "Filename")#<File Filename>
use与require作用类似,但除了将libs load进入之外,还使用clojure.core/refer refer他们的namespaces。可以配合:exclude, :only, and :rename使用。
(ns some.namespace
(:require [clojure.contrib.json :as json])
(:use [clojure.string :only [trim lower-case split]]
[clojure.contrib.shell-out]
[clojure.pprint]
[clojure.test]))
import主要用来加载java类。
(import & import-symbols-or-lists)
import-list => (package-symbol class-name-symbols*)
(ns foo.bar
(:import (java.util Date
Calendar)
(java.util.logging Logger
Level)))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.