clojure api Regular Expressions篇

Posted in 未分类

Regular Expressions
正则表达式

Create
创建

re-pattern Returns an instance of java.util.regex.Pattern, for use, e.g. in re
re-pattern 返回一个java.util.regex.Pattern实例.使用在例如 re-matcher中.

re-matcher Returns an instance of java.util.regex.Matcher, for use, e.g. in re
re-matcher 返回一个java.util.regex.Matcher,使用在例如 re-find中.

Use
使用

re-find Returns the next regex match, if any, of string to pattern, using j
re-find 返回下一个正则表达式的匹配,如果有的话则返回字符串形式的pattern(模式) ,使用java.util.regex.Matcher.find().使用re-groups返回这个分组.

re-matches Returns the match, if any, of string to pattern, using java.util.re
re-matches 返回该匹配,如果有的话,则返回字符串形式的pattern(模式),使用java.util.regex.Matcher.matches(),使用re-groups返回这个分组.

re-seq Returns a lazy sequence of successive matches of pattern in string,
re-seq 返回一个惰性序列,在字符串中逐次匹配得到.

re-groups Returns the groups from the most recent match/find. If there are no
re-groups 返回分组. ???不会了= =|

基础的都发完了….

clojure api Strings / Characters篇

Posted in clojure

Strings / Characters
字符串/字符

Create

str With no args, returns the empty string. With one arg x, returns x.t
str 无参数返回空字符串,有参数返回参数连接起来的字符串.

print-str print to a string, returning it
print-str 打印一个字符串,并返回它

println-str println to a string, returning it
println-str 打印一个字符串并换行,返回它

pr-str pr to a string, returning it
pr-str 用pr打印一个字符串,并返回他,

prn-str prn to a string, returning it
prn-str 用prn打印一个字符串,并返回他

with-out-str Evaluates exprs in a context in which *out* is bound to a fresh Str
with-out-str 将表达式求值并绑定为context中的*out*参数中一个新的字符串.

Use
count Returns the number of items in the collection. (count nil) returns
count 返回一个数字,算出这个集合的项数,(count nil)返回0.

get Returns the value mapped to key, not-found or nil if key not present.
get 通过key 映射返回值,如果没设置not-found 或者nil 则该key 不映射,返回nil.

subs Returns the substring of s beginning at start inclusive, and ending
subs 返回截取的字符串从到start 到end结束.

format Formats a string using java.lang.String.format, see java.util.Formatt
format 格式化一个字符串,使用java.lang.String.format ,详见 java.util.Format.

Cast / Test
转换/?
char Coerce to char
char 强制转换一个参数到char

char? Return true if x is a Character
char? 判断参数是否是一个字符.

string? Return true if x is a String
string? 判断参数是否是一个字符串.

clojure api Symbols / Keywords 篇

Posted in clojure

Create
创建

keyword Returns a Keyword with the given namespace and name. Do not use :
keyword 返回一个给定的命名空间和名称的关键字,不要使用:,给一个string的值.他会自动添加…

symbol Returns a Symbol with the given namespace and name.
symbol 返回一个给定命名空间和名字的符号..

Use
使用

name Returns the name String of a string, symbol or keyword.
name 返回一个name是string的符号或关键字

intern Finds or creates a var named by the symbol name in the namespace ns
intern 查找或创建一个在命名空间[ns(可以是命名空间或者一个符号)]中以符号名命名的变量,如果提供[ns]则绑定到此命名空间中,命名空间必须存在.这个变量将接受任何元数据的符号名称,并返回这个变量.

namespace Returns the namespace String of a symbol or keyword, or nil if not pr
namespace 返回一个命名空间的符号或者关键字的字串,如果不存在则返回nil

Test

keyword? Return true if x is a Keyword
keyword? 如果参数是一个关键字则返回true

symbol? Return true if x is a Symbol
symbol? 如果参数是一个符号则返回true.

clojure api Test篇

Posted in clojure

原文地址 : http://clojuredocs.org/quickref/Clojure%20Core

Test

啥意思呢= =|

nil? Returns true if x is nil, false otherwise.
nil? 如果参数等于nil则返回true,反之返回false.

identical? Tests if 2 arguments are the same object
identical? 判断2个参数是否是相同的对象(值?)

zero? Returns true if num is zero, else false
zero? 如果参数等于0则返回true,反之false.

pos? Returns true if num is greater than zero, else false
pos? 如果大于0,返回true,反之false.

neg? Returns true if num is less than zero, else false
neg? 如果小于0返回true,反之返回false.

even? Returns true if n is even, throws an exception if n is not an integer
even? 如果参数偶数则返回true,反之返回false,如果参数不是一个整数类型则抛出异常.

odd? Returns true if n is odd, throws an exception if n is not an integer
odd? 如果参数是奇数返回true,反之返回false,如果参数不是一个整数类型则抛出异常.

clojure api Cast篇

Posted in clojure

原文地址: http://clojuredocs.org/quickref/Clojure%20Core

Cast
强制转换

byte Coerce to byte
byte 强制转换成byte

short Coerce to short
short 强制转换成short

int Coerce to int
int 强制转换成int

long Coerce to long
long 强制转换成long

float Coerce to float
float 强制转换成float

double Coerce to double
double 强制转换成double

bigint Coerce to BigInteger
bigint 强制转换成bigInteger

bigdec Coerce to BigDecimal
bigdec 强制转换成bigDecimal

num Coerce to Number
num 强制转换成Number

rationalize returns the rational value of num
rationalize 返回一个合理的参数值.

clojure api Bitwise Operations篇

Posted in clojure

原文地址:http://clojuredocs.org/quickref/Clojure%20Core

Bitwise Operations
按位操作

bit-and Bitwise and
bit-and 按位与

bit-or Bitwise or
bit-or 按位或

bit-xor Bitwise exclusive or
bit-xor 按位异或

bit-flip Flip bit at index n
bit-flip 翻转在索引n上 ?

bit-not Bitwise complement
bit-not 按位补充

bit-clear Clear bit at index n
bit-clear 清除在索引n上

bit-set Set bit at index n
bit-set 设置在索引n上

bit-shift-left Bitwise shift left
bit-shift-left 左移

bit-shift-right Bitwise shift right
bit-shift-right 右移

bit-test Test bit at index n
bit-test 测试在索引n上位数.

= =好多不太正确….明白的请留言我及时修改哈.

clojure api Compare篇

Posted in clojure

原文地址: http://clojuredocs.org/quickref/Clojure%20Core

Compare
比较

= Equality. Returns true if x equals y, false if not. Same as Java x.
= 相等,如果一个x equals(相等于) y返回true,不相等则返回false, 相当于java的相等(equals)方法.

== Returns non-nil if nums all have the same value, otherwise false
== 如果参数有相同的值,返回true,反之返回false

not= Same as (not (= obj1 obj2))
not= 相当于 (not (= obj1 obj2)) ,obj1 相等于 obj2 返回true,取非返回false,反之返回true.

< Returns non-nil if nums are in monotonically increasing order, othe
< 如果一组数从小到大排列 则返回true,反之返回false(不出现重复) > Returns non-nil if nums are in monotonically decreasing order, othe
> 如果一组数从大到小排列,则返回true 反之返回false(不出现重复)

= Returns non-nil if nums are in monotonically non-increasing order,
>= 如果一组数从大到小排列,则返回true 反之返回false(可以重复)

clojure api Number篇

Posted in clojure

原文地址:http://clojuredocs.org/quickref/Clojure%20Core

 

Arithmetic:

算术:
+ Returns the sum of nums. (+) returns 0.
+ 返回参数总和,无参数返回0.

- If no ys are supplied, returns the negation of x, else subtracts th
- 如果没有提供参数则拒绝返回任何东西,给定参数则返回.

* Returns the product of nums. (*) returns 1.
* 返回参数的乘积,无参数则返回1.

/ If no denominators are supplied, returns 1/numerator, else returns
/ 如果只提供分母(除数) , 返回 1/分母(除数) ,给定参数则返回商.

quot quot[ient] of dividing numerator by denominator.
quot 分子除以分母?

rem remainder of dividing numerator by denominator.
rem 剩余分子除以分母.

mod Modulus of num and div. Truncates toward negative infinity.
mod 取模,砍掉小数.(向负无穷大.)

inc Returns a number one greater than num.
inc 返回一个数递增

dec Returns a number one less than num.
dec 返回一个数的递减

max Returns the greatest of the nums.
max 返回一组参数最大的一个.

min Returns the least of the nums.
min 返回一个组参数最小的一个.

with-precision Sets the precision and rounding mode to be used for BigDecimal operat
with-precision 设置一个精度的四舍五入的数,使用bigDecimal操作.

64位window7下配置Clojure+Emacs开发环境

Posted in colojure[转]

 

巫云哥写的…

 

很详细…

http://www.cnblogs.com/darkluck99/articles/2360216.html

win7  win8  32位 也可以

Linux 也跟着差不多.

在linux下  使用

https://raw.github.com/technomancy/leiningen/stable/bin/lein

这个东西…一个shell脚本安装

 

啦啦啦,博客开张啦….

Posted in 未分类

还不是弄的太好…大家海涵….