From 997defa16617caf5fd869924558389639d1c8caf Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 15 Oct 2014 22:04:48 -0400 Subject: Add functors (callable attribute sets). With this, attribute sets with a `__functor` attribute can be applied just like normal functions. This can be used to attach arbitrary metadata to a function without callers needing to treat it specially. --- tests/lang/eval-okay-callable-attrs.exp | 1 + tests/lang/eval-okay-callable-attrs.nix | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/lang/eval-okay-callable-attrs.exp create mode 100644 tests/lang/eval-okay-callable-attrs.nix (limited to 'tests') diff --git a/tests/lang/eval-okay-callable-attrs.exp b/tests/lang/eval-okay-callable-attrs.exp new file mode 100644 index 000000000000..27ba77ddaf61 --- /dev/null +++ b/tests/lang/eval-okay-callable-attrs.exp @@ -0,0 +1 @@ +true diff --git a/tests/lang/eval-okay-callable-attrs.nix b/tests/lang/eval-okay-callable-attrs.nix new file mode 100644 index 000000000000..310a030df004 --- /dev/null +++ b/tests/lang/eval-okay-callable-attrs.nix @@ -0,0 +1 @@ +({ __functor = self: x: self.foo && x; foo = false; } // { foo = true; }) true -- cgit 1.4.1