Skip to content
Browse files

Removed PP Prefix

  • Loading branch information...
1 parent 887038e commit b050a62e489b07d94afcc930362709fb4ae69de0 Daniel Holden committed
Showing with 1,514 additions and 1,507 deletions.
  1. +45 −0 BOOL.h
  2. +148 −0 BRAINFUCK.h
  3. +135 −0 CHAR.h
  4. +17 −0 COMPLETE.h
  5. +12 −0 COND.h
  6. +18 −0 CORE.h
  7. +264 −0 DEC.h
  8. +263 −0 INC.h
  9. +31 −0 INT.h
  10. +51 −0 LIST.h
  11. +0 −3 MAIN.h
  12. +3 −0 MAIN_BF.h
  13. +2 −2 MAIN_TM.h
  14. +0 −12 PP.h
  15. +0 −45 PP_BOOL.h
  16. +0 −150 PP_BRAINFUCK.h
  17. +0 −135 PP_CHAR.h
  18. +0 −12 PP_COND.h
  19. +0 −16 PP_CORE.h
  20. +0 −264 PP_DEC.h
  21. +0 −263 PP_INC.h
  22. +0 −31 PP_INT.h
  23. +0 −51 PP_LIST.h
  24. +0 −227 PP_RECR.h
  25. +0 −220 PP_TEST.h
  26. +0 −74 PP_TURING.h
  27. +2 −2 README.md
  28. +227 −0 RECR.h
  29. +224 −0 TEST.h
  30. +72 −0 TURING.h
View
45 BOOL.h
@@ -0,0 +1,45 @@
+#ifndef BOOL_H
+#define BOOL_H
+
+#define NOT_0 1
+#define NOT_1 0
+
+#define AND_0_0 0
+#define AND_0_1 0
+#define AND_1_0 0
+#define AND_1_1 1
+
+#define OR_0_0 0
+#define OR_0_1 1
+#define OR_1_0 1
+#define OR_1_1 1
+
+#define XOR_0_0 0
+#define XOR_0_1 1
+#define XOR_1_0 1
+#define XOR_1_1 0
+
+/* Truth Constants */
+#define TRUE 1
+#define FALSE 0
+
+/* Boolean Operators */
+#define NOT(X) JOIN(NOT_, X)
+#define AND(X, Y) JOIN2(AND_, X, Y)
+#define OR(X, Y) JOIN2(OR_, X, Y)
+#define XOR(X, Y) JOIN2(XOR_, X, Y)
+
+/* Cast to Bool */
+#define CHECK_N(X, N, ...) N
+#define CHECK(...) CHECK_N(__VA_ARGS__, 0,)
+
+#define CHECK_ZERO(X) CHECK(JOIN(CHECK_ZERO_, X))
+#define CHECK_ZERO_0 ~, 1,
+
+#define CHECK_EMPTY(X) CHECK(JOIN(CHECK_EMPTY_, X))
+#define CHECK_EMPTY_ ~, 1,
+
+
+#define BOOL(X) NOT(CHECK_ZERO(X))
+
+#endif
View
148 BRAINFUCK.h
@@ -0,0 +1,148 @@
+#ifndef BRAINFUCK_H
+#define BRAINFUCK_H
+
+/*!
+ * BRAINFUCK
+ * ============
+ *
+ * About
+ * -----
+ *
+ * Brainfuck in c preprocessor
+ *
+ *
+ * Input
+ * -----
+ *
+ * To ensure valid preprocessor symbols
+ * instructions are mapped to the following
+ * characters, with input disabled.
+ *
+ * + `>` => `R`
+ * + `<` => `L`
+ * + `+` => `U`
+ * + `-` => `D`
+ * + `.` => `O`
+ * + `[` => `F`
+ * + `]` => `B`
+ *
+ *
+ * Structure
+ * ---------
+ *
+ * IP - Brainfuck instr index
+ * DP - Brainfuck data index
+ * IA - Brainfuck instr array
+ * DA - Brainfuck data array
+ *
+ * X - (IP, DP, IA, DA)
+ *
+ */
+
+/* Check if blank symbol */
+#define IS_BLANK(X) JOIN(IS_BLANK_, X)
+#define IS_BLANK_ 1
+#define IS_BLANK_R 0
+#define IS_BLANK_L 0
+#define IS_BLANK_U 0
+#define IS_BLANK_D 0
+#define IS_BLANK_O 0
+#define IS_BLANK_F 0
+#define IS_BLANK_B 0
+
+/* Check if output symbol */
+#define IS_OUTPUT(X) JOIN(IS_OUTPUT_, X)
+#define IS_OUTPUT_ 0
+#define IS_OUTPUT_R 0
+#define IS_OUTPUT_L 0
+#define IS_OUTPUT_U 0
+#define IS_OUTPUT_D 0
+#define IS_OUTPUT_O 1
+#define IS_OUTPUT_F 0
+#define IS_OUTPUT_B 0
+
+/* Check if forward symbol */
+#define IS_FORWARD(X) JOIN(IS_FORWARD_, X)
+#define IS_FORWARD_ 0
+#define IS_FORWARD_R 0
+#define IS_FORWARD_L 0
+#define IS_FORWARD_U 0
+#define IS_FORWARD_D 0
+#define IS_FORWARD_O 0
+#define IS_FORWARD_F 1
+#define IS_FORWARD_B 0
+
+/* Check if backward symbol */
+#define IS_BACKWARD(X) JOIN(IS_BACKWARD_, X)
+#define IS_BACKWARD_ 0
+#define IS_BACKWARD_R 0
+#define IS_BACKWARD_L 0
+#define IS_BACKWARD_U 0
+#define IS_BACKWARD_D 0
+#define IS_BACKWARD_O 0
+#define IS_BACKWARD_F 0
+#define IS_BACKWARD_B 1
+
+/* Get individual parts */
+#define BF_IP(X) FST(X)
+#define BF_DP(X) SND(X)
+#define BF_IA(X) TRD(X)
+#define BF_DA(X) FTH(X)
+#define BF_INSTR($, X) NTH($, BF_IA(X), BF_IP(X))
+#define BF_DATA($, X) NTH($, BF_DA(X), BF_DP(X))
+
+/* Inc/Dec Data Item */
+#define BF_DATA_FST($, X) TAKE($, BF_DA(X), BF_DP(X))
+#define BF_DATA_SND($, X) DROP($, BF_DA(X), INC(BF_DP(X)))
+#define BF_DATA_INCED($, X) ( INC(NTH($, BF_DA(X), BF_DP(X))) )
+#define BF_DATA_DECED($, X) ( DEC(NTH($, BF_DA(X), BF_DP(X))) )
+
+#define BF_DATA_INC($, X) CONCAT( BF_DATA_FST($, X) , CONCAT( BF_DATA_INCED($, X) , BF_DATA_SND($, X) ) )
+#define BF_DATA_DEC($, X) CONCAT( BF_DATA_FST($, X) , CONCAT( BF_DATA_DECED($, X) , BF_DATA_SND($, X) ) )
+
+/* Jump Forward/Back */
+
+// TODO: Make count braces
+#define BF_JUMP_FWD_E_TRD(S, I) IF_ELSE(IS_FOWARD(S), INC(I), IF_ELSE(IS_BACKWARD(S), DEC(I), I) )
+
+#define BF_JUMP_FWD_C($, X) NOT(IS_BACKWARD(HEAD(FST(X))))
+#define BF_JUMP_FWD_M($, X)
+#define BF_JUMP_FWD_U($, X) (TAIL(FST(X)), INC(SND(X)))
+#define BF_JUMP_FWD_E($, X) INC(SND(X))
+#define BF_JUMP_FWD($, X) JOIN(RECR_D, $)(INC($), BF_JUMP_FWD_C, BF_JUMP_FWD_M, BF_JUMP_FWD_U, BF_JUMP_FWD_E, (DROP($, BF_IA(X), BF_IP(X)), BF_IP(X) ) )
+
+// TODO: Make count braces
+#define BF_JUMP_BCK_C($, X) NOT( IS_FORWARD(NTH($, FST(X), SND(X))) )
+#define BF_JUMP_BCK_M($, X)
+#define BF_JUMP_BCK_U($, X) ( FST(X), DEC(SND(X)) )
+#define BF_JUMP_BCK_E($, X) INC(SND(X))
+#define BF_JUMP_BCK($, X) JOIN(RECR_D, $)(INC($), BF_JUMP_BCK_C, BF_JUMP_BCK_M, BF_JUMP_BCK_U, BF_JUMP_BCK_E, (BF_IA(X), BF_IP(X)) )
+
+#define BF_JUMP_F($, X) IF_ELSE(BOOL(BF_DATA($, X)), INC(BF_IP(X)), BF_JUMP_FWD($, X) )
+#define BF_JUMP_B($, X) IF_ELSE(BOOL(BF_DATA($, X)), BF_JUMP_BCK($, X) , INC(BF_IP(X)) )
+
+/* Brainfuck Symbol Update */
+#define BF_UPDATE_SYM($, S, X) JOIN(BF_UPDATE_SYM_, S)($, X)
+#define BF_UPDATE_SYM_R($, X) (INC(BF_IP(X)), INC(BF_DP(X)), BF_IA(X), BF_DA(X))
+#define BF_UPDATE_SYM_L($, X) (INC(BF_IP(X)), DEC(BF_DP(X)), BF_IA(X), BF_DA(X))
+#define BF_UPDATE_SYM_U($, X) (INC(BF_IP(X)), BF_DP(X), BF_IA(X), BF_DATA_INC($, X))
+#define BF_UPDATE_SYM_D($, X) (INC(BF_IP(X)), BF_DP(X), BF_IA(X), BF_DATA_DEC($, X))
+#define BF_UPDATE_SYM_O($, X) (INC(BF_IP(X)), BF_DP(X), BF_IA(X), BF_DA(X))
+#define BF_UPDATE_SYM_F($, X) (BF_JUMP_F($, X), BF_DP(X), BF_IA(X), BF_DA(X))
+#define BF_UPDATE_SYM_B($, X) (BF_JUMP_B($, X), BF_DP(X), BF_IA(X), BF_DA(X))
+#define BF_UPDATE_SYM_($, X) X
+
+
+#define BF_COND($, X) NOT(IS_BLANK(BF_INSTR($, X)))
+#define BF_MACRO($, X) IF(IS_OUTPUT(BF_INSTR($, X)), CHAR(BF_DATA($, X)))
+#define BF_UPDATE($, X) BF_UPDATE_SYM($, BF_INSTR($, X), X)
+#define BF_FINALLY($, X)
+#define BF_RECR($, X) JOIN(RECR_D, $)(INC($), BF_COND, BF_MACRO, BF_UPDATE, BF_FINALLY, X)
+
+#define BF_DATA_EMPTY() (0,0,0,0,0)
+
+/* Perform Brainfuck with input I */
+#define BRAINFUCK(I) BF_RECR($0, (0, 0, I, BF_DATA_EMPTY()))
+
+
+#endif
View
135 CHAR.h
@@ -0,0 +1,135 @@
+#ifndef CHAR_H
+#define CHAR_H
+
+#define CHAR(X) JOIN(CHAR_, X)
+#define CHAR_0 [NUL]
+#define CHAR_1 [SOH]
+#define CHAR_2 [STX]
+#define CHAR_3 [ETX]
+#define CHAR_4 [EOT]
+#define CHAR_5 [ENQ]
+#define CHAR_6 [ACK]
+#define CHAR_7 [BEL]
+#define CHAR_8 [BS]
+#define CHAR_9
+#define CHAR_10 \
+
+#define CHAR_11 [VT]
+#define CHAR_12 [FF]
+#define CHAR_13 [CR]
+#define CHAR_14 [SO]
+#define CHAR_15 [SI]
+#define CHAR_16 [DLE]
+#define CHAR_17 [DC1]
+#define CHAR_18 [DC2]
+#define CHAR_19 [DC3]
+#define CHAR_20 [DC4]
+#define CHAR_21 [NAK]
+#define CHAR_22 [SYN]
+#define CHAR_23 [ETB]
+#define CHAR_24 [CAN]
+#define CHAR_25 [EM]
+#define CHAR_26 [SUB]
+#define CHAR_27 [ESC]
+#define CHAR_28 [FS]
+#define CHAR_29 [GS]
+#define CHAR_30 [RS]
+#define CHAR_31 [US]
+#define CHAR_32
+#define CHAR_33 !
+#define CHAR_34 [DQ]
+#define CHAR_35 #
+#define CHAR_36 $
+#define CHAR_37 %
+#define CHAR_38 &
+#define CHAR_39 [SQ]
+#define CHAR_40 (
+#define CHAR_41 )
+#define CHAR_42 *
+#define CHAR_43 +
+#define CHAR_44 ,
+#define CHAR_45 -
+#define CHAR_46 .
+#define CHAR_47 /
+#define CHAR_48 0
+#define CHAR_49 1
+#define CHAR_50 2
+#define CHAR_51 3
+#define CHAR_52 4
+#define CHAR_53 5
+#define CHAR_54 6
+#define CHAR_55 7
+#define CHAR_56 8
+#define CHAR_57 9
+#define CHAR_58 :
+#define CHAR_59 ;
+#define CHAR_60 <
+#define CHAR_61 =
+#define CHAR_62 >
+#define CHAR_63 ?
+#define CHAR_64 @
+#define CHAR_65 A
+#define CHAR_66 B
+#define CHAR_67 C
+#define CHAR_68 D
+#define CHAR_69 E
+#define CHAR_70 F
+#define CHAR_71 G
+#define CHAR_72 H
+#define CHAR_73 I
+#define CHAR_74 J
+#define CHAR_75 K
+#define CHAR_76 L
+#define CHAR_77 M
+#define CHAR_78 N
+#define CHAR_79 O
+#define CHAR_80 P
+#define CHAR_81 Q
+#define CHAR_82 R
+#define CHAR_83 S
+#define CHAR_84 T
+#define CHAR_85 U
+#define CHAR_86 V
+#define CHAR_87 W
+#define CHAR_88 X
+#define CHAR_89 Y
+#define CHAR_90 Z
+#define CHAR_91 [
+#define CHAR_92 \
+#define CHAR_93 ]
+#define CHAR_94 ^
+#define CHAR_95 _
+#define CHAR_96 `
+#define CHAR_97 a
+#define CHAR_98 b
+#define CHAR_99 c
+#define CHAR_100 d
+#define CHAR_101 e
+#define CHAR_102 f
+#define CHAR_103 g
+#define CHAR_104 h
+#define CHAR_105 i
+#define CHAR_106 j
+#define CHAR_107 k
+#define CHAR_108 l
+#define CHAR_109 m
+#define CHAR_110 n
+#define CHAR_111 o
+#define CHAR_112 p
+#define CHAR_113 q
+#define CHAR_114 r
+#define CHAR_115 s
+#define CHAR_116 t
+#define CHAR_117 u
+#define CHAR_118 v
+#define CHAR_119 w
+#define CHAR_120 x
+#define CHAR_121 y
+#define CHAR_122 z
+#define CHAR_123 {
+#define CHAR_124 |
+#define CHAR_125 }
+#define CHAR_126 ~
+#define CHAR_127 DEL
+
+#endif
View
17 COMPLETE.h
@@ -0,0 +1,17 @@
+#ifndef COMPLETE_H
+#define COMPLETE_H
+
+#include "CORE.h"
+#include "COND.h"
+#include "RECR.h"
+
+#include "INC.h"
+#include "DEC.h"
+#include "INT.h"
+#include "CHAR.h"
+#include "LIST.h"
+
+#include "BRAINFUCK.h"
+#include "TURING.h"
+
+#endif
View
12 COND.h
@@ -0,0 +1,12 @@
+#ifndef COND_H
+#define COND_H
+
+#include "CORE.h"
+
+#define IF_ELSE(C, T, E) JOIN(IF_ELSE_, C)(T, E)
+#define IF_ELSE_0(T, E) E
+#define IF_ELSE_1(T, E) T
+
+#define IF(C, T) IF_ELSE(C, T, )
+
+#endif
View
18 CORE.h
@@ -0,0 +1,18 @@
+#ifndef CORE_H
+#define CORE_H
+
+#define EMPTY()
+#define DEFER(M) M EMPTY()
+#define OBSTRUCT(M) M DEFER(EMPTY)()
+
+#define APPLY(M, ...) M(__VA_ARGS__)
+
+#define JOIN(X, Y) X##Y
+#define JOIN2(X, Y, Z) X##Y##_##Z
+
+#define EVAL(...) __VA_ARGS__
+#define EAT(...)
+
+#define ERROR() (ERROR)##(ERROR)
+
+#endif
View
264 DEC.h
@@ -0,0 +1,264 @@
+#ifndef DEC_H
+#define DEC_H
+
+#define DEC(X) JOIN(DEC_, X)
+
+#define DEC_0 0
+#define DEC_1 0
+#define DEC_2 1
+#define DEC_3 2
+#define DEC_4 3
+#define DEC_5 4
+#define DEC_6 5
+#define DEC_7 6
+#define DEC_8 7
+#define DEC_9 8
+#define DEC_10 9
+#define DEC_11 10
+#define DEC_12 11
+#define DEC_13 12
+#define DEC_14 13
+#define DEC_15 14
+#define DEC_16 15
+#define DEC_17 16
+#define DEC_18 17
+#define DEC_19 18
+#define DEC_20 19
+#define DEC_21 20
+#define DEC_22 21
+#define DEC_23 22
+#define DEC_24 23
+#define DEC_25 24
+#define DEC_26 25
+#define DEC_27 26
+#define DEC_28 27
+#define DEC_29 28
+#define DEC_30 29
+#define DEC_31 30
+#define DEC_32 31
+#define DEC_33 34
+#define DEC_34 35
+#define DEC_35 36
+#define DEC_36 37
+#define DEC_37 38
+#define DEC_38 39
+#define DEC_39 40
+#define DEC_40 41
+#define DEC_41 42
+#define DEC_42 43
+#define DEC_43 44
+#define DEC_44 45
+#define DEC_45 46
+#define DEC_46 47
+#define DEC_47 48
+#define DEC_48 49
+#define DEC_49 50
+#define DEC_50 51
+#define DEC_51 52
+#define DEC_52 53
+#define DEC_53 54
+#define DEC_54 55
+#define DEC_55 56
+#define DEC_56 57
+#define DEC_57 58
+#define DEC_58 59
+#define DEC_59 60
+#define DEC_60 61
+#define DEC_61 62
+#define DEC_62 63
+#define DEC_63 64
+#define DEC_64 65
+#define DEC_65 66
+#define DEC_66 67
+#define DEC_67 68
+#define DEC_68 69
+#define DEC_69 70
+#define DEC_70 71
+#define DEC_71 72
+#define DEC_72 73
+#define DEC_73 74
+#define DEC_74 75
+#define DEC_75 76
+#define DEC_76 77
+#define DEC_77 78
+#define DEC_78 79
+#define DEC_79 80
+#define DEC_80 81
+#define DEC_81 82
+#define DEC_82 83
+#define DEC_83 84
+#define DEC_84 85
+#define DEC_85 86
+#define DEC_86 87
+#define DEC_87 88
+#define DEC_88 89
+#define DEC_89 90
+#define DEC_90 91
+#define DEC_91 92
+#define DEC_92 93
+#define DEC_93 94
+#define DEC_94 95
+#define DEC_95 96
+#define DEC_96 97
+#define DEC_97 98
+#define DEC_98 99
+#define DEC_99 100
+#define DEC_100 101
+#define DEC_101 102
+#define DEC_102 103
+#define DEC_103 104
+#define DEC_104 105
+#define DEC_105 106
+#define DEC_106 107
+#define DEC_107 108
+#define DEC_108 109
+#define DEC_109 110
+#define DEC_110 111
+#define DEC_111 112
+#define DEC_112 113
+#define DEC_113 114
+#define DEC_114 115
+#define DEC_115 116
+#define DEC_116 117
+#define DEC_117 118
+#define DEC_118 119
+#define DEC_119 120
+#define DEC_120 121
+#define DEC_121 122
+#define DEC_122 123
+#define DEC_123 124
+#define DEC_124 125
+#define DEC_125 126
+#define DEC_126 127
+#define DEC_127 128
+#define DEC_128 129
+#define DEC_129 130
+#define DEC_130 131
+#define DEC_131 132
+#define DEC_132 133
+#define DEC_133 134
+#define DEC_134 135
+#define DEC_135 136
+#define DEC_136 137
+#define DEC_137 138
+#define DEC_138 139
+#define DEC_139 140
+#define DEC_140 141
+#define DEC_141 142
+#define DEC_142 143
+#define DEC_143 144
+#define DEC_144 145
+#define DEC_145 146
+#define DEC_146 147
+#define DEC_147 148
+#define DEC_148 149
+#define DEC_149 150
+#define DEC_150 151
+#define DEC_151 152
+#define DEC_152 153
+#define DEC_153 154
+#define DEC_154 155
+#define DEC_155 156
+#define DEC_156 157
+#define DEC_157 158
+#define DEC_158 159
+#define DEC_159 160
+#define DEC_160 161
+#define DEC_161 162
+#define DEC_162 163
+#define DEC_163 164
+#define DEC_164 165
+#define DEC_165 166
+#define DEC_166 167
+#define DEC_167 168
+#define DEC_168 169
+#define DEC_169 170
+#define DEC_170 171
+#define DEC_171 172
+#define DEC_172 173
+#define DEC_173 174
+#define DEC_174 175
+#define DEC_175 176
+#define DEC_176 177
+#define DEC_177 178
+#define DEC_178 179
+#define DEC_179 180
+#define DEC_180 181
+#define DEC_181 182
+#define DEC_182 183
+#define DEC_183 184
+#define DEC_184 185
+#define DEC_185 186
+#define DEC_186 187
+#define DEC_187 188
+#define DEC_188 189
+#define DEC_189 190
+#define DEC_190 191
+#define DEC_191 192
+#define DEC_192 193
+#define DEC_193 194
+#define DEC_194 195
+#define DEC_195 196
+#define DEC_196 197
+#define DEC_197 198
+#define DEC_198 199
+#define DEC_199 200
+#define DEC_200 201
+#define DEC_201 202
+#define DEC_202 203
+#define DEC_203 204
+#define DEC_204 205
+#define DEC_205 206
+#define DEC_206 207
+#define DEC_207 208
+#define DEC_208 209
+#define DEC_209 210
+#define DEC_210 211
+#define DEC_211 212
+#define DEC_212 213
+#define DEC_213 214
+#define DEC_214 215
+#define DEC_215 216
+#define DEC_216 217
+#define DEC_217 218
+#define DEC_218 219
+#define DEC_219 220
+#define DEC_220 221
+#define DEC_221 222
+#define DEC_222 223
+#define DEC_223 224
+#define DEC_224 225
+#define DEC_225 226
+#define DEC_226 227
+#define DEC_227 228
+#define DEC_228 229
+#define DEC_229 230
+#define DEC_230 231
+#define DEC_231 232
+#define DEC_232 233
+#define DEC_233 234
+#define DEC_234 235
+#define DEC_235 236
+#define DEC_236 237
+#define DEC_237 238
+#define DEC_238 239
+#define DEC_239 240
+#define DEC_240 241
+#define DEC_241 242
+#define DEC_242 243
+#define DEC_243 244
+#define DEC_244 245
+#define DEC_245 246
+#define DEC_246 247
+#define DEC_247 248
+#define DEC_248 249
+#define DEC_249 250
+#define DEC_250 251
+#define DEC_251 252
+#define DEC_252 253
+#define DEC_253 254
+#define DEC_254 255
+#define DEC_255 256
+#define DEC_256 256
+
+#endif
View
263 INC.h
@@ -0,0 +1,263 @@
+#ifndef INC_H
+#define INC_H
+
+#define INC(X) JOIN(INC_, X)
+#define INC_0 1
+#define INC_1 2
+#define INC_2 3
+#define INC_3 4
+#define INC_4 5
+#define INC_5 6
+#define INC_6 7
+#define INC_7 8
+#define INC_8 9
+#define INC_9 10
+#define INC_10 11
+#define INC_11 12
+#define INC_12 13
+#define INC_13 14
+#define INC_14 15
+#define INC_15 16
+#define INC_16 17
+#define INC_17 18
+#define INC_18 19
+#define INC_19 20
+#define INC_20 21
+#define INC_21 22
+#define INC_22 23
+#define INC_23 24
+#define INC_24 25
+#define INC_25 26
+#define INC_26 27
+#define INC_27 28
+#define INC_28 29
+#define INC_29 30
+#define INC_30 31
+#define INC_31 32
+#define INC_32 33
+#define INC_33 34
+#define INC_34 35
+#define INC_35 36
+#define INC_36 37
+#define INC_37 38
+#define INC_38 39
+#define INC_39 40
+#define INC_40 41
+#define INC_41 42
+#define INC_42 43
+#define INC_43 44
+#define INC_44 45
+#define INC_45 46
+#define INC_46 47
+#define INC_47 48
+#define INC_48 49
+#define INC_49 50
+#define INC_50 51
+#define INC_51 52
+#define INC_52 53
+#define INC_53 54
+#define INC_54 55
+#define INC_55 56
+#define INC_56 57
+#define INC_57 58
+#define INC_58 59
+#define INC_59 60
+#define INC_60 61
+#define INC_61 62
+#define INC_62 63
+#define INC_63 64
+#define INC_64 65
+#define INC_65 66
+#define INC_66 67
+#define INC_67 68
+#define INC_68 69
+#define INC_69 70
+#define INC_70 71
+#define INC_71 72
+#define INC_72 73
+#define INC_73 74
+#define INC_74 75
+#define INC_75 76
+#define INC_76 77
+#define INC_77 78
+#define INC_78 79
+#define INC_79 80
+#define INC_80 81
+#define INC_81 82
+#define INC_82 83
+#define INC_83 84
+#define INC_84 85
+#define INC_85 86
+#define INC_86 87
+#define INC_87 88
+#define INC_88 89
+#define INC_89 90
+#define INC_90 91
+#define INC_91 92
+#define INC_92 93
+#define INC_93 94
+#define INC_94 95
+#define INC_95 96
+#define INC_96 97
+#define INC_97 98
+#define INC_98 99
+#define INC_99 100
+#define INC_100 101
+#define INC_101 102
+#define INC_102 103
+#define INC_103 104
+#define INC_104 105
+#define INC_105 106
+#define INC_106 107
+#define INC_107 108
+#define INC_108 109
+#define INC_109 110
+#define INC_110 111
+#define INC_111 112
+#define INC_112 113
+#define INC_113 114
+#define INC_114 115
+#define INC_115 116
+#define INC_116 117
+#define INC_117 118
+#define INC_118 119
+#define INC_119 120
+#define INC_120 121
+#define INC_121 122
+#define INC_122 123
+#define INC_123 124
+#define INC_124 125
+#define INC_125 126
+#define INC_126 127
+#define INC_127 128
+#define INC_128 129
+#define INC_129 130
+#define INC_130 131
+#define INC_131 132
+#define INC_132 133
+#define INC_133 134
+#define INC_134 135
+#define INC_135 136
+#define INC_136 137
+#define INC_137 138
+#define INC_138 139
+#define INC_139 140
+#define INC_140 141
+#define INC_141 142
+#define INC_142 143
+#define INC_143 144
+#define INC_144 145
+#define INC_145 146
+#define INC_146 147
+#define INC_147 148
+#define INC_148 149
+#define INC_149 150
+#define INC_150 151
+#define INC_151 152
+#define INC_152 153
+#define INC_153 154
+#define INC_154 155
+#define INC_155 156
+#define INC_156 157
+#define INC_157 158
+#define INC_158 159
+#define INC_159 160
+#define INC_160 161
+#define INC_161 162
+#define INC_162 163
+#define INC_163 164
+#define INC_164 165
+#define INC_165 166
+#define INC_166 167
+#define INC_167 168
+#define INC_168 169
+#define INC_169 170
+#define INC_170 171
+#define INC_171 172
+#define INC_172 173
+#define INC_173 174
+#define INC_174 175
+#define INC_175 176
+#define INC_176 177
+#define INC_177 178
+#define INC_178 179
+#define INC_179 180
+#define INC_180 181
+#define INC_181 182
+#define INC_182 183
+#define INC_183 184
+#define INC_184 185
+#define INC_185 186
+#define INC_186 187
+#define INC_187 188
+#define INC_188 189
+#define INC_189 190
+#define INC_190 191
+#define INC_191 192
+#define INC_192 193
+#define INC_193 194
+#define INC_194 195
+#define INC_195 196
+#define INC_196 197
+#define INC_197 198
+#define INC_198 199
+#define INC_199 200
+#define INC_200 201
+#define INC_201 202
+#define INC_202 203
+#define INC_203 204
+#define INC_204 205
+#define INC_205 206
+#define INC_206 207
+#define INC_207 208
+#define INC_208 209
+#define INC_209 210
+#define INC_210 211
+#define INC_211 212
+#define INC_212 213
+#define INC_213 214
+#define INC_214 215
+#define INC_215 216
+#define INC_216 217
+#define INC_217 218
+#define INC_218 219
+#define INC_219 220
+#define INC_220 221
+#define INC_221 222
+#define INC_222 223
+#define INC_223 224
+#define INC_224 225
+#define INC_225 226
+#define INC_226 227
+#define INC_227 228
+#define INC_228 229
+#define INC_229 230
+#define INC_230 231
+#define INC_231 232
+#define INC_232 233
+#define INC_233 234
+#define INC_234 235
+#define INC_235 236
+#define INC_236 237
+#define INC_237 238
+#define INC_238 239
+#define INC_239 240
+#define INC_240 241
+#define INC_241 242
+#define INC_242 243
+#define INC_243 244
+#define INC_244 245
+#define INC_245 246
+#define INC_246 247
+#define INC_247 248
+#define INC_248 249
+#define INC_249 250
+#define INC_250 251
+#define INC_251 252
+#define INC_252 253
+#define INC_253 254
+#define INC_254 255
+#define INC_255 256
+#define INC_256 256
+
+#endif
View
31 INT.h
@@ -0,0 +1,31 @@
+#ifndef INT_H
+#define INT_H
+
+#include "CORE.h"
+#include "INC.h"
+#include "DEC.h"
+#include "COND.h"
+#include "RECR.h"
+#include "LIST.h"
+
+#define ADD_C($, X) BOOL(SND(X))
+#define ADD_M($, X)
+#define ADD_U($, X) (INC(FST(X)), DEC(SND(X)))
+#define ADD_E($, X) FST(X)
+
+#define SUB_C($, X) BOOL(SND(X))
+#define SUB_M($, X)
+#define SUB_U($, X) (DEC(FST(X)), DEC(SND(X)))
+#define SUB_E($, X) FST(X)
+
+#define ADD($, X, Y) JOIN(RECR_D, $)(INC($), ADD_C, ADD_M, ADD_U, ADD_E, (X, Y))
+#define SUB($, X, Y) JOIN(RECR_D, $)(INC($), SUB_C, SUB_M, SUB_U, SUB_E, (X, Y))
+
+#define GT($, X, Y) BOOL(SUB($, X, Y))
+#define LT($, X, Y) BOOL(SUB($, Y, X))
+#define LE($, X, Y) NOT(GT($, X, Y))
+#define GE($, X, Y) NOT(LT($, X, Y))
+#define EQ($, X, Y) AND(NOT(LT($, X, Y)), NOT(LT($, Y, X)))
+#define NEQ($, X, Y) NOT(EQ($, X, Y))
+
+#endif
View
51 LIST.h
@@ -0,0 +1,51 @@
+#ifndef LIST_H
+#define LIST_H
+
+#include "CORE.h"
+#include "BOOL.h"
+#include "RECR.h"
+
+#define LIST(...) (__VA_ARGS__)
+#define UNCURRY(M, ...) M(__VA_ARGS__)
+#define CURRY(M, L) EVAL(M L)
+
+#define HEAD(L) CURRY(LIST_HEAD, L)
+#define TAIL(L) CURRY(LIST_TAIL, L)
+#define FST(L) HEAD(L)
+#define SND(L) HEAD(TAIL(L))
+#define TRD(L) HEAD(TAIL(TAIL(L)))
+#define FTH(L) HEAD(TAIL(TAIL(TAIL(L))))
+#define ISEMPTY(L) CHECK_EMPTY(HEAD(L))
+#define CONS(X, L) IF_ELSE(ISEMPTY(L), (X), (X, CURRY(EVAL, L)))
+#define CONCAT(L, G) IF_ELSE( ISEMPTY(L), G, IF_ELSE(ISEMPTY(G), L, (CURRY(EVAL, L), CURRY(EVAL, G)) ))
+
+#define LEN_C($, X) NOT(ISEMPTY(FST(X)))
+#define LEN_M($, X)
+#define LEN_U($, X) (TAIL(FST(X)), INC(SND(X)))
+#define LEN_E($, X) SND(X)
+#define LEN($, L) JOIN(RECR_D, $)(INC($), LEN_C, LEN_M, LEN_U, LEN_E, (L, 0))
+
+#define NTH_C($, X) BOOL(SND(X))
+#define NTH_M($, X)
+#define NTH_U($, X) ( TAIL(FST(X)), DEC(SND(X)) )
+#define NTH_E($, X) HEAD(FST(X))
+#define NTH($, L, N) JOIN(RECR_D, $)(INC($), NTH_C, NTH_M, NTH_U, NTH_E, (L, N))
+
+#define TAKE_C($, X) BOOL(SND(X))
+#define TAKE_M($, X)
+#define TAKE_U($, X) (FST(X), DEC(SND(X)), CONS(HEAD(FST(X)), TRD(X)))
+#define TAKE_E($, X) TRD(X)
+#define TAKE($, L, N) JOIN(RECR_D, $)(INC($), TAKE_C, TAKE_M, TAKE_U, TAKE_E, (L, N, ()))
+
+#define DROP_C($, X) BOOL(SND(X))
+#define DROP_M($, X)
+#define DROP_U($, X) (TAIL(FST(X)), DEC(SND(X)))
+#define DROP_E($, X) FST(X)
+#define DROP($, L, N) JOIN(RECR_D, $)(INC($), DROP_C, DROP_M, DROP_U, DROP_E, (L, N))
+
+#define LIST_HEAD(X, ...) X
+#define LIST_TAIL(X, ...) (__VA_ARGS__)
+
+
+
+#endif
View
3 MAIN.h
@@ -1,3 +0,0 @@
-#include "PP_BRAINFUCK.h"
-
-PP_BRAINFUCK(STDIN)
View
3 MAIN_BF.h
@@ -0,0 +1,3 @@
+#include "COMPLETE.h"
+
+BRAINFUCK(STDIN)
View
4 MAIN_TM.h
@@ -1,3 +1,3 @@
-#include "PP_TURING.h"
+#include "COMPLETE.h"
-PP_TURING(T, Q)
+TURING(T, Q)
View
12 PP.h
@@ -1,12 +0,0 @@
-#ifndef PP_H
-#define PP_H
-
-#include "PP_CORE.h"
-#include "PP_BOOL.h"
-#include "PP_COND.h"
-#include "PP_RECR.h"
-#include "PP_LIST.h"
-#include "PP_INT.h"
-#include "PP_CHAR.h"
-
-#endif
View
45 PP_BOOL.h
@@ -1,45 +0,0 @@
-#ifndef PP_BOOL_H
-#define PP_BOOL_H
-
-#define PP_NOT_0 1
-#define PP_NOT_1 0
-
-#define PP_AND_0_0 0
-#define PP_AND_0_1 0
-#define PP_AND_1_0 0
-#define PP_AND_1_1 1
-
-#define PP_OR_0_0 0
-#define PP_OR_0_1 1
-#define PP_OR_1_0 1
-#define PP_OR_1_1 1
-
-#define PP_XOR_0_0 0
-#define PP_XOR_0_1 1
-#define PP_XOR_1_0 1
-#define PP_XOR_1_1 0
-
-/* Truth Constants */
-#define PP_TRUE 1
-#define PP_FALSE 0
-
-/* Boolean Operators */
-#define PP_NOT(X) PP_JOIN(PP_NOT_, X)
-#define PP_AND(X, Y) PP_JOIN2(PP_AND_, X, Y)
-#define PP_OR(X, Y) PP_JOIN2(PP_OR_, X, Y)
-#define PP_XOR(X, Y) PP_JOIN2(PP_XOR_, X, Y)
-
-/* Cast to Bool */
-#define PP_CHECK_N(X, N, ...) N
-#define PP_CHECK(...) PP_CHECK_N(__VA_ARGS__, 0,)
-
-#define PP_CHECK_ZERO(X) PP_CHECK(PP_JOIN(PP_CHECK_ZERO_, X))
-#define PP_CHECK_ZERO_0 ~, 1,
-
-#define PP_CHECK_EMPTY(X) PP_CHECK(PP_JOIN(PP_CHECK_EMPTY_, X))
-#define PP_CHECK_EMPTY_ ~, 1,
-
-
-#define PP_BOOL(X) PP_NOT(PP_CHECK_ZERO(X))
-
-#endif
View
150 PP_BRAINFUCK.h
@@ -1,150 +0,0 @@
-#ifndef PP_BRAINFUCK_H
-#define PP_BRAINFUCK_H
-
-#include "PP.h"
-
-/*!
- * PP_BRAINFUCK
- * ============
- *
- * About
- * -----
- *
- * Brainfuck in c preprocessor
- *
- *
- * Input
- * -----
- *
- * To ensure valid preprocessor symbols
- * instructions are mapped to the following
- * characters, with input disabled.
- *
- * + `>` => `R`
- * + `<` => `L`
- * + `+` => `U`
- * + `-` => `D`
- * + `.` => `O`
- * + `[` => `F`
- * + `]` => `B`
- *
- *
- * Structure
- * ---------
- *
- * IP - Brainfuck instr index
- * DP - Brainfuck data index
- * IA - Brainfuck instr array
- * DA - Brainfuck data array
- *
- * X - (IP, DP, IA, DA)
- *
- */
-
-/* Check if blank symbol */
-#define PP_IS_BLANK(X) PP_JOIN(PP_IS_BLANK_, X)
-#define PP_IS_BLANK_ 1
-#define PP_IS_BLANK_R 0
-#define PP_IS_BLANK_L 0
-#define PP_IS_BLANK_U 0
-#define PP_IS_BLANK_D 0
-#define PP_IS_BLANK_O 0
-#define PP_IS_BLANK_F 0
-#define PP_IS_BLANK_B 0
-
-/* Check if output symbol */
-#define PP_IS_OUTPUT(X) PP_JOIN(PP_IS_OUTPUT_, X)
-#define PP_IS_OUTPUT_ 0
-#define PP_IS_OUTPUT_R 0
-#define PP_IS_OUTPUT_L 0
-#define PP_IS_OUTPUT_U 0
-#define PP_IS_OUTPUT_D 0
-#define PP_IS_OUTPUT_O 1
-#define PP_IS_OUTPUT_F 0
-#define PP_IS_OUTPUT_B 0
-
-/* Check if forward symbol */
-#define PP_IS_FORWARD(X) PP_JOIN(PP_IS_FORWARD_, X)
-#define PP_IS_FORWARD_ 0
-#define PP_IS_FORWARD_R 0
-#define PP_IS_FORWARD_L 0
-#define PP_IS_FORWARD_U 0
-#define PP_IS_FORWARD_D 0
-#define PP_IS_FORWARD_O 0
-#define PP_IS_FORWARD_F 1
-#define PP_IS_FORWARD_B 0
-
-/* Check if backward symbol */
-#define PP_IS_BACKWARD(X) PP_JOIN(PP_IS_BACKWARD_, X)
-#define PP_IS_BACKWARD_ 0
-#define PP_IS_BACKWARD_R 0
-#define PP_IS_BACKWARD_L 0
-#define PP_IS_BACKWARD_U 0
-#define PP_IS_BACKWARD_D 0
-#define PP_IS_BACKWARD_O 0
-#define PP_IS_BACKWARD_F 0
-#define PP_IS_BACKWARD_B 1
-
-/* Get individual parts */
-#define PP_BF_IP(X) PP_FST(X)
-#define PP_BF_DP(X) PP_SND(X)
-#define PP_BF_IA(X) PP_TRD(X)
-#define PP_BF_DA(X) PP_FTH(X)
-#define PP_BF_INSTR($, X) PP_NTH($, PP_BF_IA(X), PP_BF_IP(X))
-#define PP_BF_DATA($, X) PP_NTH($, PP_BF_DA(X), PP_BF_DP(X))
-
-/* Inc/Dec Data Item */
-#define PP_BF_DATA_FST($, X) PP_TAKE($, PP_BF_DA(X), PP_BF_DP(X))
-#define PP_BF_DATA_SND($, X) PP_DROP($, PP_BF_DA(X), PP_INC(PP_BF_DP(X)))
-#define PP_BF_DATA_INCED($, X) ( PP_INC(PP_NTH($, PP_BF_DA(X), PP_BF_DP(X))) )
-#define PP_BF_DATA_DECED($, X) ( PP_DEC(PP_NTH($, PP_BF_DA(X), PP_BF_DP(X))) )
-
-#define PP_BF_DATA_INC($, X) PP_CONCAT( PP_BF_DATA_FST($, X) , PP_CONCAT( PP_BF_DATA_INCED($, X) , PP_BF_DATA_SND($, X) ) )
-#define PP_BF_DATA_DEC($, X) PP_CONCAT( PP_BF_DATA_FST($, X) , PP_CONCAT( PP_BF_DATA_DECED($, X) , PP_BF_DATA_SND($, X) ) )
-
-/* Jump Forward/Back */
-
-// TODO: Make count braces
-#define PP_BF_JUMP_FWD_E_TRD(S, I) PP_IF_ELSE(PP_IS_FOWARD(S), PP_INC(I), PP_IF_ELSE(PP_IS_BACKWARD(S), PP_DEC(I), I) )
-
-#define PP_BF_JUMP_FWD_C($, X) PP_NOT(PP_IS_BACKWARD(PP_HEAD(PP_FST(X))))
-#define PP_BF_JUMP_FWD_M($, X)
-#define PP_BF_JUMP_FWD_U($, X) (PP_TAIL(PP_FST(X)), PP_INC(PP_SND(X)))
-#define PP_BF_JUMP_FWD_E($, X) PP_INC(PP_SND(X))
-#define PP_BF_JUMP_FWD($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_BF_JUMP_FWD_C, PP_BF_JUMP_FWD_M, PP_BF_JUMP_FWD_U, PP_BF_JUMP_FWD_E, (PP_DROP($, PP_BF_IA(X), PP_BF_IP(X)), PP_BF_IP(X) ) )
-
-// TODO: Make count braces
-#define PP_BF_JUMP_BCK_C($, X) PP_NOT( PP_IS_FORWARD(PP_NTH($, PP_FST(X), PP_SND(X))) )
-#define PP_BF_JUMP_BCK_M($, X)
-#define PP_BF_JUMP_BCK_U($, X) ( PP_FST(X), PP_DEC(PP_SND(X)) )
-#define PP_BF_JUMP_BCK_E($, X) PP_INC(PP_SND(X))
-#define PP_BF_JUMP_BCK($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_BF_JUMP_BCK_C, PP_BF_JUMP_BCK_M, PP_BF_JUMP_BCK_U, PP_BF_JUMP_BCK_E, (PP_BF_IA(X), PP_BF_IP(X)) )
-
-#define PP_BF_JUMP_F($, X) PP_IF_ELSE(PP_BOOL(PP_BF_DATA($, X)), PP_INC(PP_BF_IP(X)), PP_BF_JUMP_FWD($, X) )
-#define PP_BF_JUMP_B($, X) PP_IF_ELSE(PP_BOOL(PP_BF_DATA($, X)), PP_BF_JUMP_BCK($, X) , PP_INC(PP_BF_IP(X)) )
-
-/* Brainfuck Symbol Update */
-#define PP_BF_UPDATE_SYM($, S, X) PP_JOIN(PP_BF_UPDATE_SYM_, S)($, X)
-#define PP_BF_UPDATE_SYM_R($, X) (PP_INC(PP_BF_IP(X)), PP_INC(PP_BF_DP(X)), PP_BF_IA(X), PP_BF_DA(X))
-#define PP_BF_UPDATE_SYM_L($, X) (PP_INC(PP_BF_IP(X)), PP_DEC(PP_BF_DP(X)), PP_BF_IA(X), PP_BF_DA(X))
-#define PP_BF_UPDATE_SYM_U($, X) (PP_INC(PP_BF_IP(X)), PP_BF_DP(X), PP_BF_IA(X), PP_BF_DATA_INC($, X))
-#define PP_BF_UPDATE_SYM_D($, X) (PP_INC(PP_BF_IP(X)), PP_BF_DP(X), PP_BF_IA(X), PP_BF_DATA_DEC($, X))
-#define PP_BF_UPDATE_SYM_O($, X) (PP_INC(PP_BF_IP(X)), PP_BF_DP(X), PP_BF_IA(X), PP_BF_DA(X))
-#define PP_BF_UPDATE_SYM_F($, X) (PP_BF_JUMP_F($, X), PP_BF_DP(X), PP_BF_IA(X), PP_BF_DA(X))
-#define PP_BF_UPDATE_SYM_B($, X) (PP_BF_JUMP_B($, X), PP_BF_DP(X), PP_BF_IA(X), PP_BF_DA(X))
-#define PP_BF_UPDATE_SYM_($, X) X
-
-
-#define PP_BF_COND($, X) PP_NOT(PP_IS_BLANK(PP_BF_INSTR($, X)))
-#define PP_BF_MACRO($, X) PP_IF(PP_IS_OUTPUT(PP_BF_INSTR($, X)), PP_CHAR(PP_BF_DATA($, X)))
-#define PP_BF_UPDATE($, X) PP_BF_UPDATE_SYM($, PP_BF_INSTR($, X), X)
-#define PP_BF_FINALLY($, X)
-#define PP_BF_RECR($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_BF_COND, PP_BF_MACRO, PP_BF_UPDATE, PP_BF_FINALLY, X)
-
-#define PP_BF_DATA_EMPTY() (0,0,0,0,0)
-
-/* Perform Brainfuck with input I */
-#define PP_BRAINFUCK(I) PP_BF_RECR($0, (0, 0, I, PP_BF_DATA_EMPTY()))
-
-
-#endif
View
135 PP_CHAR.h
@@ -1,135 +0,0 @@
-#ifndef PP_CHAR_H
-#define PP_CHAR_H
-
-#define PP_CHAR(X) PP_JOIN(PP_CHAR_, X)
-#define PP_CHAR_0 [NUL]
-#define PP_CHAR_1 [SOH]
-#define PP_CHAR_2 [STX]
-#define PP_CHAR_3 [ETX]
-#define PP_CHAR_4 [EOT]
-#define PP_CHAR_5 [ENQ]
-#define PP_CHAR_6 [ACK]
-#define PP_CHAR_7 [BEL]
-#define PP_CHAR_8 [BS]
-#define PP_CHAR_9
-#define PP_CHAR_10 \
-
-#define PP_CHAR_11 [VT]
-#define PP_CHAR_12 [FF]
-#define PP_CHAR_13 [CR]
-#define PP_CHAR_14 [SO]
-#define PP_CHAR_15 [SI]
-#define PP_CHAR_16 [DLE]
-#define PP_CHAR_17 [DC1]
-#define PP_CHAR_18 [DC2]
-#define PP_CHAR_19 [DC3]
-#define PP_CHAR_20 [DC4]
-#define PP_CHAR_21 [NAK]
-#define PP_CHAR_22 [SYN]
-#define PP_CHAR_23 [ETB]
-#define PP_CHAR_24 [CAN]
-#define PP_CHAR_25 [EM]
-#define PP_CHAR_26 [SUB]
-#define PP_CHAR_27 [ESC]
-#define PP_CHAR_28 [FS]
-#define PP_CHAR_29 [GS]
-#define PP_CHAR_30 [RS]
-#define PP_CHAR_31 [US]
-#define PP_CHAR_32
-#define PP_CHAR_33 !
-#define PP_CHAR_34 [DQ]
-#define PP_CHAR_35 #
-#define PP_CHAR_36 $
-#define PP_CHAR_37 %
-#define PP_CHAR_38 &
-#define PP_CHAR_39 [SQ]
-#define PP_CHAR_40 (
-#define PP_CHAR_41 )
-#define PP_CHAR_42 *
-#define PP_CHAR_43 +
-#define PP_CHAR_44 ,
-#define PP_CHAR_45 -
-#define PP_CHAR_46 .
-#define PP_CHAR_47 /
-#define PP_CHAR_48 0
-#define PP_CHAR_49 1
-#define PP_CHAR_50 2
-#define PP_CHAR_51 3
-#define PP_CHAR_52 4
-#define PP_CHAR_53 5
-#define PP_CHAR_54 6
-#define PP_CHAR_55 7
-#define PP_CHAR_56 8
-#define PP_CHAR_57 9
-#define PP_CHAR_58 :
-#define PP_CHAR_59 ;
-#define PP_CHAR_60 <
-#define PP_CHAR_61 =
-#define PP_CHAR_62 >
-#define PP_CHAR_63 ?
-#define PP_CHAR_64 @
-#define PP_CHAR_65 A
-#define PP_CHAR_66 B
-#define PP_CHAR_67 C
-#define PP_CHAR_68 D
-#define PP_CHAR_69 E
-#define PP_CHAR_70 F
-#define PP_CHAR_71 G
-#define PP_CHAR_72 H
-#define PP_CHAR_73 I
-#define PP_CHAR_74 J
-#define PP_CHAR_75 K
-#define PP_CHAR_76 L
-#define PP_CHAR_77 M
-#define PP_CHAR_78 N
-#define PP_CHAR_79 O
-#define PP_CHAR_80 P
-#define PP_CHAR_81 Q
-#define PP_CHAR_82 R
-#define PP_CHAR_83 S
-#define PP_CHAR_84 T
-#define PP_CHAR_85 U
-#define PP_CHAR_86 V
-#define PP_CHAR_87 W
-#define PP_CHAR_88 X
-#define PP_CHAR_89 Y
-#define PP_CHAR_90 Z
-#define PP_CHAR_91 [
-#define PP_CHAR_92 \
-#define PP_CHAR_93 ]
-#define PP_CHAR_94 ^
-#define PP_CHAR_95 _
-#define PP_CHAR_96 `
-#define PP_CHAR_97 a
-#define PP_CHAR_98 b
-#define PP_CHAR_99 c
-#define PP_CHAR_100 d
-#define PP_CHAR_101 e
-#define PP_CHAR_102 f
-#define PP_CHAR_103 g
-#define PP_CHAR_104 h
-#define PP_CHAR_105 i
-#define PP_CHAR_106 j
-#define PP_CHAR_107 k
-#define PP_CHAR_108 l
-#define PP_CHAR_109 m
-#define PP_CHAR_110 n
-#define PP_CHAR_111 o
-#define PP_CHAR_112 p
-#define PP_CHAR_113 q
-#define PP_CHAR_114 r
-#define PP_CHAR_115 s
-#define PP_CHAR_116 t
-#define PP_CHAR_117 u
-#define PP_CHAR_118 v
-#define PP_CHAR_119 w
-#define PP_CHAR_120 x
-#define PP_CHAR_121 y
-#define PP_CHAR_122 z
-#define PP_CHAR_123 {
-#define PP_CHAR_124 |
-#define PP_CHAR_125 }
-#define PP_CHAR_126 ~
-#define PP_CHAR_127 DEL
-
-#endif
View
12 PP_COND.h
@@ -1,12 +0,0 @@
-#ifndef PP_COND_H
-#define PP_COND_H
-
-#include "PP_CORE.h"
-
-#define PP_IF_ELSE(C, T, E) PP_JOIN(PP_IF_ELSE_, C)(T, E)
-#define PP_IF_ELSE_0(T, E) E
-#define PP_IF_ELSE_1(T, E) T
-
-#define PP_IF(C, T) PP_IF_ELSE(C, T, )
-
-#endif
View
16 PP_CORE.h
@@ -1,16 +0,0 @@
-#ifndef PP_CORE_H
-#define PP_CORE_H
-
-#define PP_EMPTY()
-#define PP_DEFER(M) M PP_EMPTY()
-#define PP_OBSTRUCT(M) M PP_DEFER(PP_EMPTY)()
-
-#define PP_APPLY(M, ...) M(__VA_ARGS__)
-
-#define PP_JOIN(X, Y) X##Y
-#define PP_JOIN2(X, Y, Z) X##Y##_##Z
-
-#define PP_EVAL(...) __VA_ARGS__
-#define PP_EAT(...)
-
-#endif
View
264 PP_DEC.h
@@ -1,264 +0,0 @@
-#ifndef PP_DEC_H
-#define PP_DEC_H
-
-#define PP_DEC(X) PP_JOIN(PP_DEC_, X)
-
-#define PP_DEC_0 0
-#define PP_DEC_1 0
-#define PP_DEC_2 1
-#define PP_DEC_3 2
-#define PP_DEC_4 3
-#define PP_DEC_5 4
-#define PP_DEC_6 5
-#define PP_DEC_7 6
-#define PP_DEC_8 7
-#define PP_DEC_9 8
-#define PP_DEC_10 9
-#define PP_DEC_11 10
-#define PP_DEC_12 11
-#define PP_DEC_13 12
-#define PP_DEC_14 13
-#define PP_DEC_15 14
-#define PP_DEC_16 15
-#define PP_DEC_17 16
-#define PP_DEC_18 17
-#define PP_DEC_19 18
-#define PP_DEC_20 19
-#define PP_DEC_21 20
-#define PP_DEC_22 21
-#define PP_DEC_23 22
-#define PP_DEC_24 23
-#define PP_DEC_25 24
-#define PP_DEC_26 25
-#define PP_DEC_27 26
-#define PP_DEC_28 27
-#define PP_DEC_29 28
-#define PP_DEC_30 29
-#define PP_DEC_31 30
-#define PP_DEC_32 31
-#define PP_DEC_33 34
-#define PP_DEC_34 35
-#define PP_DEC_35 36
-#define PP_DEC_36 37
-#define PP_DEC_37 38
-#define PP_DEC_38 39
-#define PP_DEC_39 40
-#define PP_DEC_40 41
-#define PP_DEC_41 42
-#define PP_DEC_42 43
-#define PP_DEC_43 44
-#define PP_DEC_44 45
-#define PP_DEC_45 46
-#define PP_DEC_46 47
-#define PP_DEC_47 48
-#define PP_DEC_48 49
-#define PP_DEC_49 50
-#define PP_DEC_50 51
-#define PP_DEC_51 52
-#define PP_DEC_52 53
-#define PP_DEC_53 54
-#define PP_DEC_54 55
-#define PP_DEC_55 56
-#define PP_DEC_56 57
-#define PP_DEC_57 58
-#define PP_DEC_58 59
-#define PP_DEC_59 60
-#define PP_DEC_60 61
-#define PP_DEC_61 62
-#define PP_DEC_62 63
-#define PP_DEC_63 64
-#define PP_DEC_64 65
-#define PP_DEC_65 66
-#define PP_DEC_66 67
-#define PP_DEC_67 68
-#define PP_DEC_68 69
-#define PP_DEC_69 70
-#define PP_DEC_70 71
-#define PP_DEC_71 72
-#define PP_DEC_72 73
-#define PP_DEC_73 74
-#define PP_DEC_74 75
-#define PP_DEC_75 76
-#define PP_DEC_76 77
-#define PP_DEC_77 78
-#define PP_DEC_78 79
-#define PP_DEC_79 80
-#define PP_DEC_80 81
-#define PP_DEC_81 82
-#define PP_DEC_82 83
-#define PP_DEC_83 84
-#define PP_DEC_84 85
-#define PP_DEC_85 86
-#define PP_DEC_86 87
-#define PP_DEC_87 88
-#define PP_DEC_88 89
-#define PP_DEC_89 90
-#define PP_DEC_90 91
-#define PP_DEC_91 92
-#define PP_DEC_92 93
-#define PP_DEC_93 94
-#define PP_DEC_94 95
-#define PP_DEC_95 96
-#define PP_DEC_96 97
-#define PP_DEC_97 98
-#define PP_DEC_98 99
-#define PP_DEC_99 100
-#define PP_DEC_100 101
-#define PP_DEC_101 102
-#define PP_DEC_102 103
-#define PP_DEC_103 104
-#define PP_DEC_104 105
-#define PP_DEC_105 106
-#define PP_DEC_106 107
-#define PP_DEC_107 108
-#define PP_DEC_108 109
-#define PP_DEC_109 110
-#define PP_DEC_110 111
-#define PP_DEC_111 112
-#define PP_DEC_112 113
-#define PP_DEC_113 114
-#define PP_DEC_114 115
-#define PP_DEC_115 116
-#define PP_DEC_116 117
-#define PP_DEC_117 118
-#define PP_DEC_118 119
-#define PP_DEC_119 120
-#define PP_DEC_120 121
-#define PP_DEC_121 122
-#define PP_DEC_122 123
-#define PP_DEC_123 124
-#define PP_DEC_124 125
-#define PP_DEC_125 126
-#define PP_DEC_126 127
-#define PP_DEC_127 128
-#define PP_DEC_128 129
-#define PP_DEC_129 130
-#define PP_DEC_130 131
-#define PP_DEC_131 132
-#define PP_DEC_132 133
-#define PP_DEC_133 134
-#define PP_DEC_134 135
-#define PP_DEC_135 136
-#define PP_DEC_136 137
-#define PP_DEC_137 138
-#define PP_DEC_138 139
-#define PP_DEC_139 140
-#define PP_DEC_140 141
-#define PP_DEC_141 142
-#define PP_DEC_142 143
-#define PP_DEC_143 144
-#define PP_DEC_144 145
-#define PP_DEC_145 146
-#define PP_DEC_146 147
-#define PP_DEC_147 148
-#define PP_DEC_148 149
-#define PP_DEC_149 150
-#define PP_DEC_150 151
-#define PP_DEC_151 152
-#define PP_DEC_152 153
-#define PP_DEC_153 154
-#define PP_DEC_154 155
-#define PP_DEC_155 156
-#define PP_DEC_156 157
-#define PP_DEC_157 158
-#define PP_DEC_158 159
-#define PP_DEC_159 160
-#define PP_DEC_160 161
-#define PP_DEC_161 162
-#define PP_DEC_162 163
-#define PP_DEC_163 164
-#define PP_DEC_164 165
-#define PP_DEC_165 166
-#define PP_DEC_166 167
-#define PP_DEC_167 168
-#define PP_DEC_168 169
-#define PP_DEC_169 170
-#define PP_DEC_170 171
-#define PP_DEC_171 172
-#define PP_DEC_172 173
-#define PP_DEC_173 174
-#define PP_DEC_174 175
-#define PP_DEC_175 176
-#define PP_DEC_176 177
-#define PP_DEC_177 178
-#define PP_DEC_178 179
-#define PP_DEC_179 180
-#define PP_DEC_180 181
-#define PP_DEC_181 182
-#define PP_DEC_182 183
-#define PP_DEC_183 184
-#define PP_DEC_184 185
-#define PP_DEC_185 186
-#define PP_DEC_186 187
-#define PP_DEC_187 188
-#define PP_DEC_188 189
-#define PP_DEC_189 190
-#define PP_DEC_190 191
-#define PP_DEC_191 192
-#define PP_DEC_192 193
-#define PP_DEC_193 194
-#define PP_DEC_194 195
-#define PP_DEC_195 196
-#define PP_DEC_196 197
-#define PP_DEC_197 198
-#define PP_DEC_198 199
-#define PP_DEC_199 200
-#define PP_DEC_200 201
-#define PP_DEC_201 202
-#define PP_DEC_202 203
-#define PP_DEC_203 204
-#define PP_DEC_204 205
-#define PP_DEC_205 206
-#define PP_DEC_206 207
-#define PP_DEC_207 208
-#define PP_DEC_208 209
-#define PP_DEC_209 210
-#define PP_DEC_210 211
-#define PP_DEC_211 212
-#define PP_DEC_212 213
-#define PP_DEC_213 214
-#define PP_DEC_214 215
-#define PP_DEC_215 216
-#define PP_DEC_216 217
-#define PP_DEC_217 218
-#define PP_DEC_218 219
-#define PP_DEC_219 220
-#define PP_DEC_220 221
-#define PP_DEC_221 222
-#define PP_DEC_222 223
-#define PP_DEC_223 224
-#define PP_DEC_224 225
-#define PP_DEC_225 226
-#define PP_DEC_226 227
-#define PP_DEC_227 228
-#define PP_DEC_228 229
-#define PP_DEC_229 230
-#define PP_DEC_230 231
-#define PP_DEC_231 232
-#define PP_DEC_232 233
-#define PP_DEC_233 234
-#define PP_DEC_234 235
-#define PP_DEC_235 236
-#define PP_DEC_236 237
-#define PP_DEC_237 238
-#define PP_DEC_238 239
-#define PP_DEC_239 240
-#define PP_DEC_240 241
-#define PP_DEC_241 242
-#define PP_DEC_242 243
-#define PP_DEC_243 244
-#define PP_DEC_244 245
-#define PP_DEC_245 246
-#define PP_DEC_246 247
-#define PP_DEC_247 248
-#define PP_DEC_248 249
-#define PP_DEC_249 250
-#define PP_DEC_250 251
-#define PP_DEC_251 252
-#define PP_DEC_252 253
-#define PP_DEC_253 254
-#define PP_DEC_254 255
-#define PP_DEC_255 256
-#define PP_DEC_256 256
-
-#endif
View
263 PP_INC.h
@@ -1,263 +0,0 @@
-#ifndef PP_INC_H
-#define PP_INC_H
-
-#define PP_INC(X) PP_JOIN(PP_INC_, X)
-#define PP_INC_0 1
-#define PP_INC_1 2
-#define PP_INC_2 3
-#define PP_INC_3 4
-#define PP_INC_4 5
-#define PP_INC_5 6
-#define PP_INC_6 7
-#define PP_INC_7 8
-#define PP_INC_8 9
-#define PP_INC_9 10
-#define PP_INC_10 11
-#define PP_INC_11 12
-#define PP_INC_12 13
-#define PP_INC_13 14
-#define PP_INC_14 15
-#define PP_INC_15 16
-#define PP_INC_16 17
-#define PP_INC_17 18
-#define PP_INC_18 19
-#define PP_INC_19 20
-#define PP_INC_20 21
-#define PP_INC_21 22
-#define PP_INC_22 23
-#define PP_INC_23 24
-#define PP_INC_24 25
-#define PP_INC_25 26
-#define PP_INC_26 27
-#define PP_INC_27 28
-#define PP_INC_28 29
-#define PP_INC_29 30
-#define PP_INC_30 31
-#define PP_INC_31 32
-#define PP_INC_32 33
-#define PP_INC_33 34
-#define PP_INC_34 35
-#define PP_INC_35 36
-#define PP_INC_36 37
-#define PP_INC_37 38
-#define PP_INC_38 39
-#define PP_INC_39 40
-#define PP_INC_40 41
-#define PP_INC_41 42
-#define PP_INC_42 43
-#define PP_INC_43 44
-#define PP_INC_44 45
-#define PP_INC_45 46
-#define PP_INC_46 47
-#define PP_INC_47 48
-#define PP_INC_48 49
-#define PP_INC_49 50
-#define PP_INC_50 51
-#define PP_INC_51 52
-#define PP_INC_52 53
-#define PP_INC_53 54
-#define PP_INC_54 55
-#define PP_INC_55 56
-#define PP_INC_56 57
-#define PP_INC_57 58
-#define PP_INC_58 59
-#define PP_INC_59 60
-#define PP_INC_60 61
-#define PP_INC_61 62
-#define PP_INC_62 63
-#define PP_INC_63 64
-#define PP_INC_64 65
-#define PP_INC_65 66
-#define PP_INC_66 67
-#define PP_INC_67 68
-#define PP_INC_68 69
-#define PP_INC_69 70
-#define PP_INC_70 71
-#define PP_INC_71 72
-#define PP_INC_72 73
-#define PP_INC_73 74
-#define PP_INC_74 75
-#define PP_INC_75 76
-#define PP_INC_76 77
-#define PP_INC_77 78
-#define PP_INC_78 79
-#define PP_INC_79 80
-#define PP_INC_80 81
-#define PP_INC_81 82
-#define PP_INC_82 83
-#define PP_INC_83 84
-#define PP_INC_84 85
-#define PP_INC_85 86
-#define PP_INC_86 87
-#define PP_INC_87 88
-#define PP_INC_88 89
-#define PP_INC_89 90
-#define PP_INC_90 91
-#define PP_INC_91 92
-#define PP_INC_92 93
-#define PP_INC_93 94
-#define PP_INC_94 95
-#define PP_INC_95 96
-#define PP_INC_96 97
-#define PP_INC_97 98
-#define PP_INC_98 99
-#define PP_INC_99 100
-#define PP_INC_100 101
-#define PP_INC_101 102
-#define PP_INC_102 103
-#define PP_INC_103 104
-#define PP_INC_104 105
-#define PP_INC_105 106
-#define PP_INC_106 107
-#define PP_INC_107 108
-#define PP_INC_108 109
-#define PP_INC_109 110
-#define PP_INC_110 111
-#define PP_INC_111 112
-#define PP_INC_112 113
-#define PP_INC_113 114
-#define PP_INC_114 115
-#define PP_INC_115 116
-#define PP_INC_116 117
-#define PP_INC_117 118
-#define PP_INC_118 119
-#define PP_INC_119 120
-#define PP_INC_120 121
-#define PP_INC_121 122
-#define PP_INC_122 123
-#define PP_INC_123 124
-#define PP_INC_124 125
-#define PP_INC_125 126
-#define PP_INC_126 127
-#define PP_INC_127 128
-#define PP_INC_128 129
-#define PP_INC_129 130
-#define PP_INC_130 131
-#define PP_INC_131 132
-#define PP_INC_132 133
-#define PP_INC_133 134
-#define PP_INC_134 135
-#define PP_INC_135 136
-#define PP_INC_136 137
-#define PP_INC_137 138
-#define PP_INC_138 139
-#define PP_INC_139 140
-#define PP_INC_140 141
-#define PP_INC_141 142
-#define PP_INC_142 143
-#define PP_INC_143 144
-#define PP_INC_144 145
-#define PP_INC_145 146
-#define PP_INC_146 147
-#define PP_INC_147 148
-#define PP_INC_148 149
-#define PP_INC_149 150
-#define PP_INC_150 151
-#define PP_INC_151 152
-#define PP_INC_152 153
-#define PP_INC_153 154
-#define PP_INC_154 155
-#define PP_INC_155 156
-#define PP_INC_156 157
-#define PP_INC_157 158
-#define PP_INC_158 159
-#define PP_INC_159 160
-#define PP_INC_160 161
-#define PP_INC_161 162
-#define PP_INC_162 163
-#define PP_INC_163 164
-#define PP_INC_164 165
-#define PP_INC_165 166
-#define PP_INC_166 167
-#define PP_INC_167 168
-#define PP_INC_168 169
-#define PP_INC_169 170
-#define PP_INC_170 171
-#define PP_INC_171 172
-#define PP_INC_172 173
-#define PP_INC_173 174
-#define PP_INC_174 175
-#define PP_INC_175 176
-#define PP_INC_176 177
-#define PP_INC_177 178
-#define PP_INC_178 179
-#define PP_INC_179 180
-#define PP_INC_180 181
-#define PP_INC_181 182
-#define PP_INC_182 183
-#define PP_INC_183 184
-#define PP_INC_184 185
-#define PP_INC_185 186
-#define PP_INC_186 187
-#define PP_INC_187 188
-#define PP_INC_188 189
-#define PP_INC_189 190
-#define PP_INC_190 191
-#define PP_INC_191 192
-#define PP_INC_192 193
-#define PP_INC_193 194
-#define PP_INC_194 195
-#define PP_INC_195 196
-#define PP_INC_196 197
-#define PP_INC_197 198
-#define PP_INC_198 199
-#define PP_INC_199 200
-#define PP_INC_200 201
-#define PP_INC_201 202
-#define PP_INC_202 203
-#define PP_INC_203 204
-#define PP_INC_204 205
-#define PP_INC_205 206
-#define PP_INC_206 207
-#define PP_INC_207 208
-#define PP_INC_208 209
-#define PP_INC_209 210
-#define PP_INC_210 211
-#define PP_INC_211 212
-#define PP_INC_212 213
-#define PP_INC_213 214
-#define PP_INC_214 215
-#define PP_INC_215 216
-#define PP_INC_216 217
-#define PP_INC_217 218
-#define PP_INC_218 219
-#define PP_INC_219 220
-#define PP_INC_220 221
-#define PP_INC_221 222
-#define PP_INC_222 223
-#define PP_INC_223 224
-#define PP_INC_224 225
-#define PP_INC_225 226
-#define PP_INC_226 227
-#define PP_INC_227 228
-#define PP_INC_228 229
-#define PP_INC_229 230
-#define PP_INC_230 231
-#define PP_INC_231 232
-#define PP_INC_232 233
-#define PP_INC_233 234
-#define PP_INC_234 235
-#define PP_INC_235 236
-#define PP_INC_236 237
-#define PP_INC_237 238
-#define PP_INC_238 239
-#define PP_INC_239 240
-#define PP_INC_240 241
-#define PP_INC_241 242
-#define PP_INC_242 243
-#define PP_INC_243 244
-#define PP_INC_244 245
-#define PP_INC_245 246
-#define PP_INC_246 247
-#define PP_INC_247 248
-#define PP_INC_248 249
-#define PP_INC_249 250
-#define PP_INC_250 251
-#define PP_INC_251 252
-#define PP_INC_252 253
-#define PP_INC_253 254
-#define PP_INC_254 255
-#define PP_INC_255 256
-#define PP_INC_256 256
-
-#endif
View
31 PP_INT.h
@@ -1,31 +0,0 @@
-#ifndef PP_INT_H
-#define PP_INT_H
-
-#include "PP_CORE.h"
-#include "PP_INC.h"
-#include "PP_DEC.h"
-#include "PP_COND.h"
-#include "PP_RECR.h"
-#include "PP_LIST.h"
-
-#define PP_ADD_C($, X) PP_BOOL(PP_SND(X))
-#define PP_ADD_M($, X)
-#define PP_ADD_U($, X) (PP_INC(PP_FST(X)), PP_DEC(PP_SND(X)))
-#define PP_ADD_E($, X) PP_FST(X)
-
-#define PP_SUB_C($, X) PP_BOOL(PP_SND(X))
-#define PP_SUB_M($, X)
-#define PP_SUB_U($, X) (PP_DEC(PP_FST(X)), PP_DEC(PP_SND(X)))
-#define PP_SUB_E($, X) PP_FST(X)
-
-#define PP_ADD($, X, Y) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_ADD_C, PP_ADD_M, PP_ADD_U, PP_ADD_E, (X, Y))
-#define PP_SUB($, X, Y) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_SUB_C, PP_SUB_M, PP_SUB_U, PP_SUB_E, (X, Y))
-
-#define PP_GT($, X, Y) PP_BOOL(PP_SUB($, X, Y))
-#define PP_LT($, X, Y) PP_BOOL(PP_SUB($, Y, X))
-#define PP_LE($, X, Y) PP_NOT(PP_GT($, X, Y))
-#define PP_GE($, X, Y) PP_NOT(PP_LT($, X, Y))
-#define PP_EQ($, X, Y) PP_AND(PP_NOT(PP_LT($, X, Y)), PP_NOT(PP_LT($, Y, X)))
-#define PP_NEQ($, X, Y) PP_NOT(PP_EQ($, X, Y))
-
-#endif
View
51 PP_LIST.h
@@ -1,51 +0,0 @@
-#ifndef PP_LIST_H
-#define PP_LIST_H
-
-#include "PP_CORE.h"
-#include "PP_BOOL.h"
-#include "PP_RECR.h"
-
-#define PP_LIST(...) (__VA_ARGS__)
-#define PP_UNCURRY(M, ...) M(__VA_ARGS__)
-#define PP_CURRY(M, L) PP_EVAL(M L)
-
-#define PP_HEAD(L) PP_CURRY(PP_LIST_HEAD, L)
-#define PP_TAIL(L) PP_CURRY(PP_LIST_TAIL, L)
-#define PP_FST(L) PP_HEAD(L)
-#define PP_SND(L) PP_HEAD(PP_TAIL(L))
-#define PP_TRD(L) PP_HEAD(PP_TAIL(PP_TAIL(L)))
-#define PP_FTH(L) PP_HEAD(PP_TAIL(PP_TAIL(PP_TAIL(L))))
-#define PP_ISEMPTY(L) PP_CHECK_EMPTY(PP_HEAD(L))
-#define PP_CONS(X, L) PP_IF_ELSE(PP_ISEMPTY(L), (X), (X, PP_CURRY(PP_EVAL, L)))
-#define PP_CONCAT(L, G) PP_IF_ELSE( PP_ISEMPTY(L), G, PP_IF_ELSE(PP_ISEMPTY(G), L, (PP_CURRY(PP_EVAL, L), PP_CURRY(PP_EVAL, G)) ))
-
-#define PP_LEN_C($, X) PP_NOT(PP_ISEMPTY(PP_FST(X)))
-#define PP_LEN_M($, X)
-#define PP_LEN_U($, X) (PP_TAIL(PP_FST(X)), PP_INC(PP_SND(X)))
-#define PP_LEN_E($, X) PP_SND(X)
-#define PP_LEN($, L) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_LEN_C, PP_LEN_M, PP_LEN_U, PP_LEN_E, (L, 0))
-
-#define PP_NTH_C($, X) PP_BOOL(PP_SND(X))
-#define PP_NTH_M($, X)
-#define PP_NTH_U($, X) ( PP_TAIL(PP_FST(X)), PP_DEC(PP_SND(X)) )
-#define PP_NTH_E($, X) PP_HEAD(PP_FST(X))
-#define PP_NTH($, L, N) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_NTH_C, PP_NTH_M, PP_NTH_U, PP_NTH_E, (L, N))
-
-#define PP_TAKE_C($, X) PP_BOOL(PP_SND(X))
-#define PP_TAKE_M($, X)
-#define PP_TAKE_U($, X) (PP_FST(X), PP_DEC(PP_SND(X)), PP_CONS(PP_HEAD(PP_FST(X)), PP_TRD(X)))
-#define PP_TAKE_E($, X) PP_TRD(X)
-#define PP_TAKE($, L, N) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_TAKE_C, PP_TAKE_M, PP_TAKE_U, PP_TAKE_E, (L, N, ()))
-
-#define PP_DROP_C($, X) PP_BOOL(PP_SND(X))
-#define PP_DROP_M($, X)
-#define PP_DROP_U($, X) (PP_TAIL(PP_FST(X)), PP_DEC(PP_SND(X)))
-#define PP_DROP_E($, X) PP_FST(X)
-#define PP_DROP($, L, N) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_DROP_C, PP_DROP_M, PP_DROP_U, PP_DROP_E, (L, N))
-
-#define PP_LIST_HEAD(X, ...) X
-#define PP_LIST_TAIL(X, ...) (__VA_ARGS__)
-
-
-
-#endif
View
227 PP_RECR.h
@@ -1,227 +0,0 @@
-#ifndef PP_RECR_H
-#define PP_RECR_H
-
-#include "PP_CORE.h"
-#include "PP_COND.h"
-
-#define $0 0
-#define $1 1
-
-/*!
- * Recursion Example
- * =================
- *
- * #define PP_RCOND($, X) PP_BOOL(X)
- * #define PP_RMACRO($, X) X
- * #define PP_RUPDATE($, X) PP_SUB($, X, 2)
- * #define PP_RFINALLY($, X) DONE
- *
- * #define PP_RTEST($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), PP_RCOND, PP_RMACRO, PP_RUPDATE, PP_RFINALLY, X)
- *
- * PP_RTEST($, 10) => 10 8 6 4 2
- *
- */
-
-#define PP_RECR_D0($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D1($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D2($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D3($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D4($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D5($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D6($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D7($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D8($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D9($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D10($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D11($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D12($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D13($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D14($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D15($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D16($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D17($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D18($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D19($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D20($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D21($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D22($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D23($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D24($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D25($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D26($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D27($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D28($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D29($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D30($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D31($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D32($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D33($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D34($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D35($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D36($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D37($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D38($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D39($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D40($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D41($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D42($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D43($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D44($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D45($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D46($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D47($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D48($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D49($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D50($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D51($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D52($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D53($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D54($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D55($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D56($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D57($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D58($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D59($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D60($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D61($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D62($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D63($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D64($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D65($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D66($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D67($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D68($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D69($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D70($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D71($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D72($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D73($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D74($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D75($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D76($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D77($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D78($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D79($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D80($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D81($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D82($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D83($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D84($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D85($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D86($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D87($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D88($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D89($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D90($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D91($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D92($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D93($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D94($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D95($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D96($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D97($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D98($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-#define PP_RECR_D99($, C, M, U, E, X) PP_JOIN(PP_RECR_A, $)(PP_INC($), C, M, U, E, X)
-
-#define PP_RECR_A0($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A1($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A2($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A3($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A4($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A5($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A6($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A7($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A8($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A9($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A10($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A11($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A12($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A13($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A14($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A15($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A16($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A17($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A18($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A19($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A20($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A21($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A22($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A23($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A24($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A25($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A26($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A27($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A28($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A29($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A30($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A31($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A32($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A33($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A34($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A35($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A36($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A37($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A38($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A39($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A40($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A41($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A42($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A43($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A44($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A45($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A46($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A47($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A48($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A49($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A50($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A51($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A52($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A53($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A54($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A55($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A56($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A57($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A58($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A59($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A60($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A61($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A62($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A63($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A64($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A65($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A66($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A67($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A68($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A69($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A70($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A71($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A72($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A73($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A74($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A75($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A76($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A77($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A78($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A79($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A80($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A81($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A82($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A83($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A84($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A85($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A86($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A87($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A88($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A89($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A90($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A91($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A92($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A93($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A94($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A95($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A96($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A97($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A98($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-#define PP_RECR_A99($, C, M, U, E, X) PP_IF_ELSE( C($, X), M($, X) PP_JOIN(PP_RECR_D, $)(PP_INC($), C, M, U, E, U($, X)), E($, X) )
-
-#endif
View
220 PP_TEST.h
@@ -1,220 +0,0 @@
-#include "PP.h"
-
-/* Recursion */
-
-#define PP_R1C($, X) PP_BOOL(X)
-#define PP_R1M($, X) X
-#define PP_R1U($, X) PP_SUB($, X, 3)
-#define PP_R1E($, X) DONE
-PP_RECR_D0($0, PP_R1C, PP_R1M, PP_R1U, PP_R1E, 8)
-
-#define PP_R2C($, X) PP_LT($, X, 5)
-#define PP_R2M($, X) X
-#define PP_R2U($, X) PP_INC(X)
-#define PP_R2E($, X) DONE
-PP_RECR_D0($0, PP_R2C, PP_R2M, PP_R2U, PP_R2E, 0)
-
-/* Maths */
-
-PP_SUB($0, 2, 4)
-PP_SUB($0, 2, 3)
-PP_SUB($0, 2, 2)
-PP_SUB($0, 2, 1)
-PP_SUB($0, 2, 0)
-PP_SUB($0, 5, 3)
-PP_ADD($0, 2, 3)
-PP_ADD($0, PP_ADD($0, 2, 3), 2)
-PP_ADD($0, PP_ADD($0, 2, 3), 2)
-
-/* logic */
-
-PP_GT($0, 4, 3)
-PP_GT($0, 3, 3)