forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Base.jl
10511 lines (7851 loc) · 253 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
"""
@time
A macro to execute an expression, printing the time it took to execute, the number of
allocations, and the total number of bytes its execution caused to be allocated, before
returning the value of the expression.
"""
:@time
"""
systemerror(sysfunc, iftrue)
Raises a `SystemError` for `errno` with the descriptive string `sysfunc` if `iftrue` is `true`
"""
systemerror
"""
writedlm(f, A, delim='\\t')
Write `A` (a vector, matrix or an iterable collection of iterable rows) as text to `f`
(either a filename string or an `IO` stream) using the given delimiter `delim` (which
defaults to tab, but can be any printable Julia object, typically a `Char` or
`AbstractString`).
For example, two vectors `x` and `y` of the same length can be written as two columns of
tab-delimited text to `f` by either `writedlm(f, [x y])` or by `writedlm(f, zip(x, y))`.
"""
writedlm
"""
digamma(x)
Compute the digamma function of `x` (the logarithmic derivative of `gamma(x)`)
"""
digamma
"""
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.(:(<:))
"""
schedule(t::Task, [val]; error=false)
Add a task to the scheduler's queue. This causes the task to run constantly when the system
is otherwise idle, unless the task performs a blocking operation such as `wait`.
If a second argument is provided, it will be passed to the task (via the return value of
`yieldto`) when it runs again. If `error` is `true`, the value is raised as an exception in
the woken task.
"""
schedule
"""
step(r)
Get the step size of a [`Range`](:obj:`Range`) object.
"""
step
"""
utf32(s)
Create a UTF-32 string from a byte array, array of `Char` or `UInt32`, or any other string
type. (Conversions of byte arrays check for a byte-order marker in the first four bytes, and
do not include it in the resulting string.)
Note that the resulting `UTF32String` data is terminated by the NUL codepoint (32-bit zero),
which is not treated as a character in the string (so that it is mostly invisible in Julia);
this allows the string to be passed directly to external functions requiring NUL-terminated
data. This NUL is appended automatically by the `utf32(s)` conversion function. If you have
a `Char` or `UInt32` array `A` that is already NUL-terminated UTF-32 data, then you can
instead use `UTF32String(A)` to construct the string without making a copy of the data and
treating the NUL as a terminator rather than as part of the string.
"""
utf32(s)
"""
utf32(::Union{Ptr{Char},Ptr{UInt32},Ptr{Int32}} [, length])
Create a string from the address of a NUL-terminated UTF-32 string. A copy is made; the
pointer can be safely freed. If `length` is specified, the string does not have to be
NUL-terminated.
"""
utf32(::Union{Ptr{Char},Ptr{UInt32},Ptr{Int32}}, length=?)
"""
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
"""
@everywhere
Execute an expression on all processes. Errors on any of the processes are collected into a
`CompositeException` and thrown. For example :
@everywhere bar=1
will define `bar` under module `Main` on all processes.
Unlike `@spawn` and `@spawnat`, `@everywhere` does not capture any local variables. Prefixing
`@everywhere` with `@eval` allows us to broadcast local variables using interpolation :
foo = 1
@eval @everywhere bar=\$foo
"""
:@everywhere
"""
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
"""
reenable_sigint(f::Function)
Re-enable Ctrl-C handler during execution of a function. Temporarily reverses the effect of
`disable_sigint`.
"""
reenable_sigint
"""
indmin(itr) -> Integer
Returns the index of the minimum element in a collection.
"""
indmin
"""
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
"""
besselj(nu, x)
Bessel function of the first kind of order `nu`, ``J_\\nu(x)``.
"""
besselj
"""
//(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
"""
workers()
Returns a list of all worker process identifiers.
"""
workers
"""
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!
"""
hist2d!(counts, M, e1, e2) -> (e1, e2, counts)
Compute a "2d histogram" with respect to the bins delimited by the edges given in `e1` and
`e2`. This function writes the results to a pre-allocated array `counts`.
"""
hist2d!
"""
airybi(x)
Airy function ``\\operatorname{Bi}(x)``.
"""
airybi
"""
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
"""
symlink(target, link)
Creates a symbolic link to `target` with the name `link`.
**note**
This function raises an error under operating systems that do not support soft symbolic
links, such as Windows XP.
"""
symlink
"""
task_local_storage(symbol)
Look up the value of a symbol in the current task's task-local storage.
"""
task_local_storage(symbol)
"""
task_local_storage(symbol, value)
Assign a value to a symbol in the current task's task-local storage.
"""
task_local_storage(symbol, value)
"""
task_local_storage(body, symbol, value)
Call the function `body` with a modified task-local storage, in which `value` is assigned to
`symbol`; the previous value of `symbol`, or lack thereof, is restored afterwards. Useful
for emulating dynamic scoping.
"""
task_local_storage(body, symbol, value)
"""
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
"""
findnz(A)
Return a tuple `(I, J, V)` where `I` and `J` are the row and column indexes of the non-zero
values in matrix `A`, and `V` is a vector of the non-zero values.
"""
findnz
"""
Future()
Create a `Future` on the local machine.
"""
Future()
"""
Future(n)
Create a `Future` on process `n`.
"""
Future(::Integer)
"""
RemoteChannel()
Make an reference to a `Channel{Any}(1)` on the local machine.
"""
RemoteChannel()
"""
RemoteChannel(n)
Make an reference to a `Channel{Any}(1)` on process `n`.
"""
RemoteChannel(::Integer)
"""
RemoteChannel(f::Function, pid)
Create references to remote channels of a specific size and type. `f()` is a function that
when executed on `pid` must return an implementation of an `AbstractChannel`.
For example, `RemoteChannel(()->Channel{Int}(10), pid)`, will return a reference to a
channel of type `Int` and size 10 on `pid`.
"""
RemoteChannel(f::Function, pid)
"""
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)
"""
airybiprime(x)
Airy function derivative ``\\operatorname{Bi}'(x)``.
"""
airybiprime
"""
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.(:(.*))
"""
ror!(dest::BitArray{1}, src::BitArray{1}, i::Integer) -> BitArray{1}
Performs a right rotation operation on `src` and put the result into `dest`.
"""
ror!(dest::BitArray{1}, src::BitArray{1}, i::Integer)
"""
ror!(B::BitArray{1}, i::Integer) -> BitArray{1}
Performs a right rotation operation on `B`.
"""
ror!(B::BitArray{1}, i::Integer)
"""
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
"""
reducedim(f, A, dims[, initial])
Reduce 2-argument function `f` along dimensions of `A`. `dims` is a vector specifying the
dimensions to reduce, and `initial` is the initial value to use in the reductions. For `+`, `*`,
`max` and `min` the `initial` argument is optional.
The associativity of the reduction is implementation-dependent; if you need a particular
associativity, e.g. left-to-right, you should write your own loop. See documentation for
`reduce`.
"""
reducedim
"""
-(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
"""
launch(manager::FooManager, params::Dict, launched::Vector{WorkerConfig}, launch_ntfy::Condition)
Implemented by cluster managers. For every Julia worker launched by this function, it should
append a `WorkerConfig` entry to `launched` and notify `launch_ntfy`. The function MUST exit
once all workers, requested by `manager` have been launched. `params` is a dictionary of all
keyword arguments `addprocs` was called with.
"""
launch
"""
invdigamma(x)
Compute the inverse digamma function of `x`.
"""
invdigamma
"""
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
"""
nworkers()
Get the number of available worker processes. This is one less than `nprocs()`. Equal to
`nprocs()` if `nprocs() == 1`.
"""
nworkers
"""
filemode(file)
Equivalent to `stat(file).mode`
"""
filemode
"""
print_joined(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`.
"""
print_joined
"""
lfact(x)
Compute the logarithmic factorial of `x`
"""
lfact
"""
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
"""
code_typed(f, types; optimize=true)
Returns an array of lowered and type-inferred ASTs for the methods matching the given
generic function and type signature. The keyword argument `optimize` controls whether
additional optimizations, such as inlining, are also applied.
"""
code_typed
"""
hankelh1x(nu, x)
Scaled Bessel function of the third kind of order `nu`, ``H^{(1)}_\\nu(x) e^{-x i}``.
"""
hankelh1x
"""
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
"""
randexp([rng], [dims...])
Generate a random number according to the exponential distribution with scale 1. Optionally
generate an array of such random numbers.
"""
randexp
"""
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 `rounding` 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)