I've just finished reading a very spirited debate on the merits
of streaming versus reading in an entire file. I'm convinced that both are
ideal depending on the situation. Thank you for the responses I received
on my original post. I had tried previously on StackOverflow, having
joined just for
No, you’ll have to wrap it in a class. That said, class references from a
struct are frowned upon, as you may wind up sharing mutable state (which
structs are meant to combat).
What’re you trying to represent with the UnsafeMutablePointer? A connection
handle?
Dan
> On May 20, 2016, at 12:5
Can I put an UnsafeMutablePointer inside a struct and destroy deallocate
correctly without nesting a class which has `deinit`? I’m not sure how to check
this.
--
Adrian Zubarev
Sent with Airmail
___
swift-users mailing list
swift-users@swift.org
https
> On May 20, 2016, at 12:54 PM, Joe Groff via swift-users
> wrote:
>
>
>> On May 20, 2016, at 7:33 AM, Ken Burgett via swift-users
>> wrote:
>>
>> I have been told that the in-memory layout of a Swift struct is 'undefined',
>> so the C style of aliasing an array over a struct and iterating
> On May 20, 2016, at 7:33 AM, Ken Burgett via swift-users
> wrote:
>
> I have been told that the in-memory layout of a Swift struct is 'undefined',
> so the C style of aliasing an array over a struct and iterating across the
> struct is a definite no-no. Not surprising, since aliasing viola
> On May 20, 2016, at 9:44 AM, Jan Neumüller via swift-users
> wrote:
>
> What advantage? Streaming IO is a pain in the . I never got what people
> like at this stuff
Well for one, it abstracts away the source of the data. It could be a file, a
TCP socket, an HTTP body, the output of ano
On 2016-05-20 08:55, Jens Alfke wrote:
On May 20, 2016, at 7:33 AM, Ken Burgett via swift-users
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 attri
> +1. There are many reasons to prefer streaming implementations. It is also
> possible to write high-level APIs with relatively simple interfaces that use
> streaming behind the scenes. The fact that this is not always done is not a
> good argument against providing robust streaming APIs. I
> On May 20, 2016, at 10:47 AM, Jens Alfke via swift-users
> wrote:
>
>
>> On May 20, 2016, at 1:16 AM, Quinn The Eskimo! via swift-users
>> mailto:swift-users@swift.org>> wrote:
>>
>> One of the nice things about the file system is that it has reasonable
>> performance and error characteri
> On May 20, 2016, at 7:33 AM, Ken Burgett via swift-users
> 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
> On May 20, 2016, at 1:16 AM, Quinn The Eskimo! via swift-users
> wrote:
>
> One of the nice things about the file system is that it has reasonable
> performance and error characteristics such that you /can/ deal with it
> synchronously. Revel in that fact!
That’s only really true at small
I have been told that the in-memory layout of a Swift struct is
'undefined', so the C style of aliasing an array over a struct and
iterating across the struct is a definite no-no. Not surprising, since
aliasing violates all type-safe rules.
So, if you have this situation, you must address it
Hello
Interesting question
From my point of view, I want to parse a huge file without loading it in
memory...
Maybe something worth the reading
https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/TechniquesforReadingandWritingCustomFile
> On May 20, 2016, at 4:16 AM, Quinn The Eskimo! via swift-users
> wrote:
> I disagree. One-shot file system APIs make sense for a lot of reasons:
I do most of my programming in .Net, where streams are the primary IO system.
Even simple tasks often require multiple objects and loops copying da
On 19 May 2016, at 17:38, Jens Alfke wrote:
> I believe Mac/iOS developers usually transfer the entire file because that’s
> the particular hammer that Foundation provides.
I disagree. One-shot file system APIs make sense for a lot of reasons:
* It’s generally easier to use. Consider NSXMLD
15 matches
Mail list logo