%list()
returns an empty
list while %list(%")
returns a list with one element, which is
the empty string.
%<lst=%list(a,b,c)> %linsert(%&lst,1,x)%encode(%lst) => %list(%'a',%'x',%'b',%'c') %linsert(%&lst,5,y)%encode(%lst) => %list(%'a',%'x',%'b',%'c',%",%'y')
%<lst=%list(a,b,c)>%ldelete(%&lst,1)%encode(%lst) => %list(%'a',%'c')
0
denotes that the two arguments are equal, less than 0
means that the first argument should come before the second, greater
than 0
means that the first argument should come after the
second. If comparator is omitted, the macro scmp
is used.
Returns the resulting list. Examples:
%encode(%lsort(%list(b,c,a))) => %list(%'a',%'b',%'c') %encode(%lsort(%list(b,c,a),%lambda(a,b,%scmp(%b,%a)))) => %list(%'c',%'b',%'a')
seq
is used. Returns the modified
list.
%encode(%luniq(%list(a,b,b,c,d,e,e,e,f))) => %list(%'a',%'b',%'c',%'d',%'e',%'f')
1
, if the key key is contained in the hash
hash. Otherwise, returns 0
.
-1
. The
file is opened for reading if mode is omitted or is r
. The
file is opened for writing if mode is w
.
-1
if something goes wrong. Note that
the arguments are not subject to shell expansion, since the process does
not start a subshell. If you want shell expansion, you have to start a
subshell explicitly. For example, to list all files beginning with an
a
:
%pipe(/bin/sh,-c,ls a*)
uid
gid
size
blksize
blocks
atime
mtime
ctime
All times are given in seconds since January 1, 1970, 00:00:00 GMT. For
detailed description of these values see stat(2)
.
-1
. If
registers is specified, which must be a list, clears it and sets
its elements (beginning with @math{1}) to the contents of the
corresponding submatches (parts of the regular expression enclosed by
parentheses). The element 0
is set to the whole match. For
example:
%<regs=%list()>\ %smatch(%'\.([^.]*)$',alittlepicture.jpg,%®s) %regs[1] => 14 jpg
%ssplit(%regex,%string)
is equivalent to
%ssplit(%regex,%string,%lambda(a,b,c,%b))
Example:
%encode(%ssplit(:+,foo::bar:rules)) => %list(%'foo',%'bar',%'rules')
%stokenize(%regexp,%string) %stokenize(%regexp,%string,%lambda(r,%r[0]))
Examples:
%encode(%stokenize([a-zA-Z0-9]+,%' a bc d04 d fsfd, rwe')) => %list(%'a',%'bc',%'d04',%'d',%'fsfd',%'rwe') %encode(%stokenize(%'-([0-9]+)-',%' -32- -- 543 -12--43--', %lambda(r,%r[1]))) => %list(%'32',%'12',%'43')
1
and the whole match in element 0
. options, if
specified, should be a string composed of one or more of the following
characters:
i
Examples:
%sgsub(ei,HEINZI Deinzi,!,i) => H!NZI D!nzi %sgsub(a+,abaacaaadaaaa,%lambda(r,%slength(%r[0]))) => 1b2c3d4
%substring(0123456789,3) => 3456789 %substring(0123456789,-3) => 789 %substring(0123456789,2,3) => 234 %substring(0123456789,2,-5) => 234
strcmp()
C function with string1
and string2.
%snumber(34,2) => 100010 %snumber(-255,16) => -ff
%<regs=%list()>\ %void(%smatch(%'\.([^.]*)$',alittlepicture.jpg,%®s))%regs[1] => jpg
chpp
does not output anything.
chpp
to give a warning with the message message.
chpp
to signal an error with the message message.
1
if val1 and val2 refer to the same value,
otherwise 0
. Two values are the same if a change in one entails
the same change in the other, i.e. if they occupy the same memory
location. Examples:
%<val=abc>%same(%val,%val) => 0 %<val=abc>%same(%&val,%&val) => 1 %<val=abc>%<val2=%&val>%same(%&val,%&val2) => 1
1
if val1 is equal to val2, otherwise
0
. Two scalars are equal if the strings they contain are
equal. Two lists are equal if they have the same length and contain
equal elements. Two hashes are equal if they have the same count and the
same keys map to equal values.
%equal(%list(a,b,c),%list(a,b,c)) => 1 %equal(%hash(a,1,b,2,c,3),%hash(c,3,b,2,a,1)) => 1 %equal(%list(a,b,c),%list(1,2,3)) => 0
scalar
,
list
, hash
, lambda
, built-in
.
%typeof(abc) => scalar %typeof(%list(a,b,c)) => list %typeof(%hash(a,1,b,2,c,3)) => hash %typeof(%lambda(a,%a%a)) => lambda %typeof(%typeof) => built-in
1
if the name name is bound in the current
environment. If not, returns 0
.
%apply(%lambda(a,b,c,my args are %a %b %c),%list(1,2,3)) => my args are 1 2 3
1
if expr is FALSE and 0
if expr is TRUE.
%shexencode(hello world!) => 68656C6C6F20776F726C6421
shexencode
to a string.
%shexdecode(68656C6C6F20776F726C6421) => hello world!
Go to the first, previous, next, last section, table of contents.