FastCall Is Alll

Started by
14 comments, last by alh420 8 years, 11 months ago

http://ideone.com/1lnIcm from fast call please give give him your rep

Mobile Developer at PawPrint Games ltd.

(Not "mobile" as in I move around a lot, but as in phones, mobile phone developer)

(Although I am mobile. no, not as in a babies mobile, I move from place to place)

(Not "place" as in fish, but location.)

Advertisement
omg dsm-senpai noticed me ohmy.png

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]
The true horror though is that a lot of these already *have* alternative tokens:

http://en.cppreference.com/w/cpp/language/operator_alternative

Why...Why all the defines?

What will you make?

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)

Mobile Developer at PawPrint Games ltd.

(Not "mobile" as in I move around a lot, but as in phones, mobile phone developer)

(Although I am mobile. no, not as in a babies mobile, I move from place to place)

(Not "place" as in fish, but location.)

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...
https://msdn.microsoft.com/en-us/library/34h23df8.aspx#sectionToggle9
https://msdn.microsoft.com/en-us/library/0k0w269d.aspx

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...
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 :)

Mobile Developer at PawPrint Games ltd.

(Not "mobile" as in I move around a lot, but as in phones, mobile phone developer)

(Although I am mobile. no, not as in a babies mobile, I move from place to place)

(Not "place" as in fish, but location.)

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.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

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.)

Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.

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.

This topic is closed to new replies.

Advertisement