diff options
Diffstat (limited to 'test.cc')
| -rw-r--r-- | test.cc | 132 | 
1 files changed, 66 insertions, 66 deletions
| @@ -359,155 +359,155 @@ static_assert(  	"(list 1 2) != (cons 1 (cons 2 void))"  ); -// list length +// list take  static_assert(  	std::is_same< -		tav::Size<1>, -		tav::Length< -			tav::List<tav::Int<1>> +		tav::List<tav::Int<1>>, +		tav::Take< +			tav::Size<1>, +			tav::List<tav::Int<1>, tav::Int<2>>  		>  	>::value, -	"(length (list 1)) != 1" +	"(take 1 (list 1 2)) != (list 1)"  );  static_assert(  	std::is_same< -		tav::Size<2>, -		tav::Length< +		tav::List<tav::Int<1>, tav::Int<2>>, +		tav::Take< +			tav::Size<2>,  			tav::List<tav::Int<1>, tav::Int<2>>  		>  	>::value, -	"(length (list 1 2)) != 2" +	"(take 2 (list 1 2)) != (list 1 2)"  ); -// list nth -  static_assert(  	std::is_same< -		tav::Int<1>, -		tav::Nth< -			tav::Size<0>, -			tav::List<tav::Int<1>> +		tav::List<tav::Int<1>, tav::Int<2>>, +		tav::Take< +			tav::Size<3>, +			tav::List<tav::Int<1>, tav::Int<2>>  		>  	>::value, -	"(nth 0 (list 1)) != 1" +	"(take 3 (list 1 2)) != (list 1 2)"  ); +// list drop +  static_assert(  	std::is_same< -		tav::Int<1>, -		tav::Nth< -			tav::Size<0>, +		tav::List<tav::Int<2>>, +		tav::Drop< +			tav::Size<1>,  			tav::List<tav::Int<1>, tav::Int<2>>  		>  	>::value, -	"(nth 0 (list 1 2)) != 1" +	"(drop 1 (list 1 2)) != (list 2)"  );  static_assert(  	std::is_same< -		tav::Int<2>, -		tav::Nth< -			tav::Size<1>, +		void, +		tav::Drop< +			tav::Size<2>,  			tav::List<tav::Int<1>, tav::Int<2>>  		>  	>::value, -	"(nth 1 (list 1 2)) != 2" +	"(drop 2 (list 1 2)) != void"  );  static_assert(  	std::is_same< -		tav::Int<1>, -		tav::First<tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>> +		void, +		tav::Drop< +			tav::Size<3>, +			tav::List<tav::Int<1>, tav::Int<2>> +		>  	>::value, -	"(first (list 1 2 3)) != 1" +	"(drop 3 (list 1 2)) != void"  ); +// list length +  static_assert(  	std::is_same< -		tav::Int<2>, -		tav::Second<tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>> +		tav::Size<1>, +		tav::Length< +			tav::List<tav::Int<1>> +		>  	>::value, -	"(second (list 1 2 3)) != 2" +	"(length (list 1)) != 1"  );  static_assert(  	std::is_same< -		tav::Int<3>, -		tav::Third<tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>> +		tav::Size<2>, +		tav::Length< +			tav::List<tav::Int<1>, tav::Int<2>> +		>  	>::value, -	"(third (list 1 2 3)) != 3" +	"(length (list 1 2)) != 2"  ); -// list take +// list nth  static_assert(  	std::is_same< -		tav::List<tav::Int<1>>, -		tav::Take< -			tav::Size<1>, -			tav::List<tav::Int<1>, tav::Int<2>> +		tav::Int<1>, +		tav::Nth< +			tav::Size<0>, +			tav::List<tav::Int<1>>  		>  	>::value, -	"(take 1 (list 1 2)) != (list 1)" +	"(nth 0 (list 1)) != 1"  );  static_assert(  	std::is_same< -		tav::List<tav::Int<1>, tav::Int<2>>, -		tav::Take< -			tav::Size<2>, +		tav::Int<1>, +		tav::Nth< +			tav::Size<0>,  			tav::List<tav::Int<1>, tav::Int<2>>  		>  	>::value, -	"(take 2 (list 1 2)) != (list 1 2)" +	"(nth 0 (list 1 2)) != 1"  );  static_assert(  	std::is_same< -		tav::List<tav::Int<1>, tav::Int<2>>, -		tav::Take< -			tav::Size<3>, +		tav::Int<2>, +		tav::Nth< +			tav::Size<1>,  			tav::List<tav::Int<1>, tav::Int<2>>  		>  	>::value, -	"(take 3 (list 1 2)) != (list 1 2)" +	"(nth 1 (list 1 2)) != 2"  ); -// list drop -  static_assert(  	std::is_same< -		tav::List<tav::Int<2>>, -		tav::Drop< -			tav::Size<1>, -			tav::List<tav::Int<1>, tav::Int<2>> -		> +		tav::Int<1>, +		tav::First<tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>>  	>::value, -	"(drop 1 (list 1 2)) != (list 2)" +	"(first (list 1 2 3)) != 1"  );  static_assert(  	std::is_same< -		void, -		tav::Drop< -			tav::Size<2>, -			tav::List<tav::Int<1>, tav::Int<2>> -		> +		tav::Int<2>, +		tav::Second<tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>>  	>::value, -	"(drop 2 (list 1 2)) != void" +	"(second (list 1 2 3)) != 2"  );  static_assert(  	std::is_same< -		void, -		tav::Drop< -			tav::Size<3>, -			tav::List<tav::Int<1>, tav::Int<2>> -		> +		tav::Int<3>, +		tav::Third<tav::List<tav::Int<1>, tav::Int<2>, tav::Int<3>>>  	>::value, -	"(drop 3 (list 1 2)) != void" +	"(third (list 1 2 3)) != 3"  );  // list append | 
