&是什么QUOT; Objective-C的是C的一个超集比C ++&QUOT更加严格的;究竟是什么意思? [英] What does "Objective-C is a superset of C more strictly than C++" mean exactly?

查看:269
本文介绍了&是什么QUOT; Objective-C的是C的一个超集比C ++&QUOT更加严格的;究竟是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我读有:<一href=\"http://stackoverflow.com/questions/2583766/why-is-objective-c-not-very-popular-outside-of-the-apple-community\">Why是Objective-C的不是很受欢迎的苹果社区之外?

目标-C是C的一个超集(比C ++更严格,事实上),所以不会出现向后兼容的问题。任何你可以在C你可以在Objective-C做的。

Objective-C is a superset of C (much more strictly than C++, in fact) so the issue of backward compatibility does not arise. Anything you can do in C you can do in Objective-C.

作为一个超集是二进制的,就像是pregnant。 OBJ-C是C的超集,C ++是没有的。

Being a superset is binary, like being pregnant. Obj-C is a superset of C, and C++ is not.

什么是他们通过超是什么意思?在哪些方面客观-C会更接近//向后兼容到C?以何种方式做客观-C遵循C理念更加紧密比C ++?

What do they mean by superset? In what way does objective-C would be more close//backward compatible to C? In what way does objective-C follow the C philosophy more closely than C++?

能否任何C程序被一个客观的C编译器(100%兼容)无需修改编译的?

Can any C program be compiled without modification by a objective-C compiler (100% compatibility)?

这更是一个关于编程语言设计和兼容性比战争有关哪一个更好的问题。

This is more a question about programming language design and compatibility than a wars about which one is better.

推荐答案

我prepared一个简单的示意图。是不是很pretty,但希望得到跨越点:

I prepared a simple diagram; it is not very pretty, but hopefully gets the point across:


  • 红色:设置在C,C ++和Objective-C的所有有效的程序(比较小)

  • 绿色中集C和Objective-C在C时有效,但无效的所有程序++(甚至更小)

  • 灰色:设定目标C和C ++在C时有效,但无效的所有程序(空的,据我所知)

  • 蓝:设定的唯一目标C有效的所有程序的(比较大的)

  • 黄色:设定的所有程序只能在C ++有效(最大)

  • Red: the set of all programs valid in C, C++, and Objective-C (relatively small)
  • Green: the set of all programs valid in C and Objective-C, but invalid in C++ (even smaller)
  • Gray: the set of all programs valid in Objective C and C++, but invalid in C (empty, as far as I know)
  • Blue: the set of all programs valid only in Objective C (relatively large)
  • Yellow: the set of all programs valid only in C++ (largest)

该组有效的C程序(在红色和绿色)是一套有效的目标C程序(蓝色)

The set of valid C programs (in red and green) is an strict subset of the set of valid Objective C programs (blue)

这篇关于&是什么QUOT; Objective-C的是C的一个超集比C ++&QUOT更加严格的;究竟是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆