hare

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

cap.ha (222B)


      1 // License: MPL-2.0
      2 // (c) 2022 Sebastian <sebastian@sebsite.pw>
      3 use types;
      4 
      5 // Returns the capacity of a slice.
      6 export fn cap(slice: []const void) size = {
      7 	const slice = &slice: *types::slice;
      8 	return slice.capacity;
      9 };