Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6539183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:49:38+00:00 2026-05-25T10:49:38+00:00

I read that Objective-C was made by using preprocessor directives to add features of

  • 0

I read that Objective-C was made by using preprocessor directives to add features of Smalltalk to C, which got me a little curious so I started tinkering with preprocessors in C++, just because I was bored and came up with this:

#include <iostream>
#include <string>
#define Constant const
#define Integer int
#define Real double
#define Boolean bool
#define Character char
#define String string;
#define System system
#define StandardLibrary std
#define OutputStream cout



int main()
{
   Integer i = 1;
   Integer ii = 2;
   Integer iii = ii + i;
   StandardLibrary::OutputStream<<iii;
   System("pause");
   return 0;
}

So yeah, it’s pretty obvious you can change the names using preprocessors, but how is it possible to implement features of one language into another language using preprocessors?

I’m not planning to make my own language through this. I’m just curious as to see how it works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:49:38+00:00Added an answer on May 25, 2026 at 10:49 am

    A language like Objective C can be implemented using a preprocessor, but not the C preprocessor, as the C preprocessor language is fairly limited, if it even is turing complete (it may not be), it’s at best a really nasty turing tarpit. A more powerful preprocessor will allow more significant alterations to syntax.

    A preprocessor in general is a program that takes a source file and does text transformation according to some rules into some other set of source code, which is then compiled as for example C code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually I have read about that I can write Objective-C app on Linux (using
I'm new to Objective-C and Cocoa. I've read that NSInteger and NSNumber are preferred
I am working on a little game (using OS X Lion, Xcode 4, Objective-C
I read that argv[0] holds the program name i.e. the name by which we
Learning Objective-C and reading sample code, I notice that objects are usually created using
I a new to Objective C and iphone development. I read somewhere that I
I read that you could call JavaScript code from a Java Applet by calling
I read that Domain Driven Design is about concentrating on the problem domain instead
I read that SQL exceptions are treated as normal exceptions in managed SPs; I
I read that you should define your JavaScript functions in the <head> tag, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.