From 0e3574d7f8136303cd8b3a1369d1bf685727bc9f Mon Sep 17 00:00:00 2001 From: Domen Kožar Date: Tue, 23 Aug 2016 13:09:33 +0200 Subject: doc: move set functor para to Sets section --- doc/manual/expressions/language-constructs.xml | 18 ------------------ doc/manual/expressions/language-values.xml | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) (limited to 'doc') diff --git a/doc/manual/expressions/language-constructs.xml b/doc/manual/expressions/language-constructs.xml index 7535e64ea9a5..fe69dba837a1 100644 --- a/doc/manual/expressions/language-constructs.xml +++ b/doc/manual/expressions/language-constructs.xml @@ -202,24 +202,6 @@ in concat { x = "foo"; y = "bar"; } -A set that has a __functor attribute whose value -is callable (i.e. is itself a function or a set with a -__functor attribute whose value is callable) can be -applied as if it were a function, with the set itself passed in first -, e.g., - - -let add = { __functor = self: x: x + self.x; }; - inc = add // { x = 1; }; -in inc 1 - - -evaluates to 2. This can be used to attach metadata to a -function without the caller needing to treat it specially, or to implement -a form of object-oriented programming, for example. - - - diff --git a/doc/manual/expressions/language-values.xml b/doc/manual/expressions/language-values.xml index f1174ecb5d8d..b90baac5054c 100644 --- a/doc/manual/expressions/language-values.xml +++ b/doc/manual/expressions/language-values.xml @@ -276,6 +276,23 @@ added to the set: This will evaluate to {} if foo evaluates to false. +A set that has a __functor attribute whose value +is callable (i.e. is itself a function or a set with a +__functor attribute whose value is callable) can be +applied as if it were a function, with the set itself passed in first +, e.g., + + +let add = { __functor = self: x: x + self.x; }; + inc = add // { x = 1; }; +in inc 1 + + +evaluates to 2. This can be used to attach metadata to a +function without the caller needing to treat it specially, or to implement +a form of object-oriented programming, for example. + + -- cgit 1.4.1