hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

trunc.ha (276B)


      1 // License: MPL-2.0
      2 // (c) 2021 Drew DeVault <sir@cmpwn.com>
      3 use types;
      4 
      5 // Truncates a slice, setting its length to zero without freeing the underlying
      6 // storage or altering its capacity.
      7 export fn trunc(sl: *[]void) void = {
      8 	let sl = sl: *types::slice;
      9 	sl.length = 0;
     10 };