> On May 20, 2016, at 7:33 AM, Ken Burgett via swift-users
> <swift-users@swift.org> wrote:
>
> the required C struct morphs into a Swift class, with a member function
> 'as_C_byte_array' which answers an array of the required form. Internally,
> this function will shift and mask class attributes in order to build the
> necessary result.
It would be nice to see Swift acquire structured-data I/O APIs as found in
languages like Ruby and Python — these take a printf-like format string and
parameters, but read and write values in binary. The format syntax offers
modifiers to specify things like byte order, string encoding, etc. This is so
much more reliable and readable than doing the encoding by hand.
—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users