/
Base.jl
7622 lines (5696 loc) · 176 KB
/
Base.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is a part of Julia. License is MIT: http://julialang.org/license
# Base
"""
systemerror(sysfunc, iftrue)
Raises a `SystemError` for `errno` with the descriptive string `sysfunc` if `iftrue` is `true`
"""
systemerror
"""
fill!(A, x)
Fill array `A` with the value `x`. If `x` is an object reference, all elements will refer to
the same object. `fill!(A, Foo())` will return `A` filled with the result of evaluating
`Foo()` once.
"""
fill!
"""
read!(stream::IO, array::Union{Array, BitArray})
read!(filename::AbstractString, array::Union{Array, BitArray})
Read binary data from an I/O stream or file, filling in `array`.
"""
read!
"""
empty!(collection) -> collection
Remove all elements from a `collection`.
"""
empty!
"""
asin(x)
Compute the inverse sine of `x`, where the output is in radians.
"""
asin
"""
<:(T1, T2)
Subtype operator, equivalent to `issubtype(T1,T2)`.
"""
Base.:(<:)
"""
takebuf_array(b::IOBuffer)
Obtain the contents of an `IOBuffer` as an array, without copying. Afterwards, the
`IOBuffer` is reset to its initial state.
"""
takebuf_array
"""
download(url,[localfile])
Download a file from the given url, optionally renaming it to the given local file name.
Note that this function relies on the availability of external tools such as `curl`, `wget`
or `fetch` to download the file and is provided for convenience. For production use or
situations in which more options are needed, please use a package that provides the desired
functionality instead.
"""
download
"""
lstrip(string, [chars])
Return `string` with any leading whitespace removed. If `chars` (a character, or vector or
set of characters) is provided, instead remove characters contained in it.
"""
lstrip
"""
powermod(x, p, m)
Compute ``x^p \\pmod m``.
"""
powermod
"""
typeintersect(T, S)
Compute a type that contains the intersection of `T` and `S`. Usually this will be the
smallest such type or one close to it.
"""
typeintersect
"""
pointer(array [, index])
Get the native address of an array or string element. Be careful to ensure that a Julia
reference to `a` exists as long as this pointer will be used. This function is "unsafe" like
`unsafe_convert`.
Calling `Ref(array[, index])` is generally preferable to this function.
"""
pointer
"""
isnan(f) -> Bool
Test whether a floating point number is not a number (NaN).
"""
isnan
"""
println(x)
Print (using [`print`](:func:`print`)) `x` followed by a newline.
"""
println
"""
//(num, den)
Divide two integers or rational numbers, giving a `Rational` result.
"""
Base.:(//)
"""
At_mul_B(A, B)
For matrices or vectors ``A`` and ``B``, calculates ``Aᵀ⋅B``.
"""
At_mul_B
"""
methods(f, [types])
Returns the method table for `f`.
If `types` is specified, returns an array of methods whose types match.
"""
methods
"""
isinteger(x) -> Bool
Test whether `x` or all its elements are numerically equal to some integer
"""
isinteger
"""
sortrows(A, [alg=<algorithm>,] [by=<transform>,] [lt=<comparison>,] [rev=false])
Sort the rows of matrix `A` lexicographically.
"""
sortrows
"""
./(x, y)
Element-wise right division operator.
"""
Base.:(./)
"""
IPv6(host::Integer) -> IPv6
Returns IPv6 object from ip address formatted as Integer
"""
IPv6
"""
prod!(r, A)
Multiply elements of `A` over the singleton dimensions of `r`, and write results to `r`.
"""
prod!
"""
gensym([tag])
Generates a symbol which will not conflict with other variable names.
"""
gensym
"""
cummin(A, [dim])
Cumulative minimum along a dimension. The dimension defaults to 1.
"""
cummin
"""
minabs!(r, A)
Compute the minimum absolute values over the singleton dimensions of `r`, and write values to `r`.
"""
minabs!
"""
@evalpoly(z, c...)
Evaluate the polynomial ``\\sum_k c[k] z^{k-1}`` for the coefficients `c[1]`, `c[2]`, ...;
that is, the coefficients are given in ascending order by power of `z`. This macro expands
to efficient inline code that uses either Horner's method or, for complex `z`, a more
efficient Goertzel-like algorithm.
"""
:@evalpoly
"""
eigfact!(A, [B])
Same as [`eigfact`](:func:`eigfact`), but saves space by overwriting the input `A` (and
`B`), instead of creating a copy.
"""
eigfact!
"""
cosh(x)
Compute hyperbolic cosine of `x`.
"""
cosh
"""
ipermutedims(A, perm)
Like [`permutedims`](:func:`permutedims`), except the inverse of the given permutation is applied.
"""
ipermutedims
"""
dirname(path::AbstractString) -> AbstractString
Get the directory part of a path.
"""
dirname
"""
isfile(path) -> Bool
Returns `true` if `path` is a regular file, `false` otherwise.
"""
isfile
"""
diff(A, [dim])
Finite difference operator of matrix or vector.
"""
diff
"""
precision(num::AbstractFloat)
Get the precision of a floating point number, as defined by the effective number of bits in
the mantissa.
"""
precision
"""
readlines(stream::IO)
readlines(filename::AbstractString)
Read all lines of an I/O stream or a file as a vector of strings.
The text is assumed to be encoded in UTF-8.
"""
readlines
"""
foldl(op, v0, itr)
Like [`reduce`](:func:`reduce`), but with guaranteed left associativity. `v0` will be used
exactly once.
"""
foldl(op, v0, itr)
"""
foldl(op, itr)
Like `foldl(op, v0, itr)`, but using the first element of `itr` as `v0`. In general, this
cannot be used with empty collections (see `reduce(op, itr)`).
"""
foldl(op, itr)
"""
Ac_rdiv_B(A, B)
For matrices or vectors ``A`` and ``B``, calculates ``Aᴴ / B``.
"""
Ac_rdiv_B
"""
linspace(start, stop, n=50)
Construct a range of `n` linearly spaced elements from `start` to `stop`.
"""
linspace
"""
promote_type(type1, type2)
Determine a type big enough to hold values of each argument type without loss, whenever
possible. In some cases, where no type exists to which both types can be promoted
losslessly, some loss is tolerated; for example, `promote_type(Int64,Float64)` returns
`Float64` even though strictly, not all `Int64` values can be represented exactly as
`Float64` values.
"""
promote_type
"""
ind2sub(dims, index) -> subscripts
Returns a tuple of subscripts into an array with dimensions `dims`,
corresponding to the linear index `index`.
**Example**:
```
i, j, ... = ind2sub(size(A), indmax(A))
```
provides the indices of the maximum element.
"""
ind2sub(dims::Tuple, index::Int)
"""
ind2sub(a, index) -> subscripts
Returns a tuple of subscripts into array `a` corresponding to the linear index `index`.
"""
ind2sub(a, index)
"""
```
.*(x, y)
```
Element-wise multiplication operator.
"""
Base.:(.*)
"""
range(start, [step], length)
Construct a range by length, given a starting value and optional step (defaults to 1).
"""
range
"""
eltype(type)
Determine the type of the elements generated by iterating a collection of the given `type`.
For associative collection types, this will be a `Pair{KeyType,ValType}`. The definition
`eltype(x) = eltype(typeof(x))` is provided for convenience so that instances can be passed
instead of types. However the form that accepts a type argument should be defined for new
types.
"""
eltype
"""
keytype(type)
Get the key type of an associative collection type. Behaves similarly to `eltype`.
"""
keytype
"""
valtype(type)
Get the value type of an associative collection type. Behaves similarly to `eltype`.
"""
valtype
"""
edit(path::AbstractString, [line])
Edit a file or directory optionally providing a line number to edit the file at. Returns to
the `julia` prompt when you quit the editor.
"""
edit(path::AbstractString, line=?)
"""
edit(function, [types])
Edit the definition of a function, optionally specifying a tuple of types to indicate which
method to edit.
"""
edit(::Function, types=?)
"""
backtrace()
Get a backtrace object for the current program point.
"""
backtrace
"""
-(x)
Unary minus operator.
"""
-(x)
"""
-(x, y)
Subtraction operator.
"""
-(x, y)
"""
mapfoldr(f, op, v0, itr)
Like [`mapreduce`](:func:`mapreduce`), but with guaranteed right associativity. `v0` will be
used exactly once.
"""
mapfoldr(f, op, v0, itr)
"""
mapfoldr(f, op, itr)
Like `mapfoldr(f, op, v0, itr)`, but using the first element of `itr` as `v0`. In general,
this cannot be used with empty collections (see `reduce(op, itr)`).
"""
mapfoldr(f, op, itr)
"""
broadcast_setindex!(A, X, inds...)
Broadcasts the `X` and `inds` arrays to a common size and stores the value from each
position in `X` at the indices given by the same positions in `inds`.
"""
broadcast_setindex!
"""
Nullable(x)
Wrap value `x` in an object of type `Nullable`, which indicates whether a value is present.
`Nullable(x)` yields a non-empty wrapper, and `Nullable{T}()` yields an empty instance of a
wrapper that might contain a value of type `T`.
"""
Nullable
"""
bits(n)
A string giving the literal bit representation of a number.
"""
bits
"""
getindex(type[, elements...])
Construct a 1-d array of the specified type. This is usually called with the syntax
`Type[]`. Element values can be specified using `Type[a,b,c,...]`.
"""
getindex(::Type, elements...)
"""
getindex(A, inds...)
Returns a subset of array `A` as specified by `inds`, where each `ind` may be an
`Int`, a `Range`, or a `Vector`. See the manual section on
[array indexing](:ref:`array indexing <man-array-indexing>`) for details.
"""
getindex(::AbstractArray, inds...)
"""
getindex(collection, key...)
Retrieve the value(s) stored at the given key or index within a collection. The syntax
`a[i,j,...]` is converted by the compiler to `getindex(a, i, j, ...)`.
"""
getindex(collection, key...)
"""
cconvert(T,x)
Convert `x` to a value of type `T`, typically by calling `convert(T,x)`
In cases where `x` cannot be safely converted to `T`, unlike `convert`, `cconvert` may
return an object of a type different from `T`, which however is suitable for
`unsafe_convert` to handle.
Neither `convert` nor `cconvert` should take a Julia object and turn it into a `Ptr`.
"""
cconvert
"""
|>(x, f)
Applies a function to the preceding argument. This allows for easy function chaining.
```jldoctest
julia> [1:5;] |> x->x.^2 |> sum |> inv
0.01818181818181818
```
"""
Base.:(|>)
"""
assert(cond)
Throw an `AssertionError` if `cond` is `false`. Also available as the macro `@assert expr`.
"""
assert
"""
sech(x)
Compute the hyperbolic secant of `x`
"""
sech
"""
filemode(file)
Equivalent to `stat(file).mode`
"""
filemode
"""
join(io, items, delim, [last])
Print elements of `items` to `io` with `delim` between them. If `last` is specified, it is
used as the final delimiter instead of `delim`.
"""
join(io, items, delim, last)
"""
deconv(b,a)
Construct vector `c` such that `b = conv(a,c) + r`. Equivalent to polynomial division.
"""
deconv
"""
insert!(collection, index, item)
Insert an `item` into `collection` at the given `index`. `index` is the index of `item` in
the resulting `collection`.
```jldoctest
julia> insert!([6, 5, 4, 2, 1], 4, 3)
6-element Array{Int64,1}:
6
5
4
3
2
1
```
"""
insert!
"""
repmat(A, n, m)
Construct a matrix by repeating the given matrix `n` times in dimension 1 and `m` times in
dimension 2.
"""
repmat
"""
acos(x)
Compute the inverse cosine of `x`, where the output is in radians
"""
acos
"""
ispath(path) -> Bool
Returns `true` if `path` is a valid filesystem path, `false` otherwise.
"""
ispath
"""
fdio([name::AbstractString, ]fd::Integer[, own::Bool]) -> IOStream
Create an `IOStream` object from an integer file descriptor. If `own` is `true`, closing
this object will close the underlying descriptor. By default, an `IOStream` is closed when
it is garbage collected. `name` allows you to associate the descriptor with a named file.
"""
fdio
"""
unsafe_copy!(dest::Ptr{T}, src::Ptr{T}, N)
Copy `N` elements from a source pointer to a destination, with no checking. The size of an
element is determined by the type of the pointers.
The `unsafe` prefix on this function indicates that no validation is performed on the
pointers `dest` and `src` to ensure that they are valid. Incorrect usage may corrupt or
segfault your program, in the same manner as C.
"""
unsafe_copy!{T}(dest::Ptr{T}, src::Ptr{T}, N)
"""
unsafe_copy!(dest::Array, do, src::Array, so, N)
Copy `N` elements from a source array to a destination, starting at offset `so` in the
source and `do` in the destination (1-indexed).
The `unsafe` prefix on this function indicates that no validation is performed to ensure
that N is inbounds on either array. Incorrect usage may corrupt or segfault your program, in
the same manner as C.
"""
unsafe_copy!(dest::Array, d, src::Array, so, N)
"""
diag(M[, k])
The `k`th diagonal of a matrix, as a vector. Use `diagm` to construct a diagonal matrix.
"""
diag
"""
.^(x, y)
Element-wise exponentiation operator.
"""
Base.:(.^)
"""
isspace(c::Union{Char,AbstractString}) -> Bool
Tests whether a character is any whitespace character. Includes ASCII characters '\\t',
'\\n', '\\v', '\\f', '\\r', and ' ', Latin-1 character U+0085, and characters in Unicode
category Zs. For strings, tests whether this is true for all elements of the string.
"""
isspace
"""
splitext(path::AbstractString) -> (AbstractString,AbstractString)
If the last component of a path contains a dot, split the path into everything before the
dot and everything including and after the dot. Otherwise, return a tuple of the argument
unmodified and the empty string.
"""
splitext
"""
gethostname() -> AbstractString
Get the local machine's host name.
"""
gethostname
"""
replace(string, pat, r[, n])
Search for the given pattern `pat`, and replace each occurrence with `r`. If `n` is
provided, replace at most `n` occurrences. As with search, the second argument may be a
single character, a vector or a set of characters, a string, or a regular expression. If `r`
is a function, each occurrence is replaced with `r(s)` where `s` is the matched substring.
If `pat` is a regular expression and `r` is a `SubstitutionString`, then capture group
references in `r` are replaced with the corresponding matched text.
"""
replace
"""
chop(string)
Remove the last character from a string.
"""
chop
"""
Float32(x [, mode::RoundingMode])
Create a Float32 from `x`. If `x` is not exactly representable then `mode` determines how
`x` is rounded.
```jldoctest
julia> Float32(1/3, RoundDown)
0.3333333f0
julia> Float32(1/3, RoundUp)
0.33333334f0
```
See [`RoundingMode`](:obj:`RoundingMode`) for available rounding modes.
"""
Float32
"""
readuntil(stream::IO, delim)
readuntil(filename::AbstractString, delim)
Read a string from an I/O stream or a file, up to and including the given delimiter byte.
The text is assumed to be encoded in UTF-8.
"""
readuntil
"""
isimmutable(v)
Return `true` iff value `v` is immutable. See [manual](:ref:`man-immutable-composite-types`)
for a discussion of immutability. Note that this function works on values, so if you give it
a type, it will tell you that a value of `DataType` is mutable.
"""
isimmutable
"""
macroexpand(x)
Takes the expression `x` and returns an equivalent expression with all macros removed (expanded).
"""
macroexpand
"""
issticky(path) -> Bool
Returns `true` if `path` has the sticky bit set, `false` otherwise.
"""
issticky
"""
Mmap.mmap(io::Union{IOStream,AbstractString,Mmap.AnonymousMmap}[, type::Type{Array{T,N}}, dims, offset]; grow::Bool=true, shared::Bool=true)
Mmap.mmap(type::Type{Array{T,N}}, dims)
Create an `Array` whose values are linked to a file, using memory-mapping. This provides a
convenient way of working with data too large to fit in the computer's memory.
The type is an `Array{T,N}` with a bits-type element of `T` and dimension `N` that
determines how the bytes of the array are interpreted. Note that the file must be stored in
binary format, and no format conversions are possible (this is a limitation of operating
systems, not Julia).
`dims` is a tuple or single `Integer` specifying the size or length of the array.
The file is passed via the stream argument, either as an open `IOStream` or filename string.
When you initialize the stream, use `"r"` for a "read-only" array, and `"w+"` to create a
new array used to write values to disk.
If no `type` argument is specified, the default is `Vector{UInt8}`.
Optionally, you can specify an offset (in bytes) if, for example, you want to skip over a
header in the file. The default value for the offset is the current stream position for an
`IOStream`.
The `grow` keyword argument specifies whether the disk file should be grown to accommodate
the requested size of array (if the total file size is < requested array size). Write
privileges are required to grow the file.
The `shared` keyword argument specifies whether the resulting `Array` and changes made to it
will be visible to other processes mapping the same file.
For example, the following code
```julia
# Create a file for mmapping
# (you could alternatively use mmap to do this step, too)
A = rand(1:20, 5, 30)
s = open("/tmp/mmap.bin", "w+")
# We'll write the dimensions of the array as the first two Ints in the file
write(s, size(A,1))
write(s, size(A,2))
# Now write the data
write(s, A)
close(s)
# Test by reading it back in
s = open("/tmp/mmap.bin") # default is read-only
m = read(s, Int)
n = read(s, Int)
A2 = Mmap.mmap(s, Matrix{Int}, (m,n))
```
creates a `m`-by-`n` `Matrix{Int}`, linked to the file associated with stream `s`.
A more portable file would need to encode the word size -- 32 bit or 64 bit -- and endianness
information in the header. In practice, consider encoding binary data using standard formats
like HDF5 (which can be used with memory-mapping).
"""
Mmap.mmap(io, ::Type, dims, offset)
"""
Mmap.mmap(io, BitArray, [dims, offset])
Create a `BitArray` whose values are linked to a file, using memory-mapping; it has the same
purpose, works in the same way, and has the same arguments, as [`mmap`](:func:`mmap`), but
the byte representation is different.
**Example**: `B = Mmap.mmap(s, BitArray, (25,30000))`
This would create a 25-by-30000 `BitArray`, linked to the file associated with stream `s`.
"""
Mmap.mmap(io, ::BitArray, dims = ?, offset = ?)
"""
bessely0(x)
Bessel function of the second kind of order 0, ``Y_0(x)``.
"""
bessely0
"""
any!(r, A)
Test whether any values in `A` along the singleton dimensions of `r` are `true`, and write
results to `r`.
"""
any!
"""
filter!(function, collection)
Update `collection`, removing elements for which `function` is `false`. For associative
collections, the function is passed two arguments (key and value).
"""
filter!
"""
base64decode(string)
Decodes the base64-encoded `string` and returns a `Vector{UInt8}` of the decoded bytes.
"""
base64decode
"""
oct(n, [pad])
Convert an integer to an octal string, optionally specifying a number of digits to pad to.
"""
oct
"""
sizeof(T)
Size, in bytes, of the canonical binary representation of the given DataType `T`, if any.
"""
sizeof(::Type)
"""
sizeof(s::AbstractString)
The number of bytes in string `s`.
"""
sizeof(::AbstractString)
"""
===(x, y)
≡(x,y)
See the [`is`](:func:`is`) operator.
"""
Base.:(===)
"""
ReadOnlyMemoryError()
An operation tried to write to memory that is read-only.
"""
ReadOnlyMemoryError
"""
startswith(string, prefix)
Returns `true` if `string` starts with `prefix`. If `prefix` is a vector or set
of characters, tests whether the first character of `string` belongs to that set.
"""
startswith
"""
permutedims!(dest, src, perm)
Permute the dimensions of array `src` and store the result in the array `dest`. `perm` is a
vector specifying a permutation of length `ndims(src)`. The preallocated array `dest` should
have `size(dest) == size(src)[perm]` and is completely overwritten. No in-place permutation
is supported and unexpected results will happen if `src` and `dest` have overlapping memory
regions.
"""
permutedims!
"""
functionloc(f::Function, types)
Returns a tuple `(filename,line)` giving the location of a generic `Function` definition.
"""
functionloc(f, types)
"""
functionloc(m::Method)
Returns a tuple `(filename,line)` giving the location of a `Method` definition.
"""
functionloc(m)
"""
last(coll)
Get the last element of an ordered collection, if it can be computed in O(1) time. This is
accomplished by calling [`endof`](:func:`endof`) to get the last index. Returns the end
point of a [`Range`](:obj:`Range`) even if it is empty.
"""
last
"""
islink(path) -> Bool
Returns `true` if `path` is a symbolic link, `false` otherwise.
"""
islink
"""
istril(A) -> Bool
Test whether a matrix is lower triangular.
"""
istril
"""
bin(n, [pad])
Convert an integer to a binary string, optionally specifying a number of digits to pad to.
"""
bin
"""
cis(z)
Return ``\\exp(iz)``.
"""
cis
"""
sinh(x)
Compute hyperbolic sine of `x`.
"""
sinh
"""
ceil([T,] x, [digits, [base]])
`ceil(x)` returns the nearest integral value of the same type as `x` that is greater than or
equal to `x`.
`ceil(T, x)` converts the result to type `T`, throwing an `InexactError` if the value is not
representable.
`digits` and `base` work as for [`round`](:func:`round`).
"""
ceil
"""
issocket(path) -> Bool
Returns `true` if `path` is a socket, `false` otherwise.
"""
issocket
"""
srand([rng], [seed])
Reseed the random number generator. If a `seed` is provided, the RNG will give a
reproducible sequence of numbers, otherwise Julia will get entropy from the system. For
`MersenneTwister`, the `seed` may be a non-negative integer, a vector of `UInt32` integers
or a filename, in which case the seed is read from a file. `RandomDevice` does not support
seeding.
"""
srand
"""
oftype(x, y)
Convert `y` to the type of `x` (`convert(typeof(x), y)`).
"""
oftype
"""
maxabs!(r, A)
Compute the maximum absolute values over the singleton dimensions of `r`, and write values to `r`.
"""
maxabs!
"""
nullspace(M)
Basis for nullspace of `M`.
"""
nullspace
"""
isfinite(f) -> Bool
Test whether a number is finite
"""
isfinite
"""
push!(collection, items...) -> collection
Insert one or more `items` at the end of `collection`.
```jldoctest
julia> push!([1, 2, 3], 4, 5, 6)
6-element Array{Int64,1}:
1