tracker issue : CF-3589888

select a category, or use search below
(searches all categories and all time range)
Title:

Null coalescing operator

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 07/04/2013

Components: Language

Versions: 10.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Final / 285665

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 0

See http://en.wikipedia.org/wiki/Null_coalescing_operator#C.23

Best summarised as:
possiblyNullValue ?? valueIfNull

eg:
variables.foo = "bah";
// uses an existing value
variables.foo = variables.foo ?? "bar"; // => variables.foo = "bah";

// uses the default value
variables.moo = variables.moo ?? "baa"; // => variables.moo = "baa";

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3589888

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

There might be a case for replicating Railo's handling of this: https://groups.google.com/forum/#!topic/railo/5yzilA63kSs https://issues.jboss.org/browse/RAILO-2195?_sscc=t Which uses ?: instead of ??. However the similarity to the existing ?: operator might be an issue? That said, it's kinda like a null-safe version of ?: with an implied true condition, I guess..?
Comment by External U.
15057 | July 04, 2013 04:03:47 AM GMT
I see this has been marked "to fix". Cool! Which syntax are you erring towards? Cheers. -- Adam
Comment by External U.
15058 | September 20, 2013 03:23:04 AM GMT
CF will use elvis operator ?: to serve this functionality (Comment added from ex-user id:nawani)
Comment by Adobe D.
15059 | September 24, 2013 01:41:19 AM GMT