aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-01-22 18:16:45 +0100
committerAdrian Kummerlaender2015-01-22 18:16:45 +0100
commit2e58bae3b46dc292736bbdbba6d4ee56b1ee51ed (patch)
treeace35105a28d150996b14bea5a02518988d028e0
parentcb1ee55373e5efd1441664ec4e6942d4ace5e368 (diff)
downloadTypeAsValue-2e58bae3b46dc292736bbdbba6d4ee56b1ee51ed.tar
TypeAsValue-2e58bae3b46dc292736bbdbba6d4ee56b1ee51ed.tar.gz
TypeAsValue-2e58bae3b46dc292736bbdbba6d4ee56b1ee51ed.tar.bz2
TypeAsValue-2e58bae3b46dc292736bbdbba6d4ee56b1ee51ed.tar.lz
TypeAsValue-2e58bae3b46dc292736bbdbba6d4ee56b1ee51ed.tar.xz
TypeAsValue-2e58bae3b46dc292736bbdbba6d4ee56b1ee51ed.tar.zst
TypeAsValue-2e58bae3b46dc292736bbdbba6d4ee56b1ee51ed.zip
Renamed `Concatenate` to `Append` to match Scheme function naming
-rw-r--r--README.md2
-rw-r--r--src/list/list.h2
-rw-r--r--src/list/operation/append.h27
-rw-r--r--src/list/operation/concatenate.h27
-rw-r--r--src/list/operation/reverse.h8
-rw-r--r--test.cc4
6 files changed, 35 insertions, 35 deletions
diff --git a/README.md b/README.md
index c572704..bf6f4a8 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ const std::size_t count = tav::Length<
* conditionals
* `Cons` structure
* `List` function as helper for `Cons` construction
-* basic list operators such as `Nth`, `Length`, `Take` and `Concatenate`
+* basic list operators such as `Nth`, `Length`, `Take` and `Append`
* higher order list operation `Fold`
* higher order list operations such as `Map` and `Filter` expressed in terms of `Fold`
* higher order list queries such as `Any`, `All` and `None`
diff --git a/src/list/list.h b/src/list/list.h
index b0fe407..b89e1ca 100644
--- a/src/list/list.h
+++ b/src/list/list.h
@@ -30,6 +30,6 @@ using Tail = Cdr<Cons>;
}
#include "operation/basic.h"
-#include "operation/concatenate.h"
+#include "operation/append.h"
#endif // TYPEASVALUE_SRC_LIST_LIST_H_
diff --git a/src/list/operation/append.h b/src/list/operation/append.h
new file mode 100644
index 0000000..9e1be79
--- /dev/null
+++ b/src/list/operation/append.h
@@ -0,0 +1,27 @@
+#ifndef TYPEASVALUE_SRC_LIST_OPERATION_APPEND_H_
+#define TYPEASVALUE_SRC_LIST_OPERATION_APPEND_H_
+
+namespace tav {
+
+template <
+ typename Primary,
+ typename Secondary
+>
+struct Append {
+ typedef Cons<
+ Head<Primary>,
+ typename Append<
+ Tail<Primary>,
+ Secondary
+ >::type
+ > type;
+};
+
+template <typename Secondary>
+struct Append<void, Secondary> {
+ typedef Secondary type;
+};
+
+}
+
+#endif // TYPEASVALUE_SRC_LIST_OPERATION_APPEND_H_
diff --git a/src/list/operation/concatenate.h b/src/list/operation/concatenate.h
deleted file mode 100644
index 21eb1ee..0000000
--- a/src/list/operation/concatenate.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef TYPEASVALUE_SRC_LIST_OPERATION_CONCATENATE_H_
-#define TYPEASVALUE_SRC_LIST_OPERATION_CONCATENATE_H_
-
-namespace tav {
-
-template <
- typename Primary,
- typename Secondary
->
-struct Concatenate {
- typedef Cons<
- Head<Primary>,
- typename Concatenate<
- Tail<Primary>,
- Secondary
- >::type
- > type;
-};
-
-template <typename Secondary>
-struct Concatenate<void, Secondary> {
- typedef Secondary type;
-};
-
-}
-
-#endif // TYPEASVALUE_SRC_LIST_OPERATION_CONCATENATE_H_
diff --git a/src/list/operation/reverse.h b/src/list/operation/reverse.h
index 7a0305c..632fa5b 100644
--- a/src/list/operation/reverse.h
+++ b/src/list/operation/reverse.h
@@ -1,7 +1,7 @@
#ifndef TYPEASVALUE_SRC_LIST_OPERATION_REVERSE_H_
#define TYPEASVALUE_SRC_LIST_OPERATION_REVERSE_H_
-#include "concatenate.h"
+#include "append.h"
#include "higher/fold.h"
namespace tav {
@@ -13,15 +13,15 @@ class Reverse {
typename Current,
typename Previous
>
- struct reversed_concatenate {
- typedef typename Concatenate<
+ struct reversed_append {
+ typedef typename Append<
Previous,
Cons<Current, void>
>::type type;
};
public:
- typedef typename Fold<reversed_concatenate, void, List>::type type;
+ typedef typename Fold<reversed_append, void, List>::type type;
};
diff --git a/test.cc b/test.cc
index 718fb70..e8e87e1 100644
--- a/test.cc
+++ b/test.cc
@@ -323,7 +323,7 @@ static_assert(
std::is_same<
tav::Size<2>,
tav::Length<
- tav::Concatenate<
+ tav::Append<
tav::List<tav::Int<1>>::type,
tav::List<tav::Int<2>>::type
>::type
@@ -336,7 +336,7 @@ static_assert(
std::is_same<
tav::Size<4>,
tav::Length<
- tav::Concatenate<
+ tav::Append<
tav::List<tav::Int<1>, tav::Int<2>>::type,
tav::List<tav::Int<3>, tav::Int<4>>::type
>::type