@@ -1379,13 +1379,13 @@ defmodule Kernel do
13791379 file_info = FileInfo.new(atime: now())
13801380 file_info.atime #=> Returns the value of atime
13811381 file_info.atime(now()) #=> Updates the value of atime
1382-
1382+
13831383 # Update multiple attributes at once:
13841384 file_info.update(atime: now(), accesses: 1)
1385-
1385+
13861386 # Obtain the keywords representation of a record:
13871387 file_info.to_keywords #=> [accesses: 1, atime: {1370,7171,911705}]
1388-
1388+
13891389
13901390 A record is simply a tuple where the first element is the record
13911391 module name. We can get the record raw representation as follow:
@@ -1835,9 +1835,34 @@ defmodule Kernel do
18351835 end
18361836
18371837 @doc """
1838- Makes the given functions in the current module overridable.
1839- An overridable function is lazily defined, allowing a
1840- developer to customize it.
1838+ Makes the given functions in the current module overridable. An overridable
1839+ function is lazily defined, allowing a developer to customize it.
1840+
1841+ ## Example
1842+
1843+ defmodule DefaultMod do
1844+ defmacro __using__(_opts) do
1845+ quote do
1846+ def test(x, y) do
1847+ x + y
1848+ end
1849+
1850+ defoverridable [test: 2]
1851+ end
1852+ end
1853+ end
1854+
1855+ defmodule InheritMod do
1856+ use DefaultMod
1857+
1858+ def test(x, y) do
1859+ x * y + super
1860+ end
1861+ end
1862+
1863+ As seen as in the example `super` can be used to call the default
1864+ implementation, if no arguments are given to `super` it will be implictly
1865+ given the arguments of the current function.
18411866 """
18421867 defmacro defoverridable(tuples) do
18431868 quote do
0 commit comments