added toOpenArray builtin for zero-copy slices; syntax sugar yet to come
This commit is contained in:
parent
121b9e26fb
commit
1d9343080d
6 changed files with 84 additions and 14 deletions
|
|
@ -4131,3 +4131,13 @@ when defined(cpp) and appType != "lib" and not defined(js) and
|
|||
stderr.write trace & "Error: unhandled exception: " & ex.msg &
|
||||
" [" & $ex.name & "]\n"
|
||||
quit 1
|
||||
|
||||
when not defined(js):
|
||||
proc toOpenArray*[T](x: seq[T]; first, last: int): openarray[T] {.
|
||||
magic: "Slice".}
|
||||
proc toOpenArray*[T](x: openarray[T]; first, last: int): openarray[T] {.
|
||||
magic: "Slice".}
|
||||
proc toOpenArray*[I, T](x: array[I, T]; first, last: I): openarray[T] {.
|
||||
magic: "Slice".}
|
||||
proc toOpenArray*(x: string; first, last: int): openarray[char] {.
|
||||
magic: "Slice".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue