Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Boxed Expressions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Boxed Expressions



I added a new section to the Objective-C literals document:

http://clang.llvm.org/docs/ObjectiveCLiterals.html#objc_boxed_expressions

This describes the syntax we are implementing for boxed expressions. This lets you write code like:

// numbers.
NSNumber *smallestInt = @(-INT_MAX - 1);
NSNumber *piOverTwo = @(M_PI / 2);
// enumerated types.
typedef enum { Red, Green, Blue } Color;
NSNumber *favoriteColor = @(Green);

// strings.
NSString *path = @(getenv("PATH"));
NSArray *pathComponents = [path componentsSeparatedByString:@":"];
- Patrick

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.