source | all docs for version 0.8.12 | all versions | oilshell.org
Warning: Work in progress! Leave feedback on Zulip or Github if you'd like this doc to be updated.
Oil's expression language borrows heavily from Python.
In fact, it literally started with Python's Grammar/Grammar
file.
r'c:\Program Files\'
or $'line\n'
.\u{3bc}
instead of \uhhhh
and \UHHHHHHHH
42,
are disallowed, in favor of the more explicit
tup(42)
.%(one two three)
%symbol
(used in eggex now, but could also be used as interned strings)\n
and \u{03bc}
, and also #'a'
^(ls | wc -l)
^[1 +a[i] + f(x)]
Kinds of of operators:
=== ~== in not in
< > <= =>
+ -
& |
and or
++
$
and @
Equality:
===
for exact quality?~==
for approximate (numbers and strings)
==
?Oil doesn't overload operators as much, and does string <-> int conversion:
a + b
is for addition, while a ++ b
is for concatenation.a < b
does numeric comparison (with conversion). cmp()
could be for
strings.No "accidentally quadratic"
in
for array/list membership. Only dict membership.++=
operator on strings doesn't existOther:
1:5:2
syntax because 0::2
conflicts with module::name
.
This might have been unnecessary.~
operator rather than the re
module.~~
glob match operatormydict->key
as an alias for mydict['key']
++
mentioned aboves[i]
returns an integer code point ("rune").runeAt()
and byteAt()
?