Skip to content

Commit a4e065d

Browse files
Addition of Unicode operators.
1 parent 611c17c commit a4e065d

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

base/exports.jl

+4
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,22 @@ export
186186
/,
187187
//,
188188
<,
189+
,
189190
<:,
190191
<<,
191192
<=,
192193
,
193194
,
195+
,
194196
==,
195197
,
196198
>,
199+
,
197200
>:,
198201
>=,
199202
,
200203
,
204+
,
201205
>>,
202206
>>>,
203207
\,

base/operators.jl

+58-2
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ false
358358
```
359359
"""
360360
<(x, y) = isless(x, y)
361+
(x, y) = !<(x, y)
361362

362363
"""
363364
>(x, y)
@@ -384,6 +385,7 @@ true
384385
```
385386
"""
386387
>(x, y) = y < x
388+
(x, y) = !>(x, y)
387389

388390
"""
389391
<=(x, y)
@@ -409,7 +411,8 @@ false
409411
"""
410412
<=(x, y) = (x < y) | (x == y)
411413
const = <=
412-
const = <=
414+
const =
415+
(x, y) = !(x, y)
413416

414417
"""
415418
>=(x, y)
@@ -435,7 +438,8 @@ true
435438
"""
436439
>=(x, y) = (y <= x)
437440
const = >=
438-
const = >=
441+
const =
442+
(x, y) = !(x, y)
439443

440444
# this definition allows Number types to implement < instead of isless,
441445
# which is more idiomatic:
@@ -1222,6 +1226,19 @@ used to implement specialized methods.
12221226
"""
12231227
>=(x) = Fix2(>=, x)
12241228

1229+
"""
1230+
≱(x)
1231+
1232+
Create a function that compares its argument to `x` using [`≱`](@ref), i.e.
1233+
a function equivalent to `y -> y ≱ x`.
1234+
The returned function is of type `Base.Fix2{typeof(≱)}`, which can be
1235+
used to implement specialized methods.
1236+
1237+
!!! compat "Julia 1.2"
1238+
This functionality requires at least Julia 1.2.
1239+
"""
1240+
(x) = Fix2(, x)
1241+
12251242
"""
12261243
<=(x)
12271244
@@ -1235,6 +1252,19 @@ used to implement specialized methods.
12351252
"""
12361253
<=(x) = Fix2(<=, x)
12371254

1255+
"""
1256+
≰(x)
1257+
1258+
Create a function that compares its argument to `x` using [`≰`](@ref), i.e.
1259+
a function equivalent to `y -> y ≰ x`.
1260+
The returned function is of type `Base.Fix2{typeof(≰)}`, which can be
1261+
used to implement specialized methods.
1262+
1263+
!!! compat "Julia 1.2"
1264+
This functionality requires at least Julia 1.2.
1265+
"""
1266+
(x) = Fix2(, x)
1267+
12381268
"""
12391269
>(x)
12401270
@@ -1248,6 +1278,19 @@ used to implement specialized methods.
12481278
"""
12491279
>(x) = Fix2(>, x)
12501280

1281+
"""
1282+
≯(x)
1283+
1284+
Create a function that compares its argument to `x` using [`≯`](@ref), i.e.
1285+
a function equivalent to `y -> y ≯ x`.
1286+
The returned function is of type `Base.Fix2{typeof(≯)}`, which can be
1287+
used to implement specialized methods.
1288+
1289+
!!! compat "Julia 1.2"
1290+
This functionality requires at least Julia 1.2.
1291+
"""
1292+
(x) = Fix2(, x)
1293+
12511294
"""
12521295
<(x)
12531296
@@ -1261,6 +1304,19 @@ used to implement specialized methods.
12611304
"""
12621305
<(x) = Fix2(<, x)
12631306

1307+
"""
1308+
≮(x)
1309+
1310+
Create a function that compares its argument to `x` using [`≮`](@ref), i.e.
1311+
a function equivalent to `y -> y ≮ x`.
1312+
The returned function is of type `Base.Fix2{typeof(≮)}`, which can be
1313+
used to implement specialized methods.
1314+
1315+
!!! compat "Julia 1.2"
1316+
This functionality requires at least Julia 1.2.
1317+
"""
1318+
(x) = Fix2(, x)
1319+
12641320
"""
12651321
splat(f)
12661322

0 commit comments

Comments
 (0)