.. _label9:
-9. 基本ライブラリ
+基本ライブラリ
==================================
.. index::
single: VERBOSE
.. _label9.1:
-9.1 ビルドイン変数
+ビルドイン変数
----------------------------------
* **OMAKE_VERSION**
.. _label9.2:
-9.2 論理式、真偽関数、コマンドのコントロール
+論理式、真偽関数、コマンドのコントロール
-------------------------------------------------
.. Boolean values in omake are represented by case-insensitive strings. The false value can be represented by the strings false, no, nil, undefined or 0, and everything else is true.
single: not()
.. _label9.2.1:
-9.2.1 not
+not
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: equal()
.. _label9.2.2:
-9.2.2 equal
+equal
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The equal function tests for equality of two values.
single: and()
.. _label9.2.3:
-9.2.3 and
+and
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: or()
.. _label9.2.4:
-9.2.4 or
+or
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: if()
.. _label9.2.5:
-9.2.5 if
+if
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: match()
.. _label9.2.6:
-9.2.6 switch, match
+switch, match
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The switch and match functions perform pattern matching.
single: try
.. _label9.2.7:
-9.2.7 try
+try
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: raise()
.. _label9.2.8:
-9.2.8 raise
+raise
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The raise function raises an exception. The exn object can be any object. However, the normal convention is to raise an Exception object.
single: exit()
.. _label9.2.9:
-9.2.9 exit
+exit
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: defined()
.. _label9.2.10:
-9.2.10 defined
+defined
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: defined-env()
.. _label9.2.11:
-9.2.11 defined-env
+defined-env
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: getenv()
.. _label9.2.12:
-9.2.12 getenv
+getenv
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: setenv()
.. _label9.2.13:
-9.2.13 setenv
+setenv
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: unsetenv()
.. _label9.2.14:
-9.2.14 unsetenv
+unsetenv
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: get-registry()
.. _label9.2.15:
-9.2.15 get-registry
+get-registry
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: getvar()
.. _label9.2.16:
-9.2.16 getvar
+getvar
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: setvar()
.. _label9.2.17:
-9.2.17 setvar
+setvar
^^^^^^^^^^^^^^^^^^^^^^^^^
::
setvar(public.X, abc)
-9.3 配列とシーケンス
+配列とシーケンス
----------------------------------
.. index::
single: array()
.. _label9.3.1:
-9.3.1 array
+array
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: split()
.. _label9.3.2:
-9.3.2 split
+split
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: concat()
.. _label9.3.3:
-9.3.3 concat
+concat
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: length()
.. _label9.3.4:
-9.3.4 length
+length
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: nth()
.. _label9.3.5:
-9.3.5 nth
+nth
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: replace-nth()
.. _label9.3.6:
-9.3.6 replace-nth
+replace-nth
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: nth-hd()
.. _label9.3.7:
-9.3.7 nth-hd
+nth-hd
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: nth-tl()
.. _label9.3.8:
-9.3.8 nth-tl
+nth-tl
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: subrange()
.. _label9.3.9:
-9.3.9 subrange
+subrange
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: rev()
.. _label9.3.10:
-9.3.10 rev
+rev
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: join()
.. _label9.3.11:
-9.3.11 join
+join
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: string()
.. _label9.3.12:
-9.3.12 string
+string
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: string-length()
.. _label9.3.13:
-9.3.13 string-length
+string-length
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: id-escaped()
.. _label9.3.14:
-9.3.14 string-escaped, ocaml-escaped, html-escaped, html-pre-escaped, c-escaped, id-escaped
+string-escaped, ocaml-escaped, html-escaped, html-pre-escaped, c-escaped, id-escaped
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: encode-uri()
.. _label9.3.15:
-9.3.15 decode-uri, encode-uri
+decode-uri, encode-uri
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: quote()
.. _label9.3.16:
-9.3.16 quote
+quote
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: quote-argv()
.. _label9.3.17:
-9.3.17 quote-argv
+quote-argv
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: html-string()
.. _label9.3.18:
-9.3.18 html-string
+html-string
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: addsuffix()
.. _label9.3.19:
-9.3.19 addsuffix
+addsuffix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: mapsuffix()
.. _label9.3.20:
-9.3.20 mapsuffix
+mapsuffix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: addsuffixes()
.. _label9.3.21:
-9.3.21 addsuffixes
+addsuffixes
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: removeprefix()
.. _label9.3.22:
-9.3.22 removeprefix
+removeprefix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: removesuffix()
.. _label9.3.23:
-9.3.23 removesuffix
+removesuffix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: replacesuffixes()
.. _label9.3.24:
-9.3.24 replacesuffixes
+replacesuffixes
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: addprefix()
.. _label9.3.25:
-9.3.25 addprefix
+addprefix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: mapprefix()
.. _label9.3.26:
-9.3.26 mapprefix
+mapprefix
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: add-wrapper()
.. _label9.3.27:
-9.3.27 add-wrapper
+add-wrapper
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: set()
.. _label9.3.28:
-9.3.28 set
+set
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: mem()
.. _label9.3.29:
-9.3.29 mem
+mem
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: intersection()
.. _label9.3.30:
-9.3.30 intersection
+intersection
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: intersects()
.. _label9.3.31:
-9.3.31 intersects
+intersects
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: set-diff()
.. _label9.3.32:
-9.3.32 set-diff
+set-diff
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: filter()
.. _label9.3.33:
-9.3.33 filter
+filter
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: filter-out()
.. _label9.3.34:
-9.3.34 filter-out
+filter-out
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: capitalize()
.. _label9.3.35:
-9.3.35 capitalize
+capitalize
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: uncapitalize()
.. _label9.3.36:
-9.3.36 uncapitalize
+uncapitalize
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: uppercase()
.. _label9.3.37:
-9.3.37 uppercase
+uppercase
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: lowercase()
.. _label9.3.38:
-9.3.38 lowercase
+lowercase
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: system()
.. _label9.3.39:
-9.3.39 system
+system
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: shell()
.. _label9.3.40:
-9.3.40 shell
+shell
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: export()
.. _label9.3.41:
-9.3.41 export
+export
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The export function allows one to capture the current environment in a variable.
single: while
.. _label9.3.42:
-9.3.42 while
+while
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: break
.. _label9.3.43:
-9.3.43 break
+break
^^^^^^^^^^^^^^^^^^^^^^^^^
::
single: random-init()
.. _label9.3.44:
-9.3.44 random, random-init
+random, random-init
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
.. _label9.4:
-9.4 演算
+演算
----------------------------------
.. index::
single: int()
.. _label9.4.1:
-9.4.1 int
+int
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The int function can be used to create integers. It returns an Int object.
single: float()
.. _label9.4.2:
-9.4.2 float
+float
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The float function can be used to create floating-point numbers. It returns a Float object.
single: max()
.. _label9.4.3:
-9.4.3 基本的な演算
+基本的な演算
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following functions can be used to perform basic arithmetic.
single: ugt()
.. _label9.4.4:
-9.4.4 評価
+評価
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The following functions can be used to perform numerical comparisons.
.. _label9.5:
-9.5 基本的な関数群
+基本的な関数群
----------------------------------
.. index::
single: apply()
.. _label9.5.2:
-9.5.2 apply
+apply
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The apply operator is used to apply a function.
single: applya()
.. _label9.5.3:
-9.5.3 applya
+applya
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The applya operator is used to apply a function to an array of arguments.
single: create-lazy-map()
.. _label9.5.4:
-9.5.4 create-map, create-lazy-map
+create-map, create-lazy-map
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The create-map is a simplified form for creating Map objects. The create-map function takes an even number of arguments that specify key/value pairs. For example, the following values are equivalent.
.. _label9.6:
-9.6 イテレーションとマッピング
+イテレーションとマッピング
----------------------------------
.. index::
single: foreach()
.. _label9.6.1:
-9.6.1 foreach
+foreach
^^^^^^^^^^^^^^^^^^^^^^^^^
.. The foreach function maps a function over a sequence.
.. _label9.7:
-9.7 ブーリアン関数群
+ブーリアン関数群
----------------------------------
.. index::
single: sequence-forall()
.. _label9.7.1:
-9.7.1 sequence-forall
+sequence-forall
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The forall function tests whether a predicate halds for each element of a sequence.
single: sequence-forall()
.. _label9.7.2:
-9.7.2 sequence-exists
+sequence-exists
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The exists function tests whether a predicate holds for some element of a sequence.
single: sequence-sort()
.. _label9.7.3:
-9.7.3 sequence-sort
+sequence-sort
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The sort function sorts the elements in an array, given a comparison function. Given two elements (x, y), the comparison should return a negative number if x < y; a positive number if x > y; and 0 if x = y.
single: compare()
.. _label9.7.4:
-9.7.4 compare
+compare
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. The compare function compares two values (x, y) generically returning a negative number if x < y; a positive number if x > y; and 0 if x = y.