http://ideone.com/1lnIcm from fast call please give give him your rep
FastCall Is Alll
It was written in response to dsm's affection to trigraphs. I figured, why stop at trigraphs? Here's teh code. There's still room for "improvement," but whatever:
http://ideone.com/1lnIcm
#include <iostream>
#include <vector>
#include <sstream>
#include <algorithm>
#include <string>
#include <iterator>
#define mod %
#define div /
#define mul *
#define add +
#define sub -
#define insert <<
#define extract >>
#define shl <<
#define shr >>
#define bor |
#define band &
#define bxor ^
#define bnot ~
#define ptr *
#define assign =
#define equal_to ==
#define addr_of &
#define open_paren (
#define open_bracket [
#define open_brace {
#define open_angle <
#define less_than <
#define close_paren )
#define close_bracket ]
#define close_brace }
#define close_angle >
#define greater_than >
#define comma ,
#define call ()
#define member .
#define block_begin {
#define block_end }
#define stop ;
int main open_paren int argc comma char ptr ptr argv close_paren
block_begin
using namespace std stop
string line stop
while open_paren
cout insert "\n> " insert flush and
getline open_paren cin comma line close_paren close_paren
block_begin
istringstream stream open_paren line close_paren stop
auto vec assign vector open_angle int close_angle open_paren
istream_iterator open_angle int close_angle open_paren stream close_paren comma
istream_iterator open_angle int close_angle call
close_paren stop
sort open_paren
vec member begin call comma
vec member end call
close_paren stop
cout insert '[' stop
if open_paren vec member size call close_paren block_begin
copy open_paren
vec member begin call comma
vec member end call sub 1 comma
ostream_iterator open_angle int close_angle open_paren
cout comma ", "
close_paren
close_paren stop
cout insert vec member back call stop
block_end
cout insert ']' insert endl stop
block_end
block_end
Sample run:> 9 4 -3 4 0 7 8
[-3, 0, 4, 4, 7, 8, 9]
> -3 4 7 10 9 6
[-3, 4, 6, 7, 9, 10]
> 4 3 1 5 7
[1, 3, 4, 5, 7]
http://en.cppreference.com/w/cpp/language/operator_alternative
The true horror though is that a lot of these already *have* alternative tokens:
http://en.cppreference.com/w/cpp/language/operator_alternative
I tried some of these alternitives but it failed to compile (VS9)
You have to disable microsofts language extensions...The true horror though is that a lot of these already *have* alternative tokens:
http://en.cppreference.com/w/cpp/language/operator_alternative
I tried some of these alternitives but it failed to compile (VS9)
https://msdn.microsoft.com/en-us/library/34h23df8.aspx#sectionToggle9
https://msdn.microsoft.com/en-us/library/0k0w269d.aspx
You have to disable microsofts language extensions...
The true horror though is that a lot of these already *have* alternative tokens:
http://en.cppreference.com/w/cpp/language/operator_alternative
I tried some of these alternitives but it failed to compile (VS9)
https://msdn.microsoft.com/en-us/library/34h23df8.aspx#sectionToggle9
https://msdn.microsoft.com/en-us/library/0k0w269d.aspx
ah thanks
now I can destroy my codebase :)
Why...Why all the defines?
He's trying to force c to look like another language. I've seen a couple new c programmers back in college try to make c work like lua. The professor was not amused.
Why...Why all the defines?
He's trying to force c to look like another language. I've seen a couple new c programmers back in college try to make c work like lua. The professor was not amused.
One of my professors 'taught' us C by saying "C is like Java, and you all know Java, therefore you know C", and he was then surprised when he got back some mind-numbingly horrible code. (Mainly from students who had English as their second language, and this was a prof with a really think east European accent. Fun times.)
The true horror though is that a lot of these already *have* alternative tokens:
http://en.cppreference.com/w/cpp/language/operator_alternative
What is the purpose in all of that? What reason would anyone have to type "<%" or "??<" instead of '{'. This made it into the standard, so there has to be a good reason.