[Swift-user] Treatment of booleans in Swift

Bronevetsky, Greg bronevetsky1 at llnl.gov
Mon May 19 18:22:53 CDT 2014


I've been working with Booleans recently and I've run into a couple of issues with them that might be a problem for others:

-          tracef doesn't have a format option for Booleans, forcing me to convert them to strings. Running @toInt on a Boolean produces: "java.lang.NumberFormatException: For input string: "false"".

-          It is not clear how to format files to be read by readData() if the data in question is a Boolean. Based on experimentation I discovered that the correct strings are "True"/"False" rather than "true"/"false" or "0"/"1". It would be useful to document this in the description of readData().

Greg Bronevetsky
Lawrence Livermore National Lab
(925) 424-5756
bronevetsky at llnl.gov<mailto:bronevetsky at llnl.gov>
http://greg.bronevetsky.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20140519/16ca8736/attachment.html>


More information about the Swift-user mailing list