[Vala] [Genie] array slices
- From: Arc Riley <arcriley gmail com>
- To: vala-list <vala-list gnome org>
- Subject: [Vala] [Genie] array slices
- Date: Sat, 22 May 2010 06:38:21 -0400
I'm migrating some C code to Genie and ran into a troubling limitation; the
following line of code does not seem to have an equivalent in Genie:
session->wbuff = g_string_append_len(session->wbuff, str+sent,
len-sent);
What this means is "when you can't send all the data you'd like, append the
rest to our (known to be empty) GString buffer".
The key part here is "the rest" - getting a slice of an array, such as C's
array + value syntax (Incompatible operand) or Python's array[start:] syntax
(error: syntax error, expected `]' but got `:' with previous identifier).
We can't use Genie strings for the buffer because UTF8 length != byte
length.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]